agentleFS
JinLee794JinLee794/agent-framework-skills/.cursor/skills/skill-pack-audit/SKILL.md

skill-pack-audit

Skill2 starsChanged 4 months agoMITView on GitHub

Audit a skill pack for duplication, routing drift, description collisions, broken references, and always-on context cost. Produces a findings report and a prioritised fix list. Load when adding a skill to an existing pack, when the agent loads the wrong skill or two overlapping ones, when a fact has been restated in several files, or when asked to review, optimise, slim, or reorganise .cursor/skills.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every finding below is a violation of one of these.

    line 23
  2. Distinctive:

    Run all six. Each is cheap and each catches a different class.

    line 41
  3. Distinctive:

    Use the literal terms from the pack under audit, not these placeholders — and keep them out of this file, or the audit will match itself …

    line 88
  4. Very specific:

    Read only the name + description of every skill — that is all the agent sees at discovery.

    line 103
  5. Very specific:

    Add up everything loaded on every request: rules/repository.mdc.md, AGENTS.md, each *.instructions.md whose applyTo matches broadly, and …

    line 127

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill Pack Audit

A skill pack degrades in predictable ways: routing tables get copied, the same version fact gets restated, two descriptions start competing for the same task, and the always-on tier quietly grows. This is the review that finds those.

Adjacent, different job: maf-dev-loop/references/skill-sync.md checks whether a claim is still true. This checks whether it is in the right place, exactly once.

Invariants

Every finding below is a violation of one of these. State which one when reporting.

  1. One routing table. It lives in rules/repository.mdc.md. A skill may link to a sibling for a specific reason; it may not list them all.
  2. One owner per falsifiable fact. A version number, symbol name, enum spelling, or removed API belongs to the skill that owns that SDK surface. Everywhere else, cite the owner. Exactly one second copy is allowed: a row in a conformance grep table, because there the string is the search pattern.
  3. Descriptions partition the task space. Two skills must not plausibly answer the same request. Where boundaries are close, say so with an explicit NOT for … — load X instead.
  4. Universal rules live in the always-on tier. A rule that applies to all work must not sit inside a task-scoped skill, or it is only conditionally reachable.
  5. The loaded tier stays small. SKILL.md should be roughly a third of its skill's total; the rest belongs in references/.
  6. Every reference resolves.

Procedure

Run all six. Each is cheap and each catches a different class.

1. Inventory and size distribution

Get-ChildItem .cursor\skills -Recurse -Filter *.md |
  Sort-Object FullName |
  ForEach-Object { [pscustomobject]@{
      Path  = $_.FullName.Replace("$PWD\", '')
      Lines = (Get-Content $_.FullName).Count } } |
  Format-Table -AutoSize

For each skill compute SKILL.md ÷ (SKILL.md + references). Report the ratios together — the outlier is the finding, not any absolute threshold. A skill much above its peers has reference material sitting in the always-loaded tier (invariant 5).

2. Reference integrity

Extract every non-HTTP markdown link and test the path.

Get-ChildItem .cursor\skills -Recurse -Filter *.md | ForEach-Object {
  $f = $_
  [regex]::Matches((Get-Content $f.FullName -Raw), '\]\((?!https?:)([^)#]+)') | ForEach-Object {
    $rel = $_.Groups[1].Value.Trim()
    if (-not (Test-Path (Join-Path $f.Directory.FullName $rel))) {
      "$($f.FullName.Replace("$PWD\",'')) -> $rel"
    }
  }
}

Multi-line PowerShell can be mangled when pasted into some terminals — if it errors, save it to a temp .ps1 and run that rather than collapsing it to one line.

3. Repeated-fact scan

The core of the audit. Grep the pack for its own falsifiable claims, then count files per fact.

Build the term list from what the pack actually asserts — removed classes, renamed parameters, enum spellings, pinned versions, required call sites. Then one regex with alternation:

<RemovedClassName>|<enum_spelling>|<RequiredCallSite>|<PinnedVersion>

Use the literal terms from the pack under audit, not these placeholders — and keep them out of this file, or the audit will match itself and inflate every count by one.

Report as a table of fact → file count. Anything above 2 violates invariant 2. Sort descending; the top row is usually the one that has already drifted.

A count of 2 is only clean when the second hit is the conformance grep table. Two hits inside the owning skill (its SKILL.md and one of its own references) is also acceptable — the invariant is one owning skill, not one file.

For each violation, name the owner (the skill documenting that SDK surface), keep the statement there, and replace the others with a one-line citation.

4. Description collision check

Read only the name + description of every skill — that is all the agent sees at discovery. Then, for each, ask: which requests would load this and nothing else?

Flag a collision when two descriptions share a domain noun (retrieval, memory, tools, config). Fix by adding an explicit exclusion to both descriptions, not just one:

description: "… Load for X, Y, Z. NOT for <adjacent thing> — load <other-skill> for that."

Also check: name matches the folder name exactly, and any description containing a colon is quoted. Both fail silently.

5. Routing-surface count

Grep for the header row of your routing table — in this pack, a table whose columns are Task and Skill. More than one hit is invariant 1.

Prose counts ("Six skills live in…", "Four sibling skills…") are the reliable tell that copies exist and have to be hand-synced — treat any such sentence as a defect and delete the number.

6. Always-on budget

Add up everything loaded on every request: rules/repository.mdc.md, AGENTS.md, each *.instructions.md whose applyTo matches broadly, and all skill descriptions.

applyTo: "**" is the usual culprit. An instruction file that is irrelevant to most tasks in the repo should be a skill instead — same content, loaded on demand. Watch for extension-installed instruction files, which are both broad and vendor-managed.

Reporting

Order findings by cost, not severity: how much context does this waste, or how many places must change when one SDK fact changes. Each finding gets:

  • the invariant violated,
  • a file-and-line citation, not a paraphrase,
  • evidence of drift where it exists — an already-inconsistent copy is worth more than a hypothetical one,
  • a concrete fix.

Then split the fixes: apply defects with one correct answer (broken links, name mismatches, missing exclusions) directly; ask before structural moves, since those encode an opinion about what each skill is for.

Anti-patterns

PatternVerdict
Reporting duplication without counting filesThe count is what makes it actionable
Deduplicating by deleting the better-written copyKeep the owner's version; the owner is the skill that owns the SDK surface
Adding a skill to fix overlapUsually the fix is moving a rule up to the always-on tier, which removes content
Enforcing a fixed SKILL.md line limitCompare skills to each other; the outlier is the signal
Treating a conformance grep table as duplicationIts rows are search patterns, and are the one sanctioned second copy
Auditing truth and placement in one passDifferent evidence, different fix — run skill-sync separately

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.