Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/toverux/cantrips/setup-git-guardrailsnpx skills add toverux/cantrips --skill setup-git-guardrailsgit clone --depth 1 https://github.com/toverux/cantripsWrote 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.
[](https://agentmods.dev/skills/toverux/cantrips/setup-git-guardrails)<a href="https://agentmods.dev/skills/toverux/cantrips/setup-git-guardrails"><img src="https://agentmods.dev/badge/skills/toverux/cantrips/setup-git-guardrails.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00861 |
| Opus 5 | $0.00000 | $0.00430 |
| Sonnet 5 | $0.00000 | $0.00172 |
| Haiku 4.5 | $0.00000 | $0.00086 |
Grade A, and why
setup-git-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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Setup Git Guardrails
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before the agent executes them.
What Gets Blocked
git push(all variants including--force)git reset --hardgit clean -f/git clean -fdgit branch -Dgit checkout ./git restore .
When blocked, the agent sees a message telling it that it does not have authority to access these commands.
Steps
1. Ask harness and scope
Ask the user for whatever the arguments did not already supply: which harness — Claude Code, Codex CLI, or both — and install for this project only or all projects?
2. Copy the hook script
The bundled script is at: scripts/block-dangerous-git.sh
Copy it to the target location based on harness and scope:
- Claude Code, project:
.claude/hooks/block-dangerous-git.sh - Claude Code, global:
~/.claude/hooks/block-dangerous-git.sh - Codex CLI, project:
.codex/hooks/block-dangerous-git.sh - Codex CLI, global:
~/.codex/hooks/block-dangerous-git.sh
Make it executable with chmod +x.
The script needs bash, jq and grep on PATH — state that to the user, since jq ships with none of the three platforms by default.
Without it the script reads an empty command, matches nothing, and exits 0, which is the allow verdict: the guardrail installs and passes everything.
3. Add hook to config
Read HOOK-CONFIG.md and work through the section for each harness being installed.
If the config file already exists, merge the hook into existing hooks.PreToolUse array — don't overwrite other settings.
On Codex, finish by having the user trust the entry under /hooks; the hook does not run until they do.
4. Ask about customization
Ask if user wants to add or remove any patterns from the blocked list. Edit every copy step 2 wrote, so a both-harness install does not end up guarding two different lists. The entries are extended regexes matched against the whole command, not literal text.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday Changed a34dd3c1b395
- 6d ago First seen · 77 lines · 0 tokens per session scan A de29c2b1c7ca
setup-git-guardrails is a skill published in the GitHub repository toverux/cantrips (2 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 861 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.
Other skills, from other repositories
git-workflow
This skill should be used when the user asks to "create git commit", "manage branches", "follow git workflow", "use Conventional Commits", "handle merge conflicts", or asks about git branching strategies, version control best practices, pull request workflows. Provides comprehensive Git workflow guidance for team…
daily-paper-generator
Use when the user asks to generate daily paper digests on a general topic. This skill supports both arXiv and bioRxiv (or either one), then produces structured Chinese/English summaries for selected papers.
review
5-pass structured code review — correctness, security, performance, readability, consistency.
wiki
Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to 400K words.
marshal
Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work. Gathers context from codebase, docs, and memory. Only asks the user when it genuinely cannot proceed. Single-session orchestrator.
codex-autoresearch
Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…