Skip to content
Development
Skill

/reference-enrichment

Analyze agent/skill reference depth and generate missing domain-specific reference files.

From plugin
vexjoy-agent
421122 skills198 agents11 commands76 hooks
Install
$ npx -y skills add notque/vexjoy-agent --skill reference-enrichment --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/reference-enrichment

Context preview

The summary Claude sees to decide when to auto-load this skill.

Analyze agent/skill reference depth and generate missing domain-specific reference files.

SKILL.md

reference-enrichment.SKILL.md
name: reference-enrichment
description: "Analyze agent/skill reference depth and generate missing domain-specific reference files."
user-invocable: true
argument-hint: "<agent-or-skill-name> [--decompose]"
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Grep
  - Glob
  - Agent
routing:
  triggers:
    - "enrich references"
    - "improve reference depth"
    - "generate references"
    - "add reference files"
    - "reference enrichment"
    - "decompose skill"
    - "extract references"
    - "slim down skill"
    - "skill too long"
    - "move content to references"
  category: meta-tooling
  complexity: medium
  pairs_with:
    - verification-before-completion

Reference Enrichment Skill

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.

Workflow

Phase 0: DECOMPOSE

**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".

1. Run the detection script to identify extractable content:

   python3 scripts/detect-decomposition-targets.py --skill {name}

(or `--agent {name}`)

2. If no extractable blocks found, report "nothing to decompose" and stop

3. Save a snapshot of the original file: `cp {path} /tmp/decomp-before-{name}.md`

4. For each extractable block identified by the detection script: a. Read the content block and its surrounding context b. Determine the best reference filename:

  • Use the detection script's suggestion as a starting point
  • If a reference file with related content already exists, MERGE into it
  • Follow naming convention: `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

5. Ensure the body retains:

  • YAML frontmatter
  • Brief overview paragraph
  • Phase workflow (phases, gates, decision points)
  • Loading table with entries for all reference files
  • Error handling section
  • References section

6. Validate the decomposition:

   python3 scripts/validate-decomposition.py \
       --before /tmp/decomp-before-{name}.md \
       --after {path} \
       --refs {refs_dir}/

7. If validation FAILS: restore from snapshot and report the failure. Do not proceed.

8. If validation PASSES: run structural checks:

   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.

---

Phase 1: DISCOVER

**Goal**: Identify which sub-domains are missing reference coverage.

1. Run the gap analyzer: `python3 skills/meta/reference-enrichment/scripts/gap-analyzer.py --agent {name}` (or `--skill {name}`) 2. Read the component's .md file to understand its stated purpose, triggers, and domain claims 3. Read any existing reference files to map current coverage 4. Compare stated domains against covered domains to identify gaps

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.

---

Phase 2: RESEARCH

**Goal**: Compile concrete, domain-specific content for each gap.

For each identified gap: 1. Read existing Level 3 reference files in this repo as exemplars — golang-general-engineer's references/ is the benchmark: version-specific patterns, grep commands, error-fix mappings 2. Identify: version-specific patterns (what changed in version X.Y), common failure modes with 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.

---

Phase 3: COMPILE

**Goal**: Assemble research into structured reference files.

For each gap, create one reference file following `references/reference-file-template.md`:

  • One file per major sub-domain (not one monolithic file) because focused files are faster to

load and easier to update as language versions change

  • Max 500 lines per file (CLAUDE.md standard) — split into sub-topics if content exceeds this
  • Include: overview paragraph, pattern table with version ranges, failure mode table with

detection commands, error-fix mappings where applicable

Read more
Ships withvexjoy-agent

Essays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.

Get the whole plugin

Other skills on vexjoy-agent.