guide: Command for Claude Code

.github/workflows/generate-ai-rules/commands/fix-guardrails.md

fix-guardrails is a command for Claude Code from rios0rios0/guide. It costs 0 tokens per session (3,489 once invoked), scanned A, original, MIT.

A guardrail-fixing command runs linting, tests, and security analysis across one or more repositories, then works through the reported problems. A repository is a project's version-controlled folder, and a pull request proposes changes for review.

In plain words
What is it for?
Use it to sync repositories with their default branch, run make lint, make test, and make sast, fix findings, update documentation, commit, push, and create pull requests when the hosting service is recognized.
Why use it?
It combines routine checks and follow-up work into one repeatable process, so findings are fixed and documented before changes are submitted.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: positional $N argument.

This is rios0rios0/guide's own configuration. It tells Claude Code how to work on guide itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything guide configures →

Part of the engineering-standards plugin — 5 skills, 8 commands, 7 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to rios0rios0/guide. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rios0rios0/guide/main/.github/workflows/generate-ai-rules/commands/fix-guardrails.md
Clone the repo
git clone --depth 1 https://github.com/rios0rios0/guide

Made for: Claude Code.

Or install engineering-standards, the plugin that ships this one along with the rest of its 5 skills, 8 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/commands/rios0rios0/guide/fix-guardrails.svg)](https://agentmods.dev/commands/rios0rios0/guide/fix-guardrails)
Your own site
<a href="https://agentmods.dev/commands/rios0rios0/guide/fix-guardrails"><img src="https://agentmods.dev/badge/commands/rios0rios0/guide/fix-guardrails.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,489 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03489
Opus 5 $0.00000 $0.01744
Sonnet 5 $0.00000 $0.00698
Haiku 4.5 $0.00000 $0.00349

Measured 6d ago against content hash f7c2dd4a7a9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

fix-guardrails scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/workflows/generate-ai-rules/commands/fix-guardrails.md · 352 lines

How it starts

The opening of the file, as written. The whole thing — 352 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix all guardrail findings (make lint, make test, make sast) across one or more repositories. This command is a complete, repeatable workflow: sync with main, run all guardrails, fix every finding, update documentation, commit following standards, push, and create PRs.

For guardrail tools, refer to the CI/CD rule and Security rule. For commit conventions, refer to the Git Flow rule. For changelog updates, refer to the Documentation rule.

Arguments

  • $ARGUMENTS -- space-separated list of repository paths (absolute or relative to the current working directory). If empty, operate on the current working directory as a single repository.

Vendor Detection

Auto-detect the Git hosting vendor from git remote get-url origin to determine the correct PR creation CLI:

Remote URL contains Vendor PR CLI
github.com GitHub gh pr create
dev.azure.com or ssh.dev.azure.com Azure DevOps az repos pr create
gitlab.com or gitlab GitLab glab mr create
Other Unknown Skip PR, report branch for manual creation

Step-by-step Workflow (repeat for every repository)

Step 1 -- Sync with the default branch

cd <REPO_PATH>
git checkout <default-branch>
git fetch --all
git pull --rebase
  • Detect the default branch with git symbolic-ref refs/remotes/origin/HEAD (strip refs/remotes/origin/). Fall back to main if unavailable.
  • If pull --rebase fails due to conflicts, report the failure and skip this repo.

Step 2 -- Run all three guardrails

Run them in this exact order. Each gate must be evaluated independently -- even if one passes, the others may fail.

Gate 1: Lint

Read the full file on GitHub · 352 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 352 lines · 0 tokens per session scan A f7c2dd4a7a9d

Subscribe to this mod's changes

fix-guardrails is a command published in the GitHub repository rios0rios0/guide (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,489 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.