Operating standard / BP-01

Build specs that survive zero questions.

The permanent packet format for headless AI builder sessions. One slice, one bounded contract, every dependency named, every outcome provable.

7sections
5AC max
0questions
01

Why this exists

Specs used to be written for humans who could stop, inspect, and ask a clarifying question. A headless builder cannot. Each ambiguity forces an exploration loop, burns context, and introduces a decision the spec writer should have made.

A build packet turns a slice into a closed execution contract: the model knows where it starts, what it may touch, what done means, how to prove it, and when to stop.
02

The six sections

Keep this order. The builder gets orientation before implementation, constraints before improvisation, and proof before polish.

01

Starting state

State the branch name, worktree path, base branch, and the exact prior slices already present. Record what may be assumed, not what is probably there.

branch + worktree + base + landed dependencies
02

File map

Resolve every named module, component, pattern, fixture, and command to an exact path. Never write "the existing auth module" when a path can remove the search.

Every noun resolves to a path or command.
03

Acceptance criteria

Use no more than five numbered criteria. Each one states what to build, where it belongs, and the exact verification command. The final criterion is always the mechanical definition of done.

Final AC: clean tree + pushed branch + green tests.
04

Non-goals

Name what the slice must not touch, build, migrate, or refactor. Every packet also carries the permanent no-deletion rule so "adapt" cannot be misread as replacement.

Old behavior stays working. Old files stay present.
05

Escalation triggers

Define the conditions that stop execution. Use direct language: if X fails, stop and report. Do not improvise around missing access, conflicting state, or broken prerequisites.

Failure path decided before the session starts.
06

Quality bar

State the standing product rules once per spec document. Slices inherit them without repeating the same design paragraph in every task.

DensityCompact, OpenSea-like, no puffy padding.
Type12/14/16/18/20/24 scale. Mono and tabular numbers for data.
Feedback100 ms response, mousedown dropdowns, box-shadow focus rings.
AI lawCmd+K everywhere. AI inline at the moment of need, subtle and uninterrupted.
Write once per spec doc. Apply to every slice.
03

What slows builders down

Most wasted model time begins before the session. These patterns convert a bounded build into a scavenger hunt.

x
Vague acceptance criteria

"Polish the page" cannot be verified and pushes product judgment into the builder loop.

x
Buried requirements

Must-haves hidden in context paragraphs get skimmed, missed, and rediscovered in review.

x
Missing non-goals

The model expands scope, refactors neighbors, or invents adjacent improvements.

x
Missing starting state

The builder spends its first loop locating the branch, worktree, and prior dependencies.

x
Contradictory instructions

Two competing rules force the model to guess which one carries authority.

x
Prose-heavy specifications

Requirements disappear inside narrative instead of appearing as numbered contracts.

04

Worked mini-example

A small slice, written as a complete packet. The implementation is simple. The precision is the point.

BP-EXAMPLE-01 / command palette empty state
01Starting state
Branch
feat/k2-command-empty-state
Worktree
~/workspace/delta-k2
Base
origin/main @ 2f6d21d
Assume
K1 shell and command palette trigger are merged. CommandMenu opens from Cmd+K.
Preflight
pnpm playwright test tests/e2e/command-menu.spec.ts --grep "opens with Cmd+K"
02File map
Shell
src/app/(app)/layout.tsx
Global nav
src/components/shell/global-nav.tsx
Palette trigger
src/components/command/command-trigger.tsx
Command menu
src/components/command/command-menu.tsx
Empty state
src/components/command/command-empty.tsx
Inline composer
src/components/ai/inline-composer.tsx
Result ranker
src/lib/command/rank-results.ts
Shortcut registry
src/lib/keyboard/register-shortcuts.ts
Shared primitive
src/components/ui/command.tsx
Empty test
src/components/command/command-empty.test.tsx
Menu test
src/components/command/command-menu.test.tsx
E2E spec
tests/e2e/command-menu.spec.ts
Tokens
src/styles/tokens.css
03Acceptance criteria
  1. Create command-empty.tsx. When a non-empty query has zero matches, render the query, one "Ask Freddy" action, and the Esc hint.pnpm vitest run src/components/command/command-empty.test.tsx
  2. Wire the empty state into command-menu.tsx. Preserve the ranked result order produced by rank-results.ts for every non-empty result set.pnpm vitest run src/components/command/command-menu.test.tsx --testNamePattern "empty state|ranked results"
  3. On mousedown, "Ask Freddy" preserves the typed query and opens the inline composer within 100 ms.pnpm playwright test tests/e2e/command-menu.spec.ts --grep "empty state"
  4. Definition of done: all tests are green, git status --porcelain returns no output, and the branch is pushed to origin.pnpm test && test -z "$(git status --porcelain)" && git fetch origin && test "$(git rev-parse HEAD)" = "$(git rev-parse @{upstream})"
04Non-goals
  • Do not change command ranking, keyboard shortcut registration, or global navigation.
  • Do not add a new AI route, provider, migration, or analytics event.
  • Do not refactor shared command primitives.
  • Do not delete existing routes, components, or handlers. Adaptation means the old behavior keeps working, not that the old file disappears.
05Escalation triggers
  • If Cmd+K does not open on the starting commit, stop and report the failing test output. Do not repair K1.
  • If no existing inline composer accepts a seed query, stop and report the missing interface. Do not create a second composer.
  • If the referenced paths differ, stop and list the observed paths. Do not relocate files.
06Quality bar
compact density12/14/16/18/20/24mono data100 ms feedbackmousedownbox-shadow focusinline AI
05

Hard Rules From the Field

The k2 slice proved that important instructions fail when they live only in the prompt introduction or rely on a builder's interpretation. These rules now belong inside the numbered contract.

01

Done must be an acceptance criterion

The final numbered AC verifies delivery state, not just implementation. "Commit when done" in the introduction is not sufficient.

git status --porcelain = empty
branch pushed
all tests green
02

Adaptation never authorizes deletion

Every NON-GOALS section must carry the no-deletion sentence verbatim. Existing behavior survives the change, and the existing file does not disappear by implication.

Do not delete existing routes, components, or handlers.
03

Deletion gets an explicit merge check

The verifier reviews deleted files before any merge. A green test suite cannot prove that a route, component, or handler was not removed unnecessarily.

git diff --diff-filter=D --name-status origin/main...HEAD
K2 INCIDENT / 2026-10-06 worked example
OBSERVEDImplementation landed in an unverifiable state
Delivery gap
The builder left work uncommitted with three failing tests.
Deletion gap
Two route files were deleted after "adapt the route handler" was read as permission to replace them.
CAUSEThe rules were present, but not contractual
Commit rule
"Commit when done" appeared in prompt prose, not as a numbered AC with a command.
Adapt rule
The NON-GOALS section did not explicitly protect existing routes, components, and handlers from deletion.
FIXMove both protections into mechanical gates
  1. The last AC proves green tests, an empty git status --porcelain, and a pushed branch.
  2. NON-GOALS always says: "do not delete existing routes, components, or handlers. Adaptation means the old behavior keeps working, not that the old file disappears."
  3. The verifier runs a deletion-focused diff before merge and investigates every removed file.
06

Checklist for the spec writer

Freddy runs this pre-flight before a packet reaches any builder. A failed check sends the packet back to drafting.

01
Starting state is pinnedBranch, worktree, base, and prior slices are explicit.
02
Every path resolvesAll referenced files and directories exist at handoff.
03
Every AC has proofEach criterion includes one exact verification command.
04
Acceptance stays boundedFive criteria maximum, numbered and mechanical.
05
Non-goals are namedAdjacent systems and tempting refactors are protected.
06
Stop conditions are concreteFailures that require escalation cannot invite improvisation.
07
Instructions agreeNo requirement conflicts with the quality bar or another AC.
08
Text is cleanASCII-only. No em dashes. No hidden requirements in prose.
09
Verifier checks deletionsDeleted routes, components, and handlers are reviewed explicitly before any merge.
10
Final AC defines doneClean tree, pushed branch, and green tests are mechanically proven.
07

The Flywheel: Lessons Are Never Ignored

This framework improves itself after every single build. The loop is automatic and mandatory, wired into the roster skills so recorded lessons are never optional follow-up work.

The flywheel rule A lesson that is not recorded is a lesson that will be paid for again. The pipeline does not close until the flywheel step is done.
roster-builderCaptures session-end lessons in run.log after every slice.
roster-mergerRuns the flywheel step after every merge and blocks closure until verification passes.
01 / CAPTUREAsk what surprised the run

After every slice lands, ask: "did anything unexpected happen?" Capture every escalation, misread spec, new failure mode, and tool quirk. Nothing is too small.

02 / RECORDMake the lesson durable

In the same run, write a dated standing rule to ~/AGENTS.md Lessons: what happened, the fix, and the rule that prevents a repeat.

03 / SHARPENChange the packet when needed

If the lesson changes how specs get written, edit this framework in the same run. Add the hard rule, sharpen the trigger, or define the new AC shape, then republish to the branded URL.

04 / VERIFYProve the loop closed

Confirm the lesson exists in ~/AGENTS.md, this framework returns 200 at its URL, and the merge report names the lesson.

Worked example 01 / k2 escalation

Escalation becomes adjudication, then a better relaunch

  1. Verify: inspect the reported failure, current diff, tests, and protected behavior before accepting the builder's interpretation.
  2. Decide: adjudicate the ambiguity explicitly. Name what stays, what changes, and which condition stops the run.
  3. Write into spec: convert the decision into a numbered AC, non-goal, or escalation trigger with a mechanical check.
  4. Relaunch: send the corrected packet back through the builder, then verify the same conditions at merge.
Worked example 02 / k2 commit + adapt

Instructions become verifiable gates

  1. Capture: k2 ended uncommitted with three failing tests, and "adapt" was read as permission to delete two route files.
  2. Record: the standing lesson says "commit when done" must be a verifiable AC, and "adapt" never means "delete."
  3. Sharpen: the final AC now proves green tests, a clean tree, and a pushed branch. NON-GOALS protects existing routes, components, and handlers.
  4. Verify: run the delivery-state commands and deletion-focused diff, confirm the rule in ~/AGENTS.md, confirm the framework URL returns 200, and name the lesson in the merge report.
Ready means executable, not understandable.

If a builder still needs judgment to discover the task, keep writing.

Back to top