Slice and Spine Review
A human-led whole-repo coherence pass with an agentic prep sidecar. Individual
changes can each pass sliced-bread-review, sliced-bread-depth, and
sliced-bread-audit while the seams between slices and the spine accrete
leaky or duplicated logic no bounded-diff check ever sees. This skill
inventories the repo, fans out digests, then walks every seam with a human in
the loop.
Invocation
/slice-and-spine-review [scope: slice names | seam ids | full]
Default scope is full. A named scope (slice names or seam ids) limits
Phase 2's walk and Phase 3's spine visit to the matching seams and use cases,
but Phase 0's inventory and matrix still cover the whole repo so ranking has
full context.
Terms
- Slice — a
domains/* module in doctrine role, not necessarily a
literal directory named domains.
- Crust — a slice's public seam in the language's native form (exported
identifiers, package
__init__ surface, index module, public class
surface, or the positional root for languages with no native visibility).
Full rationale:
https://cheeselord.dev/sliced-bread-architecture/reference/sliced-bread/
(in-repo: [[architecture/crust-definition]]).
- Spine —
app/use_cases plus the composition root (app/bootstrap).
- Seam — a crossing edge, one of exactly three kinds: slice-slice (crust
import or event), spine-slice, adapter-port binding. Distinct from a
Feathers-style test-substitution seam.
Phase 0 — Inventory
Enumerate slices (crusts), the spine, and every seam crossing them,
classified into the three edge kinds above.
Derive hot paths from caller-graph code intelligence (dependency
closure / call hierarchy from entrypoints through the spine into slices).
Hot paths feed seam ranking (below), SeamDossiers (Phase 1), and spine
visit order (Phase 3).
Build the slice link-level matrix: for every slice pair, one ordinal
level with its evidence:
| Level |
Meaning |
| L0 |
No link |
| L1 |
Event-linked |
| L2 |
Crust import |
| L3 |
Multi-symbol import |
| L4 |
Co-change hot |
Every cell records the pinned evidence trio (imports, co_change,
hot_paths, per references/formats.md) regardless of level; a level's
meaning may cite its distinguishing detection input in prose (e.g. an
event link for L1, multiple imported symbols for L3) without that input
becoming a separate evidence field.
L4 (co-change hot) fires on a high co-change score or hot paths crossing
the pair with no import requirement — the ordinal ladder does not imply
L4 requires an import.
Pin the schema in references/formats.md; do not restate field shapes
here.
Rank the seam walk change-coupling-first: sort seams by co_change
descending (primary key); break ties with a composite of 0-1-normalized
terms (tunable):
tiebreak = w_f * norm(fan_in) + w_d * depth_verdict_weight
+ w_h * norm(|hot_paths_crossing|)
norm(x) = x / max(x over all seams) # 0 when the max is 0
fan_in — raw static fan-in count crossing the boundary; normalized to
[0,1] by the max fan_in across all seams.
depth_verdict_weight — [0,1], see the verdict table below.
|hot_paths_crossing| — the length of the SeamDossier's
hot_paths_crossing array (a string[] of hot-path identifiers),
normalized to [0,1] by the max count across all seams.
Starting weights w_f=0.4, w_d=0.35, w_h=0.25; adjust per repo and
record the adjustment in the session report.
co_change is continuous, so in practice the composite orders seams with
equal — typically zero — co-change; the weights matter most for the
never-co-changed tail.
depth_verdict_weight maps sliced-bread-depth verdicts onto [0,1] by
boundary-trouble signal strength (per that skill's own semantics); a
seam takes the max of its two sides' slice verdict weights, and a
non-slice side (spine, adapter/port) contributes 0. Verdicts come from a
sliced-bread-depth run or its latest report; when no depth report is
available, set depth_verdict_weight = 0 for all seams and record the
degradation in the session report, mirroring the shallow-git-history
degradation rule below:
| Verdict |
Weight |
| extract |
1.0 |
| narrow |
0.75 |
| watch |
0.5 |
| intent |
0.25 |
| healthy |
0 |
common/ edges get a stop in the walk only when co-change flags them —
do not stop on every common/ import by default.
Shallow git history degrades ranking to fan-in only; say so plainly in
the session output (Phase 4). Never fail the review for missing history
depth.
Phase 1 — Fan-out
Before the human session starts, fan out one subagent per file+test pair
within the invocation's scope: the files (and their tests) of in-scope
slices, plus the spine, plus the far-side slices of every seam touching an
in-scope slice — a seam is only judgeable with both sides' dossiers — or
the whole repo when scope is full.
Use the Workflow tool when the harness provides it; fall back to the Agent
tool otherwise.
Each subagent produces a FileDigest conforming to the pinned schema in
references/formats.md: surface exposed, surface used, behavior assertions
extracted from its tests, and duplication suspects. A file with no tests
carries the UNTESTED marker in place of behavior assertions — do not infer
assertions from implementation reading.
Roll FileDigests up:
- SliceDossier per slice — crust surface, internal files, assertion map,
mass.
- SeamDossier per seam — derived from the SliceDossier(s) on slice
sides (a bare identifier + summary for a non-slice side) plus co-change
and hot-path evidence from Phase 0.
Every dossier stamps the commit it was built from (staleness guard — if the
session spans edits, a dossier older than the current HEAD at its path is
stale and must be rebuilt before its stop, not silently trusted).
All schemas live in references/formats.md — cite that path in dossiers and
prompts; do not duplicate the schemas here.
Phase 2 — Seam-walk
Guided session, one stop per seam in rank order:
Present a stop card: seam id, edge kind, link level (slice-slice
seams only), both sides' summaries (SliceDossier summary for a slice
side; identifier + one-line summary for a spine or adapter/port side),
co-change and hot-path evidence, candidate findings from the dossiers.
The human interrogates freely — the agent answers from dossiers plus live
code intelligence (search, read, caller graph), not from memory or
speculation.
The human issues exactly one disposition per stop:
| Disposition |
Meaning |
| pull-up |
Duplicated/leaked logic moves up into a shared seam |
| push-down |
Logic moves down out of the seam into a slice/spine |
| rethink-seam |
The edge kind or direction itself is wrong |
| healthy |
No action |
Record the verdict (rationale, follow-ups) and move to the next seam in
rank order.
The human may stop the walk at any point; coverage (seams visited vs.
total) is recorded in the session report regardless of where the walk ends.
Phase 3 — Spine review
Visit app/use_cases hot-paths-first (using Phase 0's hot-path derivation
for visit order), then the composition root:
- Orchestration-only check — a use case that contains inline domain
logic (branching business rules, calculations, invariant checks) rather
than delegating to slices is a push-down candidate.
- Composition-root wiring check —
app/bootstrap wires adapters to
ports and use cases; any domain logic or adapter-specific branching found
there is a push-down candidate into the adapter or the relevant slice.
Spine findings feed the same disposition set as Phase 2 and land in the same
session report.
Phase 4 — Close-out
- Write the session report to
.cheese/slice-and-spine/<repo>/<date>.md:
stops visited, coverage, verdicts, the link-level matrix, and a note on
any ranking degradation (shallow history, adjusted weights).
- Every consequential verdict (pull-up, push-down, rethink-seam — not
healthy) becomes an ADR-backed wiki page under
.hallouminate/wiki/.
Resolve the exact namespace (decisions/ vs architecture/) against the
wiki's own ADR conventions at the first close-out in a repo, and state
the resolution in the session report so later runs are consistent.
- Render remaining follow-up work as a handoff menu (
/mold, /cook) —
do not silently drop unaddressed findings.
Non-goals
- Not rule-compliance checking on a bounded diff — use
sliced-bread-review.
- Not autonomous audit or issue filing — use
sliced-bread-audit.
- Not depth or crust-shape scoring — use
sliced-bread-depth.
1---2name: slice-and-spine-review3description: Run a human-in-the-loop whole-repo coherence review of a Sliced Bread codebase: inventory slices, the spine, and seams; fan out subagents to digest every file with its tests; walk seams in ranked order with the human issuing a disposition per stop; review the spine for orchestration drift. Use when the user says "review the seams", "slice and spine review", "whole-repo coherence review", "walk the seams", or asks whether slices still hang together after individual changes passed review. Do NOT use for rule-compliance checking on a bounded change set (sliced-bread-review), autonomous audit and issue filing (sliced-bread-audit), or depth/crust-shape scoring (sliced-bread-depth) — this skill is a guided session over the whole repo, not an automated check.4---56# Slice and Spine Review78A human-led whole-repo coherence pass with an agentic prep sidecar. Individual9changes can each pass `sliced-bread-review`, `sliced-bread-depth`, and10`sliced-bread-audit` while the seams between slices and the spine accrete11leaky or duplicated logic no bounded-diff check ever sees. This skill12inventories the repo, fans out digests, then walks every seam with a human in13the loop.1415## Invocation1617```text18/slice-and-spine-review [scope: slice names | seam ids | full]19```2021Default scope is `full`. A named scope (slice names or seam ids) limits22Phase 2's walk and Phase 3's spine visit to the matching seams and use cases,23but Phase 0's inventory and matrix still cover the whole repo so ranking has24full context.2526## Terms2728- **Slice** — a `domains/*` module in doctrine role, not necessarily a29 literal directory named `domains`.30- **Crust** — a slice's public seam in the language's native form (exported31 identifiers, package `__init__` surface, index module, public class32 surface, or the positional root for languages with no native visibility).33 Full rationale:34 <https://cheeselord.dev/sliced-bread-architecture/reference/sliced-bread/>35 (in-repo: [[architecture/crust-definition]]).36- **Spine** — `app/use_cases` plus the composition root (`app/bootstrap`).37- **Seam** — a crossing edge, one of exactly three kinds: slice-slice (crust38 import or event), spine-slice, adapter-port binding. Distinct from a39 Feathers-style test-substitution seam.4041## Phase 0 — Inventory42431. Enumerate slices (crusts), the spine, and every seam crossing them,44 classified into the three edge kinds above.452. Derive **hot paths** from caller-graph code intelligence (dependency46 closure / call hierarchy from entrypoints through the spine into slices).47 Hot paths feed seam ranking (below), SeamDossiers (Phase 1), and spine48 visit order (Phase 3).493. Build the **slice link-level matrix**: for every slice pair, one ordinal50 level with its evidence:5152 | Level | Meaning |53 | ----- | ------------------- |54 | L0 | No link |55 | L1 | Event-linked |56 | L2 | Crust import |57 | L3 | Multi-symbol import |58 | L4 | Co-change hot |5960 Every cell records the pinned evidence trio (`imports`, `co_change`,61 `hot_paths`, per `references/formats.md`) regardless of level; a level's62 meaning may cite its distinguishing detection input in prose (e.g. an63 event link for L1, multiple imported symbols for L3) without that input64 becoming a separate evidence field.6566 L4 (co-change hot) fires on a high co-change score or hot paths crossing67 the pair with no import requirement — the ordinal ladder does not imply68 L4 requires an import.6970 Pin the schema in `references/formats.md`; do not restate field shapes71 here.72734. **Rank the seam walk** change-coupling-first: sort seams by `co_change`74 descending (primary key); break ties with a composite of 0-1-normalized75 terms (tunable):7677 ```text78 tiebreak = w_f * norm(fan_in) + w_d * depth_verdict_weight79 + w_h * norm(|hot_paths_crossing|)80 norm(x) = x / max(x over all seams) # 0 when the max is 081 ```8283 - `fan_in` — raw static fan-in count crossing the boundary; normalized to84 [0,1] by the max fan_in across all seams.85 - `depth_verdict_weight` — [0,1], see the verdict table below.86 - `|hot_paths_crossing|` — the length of the SeamDossier's87 `hot_paths_crossing` array (a string[] of hot-path identifiers),88 normalized to [0,1] by the max count across all seams.8990 Starting weights `w_f=0.4, w_d=0.35, w_h=0.25`; adjust per repo and91 record the adjustment in the session report.9293 `co_change` is continuous, so in practice the composite orders seams with94 equal — typically zero — co-change; the weights matter most for the95 never-co-changed tail.9697 `depth_verdict_weight` maps `sliced-bread-depth` verdicts onto [0,1] by98 boundary-trouble signal strength (per that skill's own semantics); a99 seam takes the max of its two sides' slice verdict weights, and a100 non-slice side (spine, adapter/port) contributes 0. Verdicts come from a101 `sliced-bread-depth` run or its latest report; when no depth report is102 available, set `depth_verdict_weight = 0` for all seams and record the103 degradation in the session report, mirroring the shallow-git-history104 degradation rule below:105106 | Verdict | Weight |107 | ------- | ------ |108 | extract | 1.0 |109 | narrow | 0.75 |110 | watch | 0.5 |111 | intent | 0.25 |112 | healthy | 0 |1131145. `common/` edges get a stop in the walk only when co-change flags them —115 do not stop on every `common/` import by default.1166. **Shallow git history** degrades ranking to fan-in only; say so plainly in117 the session output (Phase 4). Never fail the review for missing history118 depth.119120## Phase 1 — Fan-out121122Before the human session starts, fan out one subagent per file+test pair123within the invocation's scope: the files (and their tests) of in-scope124slices, plus the spine, plus the far-side slices of every seam touching an125in-scope slice — a seam is only judgeable with both sides' dossiers — or126the whole repo when scope is `full`.127Use the Workflow tool when the harness provides it; fall back to the Agent128tool otherwise.129130Each subagent produces a **FileDigest** conforming to the pinned schema in131`references/formats.md`: surface exposed, surface used, behavior assertions132extracted from its tests, and duplication suspects. A file with no tests133carries the `UNTESTED` marker in place of behavior assertions — do not infer134assertions from implementation reading.135136Roll FileDigests up:137138- **SliceDossier** per slice — crust surface, internal files, assertion map,139 mass.140- **SeamDossier** per seam — derived from the SliceDossier(s) on slice141 sides (a bare identifier + summary for a non-slice side) plus co-change142 and hot-path evidence from Phase 0.143144Every dossier stamps the commit it was built from (staleness guard — if the145session spans edits, a dossier older than the current HEAD at its path is146stale and must be rebuilt before its stop, not silently trusted).147148All schemas live in `references/formats.md` — cite that path in dossiers and149prompts; do not duplicate the schemas here.150151## Phase 2 — Seam-walk152153Guided session, one stop per seam in rank order:1541551. Present a **stop card**: seam id, edge kind, link level (slice-slice156 seams only), both sides' summaries (SliceDossier summary for a slice157 side; identifier + one-line summary for a spine or adapter/port side),158 co-change and hot-path evidence, candidate findings from the dossiers.1592. The human interrogates freely — the agent answers from dossiers plus live160 code intelligence (search, read, caller graph), not from memory or161 speculation.1623. The human issues exactly one disposition per stop:163164 | Disposition | Meaning |165 | ------------ | --------------------------------------------------- |166 | pull-up | Duplicated/leaked logic moves up into a shared seam |167 | push-down | Logic moves down out of the seam into a slice/spine |168 | rethink-seam | The edge kind or direction itself is wrong |169 | healthy | No action |1701714. Record the verdict (rationale, follow-ups) and move to the next seam in172 rank order.173174The human may stop the walk at any point; coverage (seams visited vs.175total) is recorded in the session report regardless of where the walk ends.176177## Phase 3 — Spine review178179Visit `app/use_cases` hot-paths-first (using Phase 0's hot-path derivation180for visit order), then the composition root:181182- **Orchestration-only check** — a use case that contains inline domain183 logic (branching business rules, calculations, invariant checks) rather184 than delegating to slices is a push-down candidate.185- **Composition-root wiring check** — `app/bootstrap` wires adapters to186 ports and use cases; any domain logic or adapter-specific branching found187 there is a push-down candidate into the adapter or the relevant slice.188189Spine findings feed the same disposition set as Phase 2 and land in the same190session report.191192## Phase 4 — Close-out1931941. Write the session report to `.cheese/slice-and-spine/<repo>/<date>.md`:195 stops visited, coverage, verdicts, the link-level matrix, and a note on196 any ranking degradation (shallow history, adjusted weights).1972. Every **consequential** verdict (pull-up, push-down, rethink-seam — not198 healthy) becomes an ADR-backed wiki page under `.hallouminate/wiki/`.199 Resolve the exact namespace (`decisions/` vs `architecture/`) against the200 wiki's own ADR conventions at the first close-out in a repo, and state201 the resolution in the session report so later runs are consistent.2023. Render remaining follow-up work as a handoff menu (`/mold`, `/cook`) —203 do not silently drop unaddressed findings.204205## Non-goals206207- Not rule-compliance checking on a bounded diff — use `sliced-bread-review`.208- Not autonomous audit or issue filing — use `sliced-bread-audit`.209- Not depth or crust-shape scoring — use `sliced-bread-depth`.