writing-gates

Write per-project pi-gate anchors.json files defining frozen commands, protected paths, and command rewrites.

2|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/ShineBreaker/Guix-configs --skill writing-gates-shinebreaker
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: writing-gates
Source: https://github.com/ShineBreaker/Guix-configs/tree/main/dotfiles/mutable/agents/skills/.config/agents/skills/writing-gates
Command: npx skills add https://github.com/ShineBreaker/Guix-configs --skill writing-gates-shinebreaker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents can run dangerous commands or edit protected files in a repository. This Skill guides you in writing a project-level pi-gate configuration (.agents/anchors.json) so guardrails match the specific repo instead of relying only on global rules. ## Core Features & Use Cases - Layered authority model: Understand the three-layer ratchet (code floor, global config, project gate) where each layer can only add restrictions, never remove them. - Mechanism selection: Choose between frozen_commands (substring hard block), frozen_paths (prefix/suffix block), frozen_globs (pattern block), redirect_conventions (notify), rewrite (token swap), and path_hints (post-edit reminders). - Safety invariants: Respect meta-frozen global files, lock ratified project rules with _meta_frozen, and avoid substring pitfalls like single-word frozen commands. - Use Case: In a Terraform production repo, freeze "terraform apply" and "kubectl delete", protect the prod/ directory, and lock the gate with _meta_frozen so agents cannot weaken it. ## Quick Start Ask the agent to write a project gate for this repo that blocks deployments and protects the infra directory using .agents/anchors.json.

Frequently Asked Questions about writing-gates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block a command for AI agents in my project?▼

Add the command to frozen_commands in .agents/anchors.json at your project root. Matching is substring-based, so use multi-word entries like "kubectl delete" rather than single words to avoid false positives.

How do I protect a directory from agent edits?▼

Add the path to frozen_paths in .agents/anchors.json. Entries with a trailing slash match path prefixes relative to the repo root, while entries without a slash match basename suffixes; use frozen_globs for wildcard patterns.

What is the difference between frozen_commands and redirect_conventions?▼

frozen_commands hard-blocks matching commands, while redirect_conventions only notifies the agent of a preferred alternative without blocking. Prefer the softest mechanism that is still safe for the situation.

Can a project gate override global pi-gate rules?▼

No. pi-gate uses a ratchet model where project gates can only add restrictions, never remove what the code floor or global config enforces. The global ~/.config/agents/anchors.json is meta-frozen and only editable by humans.

Why did my frozen command not block a dry-run invocation?▼

Commands containing --dry-run intentionally escape frozen_commands so verification stays possible. Do not rely on a frozen entry to block dry-run invocations of a dangerous command.

How do I prevent agents from editing the gate file itself?▼

Set "_meta_frozen": true in the project's .agents/anchors.json. pi-gate will then refuse agent edits to that file, which is appropriate for human-ratified rules like production deploy bans.