Production-ready Fastify + TypeScript monorepo optimized for AI-assisted development
This template provides a production-ready foundation where AI coding agents autonomously generate complete backend APIs with automatically generated type-safe client SDKs using comprehensive guardrails that prevent technical debt and architectural violations.
Modern AI coding assistants are powerful but can introduce subtle bugs, architectural violations, or security issues. This template provides:
- Immediate feedback loops for AI agents through fail-fast pipelines
- Constraint-driven development that guides AI toward correct patterns
- Comprehensive quality gates that catch issues before they reach production
- Clear architectural boundaries that prevent spaghetti code
Traditional software quality relies on experienced developers making good decisions. AI agents have different failure modes that require systematic prevention:
🧪 The "Coverage Theater" Problem
🏗️ Architectural Drift Without Understanding
⚡ Different Development Velocity
- Human pace: Think → Code → Test → Review (minutes to hours)
- AI pace: Generate → Validate → Iterate (seconds)
- Our solution: Fast quality gates optimized for AI's rapid iteration
This template implements constraint-based development where quality comes from systematic guardrails, not developer experience.
Built for fully autonomous AI development workflows where AI agents generate complete applications while automated tooling provides type-safe client integration. The human role is limited to:
- Requirements collaboration with AI agents (pulling from Linear via MCP)
- Final approval of AI-generated implementations
- Deployment decisions and production oversight
AI agents handle 100% of development:
- Complete application development (backend APIs, testing, documentation)
- Code generation, testing, and code review using Cursor IDE, Claude Code, and OpenAI Codex
Automated SDK generation provides:
- Type-safe client libraries automatically generated from API specifications (via Fern)
- Zero client integration overhead - consume APIs immediately with full IntelliSense
- Contract enforcement - breaking API changes are caught at compile-time
- Rapid prototyping - frontend teams get working client libraries instantly
This eliminates the traditional bottleneck where backend teams must manually write and maintain client SDKs, documentation, and coordinate API changes with frontend teams.
- Node.js >= 20.0.0
- pnpm >= 10.0.0
If you need to install GitLeaks separately or the automatic installation fails:
Note: GitLeaks is required for the pre-commit security scanning. The setup script automatically handles installation across different platforms.
| Fast streaming API | Fastify + fastify-sse | AI needs real-time responses | Standard in many projects |
| Linting + Formatting | ESLint + Prettier + Custom Rules | AI-specific rules prevent common mistakes | Usually just formatting |
| Early type safety | TypeScript (strict) | AI can't use escape hatches like any | Often allows any types |
| Schema validation | Zod (bodies & env) | Mandatory - AI doesn't know trust boundaries | Often optional/selective |
| Security scanning | GitLeaks + audit-ci | AI might commit secrets without realizing | Manual review sufficient |
| Guard against spaghetti | dependency-cruiser | AI creates circular dependencies without understanding | Relies on code review |
| High-trust tests | Vitest + Coverage | Basic foundation for testing | Same usage |
| Mutation testing | Stryker (high standards) | Catches AI's "fake tests" that achieve coverage but test nothing | Rarely used (expensive) |
| Task caching | pnpm workspaces + TurboRepo | Sub-5-second feedback for AI's rapid iteration | Same usage |
Status: ✅ Active - Backend API implemented
Contains deployable applications:
- backend-api/ - Production-ready Fastify server with TypeScript
- Each app has its own package.json
- Apps can depend on packages but not other apps
- Apps should be thin, delegating logic to packages
Status: ✅ Active - Configuration utilities implemented
Contains shared libraries:
- Reusable code across apps
- Can depend on other packages
- Should have clear, focused responsibilities
- Constraint-driven development guides AI toward correct patterns
- Immediate feedback loops through fail-fast pipelines
- Clear architectural boundaries prevent violations
- Comprehensive validation catches AI-generated errors
- Strict TypeScript - No any types, comprehensive checking with type-aware ESLint rules
- Runtime Validation - Zod schemas for all environment variables and request inputs
- Import Graph Validation - dependency-cruiser prevents circular dependencies and enforces architecture
- Comprehensive Testing - Unit, integration tests with high-standard mutation testing
- Environment variable validation with Zod schemas
- Input sanitization and validation at all API boundaries
- GitLeaks pre-commit scanning for credential detection
- Dependency vulnerability scanning with audit-ci
This template is in active development. Current state:
✅ Foundation Complete
- Monorepo structure with pnpm + TurboRepo
- Comprehensive documentation
- AI-first development guidelines
✅ Backend API Complete (MAR-11)
- Production-ready Fastify server with TypeScript
- Strict TypeScript configuration with enterprise standards
- Comprehensive test setup with Vitest
- Development and production scripts
✅ Quality Tooling Complete
- dependency-cruiser for architectural validation
- Mutation testing with Stryker for test quality validation
- Zod validation patterns for environment and inputs
- Comprehensive testing framework with Vitest
- CI/CD pipeline with GitHub Actions
Fast Quality Validation
Getting Started
- Follow the Quick Start guide above
- The backend API is already implemented and ready to use
- Refer to docs/ for detailed development guidelines
This template is specifically designed for autonomous AI development where AI agents perform all coding tasks. We support three primary AI coding tools—OpenAI Codex, Anthropic's Claude Code, and Cursor IDE.
All AI coding agents receive the same comprehensive guidelines from AGENTS.md:
- OpenAI Codex: Direct access to @AGENTS.md
- Cursor IDE: Accesses via @.cursor/rules/default.mdc → references AGENTS.md
- Claude Code: Accesses via @CLAUDE.md → imports AGENTS.md
This ensures 100% consistency across all AI coding tools with a single source of truth.
- Requirements Gathering: AI agents pull tickets from Linear (via MCP integration)
- Complete Development: AI agents generate full applications (APIs, tests, documentation) with full TypeScript safety
- Automated SDK Generation: Fern automatically generates type-safe client SDKs from API specifications
- Quality Validation: Comprehensive automated quality gates ensure code quality
- AI Code Review: AI agents perform thorough code review and validation
- Human Approval: Humans review final output and approve for deployment
Key Principle: Humans specify requirements and approve results. AI agents handle 100% of development implementation, while automated tooling provides seamless client integration.
Guidelines integrate with our quality pipeline:
Always edit AGENTS.md for shared guidelines. Tool-specific files should remain minimal imports/references.
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Ready to build AI-powered applications? This template provides the complete foundation you need with a production-ready Fastify backend, comprehensive testing, and AI-optimized development workflows.
.png)


![Educating the Next Generation of Open Source Project Contributors [video]](https://www.youtube.com/img/desktop/supported_browsers/chrome.png)