docs: surface turbo gen feature in AGENTS.md and CLAUDE.md
Wires the existing turbo gen feature generator into AGENTS.md (Adding a Feature section, Key Commands, Specification & Guides) and CLAUDE.md (Quick Start, Read First). Adds a fast-path callout at the top of the manual walkthrough in docs/guides/adding-a-feature.md pointing at scaffolding-a-feature.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
AGENTS.md
21
AGENTS.md
@@ -72,13 +72,16 @@ No other cross-package boundary deviations are permitted.
|
||||
|
||||
## Adding a Feature
|
||||
|
||||
Start with `docs/guides/adding-a-feature.md` for a step-by-step walkthrough covering:
|
||||
- New feature scaffold (folder structure, `package.json`, `tsconfig.json`, `vitest.config.ts`)
|
||||
- Clean Architecture layers (entities, use cases, repositories, DI container, controllers)
|
||||
- Payload integration (collections, hooks, Payload repository binding)
|
||||
- tRPC integration (routers, procedure binding)
|
||||
- Core wiring (`core-api`, `core-cms`, path aliases, app bootstrap)
|
||||
- Testing and lint validation
|
||||
**Fast path — use the generator.** `pnpm turbo gen feature` scaffolds a Lazar-conformant package under `packages/<name>/` (single entity, single `getX` use case) matching the `navigation` reference shape. It emits package files, entities, use case + controller (with input/output schemas + presenter), mock + real repositories (real one is a Phase-1 stub), DI container, both binders (`bind-production` / `bind-dev-seed`), tRPC procedures + router with tests, contract suite, dev seed, and an empty `ui/` barrel — all wired with the span + capture sandwich at bind time.
|
||||
|
||||
```bash
|
||||
pnpm turbo gen feature # interactive
|
||||
pnpm turbo gen feature --args widgets Widget widgets # non-interactive: <name> <Entity> <entities-plural>
|
||||
```
|
||||
|
||||
The generator does NOT wire aggregators or emit Payload CMS templates / faker factories / multi-entity layouts. After running, hand-edit `apps/web-next/src/server/bind-production.ts`, `packages/core-api/src/root.ts`, and the two `package.json` files (the generator prints the exact checklist on success). See `docs/guides/scaffolding-a-feature.md` for the full reference.
|
||||
|
||||
**Manual path.** When the generator's Phase-1 scope doesn't fit (multiple entities/use cases, custom layout, extending an existing feature), follow `docs/guides/adding-a-feature.md` — a step-by-step walkthrough covering folder structure, Clean Architecture layers, Payload + tRPC integration, core wiring, and testing / lint validation.
|
||||
|
||||
---
|
||||
|
||||
@@ -90,6 +93,7 @@ pnpm dev # Start all dev servers (Next.js :3000, CMS :3001, Storyb
|
||||
pnpm typecheck # Type-check all packages
|
||||
pnpm lint # Lint all packages (ESLint boundaries enforced)
|
||||
pnpm turbo boundaries # Validate workspace dependency graph (Turbo boundaries)
|
||||
pnpm turbo gen feature # Scaffold a new Lazar-conformant feature package (see docs/guides/scaffolding-a-feature.md)
|
||||
pnpm test # Run all unit + integration tests (Vitest)
|
||||
pnpm test:e2e # Run e2e tests (Playwright across both apps)
|
||||
pnpm build # Build all packages (Turborepo)
|
||||
@@ -440,7 +444,8 @@ Feature packages MUST NOT `import "@sentry/*"`. Allowlist:
|
||||
- **Vertical Feature Spec** — `docs/architecture/vertical-feature-spec.md` — full design, rationale, decision log
|
||||
- **Architecture Overview** — `docs/architecture/overview.md` — package responsibilities, data flow
|
||||
- **Dependency Flow** — `docs/architecture/dependency-flow.md` — allowed directions and composition pattern
|
||||
- **Adding a Feature Guide** — `docs/guides/adding-a-feature.md` — step-by-step new feature walkthrough
|
||||
- **Scaffolding a Feature** — `docs/guides/scaffolding-a-feature.md` — `turbo gen feature` reference (fast path)
|
||||
- **Adding a Feature Guide** — `docs/guides/adding-a-feature.md` — step-by-step new feature walkthrough (manual path)
|
||||
- **Testing Strategy** — `docs/guides/testing-strategy.md` — test placement, Vitest per-package, Playwright e2e
|
||||
- **TDD Workflow** — `docs/guides/tdd-workflow.md` — red-green-refactor cycle, mocking decision tree, coverage targets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user