Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ZaxbyHub/opencode-swarm --skill guardrail-patterns -a claude-code
Open on GitHub

What 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.ts safely
  • build adversarial tests for command wrapper bypasses and Windows shell formats
  • preserve normalization and evaluation sequences during guardrail refactoring
  • verify .swarm path restrictions against argument order permutations

Example prompts for the agent

  • Update checkDestructiveCommand in src/hooks/guardrails.ts to cover additional shell-wrapper variants.
  • Add adversarial test cases for argument permutations in dcNormalizeCommand.
  • Inspect .swarm destructive 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-code

2Manually: put the files in place

~/.claude/skills/guardrail-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/guardrail-patterns/

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.

guardrail-patterns ZaxbyHub guardrail-patterns — a skill for opencode-swarm that maps how the guard blocks inside checkDestructiveCommand() are built, and what breaks when you edit them. CX Codex +1 ★ 539repo stars multi-reviewer-patterns Seth Hobson The multi-reviewer-patterns skill coordinates parallel reviews across code-quality dimensions and merges the results into one report. Use it when a change needs several review angles. CX Codex +1 9,800installs Agent Guardrail eren-solutions Agent Guardrail is an MCP server that checks an agent's planned tool calls, shell commands, and HTTP requests against security policy before execution. CX Codex +1 534installs llm-input-output-guardrail-middleware-development W4L33Dx llm-input-output-guardrail-middleware-development is a Claude Code skill for designing protective middleware around LLM agents. It guides work on untrusted inputs, tool permissions, and outbound data checks. CX Codex +1 ★ 73repo stars security-patterns Eyadkelleh The security-patterns skill provides patterns for finding and validating API keys, card numbers, emails, IP addresses, and other sensitive data. Use it during authorized security testing. CX Codex +1 663installs akka-net-testing-patterns Aaronontheweb akka-net-testing-patterns — a skill for writing unit and integration tests for Akka.NET actors with Akka.Hosting.TestKit: dependency injection, TestProbes, persistence checks. CX Codex +1 440installs testing-patterns davila7 A Claude skill that hands the agent Jest testing patterns: data factories, module mocks and the red-green-refactor loop. CX Codex +1 365installs

From the same set121

The whole set →
contributing contributing is a Claude Code skill that maps commits, test runs and PRs to the opencode-swarm checklist, including the required release fragment. CX Codex +1 ★ 539repo stars mock-to-internals-migration mock-to-internals-migration guides test migrations away from Bun mock.module leaks toward dependency-injection seams using _internals. CX Codex +1 ★ 539repo stars pr-review-fix This compatibility skill routes older pr-review-fix calls to the swarm-pr-feedback workflow for handling pull request feedback. CX Codex +1 ★ 539repo stars tech-debt-ci-review tech-debt-ci-review audits technical debt and shaky CI: test theater, flaky runs, green builds hiding a break. You get findings tied to files and lines, plus a fix order. CX Codex +1 ★ 539repo stars propagation-test The propagation-test skill sets a test procedure for changes to a shared module: exercise every consumer through the shared seam, without per-consumer overrides. CX Codex +1 ★ 539repo stars ci-failure-batching The ci-failure-batching skill blocks the agent from reporting tests as passing until the whole suite has run with the command the repo actually uses. CX Codex +1 ★ 539repo stars swarm-pr-review swarm-pr-review is a Claude Code skill that connects the canonical .opencode workflow to PR review sessions. CX Codex +1 ★ 539repo stars running-tests running-tests — a skill to safely run tests in opencode-swarm from Claude Code, Codex, or OpenCode. Runs focused tests, checks file isolation, validates changes as in CI, and diagnoses errors without stalling the session. CX Codex +1 ★ 539repo stars

Project sponsors

Companies that keep this analytics open