source-command-self-heal
Skill0 starsChanged 6 months agoMITView on GitHub
Capture durable lessons from recent work into rules, tripwires, commands, and workflows
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-developmentSkill
- agent-teamsSkill
- ai-sdkSkill
- analyzing-financial-statementsSkill
- cache-componentsSkill
- chrome-devtoolsSkill
- Codex-automation-recommenderSkill
- Codex-md-improverSkill
- code-reviewSkill
- Command DevelopmentSkill
- creating-financial-modelsSkill
- data-visualizationSkill
- debugSkill
- develop-ai-functions-exampleSkill
- evolve-ai-layerSkill
- excalidraw-diagramSkill
- find-skillsSkill
- frontend-designSkill
- Hook DevelopmentSkill
- make-skill-templateSkill
- markdown-to-htmlSkill
- mcp-builderSkill
- MCP IntegrationSkill
- pdfSkill
- playwrightSkill
- Plugin SettingsSkill
- Plugin StructureSkill
- refactorSkill
- researchSkill
- security-best-practicesSkill
- skill-creatorSkill
- Skill DevelopmentSkill
- smithery-ai-cliSkill
- source-command-commit-and-deploySkill
- source-command-commitSkill
- source-command-create-prdSkill
- source-command-create-rulesSkill
- source-command-empty-redeploySkill
- source-command-evaluateSkill
- source-command-executeSkill
- source-command-handoffSkill
- source-command-plan-featureSkill
- source-command-primeSkill
- source-command-reviewSkill
- source-command-validateSkill
- sql-queriesSkill
- statistical-analysisSkill
- vscode-ext-localizationSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-design-guidelinesSkill
- Writing Hookify RulesSkill
- xlsxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user asks to run the migrated source command self-heal.
- Very specific: line 17
Look at the work just completed: the plan, implementation, adversarial review cycles, /review, /evaluate, validation, and any live …
- Very specific: line 32
After a multi-cycle /evaluate or adversarial review.
- Distinctive: line 33
After a live publishing, update, unpublish, benchmark, or release incident.
- Very specific: line 34
After /review catches a class of defect, not just one instance.
- Distinctive: line 35
After a feature touches multiple subsystems and exposes workflow drift.
- Very specific: line 38
Do not run /self-heal for trivial fixes, one-pass clean evaluations, or docs changes with no broader lesson.
- Very specific: line 43
If {user-provided arguments} is provided, use it as the plan file path or feature name.
- Distinctive: line 69
Read the source plan in full.
- Distinctive: line 74
Commit messages or plan cycle notes that identify defect classes.
- Distinctive: line 77
Use current checkout facts, not stale plan assumptions.
- Distinctive: line 92
Every lesson must have a forensic anchor:
- Distinctive: line 98
Avoid aspirational rules. If the lesson cannot be anchored to evidence, do not promote it into durable guidance.
- Distinctive: line 111
Keep Claude and Codex surfaces synchronized.
- Distinctive: line 130
Do not commit, push, deploy, or mutate production configuration from this command unless the user explicitly asks.
- Distinctive: line 135
Run the narrow validation that matches the changes:
- Distinctive: line 143
If a new tripwire fails on day zero, either fix the live violation or document a specific allowlist rationale.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
source-command-self-heal
Use this skill when the user asks to run the migrated source command
self-heal. Original argument hint: [plan-file-path-or-feature-name].
Command Template
Self-Heal: Capability Retrospective
Mission
Look at the work just completed: the plan, implementation, adversarial review
cycles, /review, /evaluate, validation, and any live debugging. Ask what
the repo learned and how to make that lesson stick.
/self-heal is not a code review. /review and /evaluate already do that.
This command captures durable workflow improvements:
- Rule updates that prevent recurrence.
- Tripwire tests or grep checks for missed failure modes.
- Command or skill updates that close process gaps.
- Documentation drift fixes tied to current code or incident evidence.
- Process patterns worth preserving for future m0lz/editorial pipeline work.
When To Run
- After a multi-cycle
/evaluateor adversarial review. - After a live publishing, update, unpublish, benchmark, or release incident.
- After
/reviewcatches a class of defect, not just one instance. - After a feature touches multiple subsystems and exposes workflow drift.
- Periodically on the most recent active plan.
Do not run /self-heal for trivial fixes, one-pass clean evaluations, or docs
changes with no broader lesson.
Step 1: Identify Source Material
If {user-provided arguments} is provided, use it as the plan file path or
feature name. If not provided, default to the most recently modified source plan
across Claude and Codex plan folders. Prefer a plan with a ## Contract
section, because proof/evidence notes can also live under plans/ and are not
the source material for a retrospective.
PLAN_FILE=""
for f in $(ls -t .claude/plans/*.md .codex/plans/*.md 2>/dev/null); do
if rg -q '^## Contract$' "$f"; then
PLAN_FILE="$f"
break
fi
done
if [ -z "$PLAN_FILE" ]; then
for f in $(ls -t .claude/plans/*.md .codex/plans/*.md 2>/dev/null); do
case "$f" in
*proof*.md|*evidence*.md) continue ;;
esac
PLAN_FILE="$f"
break
done
fi
printf '%s\n' "$PLAN_FILE"Read the source plan in full. Pay attention to:
- Contract criteria and thresholds.
- Adversarial review findings.
- Each
/evaluateor review cycle, especially resolved HIGH/MEDIUM items. - Commit messages or plan cycle notes that identify defect classes.
- Runtime logs, publishing state, smoke notes, or DB checks that changed the diagnosis.
Use current checkout facts, not stale plan assumptions.
Step 2: Extract Patterns
For each defect class or workflow miss, classify it:
| Class | Question | Typical Output |
| Greppable code pattern | Could a regex or structural test catch this next time? | New regression/tripwire test |
| Test-quality issue | Did a passing test fail to assert the real contract? | Update /review checks or add test coverage |
| Workflow drift | Did the agent skip a repo-specific procedure? | Update .claude/commands, .codex/commands, or .agents/skills/source-command-* |
| Subsystem rule | Is the lesson scoped to CLI, DB, publishing, update, unpublish, benchmark, or evaluation? | Update .claude/rules/* and .codex/rules/* |
| Cross-cutting rule | Does it affect every agent session? | Update AGENTS.md and mirror to CLAUDE.md if present |
| Contract design gap | Did the contract miss what the evaluator caught? | Update planning/evaluation command guidance |
Every lesson must have a forensic anchor:
- File and line, route, test, log string, query, or run id.
- The cycle or incident that exposed it.
- One sentence explaining what the rule prevents.
Avoid aspirational rules. If the lesson cannot be anchored to evidence, do not promote it into durable guidance.
Step 3: Decide Where It Lives
Use this precedence:
- Mechanical tripwire or regression test when the failure is machine-checkable.
- Command or skill update when the failure was process drift.
.claude/rules/*and.codex/rules/*when the lesson is subsystem-scoped.AGENTS.mdandCLAUDE.mdonly for cross-cutting rules that should load in every session.
Keep Claude and Codex surfaces synchronized. If you update a Claude command or rule, mirror the durable content into the Codex wrapper/source skill/rule unless there is a deliberate tool-specific difference.
Step 4: Write The Changes
Make the retrospective changes now while the evidence is fresh. Do not defer durable process fixes to a follow-up unless user judgment is required.
For each change:
| Change Type | Required |
| New tripwire test | Add focused coverage and register it in review guidance if it is part of the review harness |
| New cross-cutting rule | Add forensic anchor and keep AGENTS.md/CLAUDE.md concise |
| Rule update | Mirror between .claude/rules/* and .codex/rules/* when both exist |
| Command update | Keep .claude/commands/*, .codex/commands/*, and .agents/skills/source-command-* aligned |
| Documentation correction | Cite the current file, route, migration, test, log, or query that proves the correction |
Do not commit, push, deploy, or mutate production configuration from this command unless the user explicitly asks.
Step 5: Verify
Run the narrow validation that matches the changes:
- Command/rule-only changes: verify file presence, frontmatter, and parity.
- New tests: run the new test file and any directly related suite.
- Review-harness changes: run the command's own inventory checks where feasible.
- Repo-wide behavioral changes: use the validation chain required by the active
plan or
AGENTS.md.
If a new tripwire fails on day zero, either fix the live violation or document a specific allowlist rationale. Do not leave a vacuous test that scans no files.
Step 6: Report
Return a concise report:
## /self-heal: <feature or plan>
### Source Material
- Plan/run/logs reviewed:
- Cycles reviewed:
- Defect classes captured:
### Changes Made
- Tripwire tests:
- Rule updates:
- Command/skill updates:
- Documentation corrections:
### Open Follow-Ups
- Items needing user judgment:
### Validation
- Commands run:
- Result: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
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.

