docs(work): decompose binder-wrap-helper PRD into epic + 8 stories

Output from `pnpm work decompose 2026-05-13-binder-wrap-helper
--execute` — sandcastle ran the decomposer agent with subscription
auth (after the macOS keychain workaround + Dockerfile fix from
prior commits). The agent wrote files but hit `Max iterations: 1`
before committing, so this commit carries its output unchanged.

Epic: docs/work/binder-wrap-helper/
  - _epic.md links to PRD 2026-05-13-binder-wrap-helper
  - features: [core-shared, auth, blog, media, marketing-pages,
    navigation, tooling]

Stories (8 total, with dependency edges):
  01-wire-use-case-helper           prereq (blocks 02..07)
    Goal: helper at core-shared/conformance/wire-use-case.ts +
    tests covering brand stacking, span/capture/audit composition,
    idempotent bind. depends-on: [], blocks 02..07.
  02-migrate-auth-binders           depends-on [01]
  03-migrate-blog-binders           depends-on [01]
  04-migrate-media-binders          depends-on [01]
  05-migrate-marketing-pages-       depends-on [01]
    binders
  06-migrate-navigation-binders     depends-on [01]
  07-update-feature-generator       depends-on [01]
  08-holistic-validation            depends-on [02..07], blocks: []
    Final gate suite + fallow dupes check to verify the 5 binder-
    pair clone groups have disappeared.

After 01 lands, stories 02..07 are parallelisable; 08 collects them.

Pre-commit hook regenerates _state.json + re-stages it so `pnpm
work next` immediately surfaces the new ready story.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 18:10:31 +02:00
parent 9d4b801909
commit 6f18075593
10 changed files with 598 additions and 3 deletions

View File

@@ -0,0 +1,46 @@
---
id: 07-update-feature-generator
epic: binder-wrap-helper
title: Update feature generator template to emit wireUseCase calls
type: technical-story
status: todo
feature: tooling
depends-on: [01-wire-use-case-helper]
blocks: [08-holistic-validation]
---
## Goal
Update `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` and `bind-dev-seed.ts.hbs` to emit `wireUseCase` calls instead of inline `withSpan + withCapture` blocks, so that `pnpm turbo gen feature` scaffolds conformant binders from the first commit.
## Why
Without this change, every new feature scaffolded after the migration would drift back to the inline wrap shape, silently undoing the consolidation. The generator is the only enforcement point for new-feature defaults.
## Done when
- `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` emits a `wireUseCase` call for the scaffolded use case, not an inline wrap block.
- `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` emits a `wireUseCase` call for the scaffolded use case.
- The inline `withSpan(... withCapture(...))` pattern is absent from both templates.
- `@repo/core-shared/conformance` is imported in the generated binder output (the `wireUseCase` import).
- Running `pnpm turbo gen feature` (dry-run or against a scratch location) produces binders that match the migration shape from stories 0206.
## In scope
- `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` — replace use-case wrap block.
- `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` — replace use-case wrap block.
- Import statement update in both templates to pull in `wireUseCase` from `@repo/core-shared/conformance`.
## Out of scope
- Other generator templates (entity, repository, controller, etc.) — unchanged.
- The generator's interactive prompts or `index.ts` config — unchanged unless needed to pass new template variables.
- Updating already-scaffolded features (covered by stories 0206).
## Tasks
- [ ] Read `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` — understand current inline wrap shape and Handlebars variables used
- [ ] Read `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` — same
- [ ] Update `bind-production.ts.hbs` — replace inline wrap block with `wireUseCase` call; add `wireUseCase` import from `@repo/core-shared/conformance`
- [ ] Update `bind-dev-seed.ts.hbs` — same
- [ ] Verify template output by inspecting rendered Handlebars (or running `pnpm turbo gen feature` in dry-run / scratch mode) to confirm generated binder matches the migration shape