agentleFS
OneWave-AIOneWave-AI/claude-skills/ai-coding-guardrails/SKILL.md

ai-coding-guardrails

Skill378 starsChanged 52 days agoMITView on GitHub

Use when an AI coding agent is writing or refactoring production code and its known failure modes need to be held in check — over-engineering, silent scope creep, invented APIs, claiming work is done without checking, deleting tests to make them pass. Trigger when the user asks for careful, production-grade, or reviewed code, or when a previous agent run produced confident output that turned out wrong.

1 other project uses 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. About 0 are common, 4 are distinctive, and 1 is 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.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No speculative abstraction.

    line 16
  2. Very specific:

    No empty catch blocks, no except: pass, no returning a default to hide a failure.

    line 28
  3. Distinctive:

    Before removing code, find out who calls it.

    line 37
  4. Distinctive:

    Never print, commit, or copy keys and tokens.

    line 40
  5. Distinctive:

    Run down this list. Anything you cannot answer yes to goes in the summary as a stated limitation.

    line 44

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

AI Coding Guardrails

Coding agents fail in a small number of predictable ways. This is the checklist that catches them before the diff lands.

The Rules

1. Match the codebase, not your preferences. Read two or three neighbouring files before writing. Use the project's existing patterns, naming, error handling, and comment density — even when you would have done it differently. A diff that reads like the rest of the repo is the goal. Introducing a new pattern is a decision the user makes, not a default.

2. Change the smallest thing that works. No speculative abstraction. No config option nobody asked for. No "while I was in here" rewrite. If a fix is three lines, the diff is three lines. Refactors ride separately from behavior changes so a reviewer can see one thing at a time.

3. Never invent an API. If you cannot see a function's signature in the repo, in installed source, or in the documentation, do not call it. Grep for it first. A plausible-looking method that does not exist is the single most common way agent code fails, and it fails at runtime, in front of the user.

4. Verify before claiming. "Done" means you ran something and saw it pass. Build, test, hit the endpoint, load the page. If you did not run it, say "untested". Reporting success you did not observe is worse than reporting nothing.

5. Never make a test pass by weakening it. Deleting an assertion, loosening a matcher, adding a skip, or special-casing the test input is fraud. If the test is genuinely wrong, say so in a sentence and let the user decide.

6. Do not swallow errors. No empty catch blocks, no except: pass, no returning a default to hide a failure. If an error path is intentionally ignored, one comment says why.

7. Read the error before changing anything. The stack trace usually names the file and the line. Changing code before reading the failure is guessing, and guessing costs more turns than reading.

8. Stay inside the ask. Fixing an unrelated bug you noticed is a new task, not a bonus. Mention it in a line; do not bundle it. Unrequested changes make a diff unreviewable and break things the user was not watching.

9. Do not delete or rewrite what you did not read. Before removing code, find out who calls it. Before overwriting a file, read it. "It looked unused" is not a reason.

10. Leave secrets alone. Never print, commit, or copy keys and tokens. Never hardcode a credential to get something working. Use the env var the project already uses.

Before Presenting a Diff

Run down this list. Anything you cannot answer yes to goes in the summary as a stated limitation.

  • Did I read the surrounding code before writing?
  • Does every function I called actually exist?
  • Did I run it? What was the output?
  • Is anything in this diff outside what was asked?
  • Did any test get weaker?
  • Would a reviewer understand each change without me explaining it?

Reporting

State plainly what you changed, what you verified and how, and what you did not verify. One or two sentences. No summary of the diff the user can already read, and no confidence you did not earn.

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.