subagent-maintenance
Maintain an existing generated subagent package when its sources, converters, runtime behaviour, or requirements change — detect staleness, re-ingest or re-derive, re-export, and re-validate. Use when
SKILL.md.claude/skills/subagent-maintenance/SKILL.md
GitHubSkill: subagent-maintenance
Purpose: Maintain existing generated subagents when sources, converters, platform behavior, or requirements change. Phase 12 of the authoring cycle.
Maintenance trigger types
| Trigger | Re-enter at |
|---|---|
| Source content changed materially | Phase 2 (re-interrogate) |
| New source adds a mode or changes quality bar | Phase 2 → multi-source merge |
| Platform adapter format changed | adapter-export only |
| Test failure after platform update | adapter-export → validate |
| Conflict re-opened by new evidence | multi-source merge |
| Profile body became bloated | profile-generation → Phase 8 |
| Rights status changed | Phase 1 — stop distillation if rights withdrawn |
| Authored skill/reference body drifted from its grounding | Step 9 stale check → author-skills re-author |
Steps for adding a new source
- Run
source-ingestionfor the new source - Run
source-interrogationon new source Markdown - Compare interrogation with existing profile
- Identify conflicts using Phase 7 conflict classes
- Resolve conflicts, update
profile.yaml - Update
provenance-ledger.mdwith new distillation rows - Append CHANGELOG entry
- Re-run
adapter-export - Re-run
validate
Steps for adapter-only update (platform change)
- Check
.claude/agents/generated/<slug>.mdagainst canonical profile - Re-run
adapter-export - Re-run
validate
Steps for stale authored bodies (Step 9)
When a source is re-ingested or principles are re-derived, skill/reference bodies authored from the old grounding go stale. Detect and refresh them:
python -m tools.subagent_factory.cli stale <slug> # report drift (STALE/WARN/INFO)
python -m tools.subagent_factory.cli stale <slug> --mark # flip drifted ready docs → stale
Then re-run author-skills <slug> (it re-authors stale docs like stubs and re-stamps the
baseline) and re-export. The validate gate surfaces stale bodies as an advisory WARN; they do
not hard-block release but should be refreshed before the next one.
Stale source policy
If a source is marked stale in the provenance ledger:
- Adapters generated from it are marked
status: stale - Human review required before next release
- Run
cli stale <slug>to find authored bodies whose grounding the change invalidated