prodagent
Productionizing AI coding agents — parsing, command knowledge, and hooks for safe agent tool execution.
Crates
| Crate | Purpose |
|---|---|
agent-shell-parser |
Tree-sitter-bash parsing substrate — shell tokenization, wrapper resolution, CWD tracking |
agent-command-knowledge |
Command taxonomy and knowledge layer — what commands are (effect, subcommands, flags, paths, env gates), not what to do about them |
agent-jj |
Claude Code hooks for jj-colocated repos — git guard, workspace creation, cleanup |
Architecture
Three-layer separation:
-
Parsing (
agent-shell-parser) — Tokenize shell commands into structured segments. Handles compound commands (&&,||,;,|), command substitutions, wrapper chains (sudo env git commit), redirections. -
Knowledge (
agent-command-knowledge) — Classify commands by effect (ReadOnly < Mutating < Destructive < Unknown). Embedded TOML defaults cover git (38 subcommands), cargo (32), gh (67 patterns), kubectl (26), 50+ simple commands, 14 wrappers. User config extends/overrides viaKnowledgeOverlay. -
Policy (consumers like
agent-jj,cc-toolgate) — Decide what to do based on classification. The knowledge layer provides the facts; policy layers make the decisions.
The Effect enum is ordered fail-closed: Unknown is the most restrictive, so aggregation via max never underestimates risk.
Requirements
- Rust toolchain >= 1.88
- jj-cli >= 0.40.0 (for agent-jj)
Install
Or directly:
Hook registration (Claude Code)
Add to ~/.claude/settings.json:
License
MIT OR Apache-2.0