Captures the design from the brainstorm session on agent-first development in this template. Architecture doc covers the four interlocking pillars: - Conformance engine (manifest + brands + ESLint + boot + CI gate) - Agent workflow (PRD -> Epic -> Story -> Task; manifest-first ordering; TDD per slice; in/out scope at every level) - Local task system at docs/work/ (filesystem markdown, derived committed _state.json, single-writer orchestrator rule) - Sandcastle orchestrator (implementer + reviewer loop, DAG-respecting, configurable retry cap) Work-shape guides extend the architecture doc with operational detail for frontend work (atomic design, Storybook-as-spec, component + Playwright screenshot test gates, Storybook MCP reviewer integration) and infrastructure work (ADR-first flow, dedicated ADR elicitation skill, optional core packages vs. new infrastructure layers). Phasing is conformance-first: build the enforcement system manually, then build the dispatch substrate, then migrate remaining features through it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Clean Architecture Monorepo Template
Turborepo + pnpm monorepo organized by vertical features. See CLAUDE.md for the full conventions reference and AGENTS.md for the package map.
Quick Start
pnpm install # Install all dependencies
pnpm dev # Start all dev servers
pnpm build # Build all packages
pnpm test # Run all tests
pnpm turbo boundaries # Validate workspace dependency graph
pnpm turbo gen feature # Scaffold a new feature package
docker compose up -d # Start PostgreSQL
Optional packages
The default template includes the must-have core packages and all 5 feature packages. Five core packages are optional and scaffold on demand:
pnpm turbo gen core-package realtime # Socket.IO realtime layer (ADR-016)
pnpm turbo gen core-package events # Cross-feature events + Payload jobs (ADR-015)
pnpm turbo gen core-package trpc # tRPC server setup
pnpm turbo gen core-package ui # Design system
pnpm turbo gen core-package audit # DPA-compliant audit logging (ADR-018)
See docs/architecture/template-tiers.md for the full tier list.
Key ports
| Service | Port |
|---|---|
| Next.js | 3000 |
| Payload CMS | 3001 |
| TanStack Start | 3002 |
| PostgreSQL | 5432 |
| Storybook | 6006 |
Description
Languages
TypeScript
65.6%
JavaScript
21.1%
Handlebars
12.2%
Shell
0.9%
Dockerfile
0.1%