Guardrails Skill

Quality gates wired into the agent lifecycle. Not guidance the agent might follow —
checks that block progress until they pass.
The Idea
Most coding-agent instructions live in prompt space: prose rules the agent might follow,
might not. This skill moves constraints into environment space wherever possible. A lint
rule that fails the build in 20ms gives the agent unambiguous feedback at zero token
cost. A prose instruction competes for attention with everything else in the context
window. The skill focuses on the behaviors a coding agent wouldn't exhibit without being
told, and trusts the agent's training for everything else (what linting is, how to write
a unit test, which formatter to use).
The novel behaviors:
- Lifecycle hooks —
script/test_fast runs on every stop, script/test runs on
every commit. The agent can't declare success or commit code until checks pass.
- Circuit breaker — After 2 failed attempts at the same fix, the agent must build
a diagnostic tool or switch to a structured notation before retrying. Stops thrashing.
- Config protection — The agent can't weaken its own tests to make them pass.
- Integration check — At commit time, verify new code is reachable (wired in), not
just correct (tests pass).
- Diagnostic escalation — A catalog of tools and notations for when the agent is
stuck, plus proactive recognition of problem shapes that benefit from scaffolding.
- Lessons learned — Knowledge persisted across sessions so the agent doesn't repeat
mistakes.
Install
npx skills add adewale/guardrails-skill
Skills appear on skills.sh automatically after users install the repo with the skills CLI. Install counts and leaderboard rankings come from anonymous CLI telemetry; opt out with DISABLE_TELEMETRY=1. The repo page customization in skills.sh.json is picked up after the repository is seen by telemetry and the cache refreshes.
Agent compatibility
The installable skill directory is skills/guardrails. It uses the Agent Skills SKILL.md format and is configured for Codex, OpenCode, Pi, Gemini CLI, and Claude Code.
Codex, OpenCode, Pi, and Gemini CLI can load the Guardrails skill instructions. Claude Code plugin installs additionally wire the bundled lifecycle hooks. In other agents, treat the hooks as an explicit checklist unless you add native hooks/extensions for that host.
| Agent/client | Install or use |
|---|
| Codex | cp -R skills/guardrails ~/.codex/skills/guardrails |
| OpenCode | cp -R skills/guardrails ~/.config/opencode/skills/guardrails or use .opencode/skills/guardrails in a project |
| Pi | pi install https://github.com/adewale/guardrails-skill or pi --skill skills/guardrails |
| Gemini CLI | gemini skills install https://github.com/adewale/guardrails-skill --path skills/guardrails or copy to .gemini/skills/guardrails |
| Claude Code | npx skills add adewale/guardrails-skill or copy to .claude/skills/guardrails |
Or as a Claude Code plugin:
/plugin marketplace add adewale/guardrails-skill
/plugin install guardrails@guardrails-skill
Or clone the repo and copy only the installable skill directory into your Claude Code skills directory:
git clone https://github.com/adewale/guardrails-skill /tmp/guardrails-skill
# Personal (all projects)
cp -R /tmp/guardrails-skill/skills/guardrails ~/.claude/skills/guardrails
# Or project-level (one project only)
mkdir -p .claude/skills
cp -R /tmp/guardrails-skill/skills/guardrails .claude/skills/guardrails
Browse the repo on skills.sh, or open the guardrails skill page.
Structure
guardrails-skill/
├── .claude-plugin/
│ ├── plugin.json Plugin manifest
│ ├── marketplace.json Marketplace catalog
│ └── hooks/
│ └── hooks.json Lifecycle hooks (plugin path)
├── skills/
│ └── guardrails/
│ ├── SKILL.md ← Agent reads this (≤275-line budget, CI-enforced)
│ ├── references/
│ │ ├── tool-building.md Diagnostic tools, notations, worked examples
│ │ └── language-defaults.md Tool selection table by ecosystem
│ └── assets/
│ └── notation-templates/
│ └── reproduction-script.sh Bash scaffold for repro scripts
├── CLAUDE.md
├── LICENSE
└── README.md
SKILL.md is the core — everything the agent needs to know about when checks run and what
to do when stuck. The references are loaded on demand: tool-building.md when the circuit
breaker fires, language-defaults.md when writing test scripts for an unfamiliar ecosystem.
Hooks