refactor(work): drop date prefixes + move _state.json into _system/

Convention shift: epic folders + PRD filenames + frontmatter id
fields are now bare slugs. The created: timestamp (Phase 2) carries
the date; folder names don't repeat it. A future <task-id>-<slug>
shape (e.g. ClickUp) lands cleanly when that integration ships.

Renames (git mv preserves history):
- docs/work/2026-05-13-binder-wrap-helper/
    -> docs/work/binder-wrap-helper/
- docs/work/2026-05-14-library-evaluation-policy/
    -> docs/work/library-evaluation-policy/
- docs/work/2026-05-14-ci-security-and-supply-chain/
    -> docs/work/ci-security-and-supply-chain/
- docs/work/prds/2026-05-13-binder-wrap-helper.prd.md
    -> docs/work/prds/binder-wrap-helper.prd.md
- docs/work/prds/2026-05-13-coverage-architecture.prd.md
    -> docs/work/prds/coverage-architecture.prd.md
- docs/work/prds/2026-05-14-library-evaluation-policy.prd.md
    -> docs/work/prds/library-evaluation-policy.prd.md
- docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md
    -> docs/work/prds/ci-security-and-supply-chain.prd.md

Frontmatter updates inside the renamed files: epic id, epic prd,
story epic, PRD id, PRD builds-on all drop date prefixes.

System folder + state file move:
- New docs/work/_system/ holds framework-managed state.
- docs/work/_state.json -> docs/work/_system/_state.json.
- state-builder.mjs adds _system to SKIP_FOLDERS.
- cli.mjs + state-sync-guard.mjs + .husky/pre-commit point at the
  new path.

template-reset-v1 epic deleted entirely (one-off cleanup epic from
the pre-date-convention era; status was already done).

Generator-template updates (so new artifacts ship in the right
shape):
- .sandcastle/decomposer.prompt.md emits bare-slug folder names +
  ISO created: timestamp.
- .claude/skills/to-prd/SKILL.md template uses bare-slug filename +
  bare-slug id field + ISO created: timestamp.

Doc reference updates: glossary, runbook, agent-first-workflow-
and-conformance, reviewer prompt, ADR-020, ADR-022, ADR-023 all
point at the new paths/slugs.
This commit is contained in:
2026-05-14 21:16:51 +02:00
parent 90fc2853f2
commit bae4b66fa4
43 changed files with 109 additions and 161 deletions

View File

@@ -15,7 +15,7 @@ The PRD lives on the filesystem (this repo does not use an issue tracker for wor
Check with the user that this module sketch matches their expectations. Confirm which modules they want tests written for. (The conformance system already mandates tests for every use case + controller; this question is about extra coverage — repository contract suites, integration tests, etc.)
3. **Pick a slug + date** for the PRD filename: `docs/work/prds/<YYYY-MM-DD>-<kebab-slug>.prd.md`. Use today's date.
3. **Pick a slug** for the PRD filename: `docs/work/prds/<kebab-slug>.prd.md`. No date prefix in the slug — the `created:` timestamp in frontmatter carries the date. Future task-tracker IDs (e.g. ClickUp) will land as `<task-id>-<kebab-slug>` once that integration ships; until then, bare slug only.
4. **Write the PRD using the template below**, then save it. Status starts at `draft`. The decomposer (`pnpm work decompose`) refuses to run on `draft` PRDs — the human flips it to `approved` after review.
@@ -23,13 +23,13 @@ The PRD lives on the filesystem (this repo does not use an issue tracker for wor
```markdown
---
id: <YYYY-MM-DD>-<kebab-slug>
id: <kebab-slug>
title: <Human-readable title>
type: prd
status: draft
author: <user>
elicitation-session: <agent-session-id-or-omit>
created: <YYYY-MM-DD>
created: <ISO-8601-UTC-timestamp, e.g. 2026-05-14T19:23:45Z>
---
## Problem
@@ -103,6 +103,6 @@ Anything else: stakeholders, related PRDs (`Builds on <prd-id>`, `Supersedes <pr
## After writing
- Verify the file lives at `docs/work/prds/<date>-<slug>.prd.md`.
- Verify the file lives at `docs/work/prds/<slug>.prd.md`.
- Tell the user the path and remind them to review and flip `status: draft → approved` before running `pnpm work decompose`.
- If new domain terms were introduced or sharpened during synthesis, append them to `docs/glossary.md` (lazy-create if missing) — same rules as `grill-with-docs`.

View File

@@ -12,7 +12,7 @@ node scripts/work/bump-updated-timestamps.mjs || exit 1
# 3. If any docs/work/ markdown is staged, regenerate _state.json + re-stage it
if git diff --cached --name-only | grep -qE '^docs/work/.*\.md$'; then
pnpm work rebuild-state
git add docs/work/_state.json
git add docs/work/_system/_state.json
fi
# 3. Run the state-sync guard: refuses to commit if _state.json is

View File

@@ -1,6 +1,6 @@
# Decomposer Agent
You are the decomposer agent. Given an approved PRD, you produce the epic file + one story file per requirement under `docs/work/<epic-slug>/`. Each story has its own checkbox-driven Tasks list — where **every checkbox is a vertical slice**.
You are the decomposer agent. Given an approved PRD, you produce the epic file + one story file per requirement under `docs/work/<epic-slug>/`. Folder names use the **bare slug** — no date prefix; the `created:` timestamp in frontmatter carries the date. Each story has its own checkbox-driven Tasks list — where **every checkbox is a vertical slice**.
## The slice rule (non-negotiable)
@@ -53,10 +53,10 @@ The approved PRD:
## Your job
1. Read the PRD. Extract: epic id (slugified from title + date), story list (one per Requirement), dependency edges (from "depends on" hints in the PRD), out-of-scope items.
2. Write `docs/work/<epic-id>/_epic.md` with the standard frontmatter (id, prd, title, type: epic, status: in-progress, features, created).
1. Read the PRD. Extract: epic id (kebab-slug from title — **no date prefix**; the `created:` timestamp carries the date), story list (one per Requirement), dependency edges (from "depends on" hints in the PRD), out-of-scope items. The epic id should match the PRD's `id:` field exactly.
2. Write `docs/work/<epic-id>/_epic.md` with frontmatter: `id`, `prd` (path to the PRD file), `title`, `type: epic`, `status: in-progress`, `features`, `created: <ISO-8601-UTC-timestamp>` (use the current timestamp). The pre-commit hook adds `updated:` automatically — do NOT set it yourself.
3. For each Requirement, write `docs/work/<epic-id>/<NN>-<story-slug>/_story.md`:
- Frontmatter: id, epic, title, type: technical-story | user-story, status: in-progress (for the first) or todo (subsequent), feature, depends-on (array, may reference other stories in this epic by id), blocks.
- Frontmatter: `id`, `epic`, `title`, `type: technical-story | user-story`, `status: in-progress` (for the first) or `todo` (subsequent), `feature`, `depends-on` (array, may reference other stories in this epic by id), `blocks`, `created: <ISO-8601-UTC-timestamp>`. The pre-commit hook stamps `updated:` — do NOT set it yourself.
- Sections: Goal, Why, Done when, In scope, Out of scope, Tasks (checkbox list).
- **Each story's Tasks list:** every checkbox MUST satisfy the slice rule above — one green commit per checkbox. If a generator is applicable, list the generator invocation as the FIRST checkbox; subsequent checkboxes customise the generator's output and each one lands its own green commit (e.g. "Add audit emission to use case X", "Wire event publish from X into bus").

View File

@@ -43,7 +43,7 @@ If you suspect the implementer hand-rolled what should have been generator outpu
## Epic close-out: PRD status flip
After approving a task, check `docs/work/_state.json` for the `needs_prd_ship` array (rebuilt automatically by the pre-commit state-sync hook). Each entry has shape:
After approving a task, check `docs/work/_system/_state.json` for the `needs_prd_ship` array (rebuilt automatically by the pre-commit state-sync hook). Each entry has shape:
```json
{

View File

@@ -339,7 +339,7 @@ the compiler can't tell a wrapped factory from an unwrapped one.
Reject if brand is implemented with runtime tag rather than pure type.
```
## State file — `docs/work/_state.json`
## State file — `docs/work/_system/_state.json`
A derived, committed, orchestrator-written index. Markdown is source of truth; `_state.json` is a fast-to-query mirror.

View File

@@ -3,7 +3,7 @@
**Status:** Accepted
**Date:** 2026-05-13
**Builds on:** ADR-006 (vertical-feature-packages), ADR-011 (TDD foundation)
**PRD:** docs/work/prds/2026-05-13-coverage-architecture.prd.md
**PRD:** docs/work/prds/coverage-architecture.prd.md
## Context
@@ -113,4 +113,4 @@ Repo-wide state at shipping (`coverage/summary.json`): statements 95.87% / branc
- ADR-011 — TDD foundation
- ADR-018 — audit-and-compliance (similar manifest-declared shape pattern)
- ADR-019 — sandcastle agent orchestration (the dispatch loop that reads `pnpm coverage:diff`)
- PRD `2026-05-13-coverage-architecture` — implementation seed
- PRD `coverage-architecture` — implementation seed

View File

@@ -388,7 +388,7 @@ pushed to a GitHub remote — uses the same configurations unchanged.
Socket SDK)
- Glossary entries for **Library trace**, **Pre-shipped trace**,
**Trace revalidation**, **Major-bump re-evaluation**
- PRD: `docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md`
- PRD: `docs/work/prds/ci-security-and-supply-chain.prd.md`
(to be written, materialized via `/to-prd`)
- Companion guide: `docs/guides/ci-security.md` (to be written; human
reading-room with worked examples)

View File

@@ -288,7 +288,7 @@ A change that exercises every Clean Architecture layer end-to-end for one capabi
The agent dispatch orchestrator (https://github.com/mattpocock/sandcastle). Invoked via `pnpm work dispatch --execute`. See ADR-019.
**`_state.json`**:
The orchestrator-managed derived index at `docs/work/_state.json`. Regenerated from markdown via `pnpm work rebuild-state`. Committed.
The orchestrator-managed derived index at `docs/work/_system/_state.json`. Regenerated from markdown via `pnpm work rebuild-state`. Committed.
**Generator**:
A `pnpm turbo gen <kind>` invocation. Generator-first is **non-negotiable** — agents always prefer the generator over hand-rolled scaffolding. Available kinds: `feature`, `event`, `job`, `realtime`, `core-package`, `core-ui-component`.

View File

@@ -85,7 +85,7 @@ pnpm work status # tree of epics + stories
pnpm work next # next ready story
pnpm work ready # all ready stories
pnpm work blocked # blocked stories + what they wait on
pnpm work rebuild-state # regenerate docs/work/_state.json
pnpm work rebuild-state # regenerate docs/work/_system/_state.json
pnpm work dispatch # print next dispatch plan
pnpm work dispatch --execute # invoke sandcastle (subscription or API key — see runbook)
```
@@ -448,7 +448,7 @@ This gives you the same DAG-aware "what's next?" without invoking any agent. Use
— Your change added unused exports or duplicated logic. Either remove the dead code or accept with `pnpm fallow:audit --gate all` (the audit considers the baseline; only NEW findings fail).
**Pre-commit hook refuses to commit with "state-sync-guard"**
— You staged `docs/work/_state.json` but it's not byte-identical to `pnpm work rebuild-state` output. Run `pnpm work rebuild-state && git add docs/work/_state.json` and try again.
— You staged `docs/work/_system/_state.json` but it's not byte-identical to `pnpm work rebuild-state` output. Run `pnpm work rebuild-state && git add docs/work/_system/_state.json` and try again.
**Tests fail in `@repo/turbo-generators` with Vitest worker timeouts**
— Known flaky on slow machines. Re-run; if persistent, increase the `turbo-generators` package's vitest `testTimeout`.

View File

@@ -1,10 +1,10 @@
{
"updated_at": "2026-05-14T19:10:35.823Z",
"updated_at": "2026-05-14T19:16:53.146Z",
"epics": {
"2026-05-13-binder-wrap-helper": {
"binder-wrap-helper": {
"status": "done",
"title": "Collapse binder duplication via wireUseCase helper",
"prd": "docs/work/prds/2026-05-13-binder-wrap-helper.prd.md",
"prd": "docs/work/prds/binder-wrap-helper.prd.md",
"stories": {
"01-wire-use-case-helper": {
"status": "done",
@@ -39,10 +39,10 @@
}
}
},
"2026-05-14-ci-security-and-supply-chain": {
"ci-security-and-supply-chain": {
"status": "done",
"title": "CI security + supply-chain enforcement stack",
"prd": "docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md",
"prd": "docs/work/prds/ci-security-and-supply-chain.prd.md",
"stories": {
"01-trace-schema-extensions": {
"status": "done",
@@ -142,10 +142,10 @@
}
}
},
"2026-05-14-library-evaluation-policy": {
"library-evaluation-policy": {
"status": "done",
"title": "Library evaluation policy — skill, traces, enforcement stack",
"prd": "docs/work/prds/2026-05-14-library-evaluation-policy.prd.md",
"prd": "docs/work/prds/library-evaluation-policy.prd.md",
"stories": {
"01-trace-schema-foundation": {
"status": "done",
@@ -240,21 +240,6 @@
"blocks": []
}
}
},
"template-reset-v1": {
"status": "done",
"title": "Template reset — strip setup-process noise + archive history",
"prd": null,
"stories": {
"01-template-reset": {
"status": "done",
"title": "Strip setup refs + archive history + rename ADR-012",
"ac_total": 12,
"ac_completed": 12,
"depends_on": [],
"blocks": []
}
}
}
},
"ready": [],

View File

@@ -1,6 +1,6 @@
---
id: 01-wire-use-case-helper
epic: 2026-05-13-binder-wrap-helper
epic: binder-wrap-helper
title: Introduce wireUseCase helper in core-shared
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: core-shared
depends-on: []
blocks: [02-migrate-feature-binders, 03-update-generator-templates]
created: 2026-05-13T19:17:10+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 02-migrate-feature-binders
epic: 2026-05-13-binder-wrap-helper
epic: binder-wrap-helper
title: Migrate all five feature binders to wireUseCase
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: auth, blog, media, marketing-pages, navigation
depends-on: [01-wire-use-case-helper]
blocks: []
created: 2026-05-13T19:17:10+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 03-update-generator-templates
epic: 2026-05-13-binder-wrap-helper
epic: binder-wrap-helper
title: Update feature generator templates to emit wireUseCase call shape
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: core-shared
depends-on: [01-wire-use-case-helper]
blocks: []
created: 2026-05-13T19:17:10+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,12 +1,12 @@
---
id: 2026-05-13-binder-wrap-helper
prd: docs/work/prds/2026-05-13-binder-wrap-helper.prd.md
id: binder-wrap-helper
prd: docs/work/prds/binder-wrap-helper.prd.md
title: Collapse binder duplication via wireUseCase helper
type: epic
status: done
features: [core-shared, auth, blog, media, marketing-pages, navigation]
created: 2026-05-13T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 01-trace-schema-extensions
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Trace schema extensions (socketRisk + lastRevalidated)
type: technical-story
status: done
@@ -13,7 +13,7 @@ blocks:
05-trace-revalidation-workflow,
]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 02-socket-integration
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Socket integration (skill + CI)
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: [01-trace-schema-extensions]
blocks: [08-reviewer-prompt-update]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 03-renovate-adoption
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Renovate adoption
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: []
blocks: [09-ci-security-guide-and-docs]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 04-major-bump-reevaluation
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Major-bump re-evaluation flow
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: scripts
depends-on: [01-trace-schema-extensions]
blocks: [05-trace-revalidation-workflow]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 05-trace-revalidation-workflow
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Trace revalidation workflow
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: scripts
depends-on: [01-trace-schema-extensions, 04-major-bump-reevaluation]
blocks: [09-ci-security-guide-and-docs]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 06-codeql-and-audit-signatures
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: CodeQL workflow + pnpm audit signatures
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: []
blocks: [08-reviewer-prompt-update]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 07-gitleaks-precommit
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Gitleaks pre-commit hook
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: []
blocks: [09-ci-security-guide-and-docs]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 08-reviewer-prompt-update
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: Sandcastle reviewer prompt update
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: [02-socket-integration, 06-codeql-and-audit-signatures]
blocks: [09-ci-security-guide-and-docs]
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 09-ci-security-guide-and-docs
epic: 2026-05-14-ci-security-and-supply-chain
epic: ci-security-and-supply-chain
title: CI security guide + CLAUDE.md
type: technical-story
status: done
@@ -18,7 +18,7 @@ depends-on:
]
blocks: []
created: 2026-05-14T18:59:12+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,12 +1,12 @@
---
id: 2026-05-14-ci-security-and-supply-chain
prd: docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md
id: ci-security-and-supply-chain
prd: docs/work/prds/ci-security-and-supply-chain.prd.md
title: CI security + supply-chain enforcement stack
type: epic
status: done
features: [scripts, tooling, docs]
created: 2026-05-14T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 01-trace-schema-foundation
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Trace schema module + docs/library-decisions/ foundation
type: technical-story
status: done
@@ -14,7 +14,7 @@ blocks:
08-backfill-traces,
]
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 02-pre-commit-check-script
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Pre-commit check script for library trace presence
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: scripts
depends-on: [01-trace-schema-foundation]
blocks: [06-sandcastle-reviewer-prompt]
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 03-claude-hooks
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Claude PreToolUse / PostToolUse hooks for library-policy nudge
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: []
blocks: []
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 04-evaluate-library-skill
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: evaluate-library skill (SKILL.md + supporting files)
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: [01-trace-schema-foundation]
blocks: [05-human-guide]
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 05-human-guide
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Human reading-room guide — docs/guides/adding-a-library.md
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: docs
depends-on: [04-evaluate-library-skill]
blocks: [09-claude-md-update]
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 06-sandcastle-reviewer-prompt
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Sandcastle reviewer prompt — Library-trace check section
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: [02-pre-commit-check-script]
blocks: []
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 07-generator-pre-shipped-traces
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Generator templates — pre-shipped traces for optional core packages
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: tooling
depends-on: [01-trace-schema-foundation]
blocks: []
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 08-backfill-traces
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: Backfill library traces for existing feature- and core-tier runtime deps
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: docs
depends-on: [01-trace-schema-foundation]
blocks: []
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,6 +1,6 @@
---
id: 09-claude-md-update
epic: 2026-05-14-library-evaluation-policy
epic: library-evaluation-policy
title: CLAUDE.md Key Conventions — library policy bullet
type: technical-story
status: done
@@ -8,7 +8,7 @@ feature: docs
depends-on: [05-human-guide]
blocks: []
created: 2026-05-14T06:52:02+02:00
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,12 +1,12 @@
---
id: 2026-05-14-library-evaluation-policy
prd: docs/work/prds/2026-05-14-library-evaluation-policy.prd.md
id: library-evaluation-policy
prd: docs/work/prds/library-evaluation-policy.prd.md
title: Library evaluation policy — skill, traces, enforcement stack
type: epic
status: done
features: [scripts, tooling, docs]
created: 2026-05-14T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Goal

View File

@@ -1,12 +1,12 @@
---
id: 2026-05-13-binder-wrap-helper
id: binder-wrap-helper
title: Collapse binder duplication via wireUseCase helper
type: prd
status: approved
author: danijel
elicitation-session: improve-codebase-architecture-2026-05-13
created: 2026-05-13T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
---
## Problem

View File

@@ -1,13 +1,13 @@
---
id: 2026-05-14-ci-security-and-supply-chain
id: ci-security-and-supply-chain
title: CI security + supply-chain enforcement stack
type: prd
status: approved
author: danijel
created: 2026-05-14T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
adr: adr-023
builds-on: 2026-05-14-library-evaluation-policy
builds-on: library-evaluation-policy
---
## Problem
@@ -479,7 +479,7 @@ mode) — they get standard vitest coverage.
- **Builds on ADR-022** — Library evaluation policy. ADR-022 stays
unedited; ADR-023 §6 amends it with major-bump trigger,
`last-revalidated` field, and Socket as the 9th hard filter.
- **Builds on PRD** `2026-05-14-library-evaluation-policy` — many of
- **Builds on PRD** `library-evaluation-policy` — many of
this PRD's modules extend artifacts being built by that PRD's epic.
The sequencing constraint in §Implementation Decisions is
load-bearing.

View File

@@ -1,12 +1,12 @@
---
id: 2026-05-13-coverage-architecture
id: coverage-architecture
title: Agent-first coverage architecture (4 layers + manifest-driven thresholds)
type: prd
status: shipped
author: danijel
elicitation-session: brainstorm-2026-05-13
created: 2026-05-13T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
shipped: 2026-05-13
shipping-commits:
- 7eb783a (PRD)

View File

@@ -1,11 +1,11 @@
---
id: 2026-05-14-library-evaluation-policy
id: library-evaluation-policy
title: Library evaluation policy — skill, traces, enforcement stack
type: prd
status: approved
author: danijel
created: 2026-05-14T00:00:00Z
updated: 2026-05-14T19:10:35.370Z
updated: 2026-05-14T19:16:52.691Z
adr: adr-022
---

View File

@@ -1,25 +0,0 @@
---
id: 01-template-reset
epic: template-reset-v1
title: Strip setup refs + archive history + rename ADR-012
type: technical-story
status: done
feature: cleanup
depends-on: []
blocks: []
---
## Tasks
- [x] Story scaffold
- [x] Create .archive/ + .gitignore entry + README.md
- [x] Move docs/work/<epic-slug>/ (except \_templates, README, \_state.json, this epic) to .archive/work/
- [x] Move docs/superpowers/plans/ to .archive/plans/
- [x] Move docs/superpowers/refactor-logs/ to .archive/refactor-logs/ (if exists)
- [x] Move docs/superpowers/specs/ to .archive/specs/ (if exists)
- [x] Strip Phase/Plan/R-number references from source comments (packages/**/src, apps/**/src, scripts/, turbo/generators)
- [x] Strip Lazar references from source comments + docs (CLAUDE.md, AGENTS.md, README.md, runbook, guides, turbo/generators)
- [x] Rename docs/decisions/adr-012-lazar-conformance.md → adr-012-feature-conventions.md; update content + cross-references
- [x] Update cli.test.mjs to accept empty docs/work/ state
- [x] Rebuild \_state.json
- [x] Final verification + closeout

View File

@@ -1,25 +0,0 @@
---
id: template-reset-v1
prd: null
title: Template reset — strip setup-process noise + archive history
type: epic
status: done
features: [docs, cleanup]
created: 2026-05-13
---
## Goal
Strip every Phase/Plan/R-number/Lazar/milestone reference from source
comments + top-level docs. Move 14 completed epics, 14 plans, and any
refactor-logs/specs into a gitignored `.archive/` folder. Rename
ADR-012 (drop "lazar" from filename + content).
## Why
This repo is used as a template. Fresh clones should not see internal
setup history bleeding through comments or docs.
## Stories
- [x] [01 — Template reset (one-shot cleanup)](01-template-reset/_story.md)

View File

@@ -7,7 +7,7 @@
* being imported.
*
* Subcommands:
* rebuild-state Rewrites docs/work/_state.json from the current markdown
* rebuild-state Rewrites docs/work/_system/_state.json from the current markdown
* status Prints a tree of all epics + their stories
* next Prints the first ready story (or "All done" / "Blocked: ...")
* ready Prints every ready story
@@ -38,10 +38,12 @@ import { runCli as runDispatch } from "./dispatch.mjs";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = path.resolve(__dirname, "..", "..");
const WORK_ROOT = path.join(REPO_ROOT, "docs", "work");
const STATE_FILE = path.join(WORK_ROOT, "_state.json");
const SYSTEM_DIR = path.join(WORK_ROOT, "_system");
const STATE_FILE = path.join(SYSTEM_DIR, "_state.json");
function rebuildState() {
const state = buildState(WORK_ROOT);
if (!fs.existsSync(SYSTEM_DIR)) fs.mkdirSync(SYSTEM_DIR, { recursive: true });
fs.writeFileSync(STATE_FILE, JSON.stringify(state, null, 2) + "\n");
console.log(
`Rebuilt ${path.relative(REPO_ROOT, STATE_FILE)} with ${Object.keys(state.epics).length} epic(s).`,

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
const SKIP_FOLDERS = new Set(["_templates", "prds"]);
const SKIP_FOLDERS = new Set(["_templates", "_system", "prds"]);
const SKIP_FILES = new Set(["README.md", "_state.json"]);
/**

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
* Pre-commit guard: refuses the commit if docs/work/_state.json is staged
* Pre-commit guard: refuses the commit if docs/work/_system/_state.json is staged
* but is not byte-identical to what `pnpm work rebuild-state` would emit
* given the current markdown content of docs/work/.
*
@@ -23,34 +23,45 @@ import { buildState } from "./state-builder.mjs";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = path.resolve(__dirname, "..", "..");
const WORK_ROOT = path.join(REPO_ROOT, "docs", "work");
const STATE_FILE = path.join(WORK_ROOT, "_state.json");
const STATE_FILE = path.join(WORK_ROOT, "_system", "_state.json");
function stagedFiles() {
const out = execSync("git diff --cached --name-only", { cwd: REPO_ROOT, encoding: "utf8" });
const out = execSync("git diff --cached --name-only", {
cwd: REPO_ROOT,
encoding: "utf8",
});
return out.split("\n").filter(Boolean);
}
function main() {
const staged = stagedFiles();
const stateRel = path.relative(REPO_ROOT, STATE_FILE);
if (!staged.includes(stateRel) && !staged.some((f) => f.startsWith("docs/work/") && f.endsWith(".md"))) {
if (
!staged.includes(stateRel) &&
!staged.some((f) => f.startsWith("docs/work/") && f.endsWith(".md"))
) {
process.exit(0);
}
if (!fs.existsSync(STATE_FILE)) {
console.error("✗ state-sync-guard: docs/work/_state.json missing. Run `pnpm work rebuild-state`.");
console.error(
"✗ state-sync-guard: docs/work/_system/_state.json missing. Run `pnpm work rebuild-state`.",
);
process.exit(1);
}
const onDisk = fs.readFileSync(STATE_FILE, "utf8");
const fresh = JSON.stringify(buildState(WORK_ROOT), null, 2) + "\n";
// The `updated_at` timestamp will always differ. Strip it from both sides
// before comparing.
const stripUpdatedAt = (s) => s.replace(/"updated_at":\s*"[^"]+",?\s*\n?/, "");
const stripUpdatedAt = (s) =>
s.replace(/"updated_at":\s*"[^"]+",?\s*\n?/, "");
if (stripUpdatedAt(onDisk) === stripUpdatedAt(fresh)) {
process.exit(0);
}
console.error("✗ state-sync-guard: docs/work/_state.json is out of sync with markdown.");
console.error(
"✗ state-sync-guard: docs/work/_system/_state.json is out of sync with markdown.",
);
console.error(" Run: pnpm work rebuild-state");
console.error(" Then: git add docs/work/_state.json");
console.error(" Then: git add docs/work/_system/_state.json");
process.exit(1);
}