Skip to content

docs: surface anti-patterns earlier in TEMPLATE.md + add PROPOSAL/REVIEW templates#16

Merged
indykish merged 1 commit into
masterfrom
chore/template-md-improvements
May 12, 2026
Merged

docs: surface anti-patterns earlier in TEMPLATE.md + add PROPOSAL/REVIEW templates#16
indykish merged 1 commit into
masterfrom
chore/template-md-improvements

Conversation

@indykish

Copy link
Copy Markdown
Owner

Summary

Three structural improvements to the spec-authoring templates based on observed drift in cache-kit.rs/plans/.

  • TEMPLATE.md — Document Types Map at the top, anti-patterns moved up + tabulated, Provenance field added, pseudocode litmus test surfaced, prologue minimum (3-5) made explicit, 300-line cap visible.
  • PROPOSAL_TEMPLATE.md (new) — for design exploration before commitment. Banner: "do not implement directly." Forces ≥2 options + a do-nothing baseline. Conversion-to-spec tracking.
  • REVIEW_TEMPLATE.md (new) — for code/audit reviews with many findings. Banner: "each actionable finding becomes its own spec — don't bundle." Findings table with Severity (P0/P1/P2/Note) + Status (OPEN/SPEC'D/REJECTED/OUT_OF_SCOPE) + Spec column.

Motivation — observed failure modes

Doc Failure mode
cache-kit.rs/plans/comprehensive-code-review.md Code review masquerading as a spec — 12 action items in one file, none actionable as-is. "Add circuit breaker" with no scope, no API, no tests.
cache-kit.rs/plans/error-codes-improvement.md Proposal masquerading as a spec — 850 lines of inlined Rust pseudocode (pinned enum values, full match arms, sample test bodies). All of it will drift the moment implementation lands.

The fix isn't more discipline — it's making the correct shape obvious at template-pick time, before the author drifts. Both docs would have been forced to a different shape if the Document Types Map had been on line 1.

What changed concretely

TEMPLATE.md

  • Added Document Types Map (Spec / Proposal / Review / Postmortem) at the top.
  • Pseudocode litmus test (one-line callout) inside Spec Registry.
  • Moved 6 anti-patterns from line 173 → near top, converted to table form.
  • Added `Provenance:` field to the spec header (human / LLM-drafted / agent-generated) so executing agents calibrate trust.
  • Made prologue minimum explicit (3-5 pointers).
  • Promoted "no test code in this section" to a top-of-section callout in Test Specification.
  • Surfaced the 300-line cap as a hard upper bound.

PROPOSAL_TEMPLATE.md (new — 93 lines)

  • Banner + clear contrast with TEMPLATE.md.
  • Required: ≥2 options + a "do nothing" baseline. If you only have one option, you have a spec, not a proposal.
  • Open Questions section forces explicit blockers before conversion.
  • Conversion-to-Spec section links the resulting spec(s).

REVIEW_TEMPLATE.md (new — 97 lines)

  • Banner + clear contrast.
  • Findings table — one row per finding, with Severity + Status + Spec link columns.
  • Severity guide: P0 (must spec now), P1 (spec when capacity allows), P2 (polish), Note (record-only).
  • Closed only when every P0/P1 has either a spec or a REJECTED row.

Invariance

Audit script passes (18 gates, fixtures clean). `AGENTS.md` untouched; questionnaire scenarios 1-20 unchanged. Sign-off refreshed for 79aba99.

Test plan

  • Read TEMPLATE.md top-to-bottom; the Document Types Map should reroute you before reaching the spec body.
  • Try drafting a spec for one of the cache-kit recommendations ("add circuit breaker") against the new TEMPLATE.md and verify the Anti-Patterns table catches the drift.
  • Try porting `cache-kit.rs/plans/comprehensive-code-review.md` into REVIEW_TEMPLATE.md and confirm the structure surfaces each finding as a discrete row.
  • Confirm `audit-agents-md.sh` continues to pass on this branch.

🤖 Generated with Claude Code

…lates

Three structural improvements based on observed drift in cache-kit.rs:

TEMPLATE.md
- Surface a Document Types Map at the top (Spec / Proposal / Review /
  Postmortem) so reviews and proposals stop being treated as specs.
- Add a pseudocode litmus test as a one-line callout in the Spec Registry
  section.
- Move the 6 anti-patterns table to near-top (was at line 173 — by then
  authors have already drifted) and convert to tabular form.
- Add a Provenance field to the spec header so executing agents can
  calibrate trust (human / LLM-drafted / agent-generated).
- Make the prologue minimum explicit: 3-5 pointers. Fewer = homework not
  done; more = tutorial.
- Promote the Test Specification "no test code" rule to a top-of-section
  callout.
- Surface the 300-line upper bound near the top.

PROPOSAL_TEMPLATE.md (new)
- Short template for design exploration before commitment.
- Banner: "this is a proposal, not a spec, do not implement directly."
- Forces author to list >=2 options + a "do nothing" baseline.
- Has a Conversion-to-Spec section to track when a proposal becomes work.

REVIEW_TEMPLATE.md (new)
- Short template for code/audit reviews with many findings.
- Banner: "each actionable finding becomes its own spec — don't bundle."
- Findings table with Severity (P0/P1/P2/Note) + Status (OPEN/SPEC'D/
  REJECTED/OUT_OF_SCOPE) and a Spec column tracking conversion.
- Closed only when every P0/P1 has either a spec or a REJECTED row.

Motivation: cache-kit.rs/plans/comprehensive-code-review.md is a code
review masquerading as a spec — 12 action items in one file, none
actionable as-is. cache-kit.rs/plans/error-codes-improvement.md is a
proposal masquerading as a spec — 850 lines of inlined Rust pseudocode.
Neither was implementable without conversion. These templates make the
correct shape obvious before authors drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@indykish indykish merged commit 79aba99 into master May 12, 2026
1 check passed
@indykish indykish deleted the chore/template-md-improvements branch May 12, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant