Scaffolding Engine — From Patterns to Working Project

Two-phase generation: pattern composition (deterministic) + chat refinement (AI-driven)

Generation Pipeline
# Phase 1: Pattern Composition (deterministic, no AI needed) mahavishnu scaffold "my-app" \ --patterns scaffolding/project,components/table,components/form \ --slots nav=components/nav → Resolves dependency graph: scaffolding/project (base) ├── components/table (plugs into templates/base/blocks/) ├── components/form (plugs into templates/base/blocks/) └── components/nav (plugs into templates/base/blocks/) → Generates deterministic output: my-app/ ├── main.py ← from project.yaml template ├── settings/ │ ├── app.yml ← from project.yaml template │ └── adapters.yml ← from project.yaml template ├── templates/ │ ├── base/ │ │ └── blocks/ │ │ ├── nav.html ← from nav.yaml template │ │ ├── table.html ← from table.yaml template │ │ └── form.html ← from form.yaml template │ └── pages/ ← empty, ready for Phase 2 ├── adapters/ └── pyproject.toml ← from project.yaml template ───────────────────────────────────────────────────── # Phase 2: Chat-Driven Refinement (AI-assisted) User: "Add a dashboard page with a stats summary card" Mahavishnu: → generates templates/pages/dashboard.html → adds dashboard route to main.py → creates settings/dashboard.yml if needed User: "Use the Splashstand auth pattern with Google OAuth" Mahavishnu: → adds auth.yaml pattern to the project → generates adapters/auth.py → adds session middleware to main.py → creates settings/auth.yml with Google OAuth config User: "Deploy to Cloud Run" Mahavishnu: → adds deployment/cloudrun.yaml pattern → generates Dockerfile, cloudbuild.yaml → adds deploy command to pyproject.toml

Key design decisions: