guardrail-patterns · zaxbyhub — Claude Code skill: what it does, how to install
guardrail-patterns guides agents when editing destructive-command guards in opencode-swarm, setting document reading order and adversarial testing rules.
MIT ★ 539 updated 2026-10-29
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a claude-codeWhat guardrail-patterns does
This skill guides Claude Code and Codex when changing src/hooks/guardrails.ts, checkDestructiveCommand, dcNormalizeCommand, shell wrappers, or .swarm path blocking. It sets a strict sequence for reviewing documentation, starting with AGENTS.md and engineering conventions before touching any guardrail code.
The workflow mandates keeping the order of wrapper stripping, normalization, and segment evaluation intact. Line numbers inside generated skill files drift, so locating sections with rg before editing is required.
Any updates to protective patterns must include adversarial tests. These check argument permutations, Windows shell patterns, and .swarm paths, ending with targeted test runs and exact execution commands reported back.
What it helps with
- update destructive-command filtering logic in
src/hooks/guardrails.tssafely - build adversarial tests for command wrapper bypasses and Windows shell formats
- preserve normalization and evaluation sequences during guardrail refactoring
- verify
.swarmpath restrictions against argument order permutations
Example prompts for the agent
- Update
checkDestructiveCommandinsrc/hooks/guardrails.tsto cover additional shell-wrapper variants. - Add adversarial test cases for argument permutations in
dcNormalizeCommand. - Inspect
.swarmdestructive command blocking and run the focused guardrail test suite.
How to install guardrail-patterns
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a claude-code2Manually: put the files in place
~/.claude/skills/guardrail-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/guardrail-patterns/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a codex2Manually: put the files in place
.agents/skills/guardrail-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a cursor2Manually: put the files in place
.cursor/skills/guardrail-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ZaxbyHub/opencode-swarm .agents/skills/guardrail-patterns2Manually: put the files in place
.github/skills/guardrail-patterns/SKILL.md1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a gemini-cli2Platform CLI
gemini skills install https://github.com/ZaxbyHub/opencode-swarm --path .agents/skills/guardrail-patternsManually: put the files in place
.devin/skills/guardrail-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about guardrail-patterns
How to install guardrail-patterns in Claude Code?
Run npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a claude-code. The file will be available at ~/.claude/skills/guardrail-patterns/SKILL.md.
When should guardrail-patterns be used?
Apply it before touching src/hooks/guardrails.ts, editing command normalization routines, or working on adversarial test suites in opencode-swarm.
Why does the skill require searching with rg before changes?
Line references in generated skill documentation can drift over time, making rg necessary to find the actual code boundaries before editing.
Source text
SKILL.md · MIT
--- name: guardrail-patterns description: Codex adapter for opencode-swarm destructive-command guardrail changes. Use before modifying src/hooks/guardrails.ts, checkDestructiveCommand, dcNormalizeCommand, shell-wrapper parsing, .swarm destructive-command blocking, or guardrails unit/adversarial tests. metadata: audience: swarm-plugin --- # Guardrail Patterns Read, in order: 1. `AGENTS.md` 2. `.agents/skills/engineering-conventions/SKILL.md` 3. `.agents/skills/writing-tests/SKILL.md` if tests are touched 4. `.opencode/skills/generated/guardrail-patterns/SKILL.md` Codex-specific execution notes: - Use `rg` to locate the current guardrail section numbers before editing; line numbers in generated skills can drift. - Preserve wrapper-unwrapping, normalization, and per-segment evaluation order unless the task is specifically to change it. - Add or update adversarial tests for bypass surfaces, argument-order permutations, Windows shell forms, and `.swarm` path variants. - Run focused guardrail tests after the change and report exact commands.
© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm
Similar skills
All skills for Security →guardrail-patterns by other authors comes first.