agent-guardrails
Skill0 starsChanged 13 days agoMITView on GitHub
Hard operating rules for coding agents on Payload CMS + Next.js projects, especially unattended, overnight, or turbo runs. Use in every session. Prevents scope creep, rebuilding from scratch, throwaway scripts that roam the machine, retry loops that burn tokens, leaked secrets, destructive database commands, "invalidate everything to be safe" cache hooks that exhaust free-tier quotas, and false "done" claims.
- Pipes a download into a shell
- Reads credentials
- Deletes or force-pushes
- Installs packages
9 other projects use a version of this.
Adopted by
Most recently taken up by
- XData-si/xdata-agenthubtheir own version, first seen Nov 22, 2026
- milad-ahmd/agent-skillstheir own version, first seen Nov 8, 2026
- wilbeibi/wilbeibi-skillstheir own version, first seen Nov 1, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
- guerrilla2799/ops-and-scale-ostheir own version, first seen Oct 13, 2026
- Sathvikar01/Agent-engineering-skillstheir own version, first seen Oct 5, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- jzOcb/agent-guardrails★ 15same name
- milad-ahmd/agent-skills★ 7same name
- Sathvikar01/Agent-engineering-skills★ 3same name
- wilbeibi/wilbeibi-skills★ 2same name
- guerrilla2799/ops-and-scale-os★ 1same name
- produckyou-design/agent-guardrails★ 1same name
- XData-si/xdata-agenthub★ 1same name
- antonioneto11/agent-dev-framework★ 0same name
- vindreshsingh/engineering-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- creative-frontendSkill
- figma-handoffSkill
- payload-admin-brandingSkill
- payload-auth-rbacSkill
- payload-bookings-paymentsSkill
- payload-bootstrapSkill
- payload-deploy-vercelSkill
- payload-forms-crmSkill
- payload-integrationsSkill
- payload-legal-trustSkill
- payload-live-previewSkill
- payload-localizationSkill
- payload-mcpSkill
- payload-mediaSkill
- payload-performanceSkill
- payload-project-kickoffSkill
- payload-seo-geoSkill
- payload-testingSkill
- project-architectureSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 15 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
11
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
- Very specific: line 15
Do only the current phase in PROJECT.md.
- Distinctive: line 16
Never start from scratch when code exists.
- Distinctive: line 17
Never rewrite a working file to change its style.
- Very specific: line 18
If the task is unclear, write the question under ## Questions and work on the parts that are clear.
- Distinctive: line 45
Never run the same failing command more than twice without changing something relevant.
- Distinctive: line 46
If the same error appears after two different fixes, stop fixing.
- Very specific: line 47
After three failed attempts on one problem, write an entry under ## Blockers in PROJECT.md with the error output, what you tried, and your …
- Very specific: line 48
Run the cheap check first: pnpm tsc --noEmit before pnpm build.
- Distinctive: line 49
Start at most one dev server.
- Distinctive: line 50
Do not poll or sleep in a loop waiting for something that is not running.
- Very specific: line 55
Check the latest stable version with pnpm view <package> version and install that version.
- Distinctive: line 56
Do not add a package that duplicates one already installed (a second date library, a second form library, a second icon set).
- Distinctive: line 57
Never install a package with no release in the last 12 months unless a skill names it.
- Distinctive: line 61
Never print, echo, log, or commit secret values.
- Very specific: line 62
Keep secrets in the gitignored env file (.env from the Payload template) for development and in the hosting dashboard for production.
- Very specific: line 63
Never run payload migrate:fresh, migrate:reset, migrate:down, or drop tables against any database except a local development file.
- Distinctive: line 64
Never delete media, users, or submissions to "clean up" test data in a shared database.
- Distinctive: line 65
Never paste real customer data into code, tests, or seed files.
- Distinctive: line 72
Never schedule crons, polling, or background work more often than the feature requires.
- Distinctive: line 73
Never raise limits or plan-dependent settings (function duration, retries, image sizes, query limits) beyond what the task needs.
- Very specific: line 74
When a broader option is chosen deliberately, the code comment states the reason and the expected cost, and PROJECT.md records it under ## …
- Distinctive: line 79
Commit after each completed step with a message that names the step.
- Very specific: line 80
Never force push, rewrite published history, or commit .env* files other than .env.example.
- Very specific: line 86
Do not disable tests, lint rules, or type checks to make a check pass.
- Very specific: line 90
Stop the affected task and write a question under ## Questions when any of these is needed:
- Distinctive: line 102
Before starting an overnight or turbo run:
“Common” is measured: kept by at least 6 in 10 of the 8 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.
Files
Agent guardrails
These rules override any instinct to improvise. When a rule and a task conflict, follow the rule and record the conflict in PROJECT.md under ## Questions.
1. Scope
- Do only the current phase in
PROJECT.md. Do not start the next phase, add unrequested features, or "improve" unrelated code. - Never start from scratch when code exists. Never re-scaffold, re-initialize, or replace a working project. Extend it.
- Never rewrite a working file to change its style. Change only the lines the task needs.
- If the task is unclear, write the question under
## Questionsand work on the parts that are clear.
2. Shell use
Allowed commands, run from the project root only:
| Purpose | Commands |
| Packages | pnpm add, pnpm remove, pnpm install, pnpm view <pkg> version |
| Payload | pnpm payload <command>, pnpm generate:types, pnpm generate:importmap |
| Next.js | pnpm dev, pnpm build, pnpm start, pnpm lint |
| Checks | pnpm tsc --noEmit, pnpm test, pnpm exec playwright test, pnpm exec vitest run |
| Git | git status, git diff, git add, git commit, git switch -c, git log |
| Scaffolding | npx create-payload-app, npx degit (only as written in a skill) |
Forbidden:
- Writing scripts (Python, Node, PowerShell, Bash) to search code, patch files, rename in bulk, inspect the system, or "explore". Use the editor's search, read, and edit tools instead.
- Any command that reads or writes outside the project folder, including the home directory, other projects, system folders, and global config.
- Global installs (
npm i -g,pip install),sudo, piping downloads into a shell (curl ... | sh), changing system settings. - Installing a language runtime or tool the project does not already use.
- Deleting files outside
node_modules,.next, and test output folders without the task requiring it.
A script is allowed only when a skill ships it in assets/ or scripts/ and tells you to run it.
3. Loop breaker
- Never run the same failing command more than twice without changing something relevant.
- If the same error appears after two different fixes, stop fixing. Re-read the error, read the relevant skill's diagnosis table, and form a new hypothesis.
- After three failed attempts on one problem, write an entry under
## BlockersinPROJECT.mdwith the error output, what you tried, and your best hypothesis. Then move to the next independent task, or stop if none exists. - Run the cheap check first:
pnpm tsc --noEmitbeforepnpm build. Never loop onpnpm build. - Start at most one dev server. Reuse it. Stop it when the session ends.
- Do not poll or sleep in a loop waiting for something that is not running.
4. Dependencies
- Install only packages named in a skill or in
PROJECT.md. - Check the latest stable version with
pnpm view <package> versionand install that version. - Do not add a package that duplicates one already installed (a second date library, a second form library, a second icon set).
- Never install a package with no release in the last 12 months unless a skill names it.
5. Secrets and data
- Never print, echo, log, or commit secret values. Refer to variables by name.
- Keep secrets in the gitignored env file (
.envfrom the Payload template) for development and in the hosting dashboard for production. Keep.env.exampleupdated with names and placeholder values only. - Never run
payload migrate:fresh,migrate:reset,migrate:down, or drop tables against any database except a local development file. - Never delete media, users, or submissions to "clean up" test data in a shared database.
- Never paste real customer data into code, tests, or seed files.
6. Cost and blast radius
"When in doubt, do more" is wrong when "more" is billed or touches every page. Choose the smallest change that is provably correct.
- Cache invalidation is metered on Vercel, and when the free allowance runs out, content silently stops updating. Never add a cache tag shared by all content queries. Never call
revalidatePath(path, 'layout')except in a hook for a global the layout renders, with a comment naming that data. Revalidate only the routes that render the changed document (payload-performanceskill, Step 2). - Never schedule crons, polling, or background work more often than the feature requires.
- Never raise limits or plan-dependent settings (function duration, retries, image sizes, query limits) beyond what the task needs.
- When a broader option is chosen deliberately, the code comment states the reason and the expected cost, and
PROJECT.mdrecords it under## Decisions.
7. Git
- Work on a feature branch. Never commit or push to
mainormaster. - Commit after each completed step with a message that names the step.
- Never force push, rewrite published history, or commit
.env*files other than.env.example.
8. Verification and honesty
- A task is done only when the skill's "Done when" checks have been run and passed.
- Report failing checks plainly. Never claim a test passed if you did not run it.
- Do not disable tests, lint rules, or type checks to make a check pass. Do not add
// @ts-ignoreoras anyto silence errors.
9. Stop and ask
Stop the affected task and write a question under ## Questions when any of these is needed:
- a credential, API key, or account login
- a paid plan or a service outside the fixed stack
- legal text, prices, or business rules the brief does not state
- a change that deletes data or breaks an existing URL
- two requirements that contradict each other
In an interactive session, ask the user directly as well.
10. Unattended runs
Before starting an overnight or turbo run:
- One phase is selected in
PROJECT.md - A feature branch is checked out
.envexists with the variables the phase needs; if not, skip tasks that need them
During the run, follow sections 1 to 9 strictly. Never wait for input: record questions and continue with independent tasks.
At the end of the run, add a ## Session log entry to PROJECT.md:
### 2026-01-15 - <model name>
- Done: <steps completed, with commit hashes>
- Not done: <steps left>
- Checks: <commands run and their results>
- Blockers: <links to Blockers entries>
- Next step: <the exact next action>Done when
- No command ran outside the project folder
- No throwaway scripts were created
- Every completed step is committed on a feature branch
PROJECT.mdhas an up-to-date session log entry
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.

