A complete framework for starting new projects from scratch with LLM assistance. Features modular architecture, automatic test generation, and structured workflows for greenfield development.
Based on the original Claude Code Project Template by ktnyt, adapted for greenfield development with automatic test coverage.
This framework helps you start new projects with LLMs (like Claude) by providing:
- Project Genesis - Interactive wizard for project setup
- Architecture Definition - Module boundaries and interfaces first
- Modular Development - Implement modules in isolation
- Automatic Testing - 85%+ coverage without manual test writing
- Technology Selection - Smart defaults with customization
- Multiple Project Types - Web API, CLI Tool, Library
| Aspect | Feature-Driven | Greenfield Bootstrap |
|---|---|---|
| Starting Point | Existing codebase | Empty directory |
| First Step | Create work-item | Initialize project |
| Architecture | Discover existing | Define from scratch |
| Tech Stack | Assumed | Interactive selection |
| Modules | Modify existing | Create new |
| Build Order | Feature by feature | Layer by layer |
# Start interactive wizard
/claude init-project
# You'll be prompted for:
# - Project name
# - Description
# - Technology stack (with smart defaults)
# - Project type (Web API / CLI / Library)# Design module boundaries
/claude define-architecture
# Creates:
# - docs/architecture/README.md
# - docs/architecture/interfaces/*.md
# - Module dependency graph# Build foundation first
/claude implement-module core
# Includes:
# - Configuration management
# - Logging setup
# - Base exceptions
# - Database connection (if applicable)# Implement domain modules in parallel
/claude implement-module users
/claude implement-module orders
/claude implement-module products# Build service layer
/claude implement-module payment_service
/claude implement-module email_service# Wire modules together
/claude integrate-modules
# Creates:
# - Dependency injection
# - API routes (Web API) or CLI commands
# - Integration tests/init-project → Create project structure
/define-architecture → Design modules and interfaces
/implement-module → Build module with auto-testing
/integrate-modules → Assemble complete system
/add-migrations → Add database migrations (optional)
Best for: HTTP APIs, microservices, backend services
Stack:
- FastAPI - Modern async web framework
- Pydantic - Data validation
- SQLAlchemy 2.0 - Database ORM
- PostgreSQL - Production database
- pytest - Testing
- Docker - Development environment
Structure:
project/
├── src/project/
│ ├── main.py # FastAPI app
│ ├── dependencies.py # DI container
│ ├── core/ # Config, logging
│ ├── models/ # Database models
│ ├── services/ # Business logic
│ └── api/ # Route handlers
├── tests/
│ ├── unit/
│ └── integration/
└── docker-compose.yml
Best for: Command-line utilities, scripts, tools
Stack:
- Typer - CLI framework
- Rich - Terminal output
- Pydantic - Settings
- SQLite - File-based DB (optional)
- pytest - Testing
Structure:
project/
├── src/project/
│ ├── cli.py # Entry point
│ ├── core/ # Config
│ ├── commands/ # CLI commands
│ └── services/ # Business logic
├── tests/
└── Dockerfile
Best for: Reusable packages, SDKs, tools
Stack:
- Pure Python
- Minimal dependencies
- Clean public API
- Examples directory
- Comprehensive tests
Structure:
project/
├── src/project/
│ ├── __init__.py # Public API
│ ├── core/ # Base classes
│ └── modules/ # Functionality
├── tests/
└── examples/ # Usage examples
Build in layers, bottom-up:
Layer 3: API/CLI (depends on 0-2)
Layer 2: Services (depends on 0-1)
Layer 1: Domains (depends on 0)
Layer 0: Core (no dependencies)
Each module:
- Has defined interface contract
- Can be implemented independently
- Tested in isolation (mock dependencies)
- Integrated via dependency injection
Before implementation:
- Define interface in
docs/architecture/interfaces/{module}.md - Specify functions, types, exceptions
- Document behavior and examples
- Then implement to spec
Every module automatically gets tests:
- Happy paths
- Error cases
- Edge cases
- Input validation
- Business logic
- Error handling
- Validation rules
- Database operations
- External calls
- Third-party libraries
- Standard library
- Dataclass definitions
- Constants
- Type hints
- Import statements
Every implementation has 6 user checkpoints:
- Implementation Plan - Review strategy
- Code Implementation - Review changes
- Test Generation - Approve test plan
- Coverage Gap - Handle <85% (if needed)
- Review Findings - Approve code review
- Final Staging - Commit or reset
No automatic commits - you control git history.
Each skill loads minimal context:
init-project:
- User inputs only
- Template files
define-architecture:
- Project structure
- No source code (doesn't exist yet)
implement-module:
- Interface contract only
- Core module (if needed)
- No other modules
integrate-modules:
- All interfaces
- Integration points only
- Prevents context exhaustion
- Enables parallel module work
- Keeps LLM focused
- Faster iterations
- Framework: FastAPI
- Validation: Pydantic v2
- Database: PostgreSQL + asyncpg
- ORM: SQLAlchemy 2.0 (async)
- Auth: JWT + bcrypt
- Testing: pytest + async support
- Linting: ruff
- Types: mypy
- Container: Docker + docker-compose
- Framework: Typer
- Output: Rich
- Config: Pydantic Settings
- DB: SQLite (optional)
- Testing: pytest
- Linting: ruff
- Types: mypy
- Minimal: Pure Python
- Validation: Pydantic (optional)
- Testing: pytest
- Linting: ruff
- Types: mypy
All defaults are customizable during initialization.
project/
├── src/{project_name}/
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── dependencies.py # DI (Web API)
│ ├── cli.py # Entry point (CLI)
│ ├── core/ # Layer 0
│ │ ├── __init__.py
│ │ ├── config.py
│ │ ├── database.py
│ │ ├── exceptions.py
│ │ └── logging.py
│ └── {modules}/ # Layers 1-2
│ ├── __init__.py
│ ├── models.py
│ ├── service.py
│ └── exceptions.py
├── tests/
│ ├── __init__.py
│ ├── conftest.py # Fixtures
│ ├── test_core_*.py
│ └── test_{module}_*.py
├── docs/
│ ├── architecture/
│ │ ├── README.md
│ │ └── interfaces/
│ │ ├── core.md
│ │ └── {module}.md
│ └── decisions/ # ADRs
├── alembic/ # Migrations (optional)
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
├── .pre-commit-config.yaml
├── .gitignore
└── README.md
- Interactive wizard
- Tech stack selection
- Project scaffolding
- Docker setup
- Git initialization (optional)
- Module boundary design
- Interface contracts
- Dependency graph
- Build order
- ASCII diagrams
- Reads interface contract
- Implements all functions
- Generates tests (85%)
- 6 approval checkpoints
- Stages changes
- Verifies all modules
- Creates DI container
- Implements API/CLI layer
- Creates integration tests
- End-to-end verification
- Alembic setup
- Initial migration
- Docker integration
- Command documentation
- Single responsibility
- Clear interfaces
- Dependency injection
- No circular dependencies
- Test behavior, not implementation
- Mock external dependencies
- Test error paths
- 85% coverage minimum
- Living docs (evolve with code)
- Interface contracts as spec
- ADRs for decisions
- Code is truth (after implementation)
- Define interface first
- Implement in isolation
- Test thoroughly
- Integrate at the end
- Review and finalize
| Template | Best For | Starting Point | Key Feature |
|---|---|---|---|
| Greenfield | New projects | Empty directory | Architecture-first |
| Feature-Driven | Existing code | Working codebase | Automatic tests |
| Sprint-Based | Team planning | Existing codebase | Sprint ceremonies |
# 1. Initialize
$ /claude init-project
> Project name: ecommerce-api
> Type: Web API
> Accept defaults? Yes
# 2. Define architecture
$ /claude define-architecture
> Modules: users, products, orders
> Services: payment, email
# 3. Implement core
$ /claude implement-module core
> Coverage: 94%
> Status: Approved
# 4. Implement domains (parallel)
$ /claude implement-module users # Coverage: 87%
$ /claude implement-module products # Coverage: 91%
$ /claude implement-module orders # Coverage: 89%
# 5. Implement services
$ /claude implement-module payment_service # Coverage: 92%
# 6. Integrate
$ /claude integrate-modules
> All tests pass
> Coverage: 88%
# 7. Add migrations
$ /claude add-migrations
> Initial migration createdStart small:
- Fewer modules = faster iteration
- Add complexity incrementally
Interface contracts are binding:
- Define carefully
- Change before implementation is cheap
- Change after is expensive
Test as you go:
- Each module standalone
- Integration at the end
- Full system verification
Use dependency injection:
- Makes testing easy
- Enables parallel work
- Clean separation
"Module not found" during implement-module:
- Run
/define-architecturefirst - Check interface file exists
"Dependency not ready":
- Build bottom-up (Layer 0 → 1 → 2 → 3)
- Core module must be complete first
"Coverage below 85%":
- Normal for complex modules
- Can accept lower with documentation
- Or run more test generation cycles
This is a template/framework. Use it however you want for your projects.
This framework is based on the Claude Code Project Template by ktnyt, completely redesigned for greenfield development with architecture-first approach and automatic test generation.