diff --git a/docs/guides/scaffolding-a-feature.md b/docs/guides/scaffolding-a-feature.md index 25c5856..17ee620 100644 --- a/docs/guides/scaffolding-a-feature.md +++ b/docs/guides/scaffolding-a-feature.md @@ -90,6 +90,18 @@ feature on the app's runtime composition graph: The same checklist is printed by the generator when it finishes. +## Adding events and jobs to a feature + +Once a feature exists, augment it with cross-feature events or background jobs using the dedicated generators. See [`docs/guides/events-and-jobs.md`](./events-and-jobs.md) for full walkthroughs. + +```bash +pnpm turbo gen event publish # publisher contract +pnpm turbo gen event consume # consumer handler + Payload event-task +pnpm turbo gen job # background job + TaskConfig +``` + +The generators insert at six fixed `// ` anchor comments. Generated features include four of them automatically (the `// ` location is in `integrations/cms/index.ts`, which is manually authored as part of Phase-2 wiring); pre-existing features were retrofitted in ADR-015. + ## Cross-links - `CLAUDE.md` — Key Conventions (factory-style use cases, `.toDynamicValue()`, @@ -99,3 +111,4 @@ The same checklist is printed by the generator when it finishes. - `docs/decisions/adr-012-lazar-conformance.md` — file naming + factory pattern - `docs/decisions/adr-013-input-output-unification.md` — schemas-in-use-case + presenter - `docs/decisions/adr-014-instrumentation-sentry.md` — span + capture wiring (R41–R44) +- `docs/decisions/adr-015-events-and-jobs.md` — cross-feature events + background jobs