rule-patcher
Skill2 starsChanged 4 months agoMITView on GitHub
Propose, test, and promote patches to rules, workflows, and skills via replay-gated promotion
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- Academic Paper SummarizationSkill
- Accessibility WCAG AuditSkill
- API Error TroubleshootingSkill
- CI/CD Pipeline TroubleshootingSkill
- Competitor Analysis SynthesisSkill
- Customer Onboarding AssistanceSkill
- Dependency Audit ResolutionSkill
- Docker Image OptimizationSkill
- GDPR Data MappingSkill
- genome-analyzerSkill
- incident-distillerSkill
- Kubernetes Pod DebuggingSkill
- nve-genome-explorerSkill
- OWASP Input ValidationSkill
- repo-auditorSkill
- research-packagerSkill
- Secret Leak RemediationSkill
- skill-curatorSkill
- skill-package-builderSkill
- SOC2 Policy VerificationSkill
- tama-community-summarizerSkill
- Technology Stack EvaluationSkill
- Ticket Triage and RoutingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
After a high-impact incident (Impact ≥ 7) or when a failure family is detected.
- Distinctive: line 35
Write the proposed change:
- Distinctive: line 80
Update the source genome file:
- Distinctive: line 112
After rejection: refine the patch or propose a different patch type.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Rule Patcher
Proposes mutations to the agent's rules, workflows, and skills based on incident data. V4: includes Failure Genome replay-gated promotion.
When to Use
After a high-impact incident (Impact ≥ 7) or when a failure family is detected.
Patch Types
| Type | Target | Example | When to Use |
rule_patch | .agents/rules/*.md | Add new invariant | Missing knowledge — no rule existed |
workflow_patch | .agents/workflows/*.md | Add new check step | Process gap — steps skipped |
skill_patch | .agents/skills/*/SKILL.md | Extend extraction | Capability gap |
verifier_patch | Checklist or test | Add verification check | Invariant was clear but not enforced |
doc_patch | docs/*.md | Update architecture | Documentation drift |
Procedure
1. Identify Gap
From the incident and its failure genome:
- Which rule/workflow/skill would have PREVENTED this?
- Is it a new gap or a known family with no patch?
2. Draft Patch
Write the proposed change:
patch_type: rule_patch
target_file: .agents/rules/10-truthfulness-and-no-fallbacks.md
change: Add CSS variable detection to pre-commit checklist
rationale: CSS var(--x) passes presence check but is unresolvable
source_genome: FG-0000043. Replay-Gated Promotion
THIS IS THE CORE V4 MECHANISM
┌─ 1. Is the current incident FIXED? ──────────────────┐
│ NO → STOP. Fix first. │
│ YES ↓ │
├─ 2. Are there SIMILAR genomes in the family? ────────┤
│ NO → Promote with "replay: not_run" (first member) │
│ YES ↓ │
├─ 3. Would this patch have PREVENTED similar ones? ───┤
│ For each family member: │
│ - Read its incident │
│ - Simulate: would patch have caught it? │
│ - Score: PASS / FAIL │
│ ↓ │
├─ 4. Pass rate ≥ 60%? ───────────────────────────────┤
│ NO → Reject or refine the patch │
│ YES ↓ │
├─ 5. Holdout regression? ────────────────────────────┤
│ Pick 1-2 genomes from DIFFERENT family │
│ Does patch obviously break them? │
│ YES → Reject │
│ NO ↓ │
├─ 6. PROMOTE ────────────────────────────────────────┤
│ Apply patch to target file │
│ Update genome: promotion_decision = "promoted" │
│ Update genome: replay.status = "passed" │
│ Update genome: replay.pass_rate = actual_rate │
│ Commit: "🧬 genome-promoted: [family] → [type]" │
└──────────────────────────────────────────────────────┘4. Record Promotion Decision
Update the source genome file:
{
"promotion_decision": "promoted",
"proposed_patch_types": ["rule_patch"],
"replay": {
"status": "passed",
"family_sample_size": 3,
"holdout_sample_size": 2,
"pass_rate": 0.8,
"notes": "Patch would have prevented 4/5 similar incidents. No holdout regressions."
},
"notes": "Added CSS var detection to rule 10 pre-commit checklist"
}5. If Rejected
{
"promotion_decision": "rejected",
"replay": {
"status": "failed",
"family_sample_size": 5,
"holdout_sample_size": 2,
"pass_rate": 0.4,
"notes": "Only prevented 2/5 family members. Too narrow."
},
"notes": "Patch too specific — only catches exact CSS var pattern, not general quality gate bypass"
}After rejection: refine the patch or propose a different patch type.
What NOT to Do
- Don't auto-promote without replay — even if it "feels right"
- Don't mutate the global prompt — use targeted rules/workflows/skills
- Don't trust "felt useful" reflections — require evidence
- Don't merge failures and successes — they are different data types
- Don't overfit to last incident — test against the family
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.

