agentleFS
jmolzjmolz/m0lz.01/.agents/skills/source-command-self-heal/SKILL.md

source-command-self-heal

Skill0 starsChanged 6 months agoMITView on GitHub

Capture durable lessons from recent work into rules, tripwires, commands, and workflows

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
  1. Very specific:

    Use this skill when the user asks to run the migrated source command self-heal.

    line 8
  2. Very specific:

    Look at the work just completed: the plan, implementation, adversarial review cycles, /review, /evaluate, validation, and any live …

    line 17
  3. Very specific:

    After a multi-cycle /evaluate or adversarial review.

    line 32
  4. Distinctive:

    After a live publishing, update, unpublish, benchmark, or release incident.

    line 33
  5. Very specific:

    After /review catches a class of defect, not just one instance.

    line 34
  6. Distinctive:

    After a feature touches multiple subsystems and exposes workflow drift.

    line 35
  7. Very specific:

    Do not run /self-heal for trivial fixes, one-pass clean evaluations, or docs changes with no broader lesson.

    line 38
  8. Very specific:

    If {user-provided arguments} is provided, use it as the plan file path or feature name.

    line 43
  9. Distinctive:

    Read the source plan in full.

    line 69
  10. Distinctive:

    Commit messages or plan cycle notes that identify defect classes.

    line 74
  11. Distinctive:

    Use current checkout facts, not stale plan assumptions.

    line 77
  12. Distinctive:

    Every lesson must have a forensic anchor:

    line 92
  13. Distinctive:

    Avoid aspirational rules. If the lesson cannot be anchored to evidence, do not promote it into durable guidance.

    line 98
  14. Distinctive:

    Keep Claude and Codex surfaces synchronized.

    line 111
  15. Distinctive:

    Do not commit, push, deploy, or mutate production configuration from this command unless the user explicitly asks.

    line 130
  16. Distinctive:

    Run the narrow validation that matches the changes:

    line 135
  17. Distinctive:

    If a new tripwire fails on day zero, either fix the live violation or document a specific allowlist rationale.

    line 143

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. Rule updates that prevent recurrence.
  2. Tripwire tests or grep checks for missed failure modes.
  3. Command or skill updates that close process gaps.
  4. Documentation drift fixes tied to current code or incident evidence.
  5. Process patterns worth preserving for future m0lz/editorial pipeline work.

When To Run

  • After a multi-cycle /evaluate or adversarial review.
  • After a live publishing, update, unpublish, benchmark, or release incident.
  • After /review catches 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 /evaluate or 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:

ClassQuestionTypical Output
Greppable code patternCould a regex or structural test catch this next time?New regression/tripwire test
Test-quality issueDid a passing test fail to assert the real contract?Update /review checks or add test coverage
Workflow driftDid the agent skip a repo-specific procedure?Update .claude/commands, .codex/commands, or .agents/skills/source-command-*
Subsystem ruleIs the lesson scoped to CLI, DB, publishing, update, unpublish, benchmark, or evaluation?Update .claude/rules/* and .codex/rules/*
Cross-cutting ruleDoes it affect every agent session?Update AGENTS.md and mirror to CLAUDE.md if present
Contract design gapDid 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:

  1. Mechanical tripwire or regression test when the failure is machine-checkable.
  2. Command or skill update when the failure was process drift.
  3. .claude/rules/* and .codex/rules/* when the lesson is subsystem-scoped.
  4. AGENTS.md and CLAUDE.md only 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 TypeRequired
New tripwire testAdd focused coverage and register it in review guidance if it is part of the review harness
New cross-cutting ruleAdd forensic anchor and keep AGENTS.md/CLAUDE.md concise
Rule updateMirror between .claude/rules/* and .codex/rules/* when both exist
Command updateKeep .claude/commands/*, .codex/commands/*, and .agents/skills/source-command-* aligned
Documentation correctionCite 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:

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.