Spec to Repo
Turn a natural-language project specification into a complete, runnable starter repository. Not a template filler — a spec interpreter that generates real, working code for any stack.
When to Use
- User provides a text description of an app and wants code
- User has a PRD, requirements doc, or feature list and needs a codebase
- User says "build me an app that...", "scaffold this", "bootstrap a project"
- User wants a working starter repo, not just a file tree
Not this skill when the user wants a SaaS app with Stripe + Auth specifically — use product-team/saas-scaffolder instead.
Core Workflow
Phase 1 — Parse & Interpret
Read the spec. Extract these fields silently:
| Field |
Source |
Required |
| App name |
Explicit or infer from description |
yes |
| Description |
First sentence of spec |
yes |
| Features |
Bullet points or sentences describing behavior |
yes |
| Tech stack |
Explicit ("use FastAPI") or infer from context |
yes |
| Auth |
"login", "users", "accounts", "roles" |
if mentioned |
| Database |
"store", "save", "persist", "records", "schema" |
if mentioned |
| API surface |
"endpoint", "API", "REST", "GraphQL" |
if mentioned |
| Deploy target |
"Vercel", "Docker", "AWS", "Railway" |
if mentioned |
Stack inference rules (when user doesn't specify):
| Signal |
Inferred stack |
| "web app", "dashboard", "SaaS" |
Next.js + TypeScript |
| "API", "backend", "microservice" |
FastAPI (Python) or Express (Node) |
| "mobile app" |
Flutter or React Native |
| "CLI tool" |
Go or Python |
| "data pipeline" |
Python |
| "high performance", "systems" |
Rust or Go |
After parsing, present a structured interpretation back to the user:
## Spec Interpretation
**App:** [name]
**Stack:** [framework + language]
**Features:**
1. [feature]
2. [feature]
**Database:** [yes/no — engine]
**Auth:** [yes/no — method]
**Deploy:** [target]
Does this match your intent? Any corrections before I generate?
Flag ambiguities. Ask at most 3 clarifying questions. If the user says "just build it", proceed with best-guess defaults.
Phase 2 — Architecture
Design the project before writing any files:
- Select template — Match to a stack template from
references/stack-templates.md
- Define file tree — List every file that will be created
- Map features to files — Each feature gets at minimum one file/component
- Design database schema — If applicable, define tables/collections with fields and types
- Identify dependencies — List every package with version constraints
- Plan API routes — If applicable, list every endpoint with method, path, request/response shape
Present the file tree to the user before generating:
project-name/
├── README.md
├── .env.example
├── .gitignore
├── .github/workflows/ci.yml
├── package.json / requirements.txt / go.mod
├── src/
│ ├── ...
├── tests/
│ ├── ...
└── ...
Phase 3 — Generate
Write every file. Rules:
- Real code, not stubs. Every function has a real implementation. No
// TODO: implement or pass placeholders.
- Syntactically valid. Every file must parse without errors in its language.
- Imports match dependencies. Every import must correspond to a package in the manifest (package.json, requirements.txt, go.mod, etc.).
- Types included. TypeScript projects use types. Python projects use type hints. Go projects use typed structs.
- Environment variables. Generate
.env.example with every required variable, commented with purpose.
- README.md. Include: project description, prerequisites, setup steps (clone, install, configure env, run), and available scripts/commands.
- CI config. Generate
.github/workflows/ci.yml with: install, lint (if linter in deps), test, build.
- .gitignore. Stack-appropriate ignores (node_modules, pycache, .env, build artifacts).
File generation order:
- Manifest (package.json / requirements.txt / go.mod)
- Config files (.env.example, .gitignore, CI)
- Database schema / migrations
- Core business logic
- API routes / endpoints
- UI components (if applicable)
- Tests
- README.md
Phase 4 — Validate
After generation, run through this checklist:
Run scripts/validate_project.py against the generated directory to catch common issues.
Examples
Example 1: Task Management API
Input spec:
"Build me a task management API. Users can create, list, update, and delete tasks. Tasks have a title, description, status (todo/in-progress/done), and due date. Use FastAPI with SQLite. Add basic auth with API keys."
Output file tree:
task-api/
├── README.md
├── .env.example # API_KEY, DATABASE_URL
├── .gitignore
├── .github/workflows/ci.yml
├── requirements.txt # fastapi, uvicorn, sqlalchemy, pytest
├── main.py # FastAPI app, CORS, lifespan
├── models.py # SQLAlchemy Task model
├── schemas.py # Pydantic request/response schemas
├── database.py # SQLite engine + session
├── auth.py # API key middleware
├── routers/
│ └── tasks.py # CRUD endpoints
└── tests/
└── test_tasks.py # Smoke tests for each endpoint
Example 2: Recipe Sharing Web App
Input spec:
"I want a recipe sharing website. Users sign up, post recipes with ingredients and steps, browse other recipes, and save favorites. Use Next.js with Tailwind. Store data in PostgreSQL."
Output file tree:
recipe-share/
├── README.md
├── .env.example # DATABASE_URL, NEXTAUTH_SECRET, NEXTAUTH_URL
├── .gitignore
├── .github/workflows/ci.yml
├── package.json # next, react, tailwindcss, prisma, next-auth
├── tailwind.config.ts
├── tsconfig.json
├── next.config.ts
├── prisma/
│ └── schema.prisma # User, Recipe, Ingredient, Favorite models
├── src/
│ ├── app/
│ │ ├── layout.tsx
│ │ ├── page.tsx # Homepage — recipe feed
│ │ ├── recipes/
│ │ │ ├── page.tsx # Browse recipes
│ │ │ ├── [id]/page.tsx # Recipe detail
│ │ │ └── new/page.tsx # Create recipe form
│ │ └── api/
│ │ ├── auth/[...nextauth]/route.ts
│ │ └── recipes/route.ts
│ ├── components/
│ │ ├── RecipeCard.tsx
│ │ ├── RecipeForm.tsx
│ │ └── Navbar.tsx
│ └── lib/
│ ├── prisma.ts
│ └── auth.ts
└── tests/
└── recipes.test.ts
Example 3: CLI Expense Tracker
Input spec:
"Python CLI tool for tracking expenses. Commands: add, list, summary, export-csv. Store in a local SQLite file. No external API."
Output file tree:
expense-tracker/
├── README.md
├── .gitignore
├── .github/workflows/ci.yml
├── pyproject.toml
├── src/
│ └── expense_tracker/
│ ├── __init__.py
│ ├── cli.py # argparse commands
│ ├── database.py # SQLite operations
│ ├── models.py # Expense dataclass
│ └── formatters.py # Table + CSV output
└── tests/
└── test_cli.py
Anti-Patterns
| Anti-pattern |
Fix |
Placeholder code — // TODO: implement, pass, empty function bodies |
Every function has a real implementation. If complex, implement a working simplified version. |
| Stack override — picking Next.js when the user said Flask |
Always honor explicit tech preferences. Only infer when the user doesn't specify. |
| Missing .gitignore — committing node_modules or .env |
Generate stack-appropriate .gitignore as one of the first files. |
| Phantom imports — importing packages not in the manifest |
Cross-check every import against package.json / requirements.txt before finishing. |
| Over-engineering MVP — adding Redis caching, rate limiting, WebSockets to a v1 |
Build the minimum that works. The user can iterate. |
| Ignoring stated preferences — user says "PostgreSQL" and you generate MongoDB |
Parse the spec carefully. Explicit preferences are non-negotiable. |
Missing env vars — code reads process.env.X but .env.example doesn't list it |
Every env var used in code must appear in .env.example with a comment. |
| No tests — shipping a repo with zero test files |
At minimum: one smoke test per API endpoint or one test per core function. |
| Hallucinated APIs — generating code that calls library methods that don't exist |
Stick to well-documented, stable APIs. When unsure, use the simplest approach. |
Validation Script
scripts/validate_project.py
Checks a generated project directory for common issues:
# Validate a generated project
python3 scripts/validate_project.py /path/to/generated-project
# JSON output
python3 scripts/validate_project.py /path/to/generated-project --format json
Checks performed:
- README.md exists and is non-empty
- .gitignore exists
- .env.example exists (if code references env vars)
- Package manifest exists (package.json, requirements.txt, go.mod, Cargo.toml, pubspec.yaml)
- No .env file committed (secrets leak)
- At least one test file exists
- No TODO/FIXME placeholders in generated code
Progressive Enhancement
For complex specs, generate in stages:
- MVP — Core feature only, working end-to-end
- Auth — Add authentication if requested
- Polish — Error handling, validation, loading states
- Deploy — Docker, CI, deploy config
Ask the user after MVP: "Core is working. Want me to add auth/polish/deploy next, or iterate on what's here?"
Cross-References
- Related:
product-team/saas-scaffolder — SaaS-specific scaffolding (Next.js + Stripe + Auth)
- Related:
engineering/spec-driven-workflow — spec-first development methodology
- Related:
engineering/database-designer — database schema design patterns
- Related:
engineering-team/senior-fullstack — full-stack implementation patterns
1---2name: spec-to-repo3description: "Use when the user says 'build me an app', 'create a project from this spec', 'scaffold a new repo', 'generate a starter', 'turn this idea into code', 'bootstrap a project', 'I have requirements and need a codebase', or provides a natural-language project specification and expects a complete, runnable repository. Stack-agnostic: Next.js, FastAPI, Rails, Go, Rust, Flutter, and more."4disable-model-invocation: true5metadata:6 source: https://skillmd.com/skills/dini-2000/spec-to-repo7---89# Spec to Repo1011Turn a natural-language project specification into a complete, runnable starter repository. Not a template filler — a spec interpreter that generates real, working code for any stack.1213## When to Use1415- User provides a text description of an app and wants code16- User has a PRD, requirements doc, or feature list and needs a codebase17- User says "build me an app that...", "scaffold this", "bootstrap a project"18- User wants a working starter repo, not just a file tree1920**Not this skill** when the user wants a SaaS app with Stripe + Auth specifically — use `product-team/saas-scaffolder` instead.2122## Core Workflow2324### Phase 1 — Parse & Interpret2526Read the spec. Extract these fields silently:2728| Field | Source | Required |29|-------|--------|----------|30| App name | Explicit or infer from description | yes |31| Description | First sentence of spec | yes |32| Features | Bullet points or sentences describing behavior | yes |33| Tech stack | Explicit ("use FastAPI") or infer from context | yes |34| Auth | "login", "users", "accounts", "roles" | if mentioned |35| Database | "store", "save", "persist", "records", "schema" | if mentioned |36| API surface | "endpoint", "API", "REST", "GraphQL" | if mentioned |37| Deploy target | "Vercel", "Docker", "AWS", "Railway" | if mentioned |3839**Stack inference rules** (when user doesn't specify):4041| Signal | Inferred stack |42|--------|---------------|43| "web app", "dashboard", "SaaS" | Next.js + TypeScript |44| "API", "backend", "microservice" | FastAPI (Python) or Express (Node) |45| "mobile app" | Flutter or React Native |46| "CLI tool" | Go or Python |47| "data pipeline" | Python |48| "high performance", "systems" | Rust or Go |4950After parsing, present a structured interpretation back to the user:5152```53## Spec Interpretation5455**App:** [name]56**Stack:** [framework + language]57**Features:**581. [feature]592. [feature]6061**Database:** [yes/no — engine]62**Auth:** [yes/no — method]63**Deploy:** [target]6465Does this match your intent? Any corrections before I generate?66```6768Flag ambiguities. Ask **at most 3** clarifying questions. If the user says "just build it", proceed with best-guess defaults.6970### Phase 2 — Architecture7172Design the project before writing any files:73741. **Select template** — Match to a stack template from `references/stack-templates.md`752. **Define file tree** — List every file that will be created763. **Map features to files** — Each feature gets at minimum one file/component774. **Design database schema** — If applicable, define tables/collections with fields and types785. **Identify dependencies** — List every package with version constraints796. **Plan API routes** — If applicable, list every endpoint with method, path, request/response shape8081Present the file tree to the user before generating:8283```84project-name/85├── README.md86├── .env.example87├── .gitignore88├── .github/workflows/ci.yml89├── package.json / requirements.txt / go.mod90├── src/91│ ├── ...92├── tests/93│ ├── ...94└── ...95```9697### Phase 3 — Generate9899Write every file. Rules:100101- **Real code, not stubs.** Every function has a real implementation. No `// TODO: implement` or `pass` placeholders.102- **Syntactically valid.** Every file must parse without errors in its language.103- **Imports match dependencies.** Every import must correspond to a package in the manifest (package.json, requirements.txt, go.mod, etc.).104- **Types included.** TypeScript projects use types. Python projects use type hints. Go projects use typed structs.105- **Environment variables.** Generate `.env.example` with every required variable, commented with purpose.106- **README.md.** Include: project description, prerequisites, setup steps (clone, install, configure env, run), and available scripts/commands.107- **CI config.** Generate `.github/workflows/ci.yml` with: install, lint (if linter in deps), test, build.108- **.gitignore.** Stack-appropriate ignores (node_modules, __pycache__, .env, build artifacts).109110**File generation order:**1111. Manifest (package.json / requirements.txt / go.mod)1122. Config files (.env.example, .gitignore, CI)1133. Database schema / migrations1144. Core business logic1155. API routes / endpoints1166. UI components (if applicable)1177. Tests1188. README.md119120### Phase 4 — Validate121122After generation, run through this checklist:123124- [ ] Every imported package exists in the manifest125- [ ] Every file referenced by an import exists in the tree126- [ ] `.env.example` lists every env var used in code127- [ ] `.gitignore` covers build artifacts and secrets128- [ ] README has setup instructions that actually work129- [ ] No hardcoded secrets, API keys, or passwords130- [ ] At least one test file exists131- [ ] Build/start command is documented and would work132133Run `scripts/validate_project.py` against the generated directory to catch common issues.134135## Examples136137### Example 1: Task Management API138139**Input spec:**140> "Build me a task management API. Users can create, list, update, and delete tasks. Tasks have a title, description, status (todo/in-progress/done), and due date. Use FastAPI with SQLite. Add basic auth with API keys."141142**Output file tree:**143```144task-api/145├── README.md146├── .env.example # API_KEY, DATABASE_URL147├── .gitignore148├── .github/workflows/ci.yml149├── requirements.txt # fastapi, uvicorn, sqlalchemy, pytest150├── main.py # FastAPI app, CORS, lifespan151├── models.py # SQLAlchemy Task model152├── schemas.py # Pydantic request/response schemas153├── database.py # SQLite engine + session154├── auth.py # API key middleware155├── routers/156│ └── tasks.py # CRUD endpoints157└── tests/158 └── test_tasks.py # Smoke tests for each endpoint159```160161### Example 2: Recipe Sharing Web App162163**Input spec:**164> "I want a recipe sharing website. Users sign up, post recipes with ingredients and steps, browse other recipes, and save favorites. Use Next.js with Tailwind. Store data in PostgreSQL."165166**Output file tree:**167```168recipe-share/169├── README.md170├── .env.example # DATABASE_URL, NEXTAUTH_SECRET, NEXTAUTH_URL171├── .gitignore172├── .github/workflows/ci.yml173├── package.json # next, react, tailwindcss, prisma, next-auth174├── tailwind.config.ts175├── tsconfig.json176├── next.config.ts177├── prisma/178│ └── schema.prisma # User, Recipe, Ingredient, Favorite models179├── src/180│ ├── app/181│ │ ├── layout.tsx182│ │ ├── page.tsx # Homepage — recipe feed183│ │ ├── recipes/184│ │ │ ├── page.tsx # Browse recipes185│ │ │ ├── [id]/page.tsx # Recipe detail186│ │ │ └── new/page.tsx # Create recipe form187│ │ └── api/188│ │ ├── auth/[...nextauth]/route.ts189│ │ └── recipes/route.ts190│ ├── components/191│ │ ├── RecipeCard.tsx192│ │ ├── RecipeForm.tsx193│ │ └── Navbar.tsx194│ └── lib/195│ ├── prisma.ts196│ └── auth.ts197└── tests/198 └── recipes.test.ts199```200201### Example 3: CLI Expense Tracker202203**Input spec:**204> "Python CLI tool for tracking expenses. Commands: add, list, summary, export-csv. Store in a local SQLite file. No external API."205206**Output file tree:**207```208expense-tracker/209├── README.md210├── .gitignore211├── .github/workflows/ci.yml212├── pyproject.toml213├── src/214│ └── expense_tracker/215│ ├── __init__.py216│ ├── cli.py # argparse commands217│ ├── database.py # SQLite operations218│ ├── models.py # Expense dataclass219│ └── formatters.py # Table + CSV output220└── tests/221 └── test_cli.py222```223224## Anti-Patterns225226| Anti-pattern | Fix |227|---|---|228| **Placeholder code** — `// TODO: implement`, `pass`, empty function bodies | Every function has a real implementation. If complex, implement a working simplified version. |229| **Stack override** — picking Next.js when the user said Flask | Always honor explicit tech preferences. Only infer when the user doesn't specify. |230| **Missing .gitignore** — committing node_modules or .env | Generate stack-appropriate .gitignore as one of the first files. |231| **Phantom imports** — importing packages not in the manifest | Cross-check every import against package.json / requirements.txt before finishing. |232| **Over-engineering MVP** — adding Redis caching, rate limiting, WebSockets to a v1 | Build the minimum that works. The user can iterate. |233| **Ignoring stated preferences** — user says "PostgreSQL" and you generate MongoDB | Parse the spec carefully. Explicit preferences are non-negotiable. |234| **Missing env vars** — code reads `process.env.X` but `.env.example` doesn't list it | Every env var used in code must appear in `.env.example` with a comment. |235| **No tests** — shipping a repo with zero test files | At minimum: one smoke test per API endpoint or one test per core function. |236| **Hallucinated APIs** — generating code that calls library methods that don't exist | Stick to well-documented, stable APIs. When unsure, use the simplest approach. |237238## Validation Script239240### `scripts/validate_project.py`241242Checks a generated project directory for common issues:243244```bash245# Validate a generated project246python3 scripts/validate_project.py /path/to/generated-project247248# JSON output249python3 scripts/validate_project.py /path/to/generated-project --format json250```251252Checks performed:253- README.md exists and is non-empty254- .gitignore exists255- .env.example exists (if code references env vars)256- Package manifest exists (package.json, requirements.txt, go.mod, Cargo.toml, pubspec.yaml)257- No .env file committed (secrets leak)258- At least one test file exists259- No TODO/FIXME placeholders in generated code260261## Progressive Enhancement262263For complex specs, generate in stages:2642651. **MVP** — Core feature only, working end-to-end2662. **Auth** — Add authentication if requested2673. **Polish** — Error handling, validation, loading states2684. **Deploy** — Docker, CI, deploy config269270Ask the user after MVP: "Core is working. Want me to add auth/polish/deploy next, or iterate on what's here?"271272## Cross-References273274- Related: `product-team/saas-scaffolder` — SaaS-specific scaffolding (Next.js + Stripe + Auth)275- Related: `engineering/spec-driven-workflow` — spec-first development methodology276- Related: `engineering/database-designer` — database schema design patterns277- Related: `engineering-team/senior-fullstack` — full-stack implementation patterns