# SPECIALIZE — how the generic kit becomes project-specific

Every document in this kit is **generic** and hard-codes no project or domain value. They are specialized **at read time**: Claude examines the project `CLAUDE.md` and binds every placeholder and every "per `CLAUDE.md`" reference to the project's value. You do **not** rewrite the generic documents per project — only `CLAUDE.md` changes.

## The rule

1. **`CLAUDE.md` is the single source of project specifics.** At the start of any session, Claude reads `CLAUDE.md` (plus `PROGRESS.md` + `LESSONS.md`) and builds a placeholder→value binding from it.
2. **Bind, don't invent.** Every `<…>` token and every "per `CLAUDE.md`" phrase in the agents, commands, Constitution, and templates resolves to the corresponding `CLAUDE.md` value. If a needed value is missing or ambiguous in `CLAUDE.md`, **STOP-and-ask** — never guess a project value.
3. **The generic docs are read-only templates.** They are not edited per project. The only artifacts physically filled per project are: `CLAUDE.md` itself (filled once at bootstrap), and the two boards `docs/SCREEN_REGISTRY.md` + `docs/WORKFLOW_REGISTRY.md`, which Claude *generates* from `CLAUDE.md` + the specs following the generation contract at the top of each.

## Placeholder glossary — where each value lives in `CLAUDE.md`

| Placeholder / reference | Bound from `CLAUDE.md` |
|---|---|
| `<App>` and project names (`<App>.Host`, `.DesignSystem`, `.Contracts`, `.SharedKernel`, `.Infrastructure`, `<App>.<Module>`) | §1 What this project is · §4 Topology |
| The pinned **stack** (orchestration, UI framework, data stores, mediator/CQRS lib, validation, search, identity, integration, AI, test) | §3 Tech stack |
| `<ds-prefix>` (design-system class prefix), the stylesheet, the component library, tokens, page scaffolds, voice, hard prohibitions | §5 Design system |
| `<proto-prefix>` (prototype framework class prefix), the prototype location, entry point, reference page, reconstruction-workflow doc, screenshot caveats | §2 The prototype |
| The **design loop**: design-backlog + design-prompts board paths, the prototype file pattern, entry-point wiring anchor + route/step resolver, the sidecar convention, the **lane-routing rule** (in-repo `/design-build` vs console + `/promote-design`), the sign-off policy, and contract-graduation opt-outs | §2 The prototype (design-loop bindings) |
| `<MODULE_CODE>` and the module map / build phases | §4 Module map |
| Naming grammar (`FR-` / `BR-` / `EVT-` / `PERM-` / `WF-`) | §4 |
| The keystone component, continuity invariants, priority journeys (`J-…`) | §6 Continuity |
| Domain compliance & safety — identity-safety confirmation, audit (header + diff), RBAC, break-the-glass, config-console gating, AI governance, irreversible-action safety, NFR targets | §7 Compliance & cross-cutting |
| `<graph-project-id>` (the code-discovery graph project id) + whether a code-discovery graph MCP is configured at all | §0 Working cadence (graph-first discovery — optional) |
| Session-ledger bindings — runs/journal/STATUS paths, heartbeat staleness, claim scopes (+ `.claude/session-ledger.config.json`) | §0 Working cadence (session ledger — optional) |

| Metrics dir + retry-graduation threshold (item C1) | §0 Working cadence (quantitative memory) |
| Contracts surface snapshot path + regeneration policy (item A3) | §0 Working cadence (Contracts surface) |

## Stack note

This kit is a **modular-monolith enterprise method**; its reference stack (used in the Constitution and agents for concrete examples) is **.NET / Blazor** — CQRS via a mediator with pipeline behaviours, EF with per-module schemas, a design-system component library, architecture/boundary tests. The agent mechanics describe that reference pattern. If your `CLAUDE.md` §3 pins a **different** stack, read those mechanics as the pattern to adapt (the *roles, gates, contracts, and orchestration are stack-independent*; only the concrete APIs change). Bind all stack-specific names from `CLAUDE.md`.

## Optional capability — session ledger (multi-session coordination)

The kit ships an opt-in **session ledger** (`templates/session-ledger.js` + `SESSION_SETUP.md`): one
cross-platform Node implementation behind Claude Code hooks that gives every session a `RUN_STATE`
shard, captures asks, warns about concurrent sessions' write-claims (Law 3), demands the end-of-session
story once (Law 11), always leaves a mechanical envelope in the dated journal, and derives
`docs/STATUS.md` from rows + corpus + git. Feature-detected: hooks not wired, or `node` absent → the
guard launchers exit 0 and nothing changes. Bindings are materialized once into
`.claude/session-ledger.config.json` (the script cannot parse `CLAUDE.md` prose).

## Optional capability — code-discovery graph (codebase-memory-mcp)

The kit's audit/spec/build agents are pre-wired with the **read** tools of a code-discovery graph MCP (`codebase-memory-mcp`) and a "Graph-first discovery" note that binds the graph project id from `CLAUDE.md §0`. This is an **optional capability**: if the project does not configure such an MCP server, the listed `mcp__codebase-memory-mcp__*` tools are simply absent and every agent falls back to Grep/Glob/Read — no behaviour is lost. To enable it, install the MCP server, index the repo, fill `<graph-project-id>` (and keep the graph-first bullet) in `CLAUDE.md §0`, and seed `.cbmignore` (the kit ships a generic template, installed to the repo root). The index-mutating tools (`index_repository`/`delete_project`) are deliberately **not** granted to any subagent — re-indexing is the orchestrator's single-writer duty and a mandatory closure step of every sweep/wave fold-in (never deferred, so the graph never lags the main branch).

## Session-start procedure (Claude)

1. Read `CLAUDE.md`, `PROGRESS.md`, `LESSONS.md`.
2. Build the placeholder→value binding from the glossary above.
3. When acting on any kit document, apply the binding — treat every `<…>` and "per `CLAUDE.md`" reference as its bound value.
4. If a required value is missing from `CLAUDE.md`, surface it (don't invent). When a discovered fact is durable, record it (`INSIGHTS.md`) and, if broadly useful, graduate it into a `CLAUDE.md` rule.
