agentleFS
wilbeibiwilbeibi/wilbeibi-skills/skills/agent-guardrails/SKILL.md

agent-guardrails

Skill2 starsChanged 2 months agoMITView on GitHub

Turn recurring agent mistakes in a project into enforceable constraints. Use when the user keeps correcting the same mistake or asks to prevent a repeated class of errors. Do NOT use for a single bug fix, general code review, or skill-library cleanup.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 5

    Distinctive

    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
  1. Distinctive:

    Read relevant project commits, reverts, review comments, instruction files, and examples supplied by the user.

    line 12
  2. Distinctive:

    Project guidance: Keep judgment calls that cannot be enforced as concise instructions, with their limit stated.

    line 24
  3. Distinctive:

    Test a nearby valid case too, especially for syntax or text-based rules.

    line 32
  4. Distinctive:

    Keep any rule-to-enforcement mapping beside the project's existing guidance only when it helps maintainers find the check.

    line 38
  5. Distinctive:

    Leave judgment-only rules visible.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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

agent-guardrails

Replace a repeated correction with a constraint that catches the next occurrence.

Find the class

Read relevant project commits, reverts, review comments, instruction files, and examples supplied by the user. Stay within the current project and explicitly supplied history; do not search unrelated conversations or host memory.

Group mistakes by their cause rather than their wording. Require two distinct occurrences before calling a class recurring; multiple comments about one occurrence count once. A request to prevent a specific mistake can justify a guard without a history claim. Record the evidence and the behavior that should have happened instead.

Choose the strongest practical constraint

Work down this order, stopping at the smallest change that prevents the demonstrated error:

  1. Ownership and architecture. One owner for shared state, one authoritative list, an internal boundary, or removal of an obsolete example can make the mistaken path unavailable. Reject a broad redesign whose cost exceeds the recurring failure.
  2. Types and schemas. Encode the invalid state or unsupported operation so existing validation rejects it.
  3. Lint, build, or CI. Catch the bad pattern with an actionable error naming the supported alternative. Follow the project's existing check path. If legacy violations make adoption impractical, reject newly introduced violations without hiding the old ones.
  4. Behavioral regression. Protect the external contract with an independent expected result. An internal-shape assertion is not a substitute for a behavior check.
  5. Project guidance. Keep judgment calls that cannot be enforced as concise instructions, with their limit stated. Another reminder does not count as an enforced guard.

For each chosen level, say why a cheaper or stronger option did not fit. Do not add every layer for the same error.

Prove the constraint

Recreate a representative past mistake in an isolated fixture, scratch checkout, or narrowly controlled reversible edit. Show that the normal project check rejects it for the intended reason, then that the corrected form passes. Use the same command CI will use when CI enforcement is claimed.

Test a nearby valid case too, especially for syntax or text-based rules. A check that bans legitimate code or fails for an unrelated reason is unfinished. When a real-case replay is unavailable, label the guard unverified and name what remains to run.

Keep the change scoped

  • A diagnosis-only request ends with evidence and proposed constraints. An authorized implementation fixes the selected classes within the project; it does not expand into host configuration, global agent rules, deployment, or publication.
  • Preserve existing tests and project policy. Changing their contracts requires the authority applicable to that project.
  • Keep any rule-to-enforcement mapping beside the project's existing guidance only when it helps maintainers find the check. Do not create another policy file or append unenforced rules by default.
  • Leave judgment-only rules visible. Drop an obsolete reminder only after proving its constraint covers the original cases.

Output

Report each class with its occurrence evidence, selected constraint and cost, failing replay, passing correction and valid case, and enforcement command. Identify any remaining judgment call or verification gap. Report only classes the evidence supports.

Adapted from pstack/correct, under the MIT license.

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.