Wiki · Research
Pattern catalog
Shelf
Research

Pattern catalog

The canonical definition of every extracted pattern. Written 2026-08-14 from repos/ and synthesis.md. Per-repo files cite these ids; they do not restate them (CLAUDE.md — one definition per concept).

Rung = maturity rung from synthesis §5. Module = the proposed CLI module, specified in Phase 4. Workflow sources: AM axiom-mesh · HG hexguard · HT hexguard-templates · RF rift-forge. Public-framework sources, pinned through frameworks/synthesis.md: SW SWE-agent · LG LangGraph · OA OpenAI Agents SDK · PA Pydantic AI · MF Microsoft Agent Framework · OH OpenHands.


A. Instructions & routing → module instructions

idPatternSrcRung
entry-pointOne canonical agent-instruction file: identity · non-negotiables · repo map · routing. Everything else links to it4/40
agents-md-bridgeThin AGENTS.md (~25 lines) pointing at the canonical file, stating why it does not duplicate, and naming the tie-breakerRF0
scoped-instructionsSplit instructions into path-scoped files with description: (“Use when…”) + applyTo: glob frontmatter. Routing lives in the instructionHGHT2
core-size-budgetThe always-loaded core has a declared line budget; overflow routes to a scoped guidenone — RF counter-example at 15132
validation-matrixChange-surface → exact commands, in the always-loaded file. Kills both “run everything” and “run the wrong subset”HGRFAM0
repo-mapWhere things live, in the entry doc — generated from the workspace, not hand-listed (generate-derivable)4/40
narrowest-anchor-loopanchor (file/symbol/failing test) → scoped instruction → smallest change → narrowest validation → docsHG, SW0
isolation-boundary-declarationState where agent commands run, the unit isolated, which filesystem/environment/credential/network surfaces cross it, and which resource or rollback controls are absent. A worktree is Git coordination, not a sandboxOH0
negative-conventionsProhibitions stated as strongly as prescriptions, each with the evidence threshold that would reverse itHGHTRF0
comms-styleOpt-in anti-sycophancy block: contradict me, challenge assumptions, no “Great idea!”AM0
vocabulary-tableDomain glossary as a routed doc with an owner — not inline in the entry fileAM (location is the correction)1

B. Work tracking → module backlog

idPatternSrcRung
work-item-lifecycleStable WI-### + 8 statuses (proposed→accepted/rejected/deferred→planned→in_progress→review→done) + the propose→decide→plan→execute→review workflowRF1
item-template-required-fieldsFrontmatter + sections that may not be left blank or deleted: rationale, decision, requirements, impacts, acceptance criteria, out-of-scope, and any gating verdict (“none, because…”). A blank line is an unfinished planRF1
branch-per-itemfeature/{id} off the integration branch, chore/ docs/ spike/ variants; delete on mergeRF1
planning-rides-trunkProposals/decisions/plans land on the integration branch; only code needs a branchRF1
scope-disciplineNever scope-creep an item; follow-ups become new itemsRFHT1
epics-and-subitemsParent/child links, both directionsRF2
sprint-archiveClosing a sprint archives it with its items; links recomputed repo-wide; ids stay permanently spent; archived items are never editedRF2
backlog-spacesSplit the board by stack/domain when a monorepo carries more than oneHG2
milestone-overlayM## + mandatory T1 planning task + exit criteria, for long sequenced programmes. Optional overlay on work itemsAM2

C. Problems noticed → module findings

idPatternSrcRung
findings-logF-### register: severity · priority · evidence · when to act · how to fix · blockers. A finding is the observation; a work item is the decisionRF1
record-without-derailingAn invocable path to record an out-of-scope observation mid-task at near-zero cost, then continueRF1
finding-promotionExplicit triage: promote → work item · fix → mark · dismiss → with a written reasonRF1
defect-register-splitSeparate registers for code diverges from standard (AD-###) and the standard is missing/contradictory (DF-###) — different resolvers. Scale-onlyAM4
inline-gap-calloutAn open design gap gets a > ⚠️ Known gap [DF-NNN] callout in every affected doc, removed on resolution. An incomplete callout set is itself a gapAM4
audit-to-registerAn audit’s output is rows in a register, never a document per subject(HG counter-example: 268 docs)2

D. Decisions & specs → modules adr, specs

idPatternSrcRung
adr-recordNumbered, indexed, immutable decision recordsAMRFHG1
adr-admission-ruleN criteria, all must hold, applied before creation; otherwise the content belongs in an authoritative docAM2
spec-ids-and-status<PREFIX>-F## / <PREFIX>-US-###, referenced from commits/PRs/plans; status per story (✅ 🟡 ⬜), not per fileHTRF2
mandatory-scope-sectionEvery spec states out-of-scope, “so agents don’t silently expand a surface while implementing an unrelated story”HTRFAM1
demo-not-doneA showcase/partial implementation is 🟡 with a note, never ✅. A spec that overclaims integration is worse than no specHT2
split-thresholdSplit a doc only past ~N lines — don’t pre-splitHT1
reference-implementation-pointerName the directory that demonstrates the correct pattern; cheaper than prose and cannot drift from codeHT0
adoption-guideYours-to-change vs. platform-owned, for any repo meant to be started fromHT2

E. Document authority → module doc-authority

idPatternSrcRung
doc-ownership-registryTable: topic · authoritative doc · must NOT appear in. The arbiter, consulted before writingAM4
scope-headersEvery doc opens with Authoritative for: / Not authoritative for:AM4
stub-ruleA stub may contain only scope headers and cross-references until explicitly promotedAM4
no-paraphraseReference, never restate — “a doc that paraphrases rather than references will drift; paraphrase is not permitted”AM4
no-redirect-stubsA file that exists only to say “go elsewhere” is a bug. Delete it and repoint the citers(AM counter-example: 4 warnings for one stub)4

F. Decision procedures → module workflows

idPatternSrcRung
reuse-decision-tablePer concern: use-as-is · extend-local · extend-upstream · hand-roll — each with criteria and where the work landsHT2
second-consumer-thresholdHand-roll once; extract on the second consumer. The negative form stated too: do not build a second local copyHTHG2
doc-tier-selectionTier 0 (no doc) / Tier 1 (light plan) / Tier 2 (heavy proposal) with bump triggers. “Use this table instead of ‘use judgment’.” Tier 0 must existHT2
per-concern-decompositionThe decide loop runs per concern, not per storyHT2
multi-story-batchingRun decomposition across a whole slice first → one combined concern table, so shared concerns are caught onceHT3
numbered-workflow-stepsNumber the steps so other documents cite “Step 4” instead of restating the reasoningHT2
phase-checklistOrdered mandatory phases for repeated creation work, ending in an assessment gateHG2
lifecycle-verbsfind → plan → assess (or equivalent), one invocable entry point eachHG2
controlled-performance-comparisonBaseline command/ref/count/environment recorded before; contamination noted; “passing tests proves correctness, not a speedup”; if uncontended comparison is impossible the criterion stays openRF3
protocol-with-escape-hatchA deliberately small abstraction names the protocol, callback, adapter, or capability check through which non-owned cases extend it. Minimalism without an escape hatch is a closed assumptionOA, PA2
replay-safe-side-effectEvery resumable procedure names the durable boundary, what may re-execute after it, and whether pre-boundary effects are idempotent, separately recorded, or explicitly ambiguous. Persistence alone is not replay safetyLG, PA, OH3
resumable-approval-stateA pending decision is durable state with stable request identity, validated arguments, an explicit response path, and enough continuation state to resume. UI and authority may stay host-ownedOA, PA, MF, LG2
approval-bound-to-requestApproval binds server-side to the exact immutable action id and arguments that were surfaced, records the authorized decision, and is consumed once. A caller-supplied boolean is not the bindingMF (OH counter-example)2
explicit-output-designationInternal progress becomes caller-facing output only through an allow-list; graph connectivity, tool visibility, or event emission must not decide disclosure by accidentMF2

G. Invocation → module skills

idPatternSrcRung
invocable-procedureEvery procedure document ships its entry point in the same change. A workflow with no invocation surface does not runRFHG2
skill-neighboursEvery skill names adjacent skills and the boundary between them, including whether routing transfers continuation ownership or returns a result. Fixes plausible-but-wrong skill runs to completionRF, OA3
agent-facing-interfaceDesign action schema, state exposure, observations, empty output, truncation, and errors as one interface the agent can reason about; each failure returns a bounded model-visible shapeSW2
bounded-agent-loopEvery agentic invocation declares iteration, cost, time, context, and retry bounds that apply, plus the terminal artifact/status produced when each bound fires. “Until done” is not a procedureSW, PA, OH2
ownership-changing-handoffA composed invocation declares who owns continuation, which state crosses, what the callee may mutate, and whether its result returns to the caller. Tool-shaped syntax does not settle those semanticsOA, MF2
prompt-writes-artifactEvery invocation lands durable progress in a known directory, at the recovery boundary rather than only after successful completion. What makes a prompt library compound instead of evaporatingHG, RF, HT, SW2
operating-skillsSkills for running the product — release, external-data ingest, inbound triage, design sync — not only for building itRF3
prompt-index-routingA “suggested starting points” decision list, not just an alphabetical file listingAM2
external-reasoning-promptA playbook for briefing a model that has no repo accessAM2
model-selection-promptA playbook for choosing model tier per task shapeAM2

H. Enforcement → module gates

idPatternSrcRung
instruction-hardeningA mistake an instruction could have prevented is a defect in the instruction. Repair it in the same change, unprompted. Trigger on shapes, not introspection. 4-rung ladder: sentence at point of use → skill row → declared cross-cutting rule → gate/hook. If the rule already existed and you broke it anyway, make it mechanicalRF3
working-rule-propagationDeclare each cross-cutting rule with the surfaces that restate it; check that engaged surfaces carry current vocabulary and not the retired instruction. Fix the authority first, then the citers. A citation is not propagationRF4
gate-self-testEvery gate has a self-test over fixtures. A gate whose rules are all satisfied is indistinguishable from a gate that matches nothingRF3
read-the-negationMatch forbids patterns against a preceding-context negation window. A guard that also refuses its own fix is one people disableRF3
reasoned-exemptionExemption markers are ignored unless they state a reason. An escape hatch nobody has to justify is an off switchRF3
computed-claimsA number a machine can compute is never typed by a human — gate + autofix. Probe only what the data settles without judgement; pin what the gate does not cover, so green never reads as “verified”RF3
generate-derivableGenerate what the filesystem already knows (repo maps, indexes, coverage), and gate that the generated file is current. A green check means “not yet regenerated”, never “current”RFHG2
structural-gatesNear-free tier-1 checks, on by default: links resolve · ids unique · required sections present · referenced paths existAMRF1
typed-output-gateTurn probabilistic output into a typed structural boundary: invalid shape becomes an explicit retry or terminal error. A well-typed value is not thereby true; semantic validation is a separate gatePA1
bookkeeping-gatesStatus checked against git: no doc waiting on finished work · no merged branch in a pre-review status. One-directional, with reasoned escapes, vocabulary narrowed after measuring false positivesRF3
tool-level-hookPreToolUse guard for traps prose has already failed to prevent (shell backticks). Must assert both directionsRF3
ageing-signalAny known-broken-is-non-blocking affordance ships an ageing signal, or the mitigation extends the outage(RF counter-example: 11/15 CI runs red)3
enforcement-declarationEvery generated rule is tagged gated or review-only. No silent third category(F1, unanimous)1

I. Concurrency → module concurrency

Entry threshold: ~5+ concurrent sessions on one integration branch. Below that this is overhead.

idPatternSrc
green-refCut branches from the last verified merge, not the tip; fall back to the tip and say soRF
failure-attributionRe-run failing gates against the merge base; report inherited (stated, non-blocking) vs INTRODUCED (blocks); unattributable blocks. A gate red for reasons you cannot fix is a gate you learn to bypassRF
land-protocolMerge → verify the merged tree on a scratch ref → fast-forward by compare-and-swap. Never git merge by hand. The integration branch cannot go red from an unverified mergeRF
lock-not-checkoutExclusion via an atomic lock naming its holder and start time, taken over if the holder died. Never by holding the integration branch checked outRF
no-pre-land-full-verify--fast constantly, full verify at the boundary only. A pre-land full run widens the window the merge conflicts in — 3 of 5 lands refusedRF
preflightPredict conflicts by file overlap, not commit countRF
conflict-classesledger (driver merges counters) · generated (driver refuses, prints the regenerate command) · shared code (scheduling, not tooling — one owner at a time)RF
regenerate-never-mergeReconcile generated artifacts by taking one side and re-running the producer; re-pin what moved, with the reason at the pinRF
id-claimingScan every ref, every ref name, and every worktree’s live docs including uncommitted files; claim on your own branchRF
worktree-lifecycleReport finished worktrees; never remove someone else’s; add ageing. Worktrees isolate checkout/index/branch state, not processes, the wider filesystem, credentials, or networkRF, OH
ci-at-land-timeTrigger CI on the merged scratch ref, not per item-branch push. State the arithmetic (~19 billed min/run × N sessions)RF

J. Release & external sync → modules release, design-sync, ci

idPatternSrcRung
candidate-and-release-linescandidate/<version> integrates the next release; main is stable; a long-lived release/<version> deploys and rolls backRF3
release-skillOne invocable path for gates → version bump → changelog → tag → deploy branch → next candidate, plus hotfix and rollbackRF3
external-authority-precedenceAn external source of truth is named, routed to, and bounded: which decisions it owns and which the repo’s constraints overrideHTRF3
two-way-design-syncPull the external design system down; route every delta to a backlog item, a phase-gated future item, or an upstream change request. Never silent divergenceRF4
matrix-not-per-item-ciPer-item CI config is a matrix entry, never a file per item(HG counter-example: 98 workflows)1
workflow-proliferation-checkGate the count of near-identical CI files(HG counter-example)2

K. Session continuity → module session

idPatternSrcRung
session-handoffFixed-section narrative state: objectives · in progress · resume from · up next · active constraints · working assumptions · open questions · archive refs. It is not a machine checkpoint, event log, or conversation-memory storeAM (SW, LG, OA, PA, MF boundary evidence)1
settled-decisions-lockAn explicit “do not reopen X during Y unless re-planned” list, so a fresh session cannot relitigate settled questionsAM1
dated-session-archiveYYYY-MM-DD_session-NN_<what-closed>-and-<what-is-next>.mdAM2
board-as-stateOr: derive session state from the work-item board instead of a hand-written file (the rift-forge alternative — cheaper, less narrative)RF1
event-stream-not-audit-logEvents, spans, and persisted history are audit inputs, not accountability. Call out durability, retention, access control, actor identity, request binding, and decision reasons separatelyMF, OH1

L. Engineering practice (non-agentic, but extracted) → module testing

idPatternSrcRung
contract-test-baseFake and real implementations share one abstract <Interface>ContractTests base carrying all test methods; concrete subclasses wire each implementation. Add separately named real-boundary evidence for behavior a deterministic substitute cannot prove. Testing a fake in isolation is a violationAM, PA2
deterministic-model-substitutionInject a scripted/deterministic decision source to make loop branches and state transitions exact; pair it with separate provider/transport evidence and state the fake’s claim boundaryPA2
golden-testsTests pinned against an external ground truth, never weakened; changes to them are a documented eventRF2
shell-editing-rulesScript files, not -e strings; && not ; when a later step consumes an earlier one. A control that cannot fail loudly is not a controlRF1

Proposed module set (input to Phase 4)

ModuleDepends onRungPatterns
instructions0§A
session1§K
backloginstructions1§B
findingsbacklog1§C
adr1§D (adr-*)
specs2§D (spec-*)
workflowsinstructions2§F
skillsworkflows2§G
gatesinstructions1→3§H (tiered)
doc-authoritygates4§E
cigates1§J (ci-*)
releasebacklog, ci3§J (release-*)
concurrencybacklog, gates, ci5§I
design-syncbacklog, skills3§J (design-*)
testing2§L

Declared dependency chains that exist because a repo violated them: audit → findings → backlog (HG’s 268 unactioned reports) · workflows → skills (HT’s uninvocable 9-step workflow) · doc-authority → gates (AM’s uncheckable non-negotiables).