/trogonstack-engineering:engineering-place-guardrailsfrom trogonstack-engineering
Walks a proposed rule or recurring mistake down a five-layer pyramid (codebase, static analysis, verification, prose, human review) to find the cheapest layer that can prevent it. Use when adding rules to AGENTS.md/CLAUDE.md, auditing growing instructions files, or deciding where a convention should live.
Ships in trogonstack-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every guardrail costs something each time it is used. Put it where that cost is lowest: make the mistake impossible in the code before making it detectable, detectable before asking anyone to remember it, and remembered before asking a human to catch it.
Picture an inverted pyramid. The wide top is where effort should go; cost per prevented mistake grows as you move down.
| Layer | How it stops the mistake | Paid on every change | Read when weighing it |
|---|---|---|---|
| 1. Codebase | cannot be written | nothing | layers/codebase.md |
| 2. Static analysis | rejected deterministically before merge | machine time | layers/static-analysis.md |
| 3. Verification | caught against a stated property, at build or run time | more machine time, some misses reach runtime | layers/verification.md |
| 4. Prose | a reader remembers and complies | context, attention, drift | layers/prose.md |
| 5. Human review | a person notices | scarce time, slow feedback, inconsistency | layers/human-review.md |
Each layer down is less reliable and more expensive per use, and the cost recurs: prose is re-read by every agent on every task, review is paid on every pull request. A refactor at the top is paid once.
The lower layers are not bad. They are the right home for intent, trade-offs, and judgment, which the upper layers cannot express. The failure is using a lower layer for something an upper layer could carry: the expensive layer fills with work the cheap one should do, and crowds out what only it can do.
Ask each layer in order "can you carry this?" and stop at the first yes. Do not start from the layer the request arrived in. A request to "add a line to AGENTS.md" is a request to prevent a mistake; the prose is one candidate answer, usually not the best. Read only the layer files you are actually weighing, top down, and stop reading once one says yes.
A type that cannot hold an invalid value beats a lint that flags it, which beats a test that catches it. If the right path is also the easy path, agents and humans take it without being told.
Read references/layers/codebase.md when looking for the codebase move, or when it seems too expensive to make now.
Layers 1 to 3 give the same answer every time and do not depend on anyone having read anything. Layers 4 and 5 depend on attention, which is finite. If a program can check a rule, a program should check it. "Never import X from Y" is a lint, not a sentence.
Read references/layers/static-analysis.md when a rule is phrased "never" or "always", or when a proposed check would be noisy.
Every rule in an instructions file is either something only a reader can apply, or a guardrail waiting to be promoted. Treat the second kind as debt. When it is promoted, delete the prose.
Read references/layers/prose.md when deciding whether a rule is judgment or mechanical. Read references/review/audit-instructions.md when the input is a whole AGENTS.md, CLAUDE.md, rules directory, or checklist rather than one rule.
The same review comment twice, or the same agent error across sessions, means the current layer is not holding it. Move it up, not sideways: a second, louder sentence is not a fix.
Reserve the bottom layer for what no layer above can decide. Every mechanical catch a reviewer makes is evidence of a missing guardrail higher up.
Read references/layers/human-review.md when the guardrail seems to land at the bottom, or when mining review comments for candidates.
### <mistake, one line>
- Today: <layer that catches it now, or "nothing"> (<evidence of slippage>)
- Layer chosen: <codebase | static analysis | verification | prose | human review>
- Why not higher: <one line per layer above the chosen one>
- Move: <the concrete change>
- Delete after: <redundant prose, checklist items, review steps, or "none">
- Follow-up: <deferred higher-layer move, or "none">
Read references/review/report-template.md before writing the first entry, for worked examples including one that correctly lands at human review.
references/layers/codebase.md (opens in a new tab)references/layers/human-review.md (opens in a new tab)references/layers/prose.md (opens in a new tab)references/layers/static-analysis.md (opens in a new tab)references/layers/verification.md (opens in a new tab)references/review/audit-instructions.md (opens in a new tab)references/review/report-template.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub trogonstack/agentskills --plugin trogonstack-engineeringOther plugins' skills for the same job