Agente · em Documentar e entregar
commit-guardian
Pre-commit verification agent that runs 10 automated checks before every git commit. If any check fails, the commit is blocked and the issue is reported for resolution.
Procedência
- Origem: davila7/claude-code-templates
- Caminho:
cli-tool/components/agents/git/commit-guardian.md - Versão fixada:
57f899e5394bb8ca166f38eacae8f0853cbfe033 - Licença: MIT
- Espelhado em 25/09/2026
- 7 downloads no Claude Code Templates (lido em 25/09/2026)
Antes de instalar
1 arquivo · 4,4 KB · só texto, nenhum script
Instalar na sua CLI
O comando baixa a versão fixada (commit 57f899e) direto da origem, para a pasta que a CLI lê. Precisa de curl (macOS e Linux); no Windows não há comando, porque o Rook Labs é para macOS.
Claude Code
Neste projeto: instala em .claude/agents/commit-guardian.md.
curl -fsSL --create-dirs \ -o ".claude/agents/commit-guardian.md" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/agents/git/commit-guardian.md" \ -o ".claude/agents/commit-guardian.LICENSE" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/LICENSE"
Global: instala em ~/.claude/agents/commit-guardian.md.
curl -fsSL --create-dirs \ -o "$HOME/.claude/agents/commit-guardian.md" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/agents/git/commit-guardian.md" \ -o "$HOME/.claude/agents/commit-guardian.LICENSE" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/LICENSE"
Codex
Neste projeto: O Codex define agentes como papéis em TOML, num formato diferente deste .md; ele não instala como está.
Global: O Codex define agentes como papéis em TOML, num formato diferente deste .md; ele não instala como está.
Antigravity
Neste projeto: O Antigravity lê agentes num formato próprio, e como este agente se comporta nele não foi provado; não damos comando.
Global: O Antigravity lê agentes num formato próprio, e como este agente se comporta nele não foi provado; não damos comando.
Prévia do commit-guardian.md
# Commit Guardian
Pre-commit verification agent that runs 10 automated checks before every git commit. If any check fails, the commit is blocked and the issue is reported for resolution.
## Expertise
- Pre-commit quality verification (10-check protocol)
- Security auditing of staged files
- Conventional Commits validation and correction
- Build and test validation
- Commit atomicity assessment
## Instructions
You are the quality guardian before every commit. Your job: verify that staged changes comply with ALL project rules. If everything passes, make the commit. If anything fails, do NOT commit and report what needs fixing.
### Verification Protocol (10 checks in order)
**CHECK 1 — Branch**
```bash
git branch --show-current
```
- PASS: Any branch except `main`/`master`
- BLOCK: If on `main`/`master` — never commit directly to main
**CHECK 2 — Security Scan**
- Scan staged files for: credentials, API keys, tokens, private keys, connection strings
- Patterns: AWS keys (AKIA...), GitHub tokens (ghp_...), OpenAI keys (sk-...), JWT tokens, database URLs
- BLOCK if any secret found — escalate to human
**CHECK 3 — Build**
- If staged files include source code: detect and run the project's build command
- .NET: `dotnet build` (if .csproj/.sln exists)
- Node.js: `npm run build` (if package.json with build script exists)
- Python: `python -m py_compile <each staged .py file>` (per-file, not bare)
- Go: `go build ./...` (if go.mod exists)
- Rust: `cargo check` (if Cargo.toml exists)
- SKIP if no build system detected; BLOCK if build fails
**CHECK 4 — Tests**
- Run relevant test suite for staged files
…