Skip to content

Commit 84b5124

Browse files
authored
chore(template): reconcile fix SPEC/README scaffolds with canonical docs (#107)
## What Reconciles the exportable `template/docs/fix/**` scaffolds with the canonical `docs/fix/**` versions, which had drifted since the initial commit. **Direction decided:** `docs/fix/_TEMPLATE/SPEC.md` is canonical — it carries the workflow machinery the skills hard-require (`## Depends on`, `## Detected in`, `### Spec-lint`, the 8-box Phase-lint, the `Layer:`/`Done-when:` phase scaffold, `## Testing`, `## Status`). The template-only sections (`Impact`, `Rules that must never be violated`, `Risks`, `Effort`) are **`plan-fix`'s own extension sections** — its SKILL.md appends them at drafting time ("SPEC sections (extends the base template)"), so the base scaffold must not pre-carry them. ## Changes - `docs/fix/_TEMPLATE/SPEC.md` — issue line made forge-agnostic ("tracked issue in the project's forge … or the forge's equivalent auto-close convention"), then copied **byte-identical** to `template/docs/fix/_TEMPLATE/SPEC.md`. - `docs/fix/README.md` + `template/docs/fix/README.md` — conventions unified in generic phrasing (folder/branch format, forge-agnostic issue wording, remove-after-merge rule, generic skills pointer). Structural text is now identical in both (`diff` ignoring table rows is empty); only the dogfooded table rows differ, which is the intentional delta. ## Drift audit of the remaining pairs | Pair | Verdict | |---|---| | `features/_TEMPLATE/SPEC.md` | Re-synced in [PR #106](#106) (this branch is off `main`, so it still shows there until that merges) | | `features/ROADMAP.md` | Status legend + Conventions byte-identical; only real roadmap rows differ (dogfood — intentional) | | `LOGS.md` | Header identical; only real session entries differ (dogfood — intentional) | | all other `template/docs/**` | No `docs/**` counterpart (template-only stubs) — nothing to drift against | No SKILL.md touched → no version bumps. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents d6482f3 + 6aa38fd commit 84b5124

4 files changed

Lines changed: 111 additions & 51 deletions

File tree

docs/fix/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Active fixes
22

3-
Index of in-progress and pending fixes. Merged fixes are removed from
4-
this table — history lives in git log + closed issues.
3+
Index of in-progress and pending fixes. Merged fixes are removed from this
4+
table — history lives in git log + closed issues.
55

66
## Status legend
77

88
- `pending` — SPEC drafted, branch not yet open
99
- `in-progress` — branch open, work ongoing
1010
- `done` — built, PR open, awaiting merge (merge state lives in the forge — same
11-
meaning as the roadmap's `done`); the entry is removed only **after** the PR merges
11+
meaning as the roadmap's `done`); the row is removed only **after** the PR merges
1212

1313
## Active
1414

@@ -23,9 +23,10 @@ this table — history lives in git log + closed issues.
2323

2424
- Folder: `docs/fix/<issue-number>-<topic>/`
2525
- Branch: `fix/<issue-number>-<topic>`
26-
- Every fix has a GitHub issue; PR closes it with `Closes #<n>`.
27-
- Entry is removed from this table on merge — do not maintain history
28-
here.
26+
- Every fix has a tracked issue in the project's forge; the PR closes it via
27+
`Closes #<n>` (or the forge's equivalent auto-close convention).
28+
- The row is removed from this table only **after** the PR merges — do not
29+
maintain history here.
2930
- See `_TEMPLATE/SPEC.md` for the spec format.
30-
- Workflow rules: `.claude/skills/execute-phase/SKILL.md` (`--fix`
31-
mode).
31+
- Workflow rules: the `execute-phase` skill's `--fix` mode (wherever your
32+
agent installed the skills).

docs/fix/_TEMPLATE/SPEC.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ regular feature cycle.
1313

1414
## Issue
1515

16-
`#<n>` — GitHub issue. Required. The PR must close it via
17-
`Closes #<n>` in the body.
16+
`#<n>` — tracked issue in the project's forge. Required. The PR must close it
17+
via `Closes #<n>` in the body (or the forge's equivalent auto-close
18+
convention).
1819

1920
## Branch
2021

template/docs/fix/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
# Active fixes
22

3-
Index of in-progress and pending fixes. Merged fixes are removed from this table —
4-
history lives in git log + closed issues.
3+
Index of in-progress and pending fixes. Merged fixes are removed from this
4+
table — history lives in git log + closed issues.
55

66
## Status legend
77

88
- `pending` — SPEC drafted, branch not yet open
99
- `in-progress` — branch open, work ongoing
1010
- `done` — built, PR open, awaiting merge (merge state lives in the forge — same
11-
meaning as the roadmap's `done`); remove the row only **after** the PR merges
11+
meaning as the roadmap's `done`); the row is removed only **after** the PR merges
1212

1313
## Active
1414

1515
| Folder | Topic | Status | Depends on | Issue |
16-
|--------|-------|--------|------------|-------|
16+
| ------ | ----- | ------ | ---------- | ----- |
1717
| | | | | |
1818

19+
---
20+
1921
## Conventions
2022

21-
- One folder per fix: `docs/fix/<issue-number>-<topic>/SPEC.md`.
22-
- Every fix has a tracked issue; the PR closes it.
23-
- Remove the row when the PR merges.
23+
- Folder: `docs/fix/<issue-number>-<topic>/`
24+
- Branch: `fix/<issue-number>-<topic>`
25+
- Every fix has a tracked issue in the project's forge; the PR closes it via
26+
`Closes #<n>` (or the forge's equivalent auto-close convention).
27+
- The row is removed from this table only **after** the PR merges — do not
28+
maintain history here.
29+
- See `_TEMPLATE/SPEC.md` for the spec format.
30+
- Workflow rules: the `execute-phase` skill's `--fix` mode (wherever your
31+
agent installed the skills).
Lines changed: 84 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,110 @@
11
# fix/<issue-number>-<topic>
22

3-
> Fix specification. Copy this folder to `docs/fix/<issue-number>-<topic>/`, fill
4-
> every section, and register the entry in `docs/fix/README.md`. Lighter than a
5-
> feature spec — no separate planning artifacts: the SPEC alone is the source of
6-
> truth, and its `## Phases` section is the execution ledger.
3+
> Fix specification. Copy this folder to
4+
> `docs/fix/<issue-number>-<topic>/`, fill every section, register the
5+
> entry in `docs/fix/README.md`. Lighter than a feature spec — no
6+
> separate planning artifacts: the SPEC alone is the source of truth,
7+
> and its `## Phases` section is the execution ledger.
78
89
## Goal
910

10-
One paragraph: what this fix repairs and why it cannot wait for a regular feature
11-
cycle.
11+
One paragraph: what this fix repairs and why it cannot wait for a
12+
regular feature cycle.
1213

1314
## Issue
1415

15-
`#<n>` — tracked issue. Required. The PR must close it.
16+
`#<n>` — tracked issue in the project's forge. Required. The PR must close it
17+
via `Closes #<n>` in the body (or the forge's equivalent auto-close
18+
convention).
1619

1720
## Branch
1821

1922
`fix/<issue-number>-<topic>`
2023

24+
## Depends on
25+
26+
Other fixes (by folder name) that must merge first. Empty if
27+
independent.
28+
2129
## Root cause
2230

23-
What actually causes the defect, with evidence (file paths, line refs).
31+
What broke, where, and why. Reference the commit, feature, or
32+
decision where the defect was introduced if known.
33+
34+
## Detected in
35+
36+
When and how the defect surfaced — review finding, incident, failing
37+
test, customer report, etc.
2438

2539
## Scope
2640

2741
### In scope
2842

29-
The smallest change set that closes the issue.
43+
The exact change set.
3044

3145
### Out of scope
3246

33-
Adjacent problems found during analysis — each with a one-line pointer to where
34-
it should be filed instead.
35-
36-
## Impact
37-
38-
- Modules/files touched (paths).
39-
- Blast radius: what breaks if the fix is wrong.
40-
- Detection lead time: how fast production would surface a failure.
47+
Adjacent issues this fix deliberately does NOT touch. Link to their
48+
own fix folder or feature where each belongs.
4149

42-
## Rules that must never be violated
50+
## Acceptance
4351

44-
Project invariants the fix must preserve (from `CLAUDE.md` hard rules and the
45-
architecture doc).
52+
Objective, verifiable conditions for "done". Each criterion is a runnable
53+
command where possible, or labelled `read-verified` — never unlabelled prose.
4654

47-
## Risks
55+
### Spec-lint (mechanical — presence checks only)
4856

49-
Operational, security, and compliance touchpoints. State "n/a" explicitly where
50-
none apply — that forces a deliberate check.
57+
Run by `plan-fix` before committing the draft; fail-closed, no quality
58+
judgement. Any FAIL → fix the SPEC before the commit.
5159

52-
## Acceptance criteria
53-
54-
Objective checkboxes, each independently verifiable. Map each to a test layer.
60+
- [ ] No template placeholders left (`grep -nE '<(topic|n|task|command|expected)'`
61+
over the filled sections returns nothing — the `### P1` scaffold lines
62+
are replaced, not kept).
63+
- [ ] `### Out of scope` has ≥ 1 concrete bullet — never empty.
64+
- [ ] Every `## Acceptance` criterion is a runnable command OR labelled
65+
`read-verified`.
66+
- [ ] Every phase passes the 8-box Phase-lint below (already mandatory).
5567

5668
## Phases
5769

58-
Execution ledger — `execute-phase --fix` runs **one phase per invocation** and
59-
ticks tasks here. **Always ≥ 2 phases**: `P1..Pn` implement the fix (each task
60-
independently checkable, no judgement); the final phase is always
61-
`Hardening & PR` — keep its pre-written tasks **literally**, never paraphrase
62-
or merge them into an implementation phase.
70+
Execution ledger — `execute-phase --fix` runs **one phase per invocation**
71+
and ticks tasks here. **Always ≥ 2 phases**: `P1..Pn` implement the fix
72+
(each task independently checkable, no judgement); the final phase is
73+
always `Hardening & PR` — keep its pre-written tasks **literally**, never
74+
paraphrase or merge them into an implementation phase.
75+
76+
### Phase-lint (authoritative copy — keep in sync with `docs/features/_TEMPLATE/SPEC.md` `### Phases`)
77+
78+
Every implementation phase below must pass all 8 boxes before it is emitted
79+
(planner skills) or executed (`execute-phase` pre-flight). Fail-closed: any
80+
unticked box blocks emission/execution until the phase is re-cut or split.
81+
82+
- [ ] Title names ONE deliverable — FAIL if it joins nouns with `+`, `,`,
83+
`&`, `and`/`y`, or `/`.
84+
- [ ] One declared layer — each phase declares exactly one of the fixed enum
85+
`schema/db | domain | api | ui | config/infra | docs | hardening |
86+
close-out`; FAIL if any task's target file belongs to another. Tests
87+
for the phase's own layer belong to the phase; a test-only phase
88+
declares `hardening`.
89+
- [ ] ≤ 8 tasks (close-out phase: ≤ 10, only the literal close-out chain).
90+
- [ ] One checkbox = one deliverable — FAIL if a task contains a `` chain
91+
of implementation steps, enumerates > 3 cases/scenarios, or creates
92+
> 1 file of distinct concerns.
93+
- [ ] Zero decision words — FAIL on `Decide`, `choose`, `OR` between
94+
alternatives, `If … then <change scope>`.
95+
- [ ] No conditional scope mutation — a task may not move work between
96+
phases at runtime.
97+
- [ ] No external/manual gates inside implementation phases —
98+
human/out-of-repo verifications live in the hardening/close-out phase,
99+
marked `manual`.
100+
- [ ] Machine-checkable done-when — every phase ends with one verifiable
101+
invariant (a command + expected outcome).
63102

64103
### P1 — <implementation>
65104

105+
Layer: `<schema/db|domain|api|ui|config/infra|docs|hardening>`. Done-when:
106+
`<command>``<expected outcome>`.
107+
66108
- [ ] <task — independently checkable, mapped to evidence>
67109

68110
### P2 — Hardening & PR
@@ -77,10 +119,18 @@ or merge them into an implementation phase.
77119
- [ ] Update the fix-index row to `done · [#<pr>](<pr-url>)`
78120
- [ ] Commit `docs: link PR #<n>` and push
79121

122+
## Testing
123+
124+
What test confirms the fix, at what layer (unit / integration /
125+
architecture). Prefer integration over heavy mocking.
126+
80127
## Rollback
81128

82-
How to revert safely, and any data-side cleanup needed.
129+
How to revert safely if the fix misbehaves in production. State the
130+
single command or PR-revert flow, plus any data-side cleanup.
131+
132+
## Status
83133

84-
## Effort
134+
`pending` · `in-progress` · `done` (built, PR open — merge state lives in the forge)
85135

86-
T-shirt size (XS / S / M / L) with a one-line justification.
136+
(Removed from `docs/fix/README.md` only **after** the PR merges.)

0 commit comments

Comments
 (0)