agentleFS
produckyou-designproduckyou-design/agent-guardrails/skill/SKILL.md

agent-guardrails

Skill1 starsChanged 3 months agoMITView on GitHub

Operating rules for an agent working in a repository that has guardrail gates installed. Use when committing, when reporting on work, when a gate refuses a commit, and when deciding whether something is finished. Covers what the gates check, how to unfreeze a locked path, what counts as verification, and how to report on it honestly.

  • Deletes or force-pushes

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Read this before your first commit here.

    line 11
  2. Distinctive:

    Run them yourself before committing.

    line 22
  3. Very specific:

    Use --base <ref> --head <ref> for a commit-range check.

    line 27
  4. Distinctive:

    Never use git reset --hard, git clean, git stash, git rebase, or force push without being asked to.

    line 43
  5. Very specific:

    Before you decide the freeze is in your way, read the entry.

    line 51
  6. Distinctive:

    Put three lines in the commit message:

    line 60
  7. Very specific:

    Do not weaken a freeze entry to get past the gate.

    line 75
  8. Distinctive:

    Do not write that you ran something you did not run.

    line 97
  9. Distinctive:

    Do not write that something passed when it failed.

    line 98
  10. Very specific:

    If you could not run a check, write NOT_RUN and say why.

    line 99
  11. Distinctive:

    If your change alters what a user sees, look at it in a browser, at the widths and in the themes the project supports, before you call it …

    line 106
  12. Distinctive:

    Run the read-only diagnostic after installation:

    line 137
  13. Very specific:

    If you went in a wrong direction, worked from a false assumption, or changed approach halfway, add an entry to FAILURE_MODES.md:

    line 161
  14. Distinctive:

    Write it even when nothing broke.

    line 171
  15. Distinctive:

    Do not guess. Write what is blocked and why, and stop that item.

    line 176

“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

Working in a guarded repository

This repository runs gates that can refuse your commit. They are not advice. They read the staged diff and the commit message and they exit non-zero.

Read this before your first commit here.

What runs on every commit

check_frozen.py       edits to paths marked finished
check_git_policy.py   unmerged branches, stray worktrees
check_scope.py        paths outside the declared task scope (when configured)
check_guardrail_integrity.py  changes to the gates, hooks, or policy files

Run them yourself before committing. A gate that stops you at commit time has already cost you the context you had ten minutes ago.

check_scope.py is opt-in. If .agent-guardrails/scope.json exists, the pre-commit hook checks the staged diff against its allowed and forbidden paths. Use --base <ref> --head <ref> for a commit-range check. No scope file means the gate reports INACTIVE; that is not a hidden PASS for an active scope.

Staging

Name the files you are committing.

git add src/thing.py tests/test_thing.py     # yes
git add -A                                    # refused
git add -u                                    # refused

Other work may be in progress in this tree. "Everything that changed" is not a set you control.

Never use git reset --hard, git clean, git stash, git rebase, or force push without being asked to. Recovering someone else's uncommitted work is not possible, and you will not know it was there.

Frozen paths

frozen.json lists code that is finished. Editing it fails the commit.

Before you decide the freeze is in your way, read the entry. It carries what_breaks and before_you_touch, and those exist because the failure they describe already happened once.

Very often the right move is not to unfreeze. If the entry says partial refunds live in a different file, then your change belongs in that file.

If you genuinely have to unfreeze

Put three lines in the commit message:

UNFREEZE: <path or label> - why this has to change now
UNFREEZE-IMPACT: what breaks, and how, if this is wrong
UNFREEZE-ROLLBACK: how to undo it, with the command if possible

Miss one and the commit is refused.

If you cannot write the impact and the rollback, stop. That is not a formatting problem, it is the gate telling you something true. You do not understand this code well enough to change it yet. Go read how_to_verify in the entry and run it first.

Do not weaken a freeze entry to get past the gate. Do not delete a path from frozen.json as part of a change to that path. Either of those turns the safeguard back into a note.

Guardrail files

guardrail_policy.json lists the files that make these checks trustworthy. A change to one of them must be accompanied in the same commit message by:

GUARDRAIL-CHANGE: why the guardrail must change now
GUARDRAIL-IMPACT: what protection is lost if this is wrong
GUARDRAIL-VERIFY: how the new guardrail was tested

The commit-msg hook checks these lines. The CI workflow checks each commit in the range, so a later marker cannot backdate permission for an earlier commit.

What counts as verification

Running a check counts. Reading code and concluding it should work does not.

  • Do not write that you ran something you did not run.
  • Do not write that something passed when it failed.
  • If you could not run a check, write NOT_RUN and say why. Never write PASS.
  • Capture exit codes before any pipe. cmd | tail then checking the last exit status gives you tail's status, which is almost always zero.

For anything with a visible result

A green gate is not a working screen. Gates read files, not rendered output. If your change alters what a user sees, look at it in a browser, at the widths and in the themes the project supports, before you call it done.

Added a test?

Break it on purpose once. Revert the fix, confirm the test fails, restore the fix, confirm it passes. A test you have never seen fail is not evidence that anything works.

Before calling something finished

Four questions. Most incomplete work fails one of them.

Producer    is the code that creates this data in the main branch
Consumer    is the code that uses it shipped in the same deploy
Wiring      do the config, secrets, and env vars reach it where it runs
Reproduces  does it come back from scratch, or only from a file you made by hand

The common failure is a shipped consumer with no producer. The screen works, because it is reading the last file something wrote before it stopped running.

Push is not deploy

Pushing puts a commit on the remote. It may not put anything in front of users. Find out how this project deploys, and confirm from the live response, with a cache-busting query, before you write that something is live.

Diagnose the installation

Run the read-only diagnostic after installation:

python scripts/doctor.py
python scripts/doctor.py --json

It checks the gate files, policy files, hooks, and guardrail-integrity CI. An absent task scope is reported as INFO because scope is deliberately opt-in.

The commit message is the report

Include:

  • What and why. The reasoning the diff cannot show.
  • What you did not do, and why. Scope you dropped, checks you skipped.
  • The four completeness questions, answered.

Whoever reviews this will re-run your checks themselves. Numbers you claim will be compared against numbers they measure. Claiming a passing result you did not observe is the fastest way to make everything else you wrote worthless.

When you get something wrong

If you went in a wrong direction, worked from a false assumption, or changed approach halfway, add an entry to FAILURE_MODES.md:

Symptom   what it looked like
Cause     why it happened
Fix       what changed
Rule      what to do from now on

Write it even when nothing broke. The test is: if I do not write this down, will I do it again? Skip it if nothing happened. Do not pad the file.

When you are blocked

Do not guess. Write what is blocked and why, and stop that item. Move to the next one if there is one.

"I could not verify this" is a report. "This is probably fine" is not.

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.