Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Analyze agent/skill reference depth and generate missing domain-specific reference files.
.claude/skills/notque-reference-enrichment/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 132% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 76% | 0% |
Enrich an agent or skill's reference files from Level 0-2 to Level 3+, or decompose bloated body files by extracting domain content into references. Enrichment adds knowledge; decomposition moves knowledge to where progressive disclosure says it belongs. The enrichment pipeline runs five phases with explicit gates because each phase feeds the next — starting Phase 3 without Phase 2 research produces filler, not depth.
Goal: Extract domain-heavy content from a bloated SKILL.md or agent body into reference files.
When to use: When a component's body exceeds ~500 lines and contains catalogs, code examples, specification tables, or agent rosters that should live in references/ per PHILOSOPHY.md's progressive disclosure architecture.
Trigger: Invoke with --decompose argument, or when the request matches "decompose", "extract references", "slim down", "too long", or "move to references".
bash python3 scripts/detect-decomposition-targets.py --skill {name} (or --agent {name})
cp {path} /tmp/decomp-before-{name}.mda. Read the content block and its surrounding context b. Determine the best reference filename:
references/{topic}.md (lowercase, hyphens)c. Create or update the reference file following references/reference-file-template.md d. Remove the content from the body (MOVE, not copy) e. Add a loading table entry in the body that maps task signals to the new reference file
bash python3 scripts/validate-decomposition.py \ --before /tmp/decomp-before-{name}.md \ --after {path} \ --refs {refs_dir}/
bash python3 scripts/validate-references.py --skill {name} # or --agent {name} python3 scripts/audit-reference-depth.py --skill {name} --verbose # or --agent {name}
Gate: Validation passes. Body line count reduced. All extracted content exists in reference files. Loading table entries exist for all new references.
Goal: Identify which sub-domains are missing reference coverage.
python3 skills/meta/reference-enrichment/scripts/gap-analyzer.py --agent {name}(or --skill {name})
Output format:
DISCOVER: {name}
Current level: {0-3}
Existing references: [{filenames}]
Stated domains: [{domains from description and body}]
Gaps: [{sub-domains with no reference coverage}]
Recommended files: [{filename} → {why}]Gate: Gap report exists with at least one identified gap. If no gaps exist (Level 3 already), report and stop — over-generating creates noise, not signal.
Goal: Compile concrete, domain-specific content for each gap.
For each identified gap:
references/ is the benchmark: version-specific patterns, grep commands, error-fix mappings
detection commands (grep -rn "pattern" --include="*.ext"), error-fix mappings (error message → root cause → fix), project-specific conventions visible in the codebase
Dispatch up to 5 parallel research agents — one per sub-domain gap — because sequential research bottlenecks the pipeline. Each agent receives: the sub-domain, the component's .md as context, and a path to an exemplar Level 3 reference file.
Gate: Each gap has at least 10 concrete findings (version numbers, function names, grep patterns, code examples). Generic advice ("follow best practices") does not count toward this gate.
Goal: Assemble research into structured reference files.
For each gap, create one reference file following references/reference-file-template.md:
load and easier to update as language versions change
detection commands, error-fix mappings where applicable
Do-pairing rule (mandatory): Every failure mode block written during this phase must include a "Do instead" counterpart. If the retro learning or research does not carry enough information to write a concrete positive counterpart, omit the failure mode entirely rather than shipping it without the paired "Do instead". A bare negative block encodes no actionable knowledge and will fail structural validation. If a prohibition is a genuine absolute with no correct alternative, annotate it with <!-- no-pair-required: reason --> inline before the block.
Write files to: agents/{name}/references/ or skills/{name}/references/
Gate: Each generated file is between 80-500 lines. Run both checks:
bashpython3 scripts/validate-references.py --agent {name} python3 scripts/validate-references.py --check-do-framing
Both must exit 0 before proceeding to Phase 4.
After validation passes, run the condense skill on each generated reference file to strip prose filler while preserving patterns, detection commands, and error-fix mappings.
Goal: Confirm the reference files meet Level 3+ depth before integrating.
Tier 1 (Deterministic):
bashpython3 scripts/audit-reference-depth.py --agent {name} --json
Verify the level field is 3 in the output. If still below Level 3, the files are too generic — return to Phase 2 for the weak sub-domain.
Tier 2 (LLM self-assessment): Read each generated file and apply the rubric from references/quality-rubric.md. Ask: would a reviewer using only this file produce Level 3 quality output? Concrete test: pick one failure mode from the file — does it include a grep command to detect it?
Gate: Both tiers pass. If Tier 2 fails for a specific sub-domain, loop back to Phase 2 for that gap only (not all gaps). Maximum 2 loops per gap before flagging for manual enrichment.
Goal: Wire the new references into the component so they are actually loaded.
skills/meta/do/references/repo-architecture.md: | Task type | Load | |-----------|------| | {task} | references/{file}.md |
bash python3 scripts/validate-references.py --agent {name} python3 -m pytest scripts/tests/test_reference_loading.py -k {name} -v
git add agents/{name}/ skills/{name}/Gate: Validation passes. Changes staged. Report the level change (was: N, now: M) and list each new file with its line count.
Load when the task type matches:
| Task type | Load | |-----------|------| | Understanding Level 0-3 criteria | references/quality-rubric.md | | Creating new reference files | references/reference-file-template.md | | Decomposing bloated components | Run python3 scripts/detect-decomposition-targets.py --skill {name} first |
| Signal | Load These Files | Why | |---|---|---| | classifying reference depth Level 0-3 (DISCOVER gaps, VALIDATE Tier 2) | quality-rubric.md | Loads detailed guidance from quality-rubric.md. | | writing new reference files (Phase 3 COMPILE) | reference-file-template.md | Loads detailed guidance from reference-file-template.md. |
Gap analyzer fails: The component may not exist in expected paths. Check both agents/ and skills/ directories, and ~/.claude/agents/ for deployed copies.
Phase 2 gate fails (fewer than 10 concrete findings): The domain may be too narrow or already well-documented upstream. Flag and suggest manual enrichment with project-specific production incidents rather than generic docs research.
Phase 4 Tier 1 still below Level 3 after compile: The files are too short or too generic. Read one file, apply the rubric directly, identify the weakest section, and target Phase 2 research at that section specifically.
validate-references.py not found: Script may not exist for this component. Skip that check, proceed with audit-reference-depth.py as the sole Tier 1 gate.
Decomposition validation fails: Content was lost during extraction. Restore from the snapshot at /tmp/decomp-before-{name}.md. Check that each extracted content block appears in a reference file. Common cause: a code block was partially extracted or a table was split across the body and a reference file.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 2,911 | 5,258 | +81% | 1 | 1 | 0% | 177 | 2,781 | +1471% | 0 | 0 | — |
case-02 | fail→fail | 34,979 | 5,872 | -83% | 1 | 1 | 0% | 6,201 | 2,674 | -57% | 0 | 0 | — |
case-03 | fail→fail | 34,870 | 11,492 | -67% | 1 | 1 | 0% | 6,197 | 2,708 | -56% | 0 | 0 | — |
case-04 | fail→pass | 11,317 | 3,221 | -72% | 1 | 1 | 0% | 1,860 | 2,969 | +60% | 0 | 0 | — |
case-05 | fail→pass | 7,278 | 2,152 | -70% | 1 | 1 | 0% | 1,185 | 2,748 | +132% | 0 | 0 | — |
case-06 | fail→pass | 10,818 | 5,012 | -54% | 1 | 1 | 0% | 1,869 | 3,359 | +80% | 0 | 0 | — |
case-07 | pass→pass | 7,950 | 2,032 | -74% | 1 | 1 | 0% | 1,218 | 2,767 | +127% | 0 | 0 | — |
case-08 | fail→fail | 13,321 | 6,565 | -51% | 1 | 1 | 0% | 2,058 | 2,727 | +33% | 0 | 0 | — |
case-09 | fail→pass | 17,471 | 6,698 | -62% | 1 | 1 | 0% | 2,591 | 3,543 | +37% | 0 | 0 | — |
case-10 | fail→pass | 12,278 | 4,340 | -65% | 1 | 1 | 0% | 1,795 | 3,159 | +76% | 0 | 0 | — |
case-11 | pass→fail | 6,892 | 3,397 | -51% | 1 | 1 | 0% | 1,050 | 2,907 | +177% | 0 | 0 | — |
case-12 | fail→pass | 11,319 | 3,274 | -71% | 1 | 1 | 0% | 1,642 | 2,983 | +82% | 0 | 0 | — |
case-13 | fail→pass | 21,789 | 1,941 | -91% | 1 | 1 | 0% | 770 | 2,706 | +251% | 0 | 0 | — |
case-14 | fail→pass | 8,229 | 1,775 | -78% | 1 | 1 | 0% | 1,252 | 2,632 | +110% | 0 | 0 | — |
case-15 | fail→pass | 16,000 | 1,885 | -88% | 1 | 1 | 0% | 1,277 | 2,658 | +108% | 0 | 0 | — |
case-16 | fail→pass | 10,457 | 3,308 | -68% | 1 | 1 | 0% | 1,492 | 2,927 | +96% | 0 | 0 | — |
case-17 | fail→pass | 10,466 | 2,067 | -80% | 1 | 1 | 0% | 1,443 | 2,798 | +94% | 0 | 0 | — |
case-18 | fail→fail | 14,384 | 2,786 | -81% | 1 | 1 | 0% | 2,284 | 2,894 | +27% | 0 | 0 | — |
case-19 | fail→pass | 11,690 | 2,992 | -74% | 1 | 1 | 0% | 1,798 | 2,902 | +61% | 0 | 0 | — |
case-20 | pass→pass | 12,369 | 7,152 | -42% | 1 | 1 | 0% | 1,884 | 3,516 | +87% | 0 | 0 | — |
case-21 | pass→pass | 11,527 | 14,158 | +23% | 1 | 1 | 0% | 2,108 | 5,066 | +140% | 0 | 0 | — |
case-22 | pass→pass | 15,491 | 12,276 | -21% | 1 | 1 | 0% | 2,726 | 4,577 | +68% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 17 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.