Skill Evolution
Concept of the skill
Skill evolution is the corpus walker around individual skill maintenance. The primitives are: a skill corpus; each skill's SKILL.md teaching/routing contract; each skill's audit-state.json Audit Status sidecar; an analyzer that turns Audit Status, scores, and registry facts into a priority queue; a triage step that selects bounded work; an executor that runs improve/scaffold/eval-generation actions; a verification step that keeps or reverts; and checkpoint logs that let the run resume.
Coverage
Skill evolution is the project-grounded discipline for running Skill Graph's corpus-level evolve operation. It covers:
- The public command:
skill-graph evolve
- The bundled implementation:
skill-graph/lib/audit/skill-evolution-loop.js
- The action loop: analyze -> triage -> execute -> verify -> checkpoint
- The priority model: Audit Status, application verdicts, scores, registry facts, staleness, and action types
- The keep-or-revert spine for improvement actions
- Standalone workspace flags and the removal of cross-repo path assumptions
- The boundary between walking a corpus and auditing, improving, evaluating, or scaffolding one skill
This skill is project-grounded to Skill Graph. It does not teach generic habit formation, generic evaluation theory, or first-time skill authoring.
Philosophy of the skill
Single-skill audit keeps one artifact honest. Skill evolution keeps the corpus from rotting silently. The loop exists because a large skill library has more potential drift than a human will remember to revisit.
The current implementation is not a simple hard-coded audit -> improve -> evaluate script. It is a continuous queue driver: analyze the current corpus, triage bounded work, execute one allowed action, verify the result, record findings/checkpoints, and optionally re-analyze. That shape matters because the queue can include different action types, and because a failed change must leave the corpus no worse than before.
Audit Status state lives in audit-state.json, not in SKILL.md frontmatter. SKILL.md teaches the skill; the sidecar records what the audit loop has proven about it. The evolve loop must preserve that split.
Key Files
| Workspace-relative file |
Purpose |
skill-graph/bin/skill-graph.js |
Public CLI surface for skill-graph evolve, help text, bundled-script mapping, and standalone requirements. |
skill-graph/lib/audit/skill-evolution-loop.js |
Current corpus walker: analyze, triage, execute, verify, checkpoint, continuous mode, pilot lanes, failure budget. |
skill-graph/lib/audit/run-skill-improvement-loop.js |
Improvement executor used for bounded skill edits and keep-or-revert behavior. |
skill-graph/lib/audit/evaluate-skill.js |
Evaluation runner that writes eval and behavior verdict state to audit-state.json. |
skill-graph/skill-audit-loop/SKILL_AUDIT_LOOP.md |
Binding operation doctrine: audit, improve, evaluate, evolve, write surfaces, and Behavior Gate semantics. |
skill-graph/README.md |
User-facing standalone install, smoke-test, evolve flags, and exit-code guidance. |
1. The Corpus Walker
The current evolve operation is a corpus queue driver:
analyze current skill library
triage top items by priority and allowed actions
execute one bounded action per item
verify the result
checkpoint progress and findings
repeat when continuous mode is enabled
The important operational guarantees are:
- Bounded work:
--top, --max-cycles, --max-iterations, --min-priority, --actions, and --pilot constrain the run.
- Failure containment:
--failure-budget stops repeated failures instead of letting the run thrash.
- Resumability: checkpoints let interrupted runs continue.
- Standalone operation:
--workspace-root, --skills-dir, and --output-dir make the loop work outside the original Development monorepo.
- Meta-skill protection: the implementation filters or gates meta skills unless an explicit pilot lane permits them.
2. Relationship to the Four Operations
| Operation |
Unit of work |
Writes |
audit |
One skill's Integrity Gate and optional graded checks |
audit-state.json plus evidence artifacts |
improve |
One bounded edit to one skill or asset |
SKILL.md or eval artifact, then keep-or-revert |
evaluate |
One skill's eval suite |
audit-state.json verdicts, scores, and receipts |
evolve |
A prioritized corpus queue |
The same writes as the operations/actions it invokes |
Use audit, improve, or evaluate when the target skill is already known. Use evolve when the work is to walk the corpus by priority, keep progress resumable, and decide which skill or asset should be improved next.
3. Priority Signals
The queue is not a telemetry crawler. It reads structured skill state and registry facts. Important signals include:
application_verdict: unverified or negative behavior signals raise priority.
structural_verdict and truth_verdict: failing Integrity Gate slices raise priority.
last_audited: older audit state raises priority.
eval_score: missing or lower scores raise priority when available.
- Registry/pilot metadata: some meta skills are frozen unless a specific pilot lane is active.
The exact queue formula belongs to skill-graph/lib/audit/skill-evolution-loop.js; this skill teaches the operating model and the safety boundaries, not a duplicated formula.
4. Commands
# Process a bounded queue
skill-graph evolve --top 5 --max-cycles 3
# Re-analyze and repeat until the cycle cap, convergence, or failure budget
skill-graph evolve --continuous --max-cycles 20 --min-priority 5
# Run the full auto-improve spine
skill-graph evolve --auto-improve --max-cycles 3 --failure-budget 5
# Analyze without executing improvements
skill-graph evolve --analyze-only
# Resume from a checkpoint
skill-graph evolve --resume
# Standalone workspace
skill-graph evolve --workspace-root /path/to/my-skills --skills-dir /path/to/my-skills/skills --output-dir /path/to/my-skills/audits
Exit codes:
| Code |
Meaning |
0 |
Loop completed successfully, or --analyze-only finished. |
1 |
Fatal error: missing dependency, unresolvable skill root, invalid workspace, or equivalent setup failure. |
2 |
Failure budget exceeded. |
Evals
This skill includes a sibling comprehension eval file for audit-loop grading. Keep eval_state: unverified until the eval is run by an independent grader and produces a receipt.
Verification
After applying this skill, verify:
Do NOT Use When
| Instead of this skill |
Use |
Why |
| Auditing one specific skill for schema, relations, sidecar, or manifest consistency |
graph-audit or the audit operation |
Skill-evolution owns the corpus queue, not one artifact's static consistency. |
| Creating a new skill from scratch |
skill-scaffold |
Scaffolding owns the initial skill shape; evolve may invoke scaffold-like actions inside a queue. |
| Designing or interpreting a scoring rubric |
evaluation or eval-driven-development |
Skill-evolution decides when to invoke evaluation, not how evaluation is designed. |
| Choosing which skill should route for a user request |
skill-router |
Routing picks an owner skill for a request; evolve picks maintenance work for a corpus. |
Key Sources
skill-graph/bin/skill-graph.js — public command contract.
skill-graph/lib/audit/skill-evolution-loop.js — current implementation.
skill-graph/lib/audit/run-skill-improvement-loop.js — keep-or-revert executor.
skill-graph/lib/audit/evaluate-skill.js — evaluation and sidecar write behavior.
skill-graph/skill-audit-loop/SKILL_AUDIT_LOOP.md — operation doctrine.
skill-graph/README.md — user-facing standalone usage.
1---2name: skill-evolution3description: Use when running or auditing Skill Graph's corpus-level `evolve` operation: the continuous skill-improvement loop that analyzes a skill library, triages a priority queue, executes bounded improve/scaffold/eval-generation actions, verifies the result, records checkpoints, and repeats. Covers `skill-graph evolve`, `lib/audit/skill-evolution-loop.js`, the Karpathy keep-or-revert spine, the priority signals based on Audit Status, standalone workspace flags, and the boundary between corpus walking and single-skill audit/improve/evaluate operations. Do NOT use for initial skill scaffolding alone (use skill-scaffold), single-skill schema/eval checks (use graph-audit or the audit operation), or generic evaluation rubric design (use evaluation / eval-driven-development).4license: MIT5---67# Skill Evolution89## Concept of the skill1011Skill evolution is the corpus walker around individual skill maintenance. The primitives are: a skill corpus; each skill's `SKILL.md` teaching/routing contract; each skill's `audit-state.json` Audit Status sidecar; an analyzer that turns Audit Status, scores, and registry facts into a priority queue; a triage step that selects bounded work; an executor that runs improve/scaffold/eval-generation actions; a verification step that keeps or reverts; and checkpoint logs that let the run resume.1213## Coverage1415Skill evolution is the project-grounded discipline for running Skill Graph's corpus-level `evolve` operation. It covers:1617- The public command: `skill-graph evolve`18- The bundled implementation: `skill-graph/lib/audit/skill-evolution-loop.js`19- The action loop: analyze -> triage -> execute -> verify -> checkpoint20- The priority model: Audit Status, application verdicts, scores, registry facts, staleness, and action types21- The keep-or-revert spine for improvement actions22- Standalone workspace flags and the removal of cross-repo path assumptions23- The boundary between walking a corpus and auditing, improving, evaluating, or scaffolding one skill2425This skill is project-grounded to Skill Graph. It does not teach generic habit formation, generic evaluation theory, or first-time skill authoring.2627## Philosophy of the skill28Single-skill audit keeps one artifact honest. Skill evolution keeps the corpus from rotting silently. The loop exists because a large skill library has more potential drift than a human will remember to revisit.2930The current implementation is not a simple hard-coded `audit -> improve -> evaluate` script. It is a continuous queue driver: analyze the current corpus, triage bounded work, execute one allowed action, verify the result, record findings/checkpoints, and optionally re-analyze. That shape matters because the queue can include different action types, and because a failed change must leave the corpus no worse than before.3132Audit Status state lives in `audit-state.json`, not in `SKILL.md` frontmatter. `SKILL.md` teaches the skill; the sidecar records what the audit loop has proven about it. The evolve loop must preserve that split.3334## Key Files3536| Workspace-relative file | Purpose |37|---|---|38| `skill-graph/bin/skill-graph.js` | Public CLI surface for `skill-graph evolve`, help text, bundled-script mapping, and standalone requirements. |39| `skill-graph/lib/audit/skill-evolution-loop.js` | Current corpus walker: analyze, triage, execute, verify, checkpoint, continuous mode, pilot lanes, failure budget. |40| `skill-graph/lib/audit/run-skill-improvement-loop.js` | Improvement executor used for bounded skill edits and keep-or-revert behavior. |41| `skill-graph/lib/audit/evaluate-skill.js` | Evaluation runner that writes eval and behavior verdict state to `audit-state.json`. |42| `skill-graph/skill-audit-loop/SKILL_AUDIT_LOOP.md` | Binding operation doctrine: audit, improve, evaluate, evolve, write surfaces, and Behavior Gate semantics. |43| `skill-graph/README.md` | User-facing standalone install, smoke-test, `evolve` flags, and exit-code guidance. |4445## 1. The Corpus Walker4647The current `evolve` operation is a corpus queue driver:4849```text50analyze current skill library51triage top items by priority and allowed actions52execute one bounded action per item53verify the result54checkpoint progress and findings55repeat when continuous mode is enabled56```5758The important operational guarantees are:5960- **Bounded work:** `--top`, `--max-cycles`, `--max-iterations`, `--min-priority`, `--actions`, and `--pilot` constrain the run.61- **Failure containment:** `--failure-budget` stops repeated failures instead of letting the run thrash.62- **Resumability:** checkpoints let interrupted runs continue.63- **Standalone operation:** `--workspace-root`, `--skills-dir`, and `--output-dir` make the loop work outside the original Development monorepo.64- **Meta-skill protection:** the implementation filters or gates meta skills unless an explicit pilot lane permits them.6566## 2. Relationship to the Four Operations6768| Operation | Unit of work | Writes |69|---|---|---|70| `audit` | One skill's Integrity Gate and optional graded checks | `audit-state.json` plus evidence artifacts |71| `improve` | One bounded edit to one skill or asset | `SKILL.md` or eval artifact, then keep-or-revert |72| `evaluate` | One skill's eval suite | `audit-state.json` verdicts, scores, and receipts |73| `evolve` | A prioritized corpus queue | The same writes as the operations/actions it invokes |7475Use `audit`, `improve`, or `evaluate` when the target skill is already known. Use `evolve` when the work is to walk the corpus by priority, keep progress resumable, and decide which skill or asset should be improved next.7677## 3. Priority Signals7879The queue is not a telemetry crawler. It reads structured skill state and registry facts. Important signals include:8081- `application_verdict`: unverified or negative behavior signals raise priority.82- `structural_verdict` and `truth_verdict`: failing Integrity Gate slices raise priority.83- `last_audited`: older audit state raises priority.84- `eval_score`: missing or lower scores raise priority when available.85- Registry/pilot metadata: some meta skills are frozen unless a specific pilot lane is active.8687The exact queue formula belongs to `skill-graph/lib/audit/skill-evolution-loop.js`; this skill teaches the operating model and the safety boundaries, not a duplicated formula.8889## 4. Commands9091```bash92# Process a bounded queue93skill-graph evolve --top 5 --max-cycles 39495# Re-analyze and repeat until the cycle cap, convergence, or failure budget96skill-graph evolve --continuous --max-cycles 20 --min-priority 59798# Run the full auto-improve spine99skill-graph evolve --auto-improve --max-cycles 3 --failure-budget 5100101# Analyze without executing improvements102skill-graph evolve --analyze-only103104# Resume from a checkpoint105skill-graph evolve --resume106107# Standalone workspace108skill-graph evolve --workspace-root /path/to/my-skills --skills-dir /path/to/my-skills/skills --output-dir /path/to/my-skills/audits109```110111Exit codes:112113| Code | Meaning |114|---|---|115| `0` | Loop completed successfully, or `--analyze-only` finished. |116| `1` | Fatal error: missing dependency, unresolvable skill root, invalid workspace, or equivalent setup failure. |117| `2` | Failure budget exceeded. |118119## Evals120121This skill includes a sibling comprehension eval file for audit-loop grading. Keep `eval_state: unverified` until the eval is run by an independent grader and produces a receipt.122123## Verification124125After applying this skill, verify:126127- [ ] `skill-graph evolve --help` names the same flags and exit codes this skill teaches.128- [ ] The implementation path in `skill-graph/bin/skill-graph.js` points to `skill-graph/lib/audit/skill-evolution-loop.js`.129- [ ] Audit/eval/provenance writes are described as `audit-state.json` writes, not `SKILL.md` frontmatter writes.130- [ ] The skill distinguishes corpus walking from one-skill audit, improve, evaluate, and scaffold work.131- [ ] Local truth-source drift is PASS when hashes are recorded, or UNVERIFIED when hashes are absent.132133## Do NOT Use When134135| Instead of this skill | Use | Why |136|---|---|---|137| Auditing one specific skill for schema, relations, sidecar, or manifest consistency | `graph-audit` or the `audit` operation | Skill-evolution owns the corpus queue, not one artifact's static consistency. |138| Creating a new skill from scratch | `skill-scaffold` | Scaffolding owns the initial skill shape; evolve may invoke scaffold-like actions inside a queue. |139| Designing or interpreting a scoring rubric | `evaluation` or `eval-driven-development` | Skill-evolution decides when to invoke evaluation, not how evaluation is designed. |140| Choosing which skill should route for a user request | `skill-router` | Routing picks an owner skill for a request; evolve picks maintenance work for a corpus. |141142## Key Sources143144- `skill-graph/bin/skill-graph.js` — public command contract.145- `skill-graph/lib/audit/skill-evolution-loop.js` — current implementation.146- `skill-graph/lib/audit/run-skill-improvement-loop.js` — keep-or-revert executor.147- `skill-graph/lib/audit/evaluate-skill.js` — evaluation and sidecar write behavior.148- `skill-graph/skill-audit-loop/SKILL_AUDIT_LOOP.md` — operation doctrine.149- `skill-graph/README.md` — user-facing standalone usage.