Agent setup#
pw_ghish: GitHub CLI-like interface for Gerrit code reviews and CI checks
pw_ghish (./gh) is designed to work across AI coding assistants—such as
Antigravity (Jetski), Claude Code, OpenAI Codex, Cursor, and
OpenCode—without locking developers into a single agent harness or operating
system.
Agent setup (this page): The levers
pw_ghishprovides for AI coding assistants and how to enable optional tool-call enforcement.Hooks (gh hook): Reference for the
./gh hooksubcommand (install,uninstall,status,pre-tool-use,commit-msg, andpre-push).Project setup: For repository maintainers adopting
gh-ishand configuringProjectProfilein a Gerrit/LUCI repo.Agent workflows: Day-to-day pair-programming workflows (private draft steering, staged review replies, and automated CI triage).
The four levers of agent integration#
pw_ghish layers its agent support from default CLI behavior to opt-in
execution guards:
The ./gh CLI (//pw_ghish:gh-ish) — GitHub CLI syntax: Exposes Gerrit (
./gh pr), LUCI Buildbucket (./gh pr checks,./gh run), Buganizer (./gh issue), and worktrees (./gh wt) using GitHub CLI (gh) syntax that models already know from pre-training, paired with structured 4-pillar error diagnostics for LLM self-correction.Always-on repository rules (AGENTS.md) — Baseline guardrails: Canonical instructions live in
AGENTS.md(with 1-line@AGENTS.mdpointers inCLAUDE.mdandGEMINI.mdto prevent duplicate prompt injection). This gives every harness the core./ghcommand reference and non-negotiable rules (never use rawgit push, never craft manualcurlcalls, never poll CI in a loop) without bloating unrelated tasks.On-demand skills (.agents/skills/) — Deep task context: Detailed flag semantics, exit-code contracts (
0pass,8running,1fail), trailer-preservation rules, and multi-step workflows live in.agents/skills/ghish/SKILL.mdand.agents/skills/worktree/SKILL.md, loaded only when a task involves Gerrit, CI, Buganizer, or worktrees.Opt-in execution guards (./gh hook) — Deterministic enforcement: Because models under long context windows can still regress to pre-trained
git push origin HEAD:refs/for/mainorcurlhabits,./gh hookprovides optional user-levelPreToolUseand Gitpre-pushguards implemented directly in the compiled Go binary (disabled by default so human terminal workflows are never disrupted).
Installing the optional tool hook#
To stage the gh-ish binary in your user config directory and register the
pre-execution guard across your local coding agents (Antigravity/Jetski,
Claude Code, and Cursor):
# Install for all supported agents (or pass --agent=jetski|claude|cursor):
$ ./gh hook install --agent
# Optionally also install the Git commit-msg and raw git push guards:
$ ./gh hook install --git --block-raw-push
# Verify installation status:
$ ./gh hook status
For full command details or custom harness wiring, see Hooks (gh hook) and your harness’s hook documentation:
Claude Code: Claude Code Hooks documentation
Cursor: Cursor Hooks documentation
OpenCode: OpenCode Plugins documentation
OpenAI Codex: Codex CLI documentation