Skip to content
joinery / docs

The agent setup as one inspectable system

569 words · updated yesterdaydocs/concepts/agent-setup.md

🤖 The agent setup as one inspectable system

Claude Code's native layout: CLAUDE.md files for always-on rules, skills under .claude/skills/ for task procedures, and settings, hooks, subagents and workflows beside them under .claude/. All tracked.

Why CLAUDE.md reads the way it does

CLAUDE.md holds only what the READMEs and code don't show, or what agents get wrong anyway. Each project's file is a pointer to its README plus the invariants worth losing a build over. The root file loads every turn; a project's loads once Claude reads something there.

The hooks

Two PostToolUse hooks fire after every edit, and one PreToolUse hook before every shell command.

HookEnforces
eslint-fix.shRuns eslint --fix on the touched file, so style is corrected mechanically, and records each rule hit first for the portal's lint usage
check-invariants.shRuns pnpm invariants:check after a manifest edit, and reminds about the cross-file steps of a new project or a boundary change
guard-live.shRefuses pnpm start, nuxt preview, requests to the live WordPress site, force pushes and pushes to master: the things an unattended run must never do, whatever its prompt says
reap-processes.shOn SessionEnd, kills every nuxt dev and playwright test the session started, so a closed session leaves no server or Chromium behind

The hooks are early feedback; pre-commit and CI run the same gates on edits made by hand.

What the deny list forecloses

.claude/settings.json denies editing changelogs and docs/FEATURES.md, running a release, and reading real .env files.

What the skills are collectively

A skill loads only for a matching task, which keeps procedures out of unrelated context. docs/FEATURES.md lists every skill.

The ship-issue pipeline

ship-issue.js takes issues to merged PRs with no human reading the code: /ship-issue 340 341. Issues run one after another, each branching off the master the previous one merged into.

StageWhoStops the run when
PickThe issue's labels, then pnpm issue:pick and pnpm issue:briefThe tree is dirty or the pick fails
Planticket-plannerThe issue needs a structure with no precedent, or a choice the issue leaves open
ImplementA general agent following the plan, then pnpm checkcheck is still red after two fixes
Reviewreview-architecture, review-tests and review-correctness in parallel, then a fixerBlocking findings survive two fix rounds
Polishcomment-cleanup and doc-drift-checkcheck goes red
ShipConventional commits, then pnpm issue:shipThe required checks fail after one repair, or the PR never merges
  • An owner ticket is skipped. A spike ticket skips Plan, Review and Polish: one agent writes a decision report, runs pnpm check, and ships.
  • The planner decides structure, and every file it plans names the existing path it copies, so an unattended run can't invent a convention.
  • Reviewers get the issue and the diff, never the implementer's summary.
  • Run it from a checkout nothing else writes to (pnpm worktree:prepare). The ship step commits only the paths the run touched.
  • A stopped run labels the issue or PR needs-human, comments why, and starts nothing further.
  • git and gh permissions live in each machine's .claude/settings.local.json.