Orchestrates /init-project command execution through interactive questionnaire (15 questions), brownfield codebase scanning (tech stack detection, ERD from migrations), and 8-document generation (overview, architecture, tech-stack, data, API, capacity, deployment, workflow). Use when user runs /init-project, requests project documentation generation, or asks about architecture setup for greenfield/brownfield projects. (project)
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Orchestrates /init-project command execution through interactive questionnaire (15 questions), brownfield codebase scanning (tech stack detection, ERD from migrations), and 8-document generation (overview, architecture, tech-stack, data, API, capacity, deployment, workflow). Use when user runs /init-project, requests project documentation generation, or asks about architecture setup for greenfield/brownfield projects. (project)
Guide execution of the /init-project command to generate 8 comprehensive project-level design documents through interactive questionnaire, brownfield codebase scanning, and cross-document consistency validation. Embodies "Planning is 80% of the project, 20% code" philosophy.
This skill orchestrates one-time project setup, producing foundation documentation that all features must align with.
All 8 files generated in docs/project/ (overview, system-architecture, tech-stack, data-architecture, api-strategy, capacity-planning, deployment-strategy, development-workflow)
[NEEDS CLARIFICATION] count < 20 (indicates good coverage from questionnaire/scan)
Mermaid diagrams present and valid (C4 in system-architecture, ERD in data-architecture)
Cross-document consistency validated (tech stack, database, deployment model aligned)
Tech stack accurately detected (brownfield only)
User informed of next steps (review docs, fill clarifications, commit)
If [NEEDS CLARIFICATION] count > 30, re-run questionnaire with more detailed answers or manually fill post-generation.
</success_criteria>
**Environment checks**:
- Templates exist in `.spec-flow/templates/project/` (8 files: overview-template, system-architecture-template, etc.)
- `docs/` directory exists or can be created
- Project-architect agent available at `.claude/agents/phase/project-architect.md`
Knowledge requirements:
Understanding of greenfield vs brownfield projects
Familiarity with tech stack detection strategies (package.json, requirements.txt parsing)
ERD generation from database migrations (Alembic, Prisma)
Cross-document consistency validation patterns
Before running:
⚠️ WARNING: /init-project generates 8 files in docs/project/. If directory already exists, offer user to:
A) Backup existing docs to docs/project-backup-{timestamp}/
B) Append to existing docs (merge new sections)
C) Abort (user will manually update)
**Detect Project Type (Greenfield vs Brownfield)**
Determine if starting from scratch (greenfield) or with existing codebase (brownfield).
Detection Logic:
# Check for existing codebase indicatorsif [ -f "package.json" ]; then
PROJECT_TYPE="brownfield"
TECH_DETECTED="Node.js"elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
PROJECT_TYPE="brownfield"
TECH_DETECTED="Python"elif [ -f "Cargo.toml" ]; then
PROJECT_TYPE="brownfield"
TECH_DETECTED="Rust"elif [ -f "go.mod" ]; then
PROJECT_TYPE="brownfield"
TECH_DETECTED="Go"elif [ -f "Gemfile" ]; then
PROJECT_TYPE="brownfield"
TECH_DETECTED="Ruby"else
PROJECT_TYPE="greenfield"fi
Inform user:
if [ "$PROJECT_TYPE" = "brownfield" ]; thenecho"✅ Detected existing codebase ($TECH_DETECTED)"echo" Will scan codebase to auto-fill project docs"elseecho"ℹ️ No existing codebase detected (greenfield project)"echo" Will generate templates with [NEEDS CLARIFICATION] markers"fi
Quality check: Correct project type detected? If unclear (e.g., multiple languages), ask user which is primary.
**Interactive Questionnaire (15 Questions)**
Gather essential project context to fill documentation templates.
<best_practices>
Always cite where information came from (questionnaire, scan, inference, default).
Example:
## Tech Stack**Backend**: FastAPI (detected from requirements.txt v0.109.0)
**Frontend**: Next.js 14 (detected from package.json)
**Database**: PostgreSQL (from questionnaire Q7)
**Architecture**: Monolith (inferred from team size: solo developer)
**Deployment**: Vercel (from questionnaire Q8)
Benefit: Transparency shows which answers need verification vs which are confirmed.
Make [NEEDS CLARIFICATION] markers actionable with specific questions.
Example:
## Success Metrics- Monthly Active Users (MAU): [NEEDS CLARIFICATION: What's your target MAU at 6 months? 12 months?]
- Conversion rate: [NEEDS CLARIFICATION: What % of signups should convert to paid within 30 days?]
- Churn rate: [NEEDS CLARIFICATION: What monthly churn rate is acceptable? <5%? <10%?]
Benefit: User knows exactly what information is needed, not guessing.
For brownfield projects, scan codebase before filling templates to maximize auto-fill.
Workflow:
Detect project type
If brownfield: scan tech stack, ERD, architecture BEFORE questionnaire
Pre-fill questionnaire with scan results (user can override)
Generate docs with combined questionnaire + scan data
Benefit: Reduces user effort, increases accuracy, lowers [NEEDS CLARIFICATION] count.
Always generate Mermaid diagrams for system-architecture.md and data-architecture.md.
System Architecture (C4 Context diagram):
graph TD
A[User] --> B[FlightPro App]
B --> C[PostgreSQL]
B --> D[Clerk Auth]
B --> E[Vercel Edge Network]