agentleFS
kaustubhhiwarekaustubhhiware/agent-skills-fullstack-development/.agents/skills/mistake-memory-guardrails/SKILL.md

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.

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

    Read AGENT_MISTAKES.md. If missing, create it using the required schema.

    line 17
  2. Very specific:

    Read target files and map applicable scope_tags.

    line 18
  3. Distinctive:

    Run guardrail checks before proposing or applying changes.

    line 19
  4. Distinctive:

    Run a post-edit self-check against known mistake patterns before final response.

    line 20
  5. Distinctive:

    Keep shared names, paths, status values, and contracts aligned across touched files.

    line 30
  6. Distinctive:

    Verify edits do not silently break existing behavior.

    line 42
  7. Distinctive:

    Call out potential regressions and missing validation coverage.

    line 43
  8. Distinctive:

    If a deduplicated entry exists:

    line 50
  9. Distinctive:

    If no matching entry exists:

    line 54
  10. Distinctive:

    If a known rule is violated, warn and revise the proposal before final response.

    line 59
  11. Distinctive:

    If unresolved, explicitly report the risk and why it could not be fully resolved.

    line 61
  12. Distinctive:

    When reporting results, provide:

    line 65

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

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

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

  1. Read AGENT_MISTAKES.md. If missing, create it using the required schema.
  2. Read target files and map applicable scope_tags.
  3. Run guardrail checks before proposing or applying changes.
  4. Run a post-edit self-check against known mistake patterns before final response.
  5. Record every detected mistake occurrence.

Guardrail Checks

  1. Requirement fidelity and scope discipline:
  • Change only what the user requested.
  • Reject unrelated refactors and speculative additions.
  1. 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.
  1. Assertion quality:
  • Replace vague claims with measurable criteria.
  • Require explicit thresholds, formulas, or pass/fail conditions when asserting quality or correctness.
  1. 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.
  1. 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).
  • If no matching entry exists:
    • Append a new entry with all required fields from AGENT_MISTAKES.md.

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:

  1. What was checked.
  2. What was changed and why.
  3. Remaining risks or unresolved ambiguities.
  4. Whether AGENT_MISTAKES.md was created or updated.

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.