Skip to content
Toolkit

003-extensibility — routine prompt

Paste the block below as the prompt of a recurring (hourly) Claude routine — or point a generic driver at this file (the CS-Hourly routine reads the front track's ROUTINE.md each run, so this file is the prompt and edits here take effect on the next firing). Each run advances the track by a batch of items, merging each as it lands. This is the 2026-08-24 revision: both start conditions are met (002's phase 02 tail merged; the Linkbio-kit fork draft recorded at .archives/removal-safe/references/linkbio/ .archives/removal-safe/references/linkbio/README.md), so the 2026-08-22 revision's phase gate is retired and the WORK shapes now cover phases 02–05 plus the track handoff. The protocol itself (batch loop, atomic claim refs, read/output budgets, verify-once, worktree rule) is unchanged — it was earned on 002's record and is not re-litigated.


Advance registry + extensibility (003) by a BATCH of items, then stop.

BATCH LOOP: repeat {claim → build → verify → PR → merge → update
SESSION.md} item by item — one item per PR (revertible slices), each fully
merged before the next is claimed. Continue until the FIRST of:
- 4 items landed this run;
- the next item is a phase-scale block (a whole phase, one product per PR
  notwithstanding) — do its first shippable slice as one item, then stop;
- the next item is blocked → one line in SESSION.md, stop;
- no unclaimed item remains, or remaining context is too small to land
  another item cleanly (never start what you cannot merge).
Read budgets are paid ONCE per run; between items re-read nothing — only
`git fetch` + the claim check for the next item.

KIT REFERENCE (the phase gate is retired — both start conditions are met):
the fork draft is .archives/removal-safe/references/linkbio/neue-linkbio-draft.zip;
its README carries the contents and the first-pass census evaluation.
Extract to a scratch directory to read; never into the repository, never
vendored, never imported. The upstream is a separate open-source system on
its own design system (Neue), published and maintained apart from Cardsite
(ADR-0031): schema gaps are FED BACK as rows in the session's gap list,
never patched into the snapshot. Inside Cardsite, --lb-* tokens alias to
Studio tokens via a bridge layer.

READ BUDGET (hard): read .station/jobs/003-extensibility/SESSION.md
from the top through the end of "Next", once per run, and stop there. Open
the charter, an ADR, catalogue.ts's registryNotes, or any 002 file only
when the claimed item names it. Trust SESSION.md's scoreboard line; once
the widened parity gate exists, phase 02's scoreboard is its closing
sentence (arms rendered by spec vs bespoke case — spec should only go
up); re-run a gate only after a diff that moves it. Re-deriving settled
context is the run's largest cost — spend it on the diff.

CI POLICY (settled — spend zero words on it): GitHub Actions here is
noise; the merge gate is local `npm run verify` exit 0, plus
`cd apps/api && go vet ./... && go test ./...` only if apps/api changed.
Green locally → merge the PR. Never re-run, mention, or "fix" Actions.
Canonical: ROADMAP.md "Standing policy".

CLAIM, THEN BUILD (002's protocol — the open-PR gate alone raced 8 times):
1. `git fetch origin` · list open PRs · `git ls-remote origin 'refs/heads/claim/*'`.
   - An open 003 PR exists → resume and land THAT PR as the batch's first
     item, then continue the loop.
   - Else take the top item under "Next" whose `claim/003-<item-slug>` ref
     is absent OR stale. Ref deletion returns 403 in the remote
     environment, so claim refs accumulate: a claim ref with no open PR
     and no branch commit newer than 3 hours is stale — treat it as free
     and re-claim over it. A slug SESSION.md's Completed already records
     is done, not in flight.
2. Claim atomically BEFORE writing any code:
     git push origin origin/main:refs/heads/claim/003-<item-slug>
   Rejected push = claimed between your list and your push → return to 1.
   Only a successful push is a claim; a SESSION.md line is not.
3. When your PR merges, attempt to delete branch and claim ref once; a
   403 is expected there, not a failure — move on.
Take ADR numbers only after `git fetch`, from origin/main's docs/decisions/.

WORK: fan out where the item is an enumeration, solo where it is not.
- Phase 02 runs in SESSION.md's working order: (a) verify each census-gap
  mapping against the extracted kit, recording the definitive gap list —
  a table, not a prototype; (b) shape packages/block-model per ADR-0030
  (descriptors + declarative layout as language-neutral JSON aligned to
  the kit's page.json — never a rival); (c) widen the block parity gate
  to "case OR render spec", watching it fail once on a broken input;
  (d) migrate declarative arms in enumerable slices, one PR each.
- Phase 03 is demonstrated end-to-end (a new block registered server-side
  appears and renders with zero apps/web changes), never asserted.
- Phases 04–05 per the charter; phase 05's deliverable is an ADR ("no
  plugin loader" is a legitimate result).
- TRACK HANDOFF: when every charter phase is closed and verified, the
  next run's single item is to charter the next PLANNED track from
  ROADMAP's table (004 → 005 → 006) under docs/guides/workstream.md —
  README, ROUTINE.md (inherit this protocol), SESSION.md — scoped
  from ROADMAP's track section and the named 001-renaissance plan; then
  mark 003 DONE on ROADMAP, and subsequent runs work the new track. When
  006 closes, drain ROADMAP's "Standing repairs" the same way; when those
  are done, report completion and recommend disabling the routine — do
  not invent scope.
Integrate and verify results yourself; never merge on an agent's word.
Any agent that writes ANYTHING runs in its own `git worktree`, never the
run's tree (an in-tree reviewer destroyed an uncommitted fix on 002); if
worktree tests resolve workspace packages, relink node_modules first — a
symlink into the run's tree reads the wrong files and false-passes.

VERIFY ONCE: while iterating, run only the touched tests
(`npx vitest run <files>`) or the one gate the item moves. Run
`npm run verify` exactly once, when the diff is final, immediately before
the PR; if it fails, fix and re-run — never as a baseline, progress
check, or "before and after".

RULES THAT STAND: migrations at the next free number with .down.sql,
applied manually, never renumbered; handler → repository → database
layering, no business logic in handlers; APIResponse envelope; breaking
API changes under /api/v2/, never in place; frontend uses Studio
primitives and tokens only — nothing new in components/ui, no raw
colours; product vocabulary from docs/GLOSSARY.md; no adjacent cleanup —
one SESSION.md row instead. ADR-0030 governs package shapes (identity
vocabularies = generated packages; runtime data = served endpoints; no
dynamic code loading). ADR-0031 governs the render spec: evaluate the
Linkbio kit's page.json schema and feed gaps back — never design a rival
spec, never hand-port the kit to React or Swift. Consequential product
calls (splash_page, the plugin model) become ADRs, never silent choices.

OUTPUT BUDGET (hard — the run's meaning is its diff, not its prose):
- New ADR only for a decision that constrains future work, ≤ 120 lines.
- SESSION.md Completed entries ≤ 8 lines, linking the ADR/PR.
- ≤ 3 new open-item rows per run, ≤ 3 lines each; a one-line fix in a
  file already touched is fixed, not recorded.
- PR body ≤ 20 lines. Final report: one line per item landed (item, merge
  commit, scoreboard before → after) + one line for what is next.

Close out per item: SESSION.md Completed entry + refresh "Next"; tick
ROADMAP.md's 003 row only when verification proved it. Conventional
Commit, PR to main, merge on local green.

Shape notes

  • Inherits 002's converged protocol wholesale. The batch loop, the atomic claim ref, the stale-claim rule, the read/output budgets, the verify-once rule and the worktree rule were each earned by a recorded failure on 002 (duplicates #49–#55, #90/#91, #93/#94; the destroyed fix; runs re-reading a 330-line file hourly). 003 starts with them instead of re-deriving them. See 002's ROUTINE.md shape notes for the full history — not restated here.
  • The start gate became a phase gate. The charter's two start conditions were written as both-required for the track; condition 1 (002's phase 02 tail) is met and verified, and by the charter's own phase table the Linkbio kit is consumed by phase 02 and nothing earlier. So the routine starts phases 00–01 now and stands down at the phase-02 boundary until SESSION.md records the fork. If the owner wants the stricter original gate back, restore the 2026-08-20 revision's stand-down paragraph — that is the only change of substance.
  • The scoreboard is check:catalogue's own closing sentence ("N products still declared rather than derived", 15 at baseline) — derived from source like 002's parity line, so it cannot drift from reality, and "before → after" in the report makes each run's contribution visible.
  • Fan-out is default here where it was opt-in on 002 because phases 00 and 01 are 15 and 85 genuinely independent units; the worktree rule is what makes that safe.
  • The 002 fallback keeps the hour useful: when 003's top item is blocked, one 002 LEDGER-drain item (under 002's rules, including its claim namespace) beats an empty run — 002's LEDGER still holds open rows.
  • 2026-08-24 revision (fork received — session entry): the phase gate is retired, not loosened — both start conditions are met and recorded, so there is nothing left for it to gate. The WORK shapes turned over from the closed phases (00 registry, 01 census) to 02–05, and gained the track-handoff rule so the routine survives 003's own completion: chartering the next track is itself one item under the same protocol, and the routine's end state is an explicit "recommend disabling", never silent scope invention. The CS-Hourly trigger now carries a thin driver that reads ROADMAP's front track and follows that track's ROUTINE.md — so this file is the live prompt and edits here take effect on the next firing without touching the trigger.

Source: .station/jobs/003-extensibility/ROUTINE.md

Library