init-project-harness
Project Harness Init
Scaffold this project's harness — .claude/settings.json (hooks, env, deny-only permissions, light plugins) — when it doesn't yet exist. The additive counterpart to audit-project-harness (subtractive). Run this before /init-project-claude: a hook that enforces something automatically beats a CLAUDE.md line asking the agent to remember it, so settling the harness first lets the instruction pass stay lean. Propose before writing; nothing is written until approved.
Be efficient: delegate discovery to an Explore subagent and work from condensed findings + file:line. Don't pull whole files into the parent.
Step 1 — Global baseline
Read ~/.claude/settings.json and the two safety hooks (read-guard.py, bash-guard.py) once. Treat the global harness (bypass-style defaultMode, the surgical PreToolUse hooks, model/effort/statusline, enabled plugins) as already in effect. Nothing you scaffold may restate, duplicate, or weaken any of it. Hooks are additive across scopes — re-declaring a global hook makes it fire twice, and the safety hooks cannot be weakened from here. Carve-out: this assumes the global harness travels with every run; it doesn't. For a guard hook that must fire where global config is absent (an AFK/CI claude -p run — no ~/.claude/), project-scope re-declaration is correct, not duplication, since it is the only copy that runs (ADR 0013; see the git guard in CATALOG.md).
Step 2 — Detect (subagent)
Dispatch Explore to report:
- Whether
.claude/settings.jsonalready exists with real harness content. Also note any.claude/settings.local.json(read-only — see Step 4). - Fact triggers for the catalog: configured formatter, fast typecheck/lint command, secret files (
.env*,*.pem,credentials/), irreplaceable-data dirs (data/,migrations/), language/stack, package manager.
If substantive harness config already exists, stop and point the user at /audit-project-harness — this skill is for greenfield scaffolding, not critique.
Note (root-only): project settings load only from the repo-root .claude/. There is no per-package settings file; do not scaffold nested ones.