# The khosra harness — human's guide Scaffolding that makes an agent build `khosra` the way you want: minimally, surgically, questions before code, docs that stay true. `README.md` is a two-line signpost — human here, agent to `CLAUDE.md`. `CLAUDE.md` is the constitution (always loaded). `harness/` is what the agent needs to build the engine — anything in it may be pulled into context on demand. It is named for its audience, not its format: `docs/` is reserved for documentation written for whoever *uses* khosra, and is absent because that does not exist yet (ADR-0082). An empty `docs/` says so honestly; `docs/` full of parser specifications said the opposite, and cost its own author a rule he did not know was written down. `ideas/` and `reference/` sit outside `harness/` deliberately: storage, opened only when you name a file, swept by nothing. `.claude/` holds the feature-loop skill (`skills/feature-loop/`), the commands, and `launch.json`. `scripts/` holds the gate. `.scratch/continue.md` is a **temporary** handoff — uncommitted, ungated, discardable — holding the continuation point and the findings worth carrying that no doc owns. It is read after the harness rather than instead of it (`CLAUDE.md` §1), and never records what landed: that is `git log`'s alone, for the reason under "Why the pieces exist". ## How you use it You ask for a feature. The skill fires by itself and runs `Clarify → Plan → Implement → Verify → Document → Commit → Report`. This runs for casual requests too — the skill fires on "the default-language files do not need the `.en` part" exactly as it does on "add tag pages", with a one-line plan instead of a full one. A short sentence is not a small change: that one renames content on disk, makes a suffix optional in code, and contradicts every doc calling it required. The agent walks every surface — code, fixture sites under `testdata/`, harness docs — and, because it cannot reach your site root, writes down the migration you need to run there rather than pretending to have done it. 1. **You:** "Add tag pages." 2. **Agent:** the clarifying questions whose answers change the code — as many as there are, batched into one turn, each with a default. Answer or ignore. 3. **Agent:** a short plan — goal, primitive, success criteria, files, ±LOC, deps, earn-it check, and what it is deliberately *not* doing. 4. **You:** "go", or edit the plan. "Just do it" skips the gate on small changes. 5. **Agent:** implements, runs `./scripts/verify.sh`, shows real output, updates docs, commits, reports. Occasional maintenance, by you: - "Park this" → the agent writes `ideas/.md`, resumable cold, and indexes it. Name the file later to pick the thread up; it reads these only when named. `ideas/exploration.md` is the same idea for engine features nobody has asked for — a catalog, deliberately outside `harness/` so it adds no weight to the working set. - `/audit` every ~5 features — finds abstractions that never earned their keep. - `/invariants` at arc boundaries, before a freeze, before the first deploy — checks the nine architecture invariants against the code, which no grep can do. **Conflicts come back to you.** If a request contradicts a recorded decision — an ADR, an invariant, the permalink shape, the untrusted boundary, a hard budget — the agent stops, quotes the line, and gives you two paths: comply, or change the decision on purpose. It resolves only what is genuinely unambiguous, such as a doc that has fallen behind the code. Repeating the request is a valid answer and is taken as your decision; what it will not do is quietly reverse a choice you made earlier, or split the difference into a compromise nobody picked. - `/refresh-docs` after a burst of work — reconciles docs with reality, reports drift. - `/verify`, `/adr`, `/leaf ` as needed. **Three surfaces, one of them yours to edit here.** Engine source lives in this repo; content lives in the site root (ADR-0011); the theme is a third surface with its own owner (ADR-0023). A request that spans engine and theme produces a *contract extension* in `harness/theme-contract.md` plus a note of what the theme must do — not the theme. `verify.sh` fails if the embedded reference theme changes without the contract doc changing, because in practice those two drift together — and it fails on a `