/grey-matter:repository-artifact-hygienefrom grey-matter
Classify repository artifacts (source art, evidence, screenshots, HTML, datasets) for Git, LFS, retention, or scratch cleanup. Use before adding large files, checking disk footprint/free space, or disposing scratch/build output at ticket close.
Ships in grey-matter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The tracked inspectors' operator contracts are indexed in the tool-script catalog.
Inspect staged candidates during work; use a selected tree or bounded history only when requested. User and agent invocation are both supported. Inspection is read-only; use the user's existing authorization for subsequent changes.
Freeze scope. Read the project's conventions. Name the repository root, inspected index/ref, owning account, concurrency and local/remote coverage. Keep independent owners separate. Untracked/ignored data needs its own explicit scope; neither Git metadata nor a successful push covers it.
Measure. Run the bundled script with Node 22+ from the installed skill path:
node <skill-dir>/scripts/inspect-artifacts.mjs --repo <repository-root>
Use locally available Git storage; cloud-only Git object stores are outside
this helper's scope. Git must support --no-lazy-fetch; older Git fails closed.
Default: staged index candidates, not the working copy. With explicit policy,
removing a manifest also checks its unchanged dependents, disclosed in scope.
--ref HEAD inspects
a committed tree. Add --history only for an explicit history audit. It defaults
to 1,000 commits and 10,000 objects; limits and incomplete coverage are reported.
Body inspection is bounded to 32 MiB/blob and 64 MiB total. Read coverage,
history limits and errors before drawing conclusions. No fetch, checkout,
worktree walk, filters, staging or Git hook installation occurs.
Report Git blob lengths, declared LFS payload and embedded base64 characters separately. They are not allocation, billed storage, staleness or reclaimable bytes. A pointer is not proof of available local or remote payload. Exit 0 permits review warnings; 1 means an explicit policy failed; 2 means inspection or input failed. Do not present partial/error results as a complete audit.
Classify purpose. For every candidate establish one role from project evidence: changing source original, generated evidence, reproducible output/reference, explicit dataset or private recovery state. Extension, size and equality alone cannot establish the role or disposability. Record unknowns; never infer deletion safety from a warning.
Choose storage and recovery. Keeping small assets in ordinary Git is valid. Consider LFS for revision-coupled source assets, pinned bundles for frozen evidence, and explicit data storage for datasets. Name the retained original, version/hash, retrieval command, private access, checkpoints and restore test. Independent backup covers ignored/private state. Verify owner-specific usage and billing before making cost claims; do not infer it from local bytes.
Present concrete targets. Separate keep/move/regenerate recommendations from uncertainty and state consequences. Preserve source originals and useful evidence. Apply approved work within the user's scope; untracking, upload, history rewrite, remote purge, deletion and spending are distinct actions. Keep unresolved pointers off published refs. A forward-only conversion leaves old Git blobs; reverting only its tip leaves pointer-bearing ancestors.
Verify approved changes. Confirm remote payload availability and restore latest plus a required historical revision into an empty-cache checkout. Compare hashes and run the asset-dependent build. Report unavailable gates; Git-only mirrors and source ZIPs are not proof of complete asset recovery.
If a bundle manifest promises exact file bytes, use the project's existing bundle verifier
against the exact inventory and raw bytes after export: reject missing, extra or duplicate
paths, and compare each file and archive checksum to the manifest. Verify a fresh copy made
from the exact source. Label a staged-index export separately from a clean checkout of a
committed SHA; export staged files from the index, since git archive <commit> contains the
commit and omits staged edits. On Windows, verify the materialized checkout/export because
checkout filters and core.autocrlf can change working bytes. Scope .gitattributes rules to
bundle paths (text eol=lf for an LF contract or -text for bytes Git must preserve); do not
change global Git configuration or repository-wide line-ending behavior to fix one bundle.
The artifact inspector reads Git blobs/index entries without checkout filters, so its hashes
do not replace checking the exported bundle.
Finish when every scoped candidate has a role or explicit uncertainty, retained recovery inputs and a justified recommendation, with coverage and checks stated.
Check before you create and prune as you go; the close-out is the second chance.
git worktree or shared clone.
Create test clones and worktrees with GIT_LFS_SKIP_SMUDGE=1: worktrees share the LFS
store, but each checks out its own copy. One copy of the same bytes per ticket.t<ticket>-<kind>-<n>. Give each release
verify or probe invocation a fresh numbered output folder. Preserve failed or cited
evidence until its useful findings are promoted and recovery or a release record no
longer needs the original; do not delete it to retry. When attempt N+1 lands, prune
only attempts older than the latest three that are neither failed nor cited.tmp_path_retention_policy = "failed"), and prune caches with the tool's own
command before deleting by hand..scratch path must be cited, cite one small
file (a report.json) so close can keep it and drop the rest.node <skill-dir>/scripts/inspect-footprint.mjs --repo <repository-root> [--ticket N] [--path DIR] [--cap 5GiB]
The inspector reads and never writes. For each family (.scratch/*, ignored build output,
linked worktrees, --path folders) it reports logical and allocated size, owning ticket and
status, tracked files citing it by exact sub-path with the resulting keep list, hard links,
open files, and an outcome: delete, slim (keep the keep list), keep, ask, prune, or skip
(written within the quiet floor, holding open files, or an active worktree). Delete/slim/prune
recommendations require an explicit owner, released retention disposition and fresh, complete
dependency observation described in the footprint inspector reference;
missing or partial observations stay at ask. Rerun with --recheck <saved.json> immediately
before using a recommendation. Recheck binds canonical scope, workspace, candidate inventory,
preservation inputs and observable active dependencies; a changed or missing family means
stop and review. It never proves reclaimable bytes or deletes files.
Flags and exit codes: footprint inspector.
When an assignment ends, changes worker or changes harness, keep retention ownership with an
accountable person or team; the active assignee is not automatically the retention owner. For
each artifact kept beyond that work, record its owner, purpose, retained/released/unknown
state and end condition in the existing project registry or a concise handoff note. Use released
only after required recovery or disposition is recorded. If any detail is unknown, mark unknown
and protect the artifact. Merge, a clean worktree, age or missing citations do not establish
recovery or release. The lifecycle reference gives scenarios
and the conformance route. This rule does not add an approval step: apply existing project/user
authorization for removal.
Use the takeover procedure when an assignment
inherits branches or worktrees. Inventory local and cached remote refs and linked
worktrees before touching them; classify landed commits with git cherry, unique
commits, explicitly evidenced supersession, and branches whose changed LFS-managed
files are ordinary blobs. The read-only takeover plan
prints those observations without merging, fetching, tagging, deleting or retiring
anything. Treat an unclear comparison or LFS attribute as unknown and inspect it.
Integrate only accepted unique work in feature order. A branch that violates the
repository's LFS rules needs a reviewed squash and renormalization plan before merge;
preserve its original ref until the normalized result is verified. Before retiring a
unique source branch, preserve it under a dated or ticket-scoped archive/ ref and
verify the ref resolves to the intended commit. Remote branch removal requires its
owner's approval. Source integration, ignored-artifact disposition and checkout
retirement are separate decisions: a named ref can preserve needed unfinished source
without merging it, and a clean checkout says nothing about ignored or private files.
Move current inputs to canonical locations and update consumers before retirement.
For a harness-managed checkout, use its supported lifecycle operation and inspect the current task/primary binding. If the app refuses because the checkout is primary or shared, report the refusal once with the supported handoff needed; retry only after a relevant binding or ownership change. Do not force Git removal or repeatedly retry an unchanged refusal. Unknown eligibility remains unknown. Keep this procedure advisory and harness-portable; app API calls and ownership records belong in that harness's reference.
Every uncommitted artifact a ticket made gets one of three outcomes before tkt close:
.scratch files, build output, worktrees, disposable homes, and work folders outside
the repo (~/release-work/…, a remote host's checkout).
.scratch path in a Resolution or tracked doc dangles once the
scratch goes; the docs check fails on new ones.t97-…, release-0.3-…, shared-<slug>-…) and, for
anything kept past this close, one line in the Resolution. A shared item stays until
the last ticket it names closes.Keep a bounded history: the latest three attempts of each kind, plus any failed or cited attempt that recovery or a release record still needs. Promote before pruning.
Use the project's existing cleanup tool and authorization. Inspect its dry-run plan and
exact targets first. Match citations in all tracked references, including done tickets and
generated dashboard data. Promote only compact final proof that needs to last; do not
promote whole run directories, raw .xcresult bundles or SQLite snapshots. Repoint ticket
and dashboard citations to the promoted proof, regenerate generated references, then
revalidate the plan immediately before applying it with the existing authorized tool.
Keep necessary raw originals privately while they support unresolved failure analysis,
recovery or release evidence. In the existing registry or a concise handoff, record their
scope, hashes, retention owner, purpose, retained/unknown state and end condition; verify
required recovery or disposition before removing the local copy. Missing
citations, a closed ticket, elapsed time or a clean worktree are review signals, not proof
that an unknown artifact is disposable. If ownership or disposition is unknown, preserve
it as unknown and route it for review under Ownership across handoffs.
Record the outcome in the Resolution: what was promoted where, what was deleted, and what was kept, with its scope. Deleting files outside the repo or on another host uses the same authorization as any other deletion there. Items marked as relied on by another tool (for example files hard-linked into a simulator) are kept until that tool is done.
Before acting on approved targets, identify both the cleanup goal (reversible removal from
the workspace vs. reclaiming disk capacity) and the executor's supported disposition (OS Trash
move vs. targeted permanent disposal). Apply the user's existing exact authorization without
adding extra approval prompts, and never escalate a Trash-only request into permanent deletion
or blanket Trash emptying. Moving files to Trash removes them from the workspace without proving
freed capacity; targeted permanent disposal preserves unrelated Trash contents; and any
previously moved batch missing without an observed purge command or receipt must be reported as
unattributed, never credited to the agent. Report moved/candidate logical and allocated bytes,
purged target counts, remaining Trash batches, and observed same-volume free space before/after
separately, disclosing that APFS/CoW clones, open files, and concurrent writers prevent exclusive
physical attribution from du or a volume delta; see
cleanup disposition and space recovery.
The inspector warns by default. --warn-bytes N adds a review signal, not a gate.
Only pass --policy FILE for a project-approved policy. It supports path-scoped
byte/embedded-content limits and manifest presence, with exact reasoned exceptions.
It does not decide purpose or install a gate. See
inspection and policy for flags, JSON and examples.
Report format owns offline presentation; doc conventions owns placement; curate-docs owns the periodic promotion/pruning sweep; this skill owns the while-you-work and close-time rules above. Use the project's Git workflow for commits and hooks. Do not copy their policies here.
Does NOT cover GitHub account administration, general Git governance, release publication, backup administration or machine-wide disk cleanup. Provider access is separate from artifact classification. Read the bounded GitHub billing access reference only when that provider's access is the question.
LICENSE (opens in a new tab)agents/openai.yaml (opens in a new tab)references/footprint-by-os.md (opens in a new tab)references/inspection.md (opens in a new tab)references/retention-lifecycle.md (opens in a new tab)references/worktree-takeover.md (opens in a new tab)scripts/inspect-artifacts.mjs (opens in a new tab)scripts/inspect-footprint.mjs (opens in a new tab)scripts/plan-worktree-takeover.mjs (opens in a new tab)scripts/plan-worktree-takeover.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub smileynet/grey-matter --plugin grey-matterOther plugins' skills for the same job
51 skills in this plugin
/adopt-projectAdopt a brownfield repo into grey-matter: characterize its as-is model, subsume existing agent config, seed a triaged board, and wire plumbing./changelogMaintain CHANGELOG.md in Keep a Changelog format with user-facing entries. Use when recording what changed for a release, updating the Unreleased section, or asked to write/update the changelog./cheat-sheetList every skill in this set by category with a one-line description. Use when the user wants a quick reference card of available skills, asks "what skills are there", or "list all commands".