Author: Martin Molenkamp
A reusable, project-agnostic shell for building software with a human Orchestrator and two agent functions, an Architect and an Engineer. This is the framework, not the product: a constitution, a rules library, a skills library, a sub-agent roster, a coordination pair (an evidence-gated ledger plus an append-only log), and a clean CI spine. Drop it into any project, fill the placeholders, and the agents compound instead of resetting every session. From a production multi-tenant AI-SaaS build, with the product, vendors and proprietary methods stripped out.
project-agent-scaffold/ into your repo root. Ask your LLM to fill in the placeholders, or grep -r "{{" . yourself (the table is in ADOPT.md); delete what does not apply.git worktree add ../design design/agent works too. The Engineer works the main tree on per-row branches; the Architect gets its own worktree on the design branch.CLAUDE.md to its root file). The constitution loads itself; type check handoff.skills/validate-scaffold-to-stack, the two-way coverage diff between the scaffold and your stack.brainstorm <your idea>. The operating model carries it from there: spec, bind, ledger rows, ship.You are the Orchestrator: resolve blocking questions, bind specs, approve destructive actions, merge PRs. Everything else moves through the ledger.
Why: two agent functions that both touch everything drift apart; clear authority boundaries plus one shared log keep them coherent over months. The human is not a relay; the shared file is the channel.
STATE.md (the ledger) and LOG.md (the conversation) in the repo, so each reads the other first-hand. The human supervises and unblocks; the file carries the message.check handoff (read the log, pick up your open rows), check the board (ledger status only), ship <row> (work a specific row).FROM, topic, STATUS: open | answered | closed. Never edit past entries; reply with new ones. Reference commit SHAs, never paste diffs. Closed items archive to a done-file so the live log stays fast to read.git checkout / reset / stash while the other agent has uncommitted appends silently destroys them. We lost a day's entries to this exactly once.This scaffold's reference setup uses two different tools, bridged by git. The names are placeholders; the topology is the point.
| Role | Runs in | Owns |
|---|---|---|
| Architect | A second CLI agent inside Orca (reference setup) or any harness with file access, in its own worktree on its own design branch | The constitution, specs, wireframes, the ledger and the design-side log entries. Commits its own branch, scoped to design paths; never source, never the integration branch, never a merge. |
| Engineer | Claude Code, inside Orca, one worktree per goal | Source code, migrations, all git for both sides, the build-side handoff entries. Commits and opens PRs, and commits the Architect's handoff/specs (the Architect has no git). |
| Orchestrator (the human) | Chats with both agents | The four gates, given in chat. Routes and approves; never touches git, the Engineer enacts every git action (commits, merges) after the human's approval. |
.git, so a checkout or reset on the build side can never revert uncommitted design work. The price is two copies of the ledger, which each side reconciles against the other before writing (CI checks d and e). Neither agent needs the other online; the repo is the rendezvous.Claude Code auto-loads CLAUDE.md from the repo root, so the constitution ships as CLAUDE.md and every Orca worktree picks it up with zero setup. The wiring is four files in the repo:
# repo root, read automatically by every Claude Code agent in every worktree CLAUDE.md # the constitution; first line tells the agent to read the handoff operating-model/STATE.md # the ledger it picks its @build rows from .claude/commands/ # slash commands: /check-handoff /check-board /ship .claude/agents/ # the specialist sub-agents invoked at gates # the loop, per worktree: # 1. Orca: new worktree for goal G1.2 (one node = one worktree = one branch) # 2. in its terminal: claude then: /check-handoff # 3. agent reads the tree, claims its @build nodes, works the goal-batch # 4. agent appends a build-side handoff entry + opens a PR (a human gate) # 5. you review the diff in Orca, merge; the design side reads the entry next session
The /check-handoff command is a short prompt file that says: read operating-model/STATE.md, find open rows owned by @build, pick up the lowest-numbered unblocked one and its goal-batch, reconcile against the other tree's copy before writing, and reply in the log with what you are taking. That single command is the whole "correct handoff" entry point; the constitution makes reading the handoff the first action of every session anyway.
An agent's context is invisible: the human cannot see which agent is replying, whether it loaded the rules, or whether it pushed back. Two cheap conventions surface it.
Context markers. Every agent reply opens with a marker, stacked space-separated, in the chat reply only (never in committed prose, where the no-inline-emoji house style still binds). It makes the operating state scannable at a glance.
| Marker | Means |
|---|---|
| 🟡 | the Architect is speaking |
| 🔵 | the Engineer is speaking |
| 🍀 | constitution + the rules matching this surface were read this session |
| ♻️ | a rule or spec was just re-read mid-session |
| ⛔ | boundary held: refused a cross-line ask and offered the right-side artifact instead |
| 🚩 | flagging a blocking-class question or a contradiction in the ask |
Dialogue habits. Two reflexes keep the human and the agents in dialogue rather than one dictating. "You do it": when an agent asks the human to run, test or deploy-prep something, the default answer is "you do it", the agent has broad tool access and usually finds a way, which reinforces remote-only execution. Reverse the direction: when an agent hands the human a decision, the human flips it ("show me a few options"); when the human is stuck dictating, the agent asks "what questions do you have?" instead of guessing.
Why: a separate kanban file is a second source of truth that drifts. But collapsing everything into one file is the opposite failure: state buried in an archivable log gets archived, and open work disappears with it. So the split is by LIFETIME, not by topic. LOG.md is finished the moment an entry is written, so it archives. STATE.md lives until the work is done, so it never does.
Tasks.md. STATE.md is the ledger, the only home of open and done, edited in place and never archived. LOG.md is the append-only conversation and carries zero state. The ledger is the what and who; the log is the why. Anything a log entry announces as open lands as a ledger row in the same commit.@design, @build, @human. Statuses: open, in-progress, blocked, done. A row moves to done only when its children are done.@build closes on a SHA, @design on a bound spec, @human on an ack. An audit by a non-owner writes its finding into the evidence field as an explicit claim and routes it; it never flips the status. The line that matters is create versus mutate, not design versus build, because appends merge cleanly and status edits collide.done is unwritable without primary evidence. A SHA, a run id, an applied migration, a DB read. An action log alone is secondary, and a gap in one is a logging bug, never proof that something did not happen.in-progress and adds a claim: <branch> @ <timestamp> token. A claimed row is read-only to everyone but the claimant: its ask, scope and children are frozen, and anyone else with something to say appends to the log referencing the row, never edits it. The claimant releases by moving to blocked (PR open) or done (merged); only @human clears a stale claim. No two agents ever edit the same work.done row is never reopened, reused or repurposed. A regression or follow-up gets a NEW row that references the closed one; pointing new work at a done row erases its audit trail and hides that the change regressed. New problem, new row.blocked row states the open question and the surface it touches; if that surface is one of the five hard surfaces (§3), it gates dependent rows until resolved.LOG-ARCHIVE.md as a verbatim move, never a summary, and an archive commit never touches the ledger. Completed rows stay in STATE.md: a ledger you can archive is a ledger you can lose, which is exactly how five open obligations once vanished in a cleanup.# STATE.md -- the ledger (edited in place, never archived) | id | status | owner | ask | gate | evidence | | G1 | in-progress | @build | Engine builds a dense radar | G1.2 | - | | G1.1 | done | @build | One database, two schemas | shipped | a1b2c3d PR #8 | | G1.2 | in-progress | @build | Recover typed discovery | claim: feature/g1-2 @ 1410 | - | | G1.2.1 | done | @build | Port the seven channels | shipped | e4f5a6b, run 9f2e | | G1.2.2 | open | @build | Bound the gather to 12 | G1.2.1 | - | | G1.3 | blocked | @design | Stage mechanism | open Q: votes vs prior? touches scoring | - | # LOG.md -- the conversation (append-only, never edited, archivable) ### 2026-06-20-1410 - FROM: design - RE: G1.3 stage call - STATUS: open Picking ONE stage mechanism. Leaning the prior-with-clamps path. @build, hold G1.3 children. # this entry is OPEN, so G1.3 exists as a row above, in this same commit
Orca shows each worktree with its agent's live state. The ledger's four statuses map one-to-one onto a four-column board, so the ledger and Orca read the same picture: a row's status is its column.
| Column | Row status | Orca worktree state |
|---|---|---|
| To do | open | Worktree not yet created, or created and idle. The next unblocked row. |
| In progress | in-progress | An agent is running in the worktree (Claude Code active). Carries the claim token. |
| Review / Blocked | blocked | Awaiting a human gate: a PR open for review, a permission prompt, or a blocking question. This is where the human looks first. |
| Done | done | Merged. The row cites its closing SHA and stays in the ledger; only the log archives. |
Worktrees share one .git but each has its own working copy of STATE.md on its own branch. That second copy is the price of the separation that protects design work from a build-side checkout, and it has to be reconciled rather than assumed away. The convention that keeps the copies converged:
STATE.md; only a row's owner changes that row's status. The two sides touch different lines, so git merges them cleanly instead of colliding. An earlier version of this model made the ledger single-writer and gave the Architect no git at all, which does prevent forks but leaves uncommitted design work exposed to a build-side reset. That trade is now paid explicitly instead of silently.STATE.md is missing a row id the other tree has; check (e) fails a commit that changes the status of a row this agent does not own. Neither can pass until the copies are reconciled, which turns "sync first" from a habit into a precondition of committing.in-progress plus the claim: branch @ time token and push it before starting, so no two worktrees take the same row. The human may claim on the agent's behalf when routing./check-handoff reads the ledger from the integration ref (git show {{INTEGRATION_BRANCH}}:operating-model/STATE.md), so an agent always sees the current rows and current claims, never a stale snapshot from branch time.done with the SHA cited as evidence.Why: the failure mode is code shipping against a question that was still open, then paying for a reconciliation migration.
security-reviewer agent runs at the bind gate on any security-relevant surface (boundary, endpoint, dispatch, secret, external content to a model, authZ, tenant data), checks six things (authenticated boundaries; tenant isolation with read-visibility separated from write-authority; secrets in the store; untrusted input stays data; authZ at the call site; replay-idempotency), and reports zero-noise (every finding carries an exploit scenario and maps to an abuse case or it is hygiene). The standing goals it audits against live in SECURITY-HARDENING.md, the checklist every project's goal tree adopts. It pairs with the code-level /security-review on the diff.// DEC-NN marker pointing at a root DECISIONS.md entry, so a later agent reads the rationale before "fixing" it. It is the one allowed exception to the no-pointers-from-code rule, because it points at a decisions log, not a design doc. Reserve it for code that looks wrong but is not; if the log grows faster than the codebase, the markers lose force.Why: deploys should be boring, attributable, and never depend on someone's laptop; CI should be a small set of composable jobs anyone can read.
git log or the code itself, never from tags or prose.release branch, never the default. main is integration: CI, previews, day-to-day agent pushes. Production deploys only from release, promoted deliberately from a green main. Because agents and humans default-push to main, separating the branches means an accidental or broken push can never reach production: the default target and the production target are structurally different refs.gates/ folder, run as one CI job. The scaffold ships six starters: RLS-coverage (policy in the same migration), no-cron-dispatch, security-headers, no-direct-LLM-SDK (enforces the one-gateway rule), no-em-dash (house style), and event-contract (every event carries an id and a version).ci workflow green and takes no direct pushes; the integration branch requires green CI to merge. Without this, "a broken push can never reach production" is a wish, not a structural fact. This is a required adoption step, not optional.row: G1.2.2); the row cites the closing SHA as its evidence when it merges. From a row you find its commits; from a commit you find its row. A PR template carries the verification checklist.WIP: checkpoints with a structured body, the decisions made, the work remaining, and the approaches already tried and rejected, so a crash or context reset reconstructs from them instead of re-deriving and repeating a dead end. The WIP: commits filter-squash before the PR (history and bisect stay clean); local by default, push is opt-in. The checkpoint doubles as the commit git-discipline requires before any tree swap.Five composable jobs, each a single responsibility, wired so a project swaps the inside of a job without touching the shape. Agnostic by placeholder; one filled reference per stack ships alongside. The gates job runs ten scripts as of v2.6.
# .github/workflows/ci.yml -- integration branch, every push jobs: lint: # format + lint, zero-warning budget typecheck: # static types across the workspace test: # unit + integration; real DB for policy negatives gates: # run every script in gates/ ; one job, many checks build: # compile / package ; artifact, no deploy # .github/workflows/deploy.yml -- production branch only on: { push: { branches: [release] } } jobs: migrate: # apply numbered migrations via CLI (never the web editor) web: # deploy the app surface workers: # deploy the compute surface # .github/workflows/scheduled.yml -- whitelisted QA + safety-net only # a CI gate refuses new cron decorators outside this whitelist
spec-deliverable-check.py, spec-propagation-check.py and spec-citation-check.py. Expect a new gate to be wrong first: these three produced 165 findings on their first run against a real corpus and every one was false, which cost one whole check (deleted) and two exclusions. Run yours against your corpus before trusting it, because a gate people skim is worse than no gate.ci, deploy, scheduled) plus a reusable composite action per stack. Long-running one-shots (backfills, re-resolves) are workflow_dispatch functions, not their own files. The rule: a reader should see the whole CI surface in three files.Why: multi-tenant data integrity is won or lost in the migration layer, not the app layer.
CREATE TABLE in a public schema ships ENABLE ROW LEVEL SECURITY plus at least one policy in the same migration. "Service-role-only via the backend" in a comment is not a constraint, the anon key reads it otherwise. A CI script enforces; the platform linter is the post-deploy backstop.col = ANY(auth_ids())), then code-path checks, then an append-only audit log. Each layer assumes the others can fail.WHERE clauses. One place that propagates to every policy, instead of a leak waiting for the one query that forgets. Pair it with an integration-test negative: archive as service role, read as member, assert gone.INSERT ... ON CONFLICT DO NOTHING in the same transaction as the effect).CHECK enums that need a migration per addition.Why: cron-and-poll architectures rot into invisible coupling; user trust dies the first time automation edits their data.
next_x_at column), or piggybacks on natural completion events. Cron survives only as whitelisted QA jobs or documented safety-net sweepers with sunset criteria; a CI check refuses new cron decorators outside the whitelist.*_candidate tables (pending / attached / rejected / expired); the user explicitly attaches. CI-enforced.pg_notify, realtime subscriptions, persistent listeners, platform schedulers), platform-native primitives over custom polling or fire-and-forget HTTP between your own services. Slice plans without a trigger-primitives section do not get acknowledged.Why: LLM call sites multiply; without one gateway and hard output contracts, costs, providers and prompts sprawl untracked.
Retry-After honoured, non-retryable 4xx short-circuit).content × config × provider × model; provider and model belong in the key because the same input through a different chain is a different output. Cache misses on chain rotation are correct, not a bug.Why: style rules belong to machines; human review time is reserved for judgement.
Why: audits without a threat model produce hygiene findings and miss cross-tenant bugs.
Why: this is the shell that makes AI-assisted development compound instead of reset every session. Four files-on-disk pillars, no hidden state.
| Pillar | What it is |
|---|---|
| Constitution | One root instructions file both agents read every session: the operating model, the invariants, the surface layout. Kept tight; details pushed down to topic rules via file-pattern progressive disclosure ("editing workers/** loads pipeline-error-handling"). |
| Ledger + log | The coordination pair (§2): an evidence-gated ledger (STATE.md, the only home of open/done, owner-closed) plus an append-only log (LOG.md, archivable by verbatim date-cut). No separate board. Goal-batches bundle related rows into one coherent pickup. |
| Rules & skills | Topic rule files loaded on demand by file-pattern, and reusable procedure skills the agents invoke. Three skills are mandatory at task entry and ship written-out in the scaffold: brainstorm before any new feature, plan before any code, verify before presenting. Sub-agent specialists are invoked at defined gates (spec promotion, new migrations, release scoping); delegation is the default when a task matches, isolated context, report back. |
| Memory + recovery | An auto-memory index of durable facts and feedback ("how we work" corrections with why + how-to-apply), snapshotted into the repo so it survives environment resets, plus a from-zero restore playbook (target: under an hour) kept honest by the remote-only secrets rule. |
.claude/settings.json with two hooks: a session-start hook that surfaces the open ledger rows (enforces "read the ledger first"), and a pre-tool hook that blocks destructive shell commands (recursive delete, force-push, hard reset, destructive SQL, shared-env migration) and points the agent at the registry. Every rule that can be a hook or a gate is one; the rest live as loaded rules.When a goal closes, after an incident, or on the human's call, each participant (Architect, Engineer, human) answers the same fixed question set independently, then the answers are laid side by side. The confluence, the agreements and the recurring frictions, is synthesised into proposed new ways of working, and each adopted item is promoted into a spec, a rule, or the operating model with a paired handoff entry and the human's bind. A retro that promotes no change was theatre. This is the memory-to-rules path on a cadence: a lesson that recurs and generalises stops being a per-session reminder and becomes a loaded rule.
Why: the scaffold is only as portable as its skills. A skill that names a product, a vendor, or a table is not reusable. This is the honest inventory.
agent-deterministic-boundary ship as-is The discipline behind §7: draw the agent / deterministic line for a stage before building it. Already product-neutral; the reference example is genericised.brainstorming, writing-plans, verification-before-completion shipped The three mandatory-at-entry skills, written out in full so a fresh project is never missing its required entry skills. The constitution's entry mandate is no longer hollow.specs-pin-exact-contracts shipped Referenced by the boundary skill. Pins an LLM call's output shape, controlled vocabulary (invented keys forbidden), cardinality, and failure mode, so the output is validated, never trusted raw.goal-tree-planning shipped Structures a request into the Goal / Subgoal / Task / Subtask rows of the ledger, with owners, status and evidence, replacing the old plan-file-plus-board split. Assigns the owner at creation, since the owner is the only party who may later close the row.handoff-discipline shipped How to write a good log entry, a paired spec-promotion entry, and when to promote a decision into the constitution.ci-gate-authoring shipped Turn a recurring review comment into a CI gate script in gates/. The mechanism that keeps human review for judgement.planning-with-files, codebase-audit-pre-push, systematic-debugging port Useful, not blocking; port from the source build as standalone procedure files.doc-coauthoring, mcp-builder, document skills (pdf / docx / xlsx / pptx) reference Provided by the host environment; the scaffold points at them rather than vendoring copies.A scan of the public skills directories surfaces a few patterns this three-function-plus-Orca setup will want. Adopt the pattern, author our own product-neutral version rather than installing a third-party skill that names a vendor or a CI shape:
consolidate-parallel-work, driving the goal tree and our gates, not a JIRA-specific one./ship <node> plus the Engineer already do; keep ours, do not add a parallel one.ci-watch-and-fix and the lint gate; no third-party skill needed.DEC-NN over a root DECISIONS.md, §3). Authored as our own product-neutral version in the operating model and rules, not installed.{{PRODUCT}}, {{DB_PLATFORM}}) or in the project's constitution, never in a reusable skill body.The reusable template is one folder. Drop it into a new project, run the adoption checklist in ADOPT.md, fill the placeholders, delete what does not apply.
project-agent-scaffold/ ADOPT.md # init checklist: fill placeholders, sequence (sect 13) CLAUDE.md # the constitution; auto-loaded by name in every Claude Code worktree ARCHITECTURE-PRINCIPLES.md # Appendix A: invariants every PR holds DECISIONS.md # counter-intuitive deliberate choices, guarded inline by DEC-NN markers .gitignore .claude/ settings.json # hooks: executable discipline hooks/ # session-start (surface open rows), guard-destructive (block) commands/ # /check-handoff /check-board /ship operating-model/ OPERATING-MODEL.md # the functions, triggers, the ledger mechanics STATE.md # the ledger: only home of open/done, owner-closed, evidence-gated LOG.md # append-only conversation, carries zero state LOG-ARCHIVE.md # verbatim date-cut moves out of LOG.md (never STATE) EXAMPLE.md # one scenario shown in both files, to copy the shape from specs/ README.md # lifecycle + the six writing rules TEMPLATE.md # spec template with the promotion checklist 000-example-spec.md # one worked, agnostic example rules/ INDEX.md # the full rules library, one line each + file-pattern map *.md # 16 core rules in full (incl. 5 promoted from memory, + decision-guards); rest stubbed agents/ ROSTER.md # the sub-agent roster + when-to-invoke gates *.md # 10 specialist reviewer definitions skills/ SKILLS.md # mandatory set, full library, the gap analysis (sect 11) */SKILL.md # 9 skills incl. the 3 mandatory + the gap skills, all shipped ci/ workflows/ # ci.yml, deploy.yml, scheduled.yml (agnostic) gates/ # 6 gate scripts: one folder, run as one CI job pull_request_template.md # node link + verification checklist (copy to .github/) REFERENCE.md # one filled stack reference (Node + Python + Postgres) memory/ MEMORY.md # the durable-facts index template RECOVERY.md # the from-zero restore playbook template
Sequence, not schedule. Each step depends on the ones above it; there are no dates.
CLAUDE.md), the handoff with its goal tree, the Architect / Engineer boundary, push-is-the-deploy, remote-only secrets..claude/commands + .claude/agents, the /check-handoff entry point, one node per worktree.The constitution-level list, genericised in name.
col = ANY(auth_ids())); a role-based default-visibility cascade (org admin sees all, workspace roles see their slice, a billing role sees no content); shared platform knowledge in a separate service-role-only store with zero tenant data; four layers of defence (signed envelope, RLS, code-path checks, audit log).content × config × provider × model; invalidation is explicit and classified; cache misses on provider rotation are correct behaviour.The topical rule files, loaded by file-pattern when an agent touches the matching surface. One line each; every one exists as a standalone doc. Core (shipped in full in the scaffold) is marked.
| Rule | One-liner | |
|---|---|---|
| rls-and-migrations | Migrations are the only schema truth; RLS + policy in the same migration as every CREATE TABLE; soft-delete suppression inside auth helpers; cross-store references are soft ids, never FKs. | core |
| git-discipline | No working-tree swap (checkout / reset / stash) while another agent may hold uncommitted shared state; commit the shared log promptly. | core |
| ci-watch-and-fix | Watch every push in-session; auto-fix two retries; architecture-class failures escalate with zero retries; nothing "shipped" until green. | core |
| destructive-actions-registry | Enumerated action classes (incl. a push to the production branch) need explicit human confirmation + an action-log line; three-tier shell-command safety. | core |
| spec-discipline v2.6 | The whole spec surface in one file, merged from four: lifecycle (draft to binding, blueprint first when large or novel, blocking questions gate authoring); THE GATE (cross-model before every bind, the one non-optional clause, resting on 9-findings-self versus 22-including-5-blockers-independent); the learning loop (a findings corpus whose detector column is a COMMAND not a question, three of them now CI gates, stop on the first fix-induced defect); the six spec-writing rules; and doc-bug promotion. Replaced spec-lifecycle + spec-authoring-discipline + gate-findings-learning-loop + implementer-questions-are-doc-bugs. | core |
| dispatch-and-events | Event-driven not cron; no auto-write to user-curated state; system actions default off; trigger-primitive named before any slice. | core |
| llm-gateway | One gateway by purpose; provider chains in registries; cache key includes provider and model; temperature-zero for stable judgments. | core |
| threat-model + audit-prompt | Named adversaries, boundaries, abuse cases; the audit reads the threat model first and names multi-tenant isolation explicitly. | core |
| remote-only-execution | No local secret-dependent execution; one-shot jobs are remotely-invokable functions reading platform secret stores. | core |
| production-comments | Comments explain what and why-this-shape; no pointers to design docs; date stamps or SHAs for temporal grounding. | core |
| logging | Everything leaves a queryable trail; autopsy-as-floor (failure reason persisted before death); families audit / run / health / external-call / observability; per-tenant, region-resident; no customer data in metrics. | core |
| pipeline-error-handling | Every stage validates inputs, catches errors, checks outputs; typed failure-mode catalogue; heartbeats + outcome markers; failures recorded to a queryable field, not just a log line. | |
| scalability-throttling | Named concurrency ceiling; semaphores, in-run batching, provider batch APIs; rate-limit events as a first-class metric family. | core |
| web-app-error-discipline | Every DB-client call destructures and logs before fallthrough; empty-state vs query-failure are visually distinct; explicit asset allowlists in matchers. | |
| web-security-headers | The seven security headers + no framework fingerprint, declared in config and asserted by a CI script. | core |
| shippable-contract | Six day-one constraints on every UI component: tenancy, signed context, i18n, theme tokens, logical CSS, locale formatters. | core |
| release-discipline | Every new backend concept ships with a user-verifiable UI surface in the same release; admin fidelity fine, SQL-only verification not. | |
| wireframe-port-audit | The port loop: build ports or creates in code, cleans up, ships an element-by-element audit diff in the same SHA, hands off; the Architect validates against the source and acks before the next node. 100 percent or it does not ship. | core |
| design-tokens-single-source | Tokens live in one source both the wireframe and the code read; no look-alike values on either surface; divergence caught at the port audit. | core |
| configuration-disclosure | Customer settings are presets + a few sliders; raw weights, thresholds and prompt text never reach the client bundle (CI-checked import boundary). | |
| user-controlled-state | Automation never writes user-curated tables; workers stage into *_candidate rows for explicit attach / reject. | core |
| prompt-injection-defence | Five-layer pre-LLM scanner on all external content with clean / suspect / block, quarantine, pattern files, eval harness. | core |
| observability-tooling | Three tools, one job each: error tracking, uptime/status, a custom internal diagnostics surface over the pipeline's own health tables. | |
| analytics-telemetry | No product analytics before launch; pipeline / audit / metric families are the instrumentation; region-resident tools; sub-processor list updates same-SHA. | |
| design-language floor rules | A numbered list of non-negotiable visual rules for the product's signature surface, including typography and punctuation, enforced at design review. | |
| dependency-policy | Latest stable at scaffold time, exceptions documented with a bump ticket; prefer lib[extras] over hand-picked transitive deps. | |
| integration-topology-first | Every multi-service slice names the trigger primitive that wakes the next service before any code; platform-native primitives over custom polling. | core |
| schema-evolution | Change a live table without downtime: expand, dual-write, backfill, contract. Never rename or retype in place. | core |
| api-contract-versioning | Additive API changes free; breaking changes ship as a new version, never a mutation; deprecation has a window. | core |
| queue-failure-handling | Dead-letter queue, poison-message handling, bounded retry with backoff, back-pressure, visibility timeout sized to the work. | core |
| planning-without-dates | Plans, handoff entries and goal nodes carry no day counts, dates or Gantt timing. Order-of-dependency is the only ordering primitive. | from memory |
| check-bindings-before-planning | Before filing a plan, spec or "open question", grep existing bindings on the same surface first; do not re-derive a settled decision or resurface a bound one as a fresh option. | from memory |
| verify-not-self-report | A node flips to done on an independent verification (browser, integration test, diff, screenshot), never on the author's local-green alone. Structural acknowledgement is not functional acknowledgement. | from memory |
| cost-comparison-honesty | Never claim "X percent cheaper" by comparing a partition of an amortised fixed cost to a marginal cost; check whether the saving is marginal (the fixed cost actually leaves) or just shifted. | from memory |
| no-stale-aggregate-seed | Do not seed a per-entity field at creation time from a parent or sibling aggregate's attribute; it is a guess that goes stale. A spec-critic red flag before any spec binds. | from memory |
| plugin-and-skill-adoption | Cherry-pick community skills and plugins that fill a real gap; never install wholesale. Sweep upstream content (style, path defaults) before it lands. Skill installs are content copies, the design side's territory, not a destructive action. | from memory |
| prose-and-copy-style | House writing conventions: no em-dash (use comma, period, parenthesis, hyphen), no inline emoji in document bodies, dark-theme-safe diagram defaults. Configurable per project; enforced at review. | from memory |
| senior-engineer-mode | Push back on the human's framing, critique your own proposals, recommend the best option for the product even when it was not asked. Compliance mode is a defect. | from memory |
| decision-guards | Counter-intuitive deliberate code gets a DEC-NN marker pointing at DECISIONS.md; the one allowed code-to-doc pointer; reserve for code that looks wrong but is not. | core |
| doc-drift-on-ship | A ship reconciles every doc the diff drifted (each side fixes the docs it owns, cross-boundary drift flagged in the handoff); docs-match-the-diff joins the verification checklist. | core |
| retro-cadence | Event-triggered retro; each participant answers a fixed set independently; the confluence is synthesised into new ways of working and promoted to a rule / spec / operating-model line. | core |
| checkpoint-discipline | Engineer auto-commits WIP: checkpoints with a structured body (decisions / remaining / rejected approaches); resume reconstructs from them; squash before the PR; local by default. | core |
| no-fake-data v1.3 | Scaffolds ship honest empty states, never fabricated demo data or controls for unbuilt stages; the live surface renders real data, the wireframe is the visual target only; a ported sample value is a port-audit deviation. | core |
| platform-findings-backstop v1.4 | Consume each platform's native security + quality findings (code scanning, dependency + secret scanning, the host/DB linter, the cloud security advisor) as a standing backstop; triage every one, escalate trust-boundary criticals; complements the CI gates + security-reviewer, never replaces them. Name your own platforms, do not inherit a vendor. | core |
| output-math-requires-binding v1.4 | Build never introduces or changes output-affecting math (ranking / scoring formulas + weights, calibration, thresholds, filters / floors, precedence) without a bound spec + human bind; propose, route to design, hand off. | core |
| phase-aware-rigor-ladder v1.5 | Effort scales with phase (Tier 0 prototype / 1 MVP / 2 production); the security/CIA floor is constant at every tier; named promotion triggers (real data, money, multi-tenant, PII, 2nd contributor, public exposure) re-rate up a tier. | core |
| epistemic-discipline v1.5 | Verify environment claims from a tool run this turn, never from stale memory; never invent flags / paths / APIs / columns; a third-party surface builds from the vendor's current docs and verifies by executing the artifact, verifiers exit non-zero; vendor guidance never overrides a bound spec; mechanize anything checkable in a script. | core |
| eval-guards-a-lesson v1.5 | Every lesson bound from a real miss ships a checkable regression scenario that would have caught it, in the same change; a lesson without a guarding check is incomplete. | core |
| secret-rotation-lifecycle v1.5 | Secrets rotate on a cadence and on exposure, zero-downtime via overlap; KEKs re-wrap on version bump; rotation is a gated action; code holds only a store reference. | core |
| data-protection-as-code v1.5 | Privacy rights are code paths: export (DSAR), erasure that cascades across every store, retention enforced by a job, DPIA for new high-risk processing; personal data inventoried with lawful basis + residency. | core |
| disaster-recovery v1.5 | Immutable, tested backups (3-2-1-1-0); sync is not a backup; PITR verified and restore drills prove named RTO/RPO per data class; provider-outage + bus-factor path written down. | core |
| cicd-supply-chain-hardening v1.5 | CI is a trust boundary: least-privilege workflow permissions, SHA/digest-pinned actions and images, SBOM + provenance + signed releases, short-lived OIDC credentials, deploy gated behind the check suite. | core |
| leakage-guard v1.5 | Keep portable surfaces free of secrets and environment-specific identifiers; specifics live in project config or an un-committed local profile; a two-tier CI grep denylist blocks a leak before it lands. | core |
| deep-modules v1.6 | Depth over module count: a lot of behaviour behind a small interface; deletion test (does removing it concentrate or just move complexity); the interface is the test surface; one adapter is a hypothetical seam, two make it real; no speculative abstraction for a single implementation. | core |
| resilience-engineering v1.7 | Degrade, do not die: timeouts on every remote call, circuit breaker, bulkhead, load-shed, designed degraded modes, kill-switch, bounded retry with backoff+jitter on transient+idempotent only. Extends queue-failure-handling to the in-request path. | core |
| infra-hardening v1.7 | The running surface is least-privilege and pinned: non-root containers, digest-pinned scanned images, minimal runtime identity; IaC state remote+locked with plan-as-gate, federated short-lived deployer, no secrets in state. | core |
| feature-flag-lifecycle v1.9 | A flag is born with a sunset (named removal trigger + owner in the same entry) and dies atomically (consumer + handler + UI + config removed together); a partial retirement leaves a control wired to nothing. | core |
| output-grounding-verification v1.9 | Injection has no complete input fix, so verify the OUTPUT: every LLM claim over untrusted content traces to a verbatim quote that exists (deterministic) and entails (NLI) the claim; ungrounded output is rejected. The output-side companion to prompt-injection-defence. | core |
| implementer-questions-are-doc-bugs v1.9 | When the build side must ask how bound mechanisms compose, or ships stricter or looser than bound, the answer promotes same-session into the owning spec as ONE stated flow; stricter-than-bound is a conformance bug too. | core |
| dependency-update-cadence v2.1 | Dependabot PRs are triaged on a clock, never left to rot: security-flagged fast, minors batched on a fixed cadence, a staleness ceiling past which every PR carries a merge / hold-with-reason / close decision. A scheduled check surfaces the open queue on time; majors ride an equivalence gate (the transformers-HHEM battery is the reference); a hold-with-reason has a shelf life and a stale reason is itself a finding. | core |
| handoff-log-state-split v2.2 | The handoff splits by LIFECYCLE: an append-only LOG (archivable only as a verbatim date-cut) and a STATE ledger, the sole home of open/done, where every item carries owner, gate, and an evidence field; done is unwritable without cited evidence. Ownership binds the write: only a row's owner mutates its status, a non-owner audit routes a claim instead of flipping, and anyone may create a row since the collision is in mutation, not creation. A CI gate blocks a log marker without a state item, an archive that touches state, a done without evidence, a copy missing a row the other tree has, and a status that differs from the other copy on a row this agent does not own. | core |
| due-diligence-audit v1.9 | Recurring baseline-anchored audit: Mode A conformance-vs-bound-specs, Mode B twelve-heading scored due-diligence; literal code never claims; every audit re-verifies the prior Criticals first; scores ratchet against the pinned baseline; findings route as goal-per-heading; closures ship guards. | core |
| traceability v2.3 | Autopsy-as-floor for every pipeline stage: each persists inputs / outputs / decisions including what it rejected and why, plus provenance, so any output walks back to its origin. Structured trace in the primary database; bulk bodies and model I/O in content-addressed object storage, deduplicated, never republished; tenant-isolated and residency-compliant; a trace-write failure degrades, never fails the run. | core |
| web-sql-column-check v2.3 | Every hand-written SQL query in the web layer has its table and column references validated against the migration DDL in CI before merge; a reference the schema lacks fails the gate. Closes the wrong-column-in-raw-SQL class that typecheck, lint, build, and deploy all pass green. A static check against the DDL, no test database. | core |
| observability-instrumentation v2.3 | Observable by construction: a mandatory declare-even-if-empty spec Observability slot (the design layer) plus a build / CI gate (declared-vs-emitted family reconcile, static label-cardinality lint, semantic-convention keys, refs-not-bodies). References the project's bound observability spec and never restates its measurement set. | core |
| human-binds-never-operates v2.4 | The human is a designer and a binder, never a runtime operator. No running stage asks a person to label, rank, adjudicate, ack or decide a per-item outcome; a pipeline that needs one has a design defect, and the fix is to make the decision systemic. The one sanctioned human input to output-math is the design-time governance bind of a value that was DERIVED systemically. The boundary is the FIRST gate question, before any internal-correctness lens. | core |
| framework-mirror-to-scaffold v2.3 | A change to how-we-engineer (a rule, agent, skill, the constitution, the spec template, a generic CI gate) mirrors same-session into the scaffold, generified; an unreachable scaffold is recorded as an owed mirror, not skipped; the mirror lands its INDEX, file-pattern, template, and handbook wiring, not just the file; a drift check runs at every retro and audit. The structural answer to the folder-only drift this changelog keeps catching. | core |
The eight rows marked "from memory" were promoted out of the source project's operating memory (the running list of how-we-work corrections) into standalone, product-neutral rules. This is the memory-to-rules path in action: a correction that recurs and generalises stops being a per-session reminder and becomes a loaded rule.
Skills are reusable procedure files; sub-agents are isolated specialist reviewers invoked at gates.
Skills, mandatory at task entry: brainstorming (before any new feature or architecture decision), writing-plans (before any code), verification-before-completion (before presenting any work).
Skills, the scaffold's own library: system-health v2.7 (the scan of the scaffold itself: enforcement ratio, orphan rules, growth-against-effect, family collisions, gate yield, dead gates; every step a command that prints a number, every admissible action a subtraction) · agent-deterministic-boundary · specs-pin-exact-contracts · goal-tree-planning · handoff-discipline · ci-gate-authoring · consolidate-parallel-work · planning-with-files · test-driven-development · codebase-audit-pre-push · systematic-debugging · create-pr · technical-change-tracker. Document and MCP skills are referenced from the host platform, not vendored.
Skills adopted from community, cherry-picked and adapted v1.7: improve-codebase-architecture (find shallow modules, deepen them, applies the deep-modules rule as a procedure) and grill-plan (stress-test a plan against existing bindings one question at a time, the narrowing counterpart to brainstorming). Both rewired to the scaffold's goal-tree / handoff, DECISIONS.md + decision-guards, and the Explore agent; bodies kept agnostic. Adapted from Matt Pocock's improve-codebase-architecture and grill-with-docs, per plugin-and-skill-adoption (cherry-pick, never install wholesale).
Sub-agents, engineering gates: system-architect (before any spec binds; topology + fault lines) · principal-engineer (18-month consequence, simpler-shape, incident pattern-match; every release-scope decision) · database-architect (every migration, policy edit, isolation question) · test-strategist (which layer tests what) · integration-test-designer (real-database security negatives, replay / idempotency) · security-reviewer v1.3 (the end-to-end boundary lens on any security-relevant surface, anchored on the threat model + SECURITY-HARDENING.md) · accessibility-reviewer (the accessibility floor on every customer surface) · incident-responder (mitigate, communicate, investigate; postmortem inside 48h) · spec-critic (the six spec-writing rules + dispatch questions) · design-critic (the visual floor rules) · prompt-engineer (designs and evals the per-purpose prompts) · adversarial-verifier v2.7 (takes ONE load-bearing claim, not an artifact, and tries to refute it; defaults to refuted when uncertain and returns survives rather than confirmed, because every other reviewer defaulting to accept reproduces the author's blind spot).
Sub-agents, research bench: a general research analyst plus optional domain specialists the design side delegates to. Default is to delegate when a task matches a specialist; isolated context, conclusions reported back.
What changed in this operating system, newest first. The detail lives in the rules and the operating model; this is the index of what moved.
@design / @build handles, placeholder tokens, sub-agent filenames. A Quickstart opens both documents (copy the template, fill placeholders, two worktrees via Orca or plain git worktree, both functions as CLI agents inside Orca in the reference setup, check handoff, validate-scaffold-to-stack, brainstorm). And the repo ships MIT at the root, with community-skill attribution already recorded in skills/SKILLS.md: a freebie without a license file is all-rights-reserved by default, the opposite of a freebie. Shipped alongside: skills/validate-scaffold-to-stack, a DRAFT: the two-way coverage diff between an adoption's manifest-inventoried stack and the rules library; uncovered surfaces become stubs with triggers, rules and file-pattern rows with no matching surface leave the instance, output capped at three actions; promotes after five successful runs, wired as ADOPT.md step 6, making "delete what does not apply" countable. Also assessed: openai/codex-security, whose scans-compare (findings matched by root cause: new / persisting / reopened / resolved) is the v1.9 regression spine implemented mechanically; not a port (a vendor service installation; the port target already exists as /security-review plus security-reviewer) but a per-project findings source under platform-findings-backstop and the natural second-vendor lens for the queued cross-model diff gate; sending source to a second vendor is a human bind, never an agent default. An intake sweep of a 139-link external corpus in two passes, and the three defects it found at home. Thirty-nine in-domain links vetted at mechanism level by five parallel reviewers, every headline claim re-verified first-hand (the v1.9 synthesizer discipline); the title-only triage of the remaining hundred was then challenged as judgment from appearance, and a second pass opened every remaining link: 79 bins held, 14 flagged links got the same mechanism-level vetting, one flag died on vetting, and eleven sources now clear the v2.7 admission test, every one a fold or a CI convert, zero new rules. Fixed in this entry: guard-destructive.sh failed open silently (an unparseable payload was allowed with no record, so guard-down was indistinguishable from guard-pass; now jq-first parsing with the sed fallback, every decision logged append-only to a gitignored .claude/guard-log.jsonl, system-health step 9 counting the fail-opens, and the injected-defect test extended to the hook, verified before this entry was written: an unparseable payload logs parse-fail, and a multiline command hiding a hard reset on its second line is decoded and blocked; named by comparison against mayankjain0141/nixis); the constitution's file-pattern table listed spec-discipline three times in one row, sediment of the v2.6 merge sweep, kept on record as the dead-reference gate's named evidence; and the README changelog had drifted two versions behind this handbook, the folder-only miss framework-mirror-to-scaffold exists to prevent, backfilled and recorded. The adoption queue, each landing with its own wiring and the skill with its five-run trial: a test-ratchet gate (delete or weaken a failing test to fake green; two independent namings), diagnosing-bugs into the systematic-debugging port slot, the cross-model gate extended from spec bind to the pre-PR diff (the v2.4 measurement was only ever applied to specs), a dead-reference gate plus a commit-relative staleness number in system-health, a visual baseline behind the wireframe-port ack, a WCAG contrast-matrix gate over the token source, a declare-even-if-empty negative-space spec slot (what must NOT be done or touched, against overperformance), a hedge-lexicon spec gate validated against the corpus first per v2.6's 165-false-findings lesson, and a credential-path / read-piped-to-egress registry row, plus from the second pass a named-defaults deny-lexicon gate over the token source and committed CSS (VibeCurb: keyword easings, AI-purple gradients, display-font misuse, the drift the wireframe contract is silent on). Deliberately not adopted: every installation; review daemons, policy engines and the memory-infra shelf answer as infrastructure what this scaffold treats as discipline, ccpm's shared-worktree parallelism is the v2.2 incident productized, and chorus's regex verdict parsing with its documented false approvals is the recorded dead end binding that a gate reviewer returns a structured verdict token, never prose. The second pass added four one-line notes (weakest-provenance inheritance, discrete anchored scales, the stale-blocked row check held for a recorded miss, a dormant prefix-cache clause), a placeholder-residue line on the queued dead-reference gate, and two corroborations: hermes-agent's own write guards against its ungated skill loop, and the session-resume author converging on checkpoints the next agent just reads, the ledger design independently arrived at.mattpocock/skills (adopt) · PiLastDigit/TRIP-workflow (adopt) · theDakshJaitly/mex (adopt) · jrpease/throughline (adopt) · codeswithroh/tastemaker (adopt) · gszhangwei/open-spdd (adopt) · murilobauck/specsmith (adopt) · mayankjain0141/nixis (adopt; the guard fix executed here) · addyo.substack.com/p/long-running-agents (adopt: test ratchet) · blog.tedivm.com Beyond the Vibes (corroborates the ratchet) · chorus-codes/chorus (note) · Cappe6969/Architect-Builder-Reviewer (note) · openclaw/clawsweeper (note) · garrytan/gbrain (note) · martinfowler.com SDD three tools (evidence) · israynotarray.com hooks guide (note) · o11y-dev/opentelemetry-skill (note) · martinfowler.com SPDD (covered) · ryanthedev/code-foundations (covered) · automazeio/ccpm (covered; dead end) · r/WebAfterAI layered-defence post (covered; the consumed source) · moazakramkhan1/assumption-auditor (covered) · sahilsaleem2907/sift (covered) · kid-sid/claude-spellbook (covered) · faizanmohiuddin482/bullpen (covered) · evilayman/opencode-raven (covered) · VoltAgent/awesome-claude-code-subagents (noise) · GetBindu/awesome-claude-code-and-skills (noise) · MengTo/Skills (noise) · HusseinLab/codex-operating-system-community (noise) · Mathews-Tom/Agentic-Design-Patterns (noise) · ergon-automation-labs/ergon-wrong-turn-logger (noise) · agix-ai/agix-aos (noise) · raia-live/amfs (noise) · chopratejas/headroom (noise) · mnemosyne-oss/mnemosyne (noise) · syncable-dev/memtrace-public (noise) · srihari7070/lore-map (noise) · Shah-in-alam/LiveArch (noise) · ShopDevX/adeptlydev (rejected same session) · Yu-369/VibeCurb (2nd pass: adopt, deny-lexicon gate) · JetXu-LLM/DocMason (2nd pass: note) · safishamsi/graphify (2nd pass: note) · esengine/deepseek-reasonix (2nd pass: dormant note) · rockthemike712/mission-control-board (2nd pass: note, held) · Hamosian/marketing-brain-starter (2nd pass: covered) · antigravity.google (2nd pass: covered) · nousresearch/hermes-agent (2nd pass: covered, the named anti-pattern) · agno-agi/dash (2nd pass: covered) · oxbshw/watch-skill (2nd pass: covered) · moa.chat (2nd pass: covered) · r/ClaudeCode CCMeter (2nd pass: noise) · r/claudeskills agent-session-resume (2nd pass: covered) · r/WebAfterAI shepherd (2nd pass: covered)The remainder of the corpus, each bin confirmed in the second pass by opening every link: already mined or in daily use (5): garrytan/gstack · Sanexxxx777/curated-claude-code · stablyai/orca · lexler.github.io/augmented-coding-patterns · lexler.github.io/pattern-catalog deep links of vetted repos (2): mattpocock/skills/skills · mattpocock/skills/engineering agent frameworks, the surface the LLM-gateway rule abstracts over (11): BuilderIO/agent-native · foundationagents/metagpt · huggingface/smolagents · langchain-ai/deepagents · langchain-ai/langgraph · langchain-ai/open_deep_research · mastra-ai/mastra · significant-gravitas/autogpt · stanfordnlp/dspy · tauricresearch/tradingagents · pydantic.dev/overview observability platforms, per platform-findings-backstop a per-project pick (4): arize.com/phoenix · comet-ml/opik · comet-ml/opik (dup) · langfuse.com memory infrastructure, the file-based stance holds (5): getzep.com/graphiti · angelnicolasc/graymatter · NevaMind-AI/memU · plastic-labs/honcho · unbody-io/adapt products and hosted platforms (33): 21st.dev/home · dify.ai · eigent.ai · 0-AI-UG/cate · 666ghj/MiroFish · alibaba/page-agent · BotCoder254/limboo · idolaman/galactic · msitarzewski/agency-agents · nesquena/hermes-webui · OpenSenseNova/SenseNova-Skills · paperclipai/paperclip · heygen-com/hyperframes · JCodesMore/ai-website-cloner-template · khoj-ai/pipali · Mintplex-Labs/anything-llm · ruvnet/ruflo · techhorizonlabs/thl-open · twentyhq/twenty · Vizards/deepseek-v4-for-copilot · wende/claude-max-api-proxy · glideapps.com/new · graperoot.dev · gumloop.com · hermes-agent.nousresearch.com · hermes-agent.nousresearch.com/skills · musterr.dev · openclaw.ai · opencode.ai · openwork.software · z.ai/subscribe · bloom500/feral · companion-inc/feynman tools and utilities (5): ChromeDevTools/chrome-devtools-mcp · Cocoon-AI/architecture-diagram-generator · oraios/serena · taisei-ide-0123/pluckmd · huggingface.co/harness-1 reference collections and how-tos (2): CodeBoarding/awesome-architecture-mds · medium.com/how-to-use-git-worktree-for- listicles, explainers, setup tours, off-topic (19): aisera.com/agentic-workflows · cnbc.com/these-are-the-5-most-valuabl · edenai.co/best-ai-agent-harnesses-comp · reddit WebAfterAI: 1uehxc0 · reddit WebAfterAI: 1unek5m · reddit promptingmagic: 1ucjmq9 · reddit hermesagent: 1ustnra · reddit WebAfterAI: 1tuymto · reddit hermesagent: 1v03vab · reddit aiagents: 1ub20yq · reddit Markdown: 1u9fs8k · reddit hermesagent: 1u9fa2w · reddit hermesagent: 1uevy29 · reddit WebAfterAI: 1t0xjs5 · reddit LLMDevs: 1uz6aee · snyk.io/top-claude-skills-finance-qu · swarm-organisation.com · vectorize.io/gbrain-alternatives · wearenotch.com/agentic-ai-explainedobservability-instrumentation clause 4 stated "no prompt, completion, page body, or PII string in any span attribute" as an absolute, and the source project bound a fenced full-text trace mode that falsified it - the clause now names the exception instead of being silently contradicted: a bound spec may open ONE gated body path onto model-call spans, entered through a single attach seam under a committed conjunction (flag, pinned self-host sink identity, tenant allowlist, absolute expiry, live retention probe), TTL-bounded, with committed attribute keys - and log records and labels stay absolute in every mode. The generalisable lesson is the editing discipline, not the mode: when an amendment falsifies a bound absolute, the absolute is edited in the same bind to name the conditional honestly, never left standing to assert P while the amendment asserts not-P one section below. The mode itself earned its shape through two adversarial gate rounds whose second round was fix-induced, triggering the stop-and-shrink pattern: scope shrank to a time-boxed debug window and the full posture deferred to the release gate that already owned it.epistemic-discipline rather than added as a file, per the v2.6 freeze - the verify-before-asserting family already owns this. The evidence, from the source project's vendor-service standup: five deploy failures in a row built from recollection (a CLI flag the binary does not have, an illegal comment token in a config format, healthchecks probing localhost on an IPv4-only bridge, an env placeholder never passed into its container, a wrong export endpoint), every one answerable by reading the vendor's current documentation or by executing the artifact once, at the cost of six deploy rounds of the human's time. Three clauses. (1) Docs first: before writing code against any third-party API, SDK, config format or container image, fetch the vendor's CURRENT docs; a recollection is not a citation, and a vendor claim gets the same verify-this-turn treatment as a codebase claim. (2) Execute to verify: verification executes the artifact (parse the config, boot the container, run the probe), before the push, not after the human hits the failure; and read the result back through the CONSUMER, because a producer's acknowledgement proves acceptance, not existence. (3) Verifiers exit non-zero: a green result that means "did not crash" will be read as "passed"; a check that cannot fail loudly is not verification. The build side had already shipped the mechanical half before the rule landed (probes that exit non-zero, a read-back through the consumer API, and four config/execution CI gates each guarding one of the failures), which is the v2.7 admission test satisfied the intended way: the procedure solved the problem before it was written down. One precedence call bound with it: vendor docs and vendor skills inform implementation; they never override a bound spec. The recorded instance is a vendor skill preferring its native SDK over the neutral telemetry seam the specs bind; the seam won because its repoint-the-backend swap property had just been exercised for real, and a genuine conflict routes to the handoff as a design question, never a silent switch.github.com/Sanexxxx777/curated-claude-code states it as "curated, not dumped" and "a harness that grows is worth more than a harness that's big", and ships 8 skills, 2 agents and 5 rules deliberately. Three things it had that this scaffold did not, all folds rather than additions. (1) adversarial-verifier, a new roster agent, and the load-bearing detail is its DEFAULT: refuted when uncertain. Every other reviewer here defaults to accepting, which reproduces the author's blind spot; this one takes a single claim, states what would falsify it before looking, tries the awkward cases (empty set, second call, other arrival order, after a regroup, at 100x), and returns survives rather than confirmed, because surviving one attack is not verification. It takes ONE claim, never an artifact, which is what keeps it distinct from the cross-model gate. (2) An admission test in front of the freeze. v2.6 said which MOVES were allowed (convert, fold, replace) and never said what QUALIFIES, which is how a library reaches 58 entries: a candidate now needs verified correctness, a NAMED failure pattern ("good practice in general" fails this), recorded ruled-out dead ends, and five successful runs before a procedure is promoted to a skill. Their phrasing is the one to keep: confident guesses never get enshrined as truth. (3) system-health, a scan of the scaffold rather than the product, and it is the most valuable of the three because it is v2.6's audit made repeatable. That audit was run by hand, once, a month after the drift started. Every step is now a command that prints a number: the enforcement ratio (rules with an executable check over total, and the interesting figure is the FRACTION, not the count), orphan rules with no retrieval trigger, growth-against-effect (rules sorted by birth date beside size, where the red flag is the newest also being the largest), family collisions, gate yield and the fix-induced trend, cadence actually running, mirror drift, and dead gates that have never failed and must be tested with an injected defect. Its output is capped at three actions and every admissible action subtracts, or the scan becomes the thing it exists to catch. Deliberately NOT adopted: their pre-push and ship-secure (our gates job and the security rule family already cover these), konsilium (the gate panel is the same shape), goal (the state ledger), and above all their rule count: five rules cannot carry tenant isolation, data protection, disaster recovery and supply-chain hardening for a multi-tenant product. The intake discipline transfers; the size does not. Their vet plus tool-scout pair remains the reference implementation for this scaffold's plugin-and-skill-adoption stub, to be filled the first time an external skill is actually taken.retro-cadence. And no record of gate yield anywhere, against a rule that mandates measuring it, so the question "which of these rules earn their place" was unanswerable from the scaffold's own records. The sharpest finding is in the birth dates: the two largest rules in the library were the two newest, both about the spec process, and both had a measured effect of zero. One's own text recorded that all ten of its clauses were bound before the last three recurrences it existed to prevent; the other's headline detector recurred four times in the round that added it, missed by the author who had just written it. Process grew fastest exactly where it worked least, which is what over-engineering looks like from the inside. Four changes, all subtraction. (1) The library is frozen. rules/INDEX.md now opens with it: a lesson converts to a CI check, folds into the rule that owns its family, or replaces a file. A genuinely new surface enters as a stub with a trigger, not an essay. (2) Four rules became one. spec-lifecycle + spec-authoring-discipline + gate-findings-learning-loop + implementer-questions-are-doc-bugs, 210 lines, one capability family, are now spec-discipline. What survived the merge is what had evidence: the lifecycle, the non-optional cross-model gate, the corpus, the stop condition, the six writing rules. What was cut was the war-story tables and the eight prose clauses that a gate now checks. (3) Three detectors became CI gates. spec-deliverable-check.py, spec-propagation-check.py, spec-citation-check.py, covering eleven recorded recurrences between them. They were run against a real corpus before being trusted and produced 165 findings of which every single one was false: one entire check was deleted (asserting that every field declared in a Data section is read in the same spec is simply wrong in a system that centralises its schema), the identifier pattern had to accept dotted qualifiers, and retired specs and checklist lines are skipped. That measurement is the reason to trust the three that remain. (4) The gate got a log. operating-model/gate-log.md, one row per gate, and the load-bearing column is fix-induced: findings created by the previous round's fixes. Two consecutive non-zero rows is the stop condition, and on the programme this came from that count went 1, 2, 4 while blockers went 1, 2, 2, so the number that mattered was rising the whole time redrafting felt like progress. Two gaps closed alongside. Capability families get one representative each, because rules that share a family compete at retrieval and the retriever cannot tell them apart: the benchmark result behind it is a baseline retriever surfacing the wrong sibling from the right family in the top 3 69% of the time, fixed by selecting one representative per family before ranking. Eleven families are now named in the index with their front rule. And retro-cadence gets two countable triggers (any second consecutive fix-induced row, and every tenth row) because the discretionary trigger produced one retro in a month, and a retro is exactly the thing that would have caught all of the above. The honest note the scaffold keeps about itself: the two rules deleted here were written two days before they were deleted, by the agent that wrote this entry.gate-findings-learning-loop rule, and it is not a new discipline: eval-guards-a-lesson already binds that every lesson from a real miss ships the regression check that would have caught it, and that had only ever been applied to CODE defects. Applying it to SPEC defects is the whole change. The evidence that forced it: across four spec drafts and six independent gate rounds on one programme, the same classes recurred - unproducible deliverable (3x), unchecked consumer invariant (4x), a defect class correctly diagnosed in prose and then committed in the adjacent section (3x), unbounded at 100x (4x). All ten rules of the spec-authoring discipline were already bound when the last three recurrences happened, so a written rule prevented none of them: a rule is read once at the start, and the defect is committed in the middle of writing something else. The loop puts the specific prior finding in front of the author at the section that would repeat it. A findings corpus tagged by class and by section-kind; a detector column carrying the concrete question that surfaces the class, which is what turns a war story into an asset; retrieval at AUTHORING time; and a mechanical pre-gate check generated from the corpus. Two deliberate design calls. The independent gate is NOT seeded from the corpus, because a seeded reviewer checks the list and stops, and reasoning from the artifact is the property that works - known classes are the pre-gate's job, novel ones are the gate's. And recurrence after a class has a corpus row means the DETECTOR is bad, not the author careless, so the detector gets rewritten; without that the corpus grows into a checklist nobody runs. No vector store: at fifty findings this is a grep against a two-screen table, and what matters is WHEN retrieval fires, not how clever the index is. A corpus template ships with the classes and detectors pre-seeded and no project instances. Three existing rules amended in the same pass rather than a fourth rule added, which is the discipline the session was about: epistemic-discipline gains the loophole it was falling through - its verify-before-asserting list named the codebase, paths, flags, APIs, columns and command output but never what one of our own bound specs asserts, and that is where it was broken repeatedly, because an external source feels like it needs checking and our own spec feels like knowledge; internal claims are not safer than external ones, they are less verified. spec-authoring-discipline rule 9 extends from the bind set to AUTHORING volume, because error density rose with artifacts-per-turn and the artifacts that failed hardest were the largest and fastest-written, so volume is a defect signal to act on rather than a productivity signal to enjoy. And the learning loop gains a stop condition: stop on the FIRST fix-induced defect, not the third - if a gate round's findings were created by the previous round's fixes, the problem is not in the drafting and drafting again is the one response guaranteed not to address it. The stop is the deliverable.spec-authoring-discipline rule, ten items, each naming the specific failure it prevents. The evidence that produced it: a design agent self-reviewed three of its own specs and found nine findings; an independent-model gate on the same three found twenty-two, including five blockers, of which the self-review had found zero. Two of those blockers were defect classes the author had correctly diagnosed in prose one paragraph earlier and then committed in the adjacent table, which is why the rule treats self-review as structurally weak rather than merely insufficient. The load-bearing items: a claim about your own system cites file:line or it does not ship (internal claims are not safer than external ones, they are less verified, because external ones feel like they need checking); a cross-model gate before any bind, non-optional, the only rule here that addresses the general case rather than an instance already seen; a finding is not closed until its defect CLASS is swept, not just its instance; trace the deliverable end-to-end before writing prose, because prose is about what a thing means rather than how it is obtained, and the sharpest blocker found was a spec whose deliverable was uncomputable from its own schema; read the consumer's bound invariants before touching its surface; and a semantics change invalidates every downstream coefficient. The rule keeps its own honest limit rather than dropping it: none of the ten fixes the deepest failure, naming a defect class and then committing it, which only the cross-model gate catches. Wired into the spec file-pattern row and the TEMPLATE promotion checklist, where the cross-model gate and the deliverable trace are the two with teeth. Same entry, the drift catch-up the mirror rule mandates: a drift check found human-binds-never-operates had been bound in the source project and never mirrored here, so it lands now with its own wiring. It is the boundary rule every gate checks first: the human is a designer and binder, never a runtime operator, no running stage asks a person to decide a per-item outcome, and the one sanctioned input to output-math is the design-time bind of a DERIVED value. Rule set drift is now zero.observability-instrumentation rule: observability is declared by construction. A mandatory declare-even-if-empty spec Observability slot (mirroring Dispatch / LLM call sites) makes the author state which spans and metric families the surface emits, so cardinality is a review-time decision, not a production discovery; a build gate then reconciles declared-vs-emitted families, lints label cardinality against the rule-of-100 (a run id or a raw path is never a metric label, it rides a span), checks the semantic-convention keys, and holds the refs-not-bodies line. Built from a broad OpenTelemetry pass on the principle that the project's own observability spec owns the measurement set, so the rule references it and never restates it, the design-tokens-single-source discipline applied to telemetry. New framework-mirror-to-scaffold rule, the structural fix for the pattern this changelog keeps recording: a change to how-we-engineer mirrors into the scaffold the same session, generified, carrying its INDEX / file-pattern / template / handbook wiring, and a drift check runs at every retro and audit, so a rule can no longer sit folder-only. Same entry, the drift catch-up that rule now prevents: traceability and web-sql-column-check had been added to the source project but never mirrored here, caught by the first drift check the new rule mandates.STATE.md existed it forked. The human corrected a row on the build branch, the correction never reached the design branch because the merge topology ran one way only, and the design agent then reconciled off a stale copy, re-opening a row the human had already closed and dropping a row it had never seen. Splitting state out of the log answered WHERE state lives; it never answered WHO may write a given row, or how two copies re-converge. Three rules added to handoff-log-state-split: the owner closes (only a row's owner mutates its status, since the owner is who holds the primary evidence; a non-owner audit writes a CLAIM into the evidence field and routes it, never flips; adopting a status the owner already recorded is a sync, not a close), anyone creates, only the owner mutates (the line is create vs mutate, not design vs build, because appends merge cleanly and status edits collide), and read the other tree's copy before writing your own. Two CI checks give them teeth: (d) this branch's STATE must contain every row id in the other tree's copy, catching the silent drop, and (e) any row whose status differs from the other copy must be owned by this branch's agent, catching the cross-owner close. Both compare against the other copy, so neither passes until the two are reconciled: syncing stops being something an agent remembers and becomes a precondition of committing. The generalisable lesson is the shape of the miss, not the fix: a rule was written, declared solved, and never tested against the topology it had to survive. The scaffold now embodies the split instead of only describing it, which it did not before: operating-model/ ships STATE.md + LOG.md + LOG-ARCHIVE.md + a worked EXAMPLE.md (the single HANDOFF.md is retired), and ci/gates/handoff-state-check.py exists at last, with all five checks and the CI wiring they need (fetch-depth: 2 for the archive diff, the other tree's ref for the anti-fork pair). Every surface that named the old file was swept: the constitution, the adoption guide, the three slash commands, the session-start hook, git-discipline, and four skills. Two pre-existing defects surfaced while verifying and were fixed in the same pass: no-direct-llm-sdk-check.py matched its own pattern strings and so failed on any clean repo, and two rules files broke the house em-dash gate. The scaffold now passes all seven of its own gates, which is the only claim of consistency worth making.ignore comment justified by a breakage a later bump had already disproven. New dependency-update-cadence rule: security-flagged updates triaged the next session, non-security batched on a fixed cadence, a staleness ceiling past which no PR sits without a recorded merge / hold-with-reason / close; a scheduled check surfaces the open queue so the decision happens on a clock, not at the next audit; majors ship with an equivalence harness in the same change (the pinned-lock plus HHEM score-equivalence battery is the reference), and a hold-with-reason expires when its reason does. Sits on top of cicd-supply-chain-hardening (which keeps the PRs coming) and reuses eval-guards-a-lesson for the equivalence gate.handoff-log-state-split rule: LOG.md is append-only conversation, archivable only as a verbatim date-cut move; STATE.md is the single home of open/done, every item carrying owner, gate, and an evidence field, with done unwritable without a cited SHA or applied-log line; decisions and bound facts keep their existing homes. A mechanical CI gate enforces all three invariants at commit time. Companion disciplines bound in the same incident window: no assertions about the other agent's tree state without the verifying command cited in the same entry, and every routed spec names its branch commit SHA so the reader verifies by content, never by asking.due-diligence-audit rule, distilled from a real full-project audit: two modes (Mode A conformance-vs-bound-specs with CONFORMS / DEVIATES / NOT-IMPLEMENTED / STRICTER-THAN-BOUND verdicts; Mode B the twelve-heading scored due-diligence with a production go/no-go), method invariants (literal code never claims, since comments and migration text claimed guards the call sites did not pass; parallel read-only domain agents with a synthesizer that re-verifies every headline finding first-hand; honest credit for what conforms), and the regression spine that makes audits compound: every later audit opens by re-verifying the prior audit's Criticals (a re-opened finding is BLOCK-class and leads the report), scores ratchet against the pinned baseline, findings route as goal-per-heading in the goal tree, and every closed finding ships the CI gate or test that keeps it closed. Cadence: launch gate, every release gate, after any serious incident; Mode A whenever a bound-amendment program ships. Same entry, the drift catch-up: feature-flag-lifecycle, output-grounding-verification, and implementer-questions-are-doc-bugs were added to the rules folder in earlier sessions but never listed here; the miss is itself the lesson this handbook's doc-drift-on-ship rule names, recorded rather than hidden.spec-lifecycle gains blueprint-before-a-large-or-novel-spec: a research-grounded pre-spec blueprint precedes the binding spec for a large / novel / research-dependent slice, so the shape and trade-offs are argued cheaply before a schema and a test list are committed (a small slice skips it). deep-modules gains turn the deletion test on your own proposals: the strongest over-build is the entity or abstraction you are about to author, so run the test on your own new module before presenting it, not only on existing code. threat-model gains SSRF as a first-class abuse case for any stage that fetches a web-discovered URL: scheme allow-list, deny the resolved internal / metadata IP re-checked per redirect hop, no internal egress from a headless render of untrusted pages, and stream-and-abort resource bounds. All three came from a real session where the gate review repeatedly caught what a first draft missed.resilience-engineering rule: degrade-don't-die patterns (timeouts, circuit breaker, bulkhead, load-shed, designed degraded modes, kill-switch, bounded jittered retry), extending queue-failure-handling from the async path to the in-request path. New infra-hardening rule: the running surface is least-privilege and pinned (non-root, digest-pinned scanned images, minimal runtime identity, remote+locked IaC state with plan-as-gate, federated short-lived deployer), the runtime counterpart to cicd-supply-chain-hardening. Two skills vendored and adapted: improve-codebase-architecture (deepen shallow modules) and grill-plan (stress-test a plan against existing bindings), rewired to the scaffold's rules and workflow rather than installed wholesale. This raised the bias: a strong, comprehensive scaffold over a minimal one, cherry-picking generously but adapting every import to the house conventions.deep-modules rule: depth over module count, the vocabulary (module / interface / depth / seam / adapter) and the heuristics (deletion test, interface-is-the-test-surface, one-adapter-is-hypothetical-two-make-it-real, no speculative abstraction for a single implementation). It is the concrete form of the principal-engineer simpler-shape test. decision-guards gains a three-criteria gate for when a decision earns a DECISIONS.md/ADR entry (hard to reverse AND surprising-without-context AND a real trade-off), keeping the log small so the markers stay forceful. Adopted as rules, not as vendored skills: the value is the heuristics and the artifact-discipline, and the interactive procedures already exist in our Explore agent + brainstorming + the gate reviewers; per plugin-and-skill-adoption, cherry-pick the idea, do not install wholesale.phase-aware-rigor-ladder: effort tiers (prototype / MVP / production) with a security floor constant at every tier and named promotion triggers. epistemic-discipline: verify environment claims from a tool run this turn, never invent flags / paths / APIs, mechanize anything checkable in a script. eval-guards-a-lesson: every lesson bound from a real miss ships the regression check that would have caught it, so it cannot silently regress. secret-rotation-lifecycle: zero-downtime rotation, KEK re-wrap, rotation as a gated action. data-protection-as-code: DSAR export, cascading erasure, job-enforced retention, DPIA. disaster-recovery: immutable tested backups (3-2-1-1-0), verified PITR, restore drills, named RTO/RPO. cicd-supply-chain-hardening: least-privilege permissions, digest-pinned actions, SBOM + provenance + signing, short-lived OIDC. leakage-guard: keep the portable core free of secrets and environment identifiers, enforced by a two-tier CI denylist. Stack-specific references from the source skill (GCP, Terraform, Apps Script, FastAPI, macOS) were deliberately not adopted; the scaffold stays agnostic.platform-findings-backstop rule: each platform emits its own security and quality findings (the code host's scanner, dependency and secret scanning, the database or host linter, the cloud security advisor) out of band from our CI, and we consume them as a standing backstop, triaged like the threat model, trust-boundary criticals escalated, never left unread; the discipline is the invariant, the tools are per-architecture, name your own platforms and do not inherit a vendor. New output-math-requires-binding rule: the build agent never introduces or changes output-affecting math (ranking / scoring formulas and weights, calibration, thresholds, filters, precedence) without a bound spec and a human bind, it proposes and hands off; the numbers a user reads are a bound decision, not a build-time edit. spec-lifecycle gains a checklist-honesty clause: a gate-checklist line is written only from a review that has run and returned, never pre-filled with an expected verdict, a BLOCK is resolved and re-run before any box is checked, and the BLOCK-then-resolved history is recorded not hidden.security-reviewer sub-agent owns the end-to-end boundary lens no other gate held (it is how an authenticated-dispatch envelope got dropped on a transport change and slipped five lenses); wired into the auto-chained pipeline for any security-relevant surface. New SECURITY-HARDENING.md: the standing security goals (authenticated boundaries, read-visibility separated from write-authority, definer-function hardening, call-site authZ, named staff predicate, secrets in the store, untrusted-input-stays-data, idempotency) every project's goal tree adopts. New no-fake-data rule and a wireframe-port-audit clause: live surfaces render real data with honest empty states, the wireframe is the visual target only; a ported sample value is a deviation. Build invariant 1 generalised: the signed envelope rides every dispatch into compute (queue or HTTP), and read-visibility never grants writes.WIP: checkpoints with a structured body (decisions, remaining work, rejected approaches), reconstructs session state from them on crash or resume, and filter-squashes them before the PR; local by default. From the gstack review.DEC-NN markers over a root DECISIONS.md (§3). doc-drift-on-ship, a ship reconciles the docs the diff drifted (§8). Auto-chained review pipeline at spec promotion (§3). Audit output discipline, zero-noise: confidence bar, exploit scenario, independent verification (§9). Retro cadence and template (§10): each participant answers independently, the confluence becomes new bound ways of working. Git bindings made explicit in §1: the build agent commits both sides, the human never touches git, closed nodes are immutable.The Project Agent Scaffold · v3.0 · recreated as the agnostic blueprint for a reusable three-function operating system. Names are placeholders; the disciplines are the deliverable. No em-dash used, per house style. This HTML is the blueprint; the folder is generated from it. MIT licensed, see LICENSE. Provided as is, without warranty of any kind: use at your own discretion and risk. Author: Martin Molenkamp.