mistake-memory-guardrails
Skill16 starsChanged 8 months agoMITView on GitHub
Prevent repeated agent mistakes across code, docs, tests, and configs by enforcing repository mistake memory before edits and recording new failures.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- coding-principlesSkill
- design-taste-frontendSkill
- frontend-designSkill
- fullstack-guardianSkill
- python-proSkill
- react-expertSkill
- the-foolSkill
- writing-styleSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Read AGENT_MISTAKES.md. If missing, create it using the required schema.
- Very specific: line 18
Read target files and map applicable scope_tags.
- Distinctive: line 19
Run guardrail checks before proposing or applying changes.
- Distinctive: line 20
Run a post-edit self-check against known mistake patterns before final response.
- Distinctive: line 30
Keep shared names, paths, status values, and contracts aligned across touched files.
- Distinctive: line 42
Verify edits do not silently break existing behavior.
- Distinctive: line 43
Call out potential regressions and missing validation coverage.
- Distinctive: line 50
If a deduplicated entry exists:
- Distinctive: line 54
If no matching entry exists:
- Distinctive: line 59
If a known rule is violated, warn and revise the proposal before final response.
- Distinctive: line 61
If unresolved, explicitly report the risk and why it could not be fully resolved.
- Distinctive: line 65
When reporting results, provide:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Mistake Memory Guardrails
Global guardrails for repository edit tasks.
Scope
Apply this skill to any repository edit task, including code, docs, tests, config, infra, and planning files.
Execution Order
- Read
AGENT_MISTAKES.md. If missing, create it using the required schema. - Read target files and map applicable
scope_tags. - Run guardrail checks before proposing or applying changes.
- Run a post-edit self-check against known mistake patterns before final response.
- Record every detected mistake occurrence.
Guardrail Checks
- Requirement fidelity and scope discipline:
- Change only what the user requested.
- Reject unrelated refactors and speculative additions.
- Cross-file consistency for shared facts/configs/interfaces:
- Keep shared names, paths, status values, and contracts aligned across touched files.
- Flag stale duplicated facts and mismatched defaults.
- Assertion quality:
- Replace vague claims with measurable criteria.
- Require explicit thresholds, formulas, or pass/fail conditions when asserting quality or correctness.
- Reproducibility metadata when claims depend on run conditions:
- For benchmark/performance/behavior claims, capture model/tool version, dataset revision, seed, environment, and run conditions when relevant.
- Separate deterministic correctness checks from environment-sensitive comparisons.
- Safety and regression checks:
- Verify edits do not silently break existing behavior.
- Call out potential regressions and missing validation coverage.
Mistake Recording Rules
- Record every detected mistake occurrence.
- Deduplicate by normalized
pattern+scope_tags+prevention_rule.- Normalization: lowercase, trim whitespace, collapse repeated spaces.
- If a deduplicated entry exists:
- Increment
occurrence_count. - Update
last_seen. - Append new evidence (file:line and/or commit).
- Increment
- If no matching entry exists:
- Append a new entry with all required fields from
AGENT_MISTAKES.md.
- Append a new entry with all required fields from
Enforcement Behavior
- If a known rule is violated, warn and revise the proposal before final response.
- Fix violations before finalizing whenever possible.
- If unresolved, explicitly report the risk and why it could not be fully resolved.
Output Contract
When reporting results, provide:
- What was checked.
- What was changed and why.
- Remaining risks or unresolved ambiguities.
- Whether
AGENT_MISTAKES.mdwas created or updated.
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.

