prototype
Discovery-first prototyping - explore app ideas with zero-risk iteration before committing to roadmap/features
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/marcusgoll/Spec-Flow/HEAD/.claude/commands/project/prototype.md -o ~/.claude/commands/prototype.mdprototype.md
# /prototype - Discovery-First Prototyping (Hybrid Pattern)
> **v11.0 Architecture**: Uses hybrid pattern for `discover` and `explore` modes - interactive questions in main context (good UX), prototype generation isolated via Task() (saves ~4-6k tokens).
<context>
**Check these files before proceeding:**
- Prototype state: `design/prototype/state.yaml`
- Design tokens: `design/systems/tokens.json` and `tokens.css`
- Project docs: `docs/project/overview.md`
- User preferences: `.spec-flow/config/user-preferences.yaml`
**Related skills (auto-loaded on demand):**
- `shadcn-integration` - Generates shadcn/ui compatible CSS variables and components.json
- `design-tokens` - OKLCH token generation and WCAG validation
- `theme-consistency` - Enforces token usage across prototype screens
</context>
<architecture>
## Hybrid Pattern (v11.0)
**For `discover` and `explore` modes:**
```
User: /prototype discover
│
▼
┌──────────────────────────────────────────────────────┐
│ MAIN CONTEXT (interactive selection - good UX) │
│ │
│ 1. Check for existing tokens │
│ 2. Palette selection (vibe picker) │
│ 3. Vision brainstorm question │
│ 4. Screen selection (multiselect) │
│ 5. Save selections to temp config │
│ → .spec-flow/temp/prototype-selections.yaml │
└──────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────┐
│ Task(prototype-discover-agent) ← ISOLATED │
│ │
│ 1. Read selections from temp config │
│ 2. Generate theme.yaml from palette │
│ 3. Generate theme.css with CSS variables │
│ 4. Create discovery artifacts (ideas.md, etc) │
│ 5. Generate HTML for all selected screens │
│ 6. Generate navigation hub (index.html) │
│ 7. Update state.yaml │
│ 8. Return summary │
│ 9. EXIT │
└──────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────┐
│ MAIN CONTEXT (results - minimal tokens) │
│ │
│ 1. Display success summary │
│ 2. Show generated screens │
│ 3. Display keyboard shortcuts │
│ 4. Suggest next steps │
└──────────────────────────────────────────────────────┘
```
**For lightweight modes (`status`, `extract`, `outcome`, `lock-theme`, etc.):**
- Run directly in main context (no Task spawning needed)
- These modes are read-heavy with minimal generation
</architecture>
<objective>
**Discovery-first prototyping** - explore app ideas visually before committing to roadmap or features.
**Philosophy**: This is your zero-risk sandbox. Try ideas. Scrap what doesn't work. Nothing here commits you to building anything. The prototype informs your roadmap, not the other way around.
**Workflow Position**:
```
/init-project -> /prototype discover -> /prototype extract --to-epic "Name" -> /epic continue
| OR
-> /roadmap import-from-prototype -> /epic or /feature
```
**Modes**:
- `discover`: Full app exploration at project start, brainstorm screens, zero commitments
- `explore`: **Loop back** - Explore new feature/epic ideas within existing prototype
- `create`: Generate structured prototype (legacy, still works)
- `update`: Add screens to existing prototype
- `status`: Show prototype overview and screen registry
- `extract`: Analyze prototype -> generate discovered-features.md + component-inventory.md
- `--to-epic "Name"`: One-shot epic creation (extract + create epic workspace)
- `lock-theme`: Lock design decisions for production use
- `unlock-theme`: Unlock for further iteration (requires confirmation)
- `sync-tokens`: Update prototype to use refined tokens from /init-brand-tokens
- `sync [pasted-content]`: Import ideas/questions/scraps captured in browser (paste inline or when prompted)
**Token Integration**:
- `--with-tokens`: Force token generation (inline palette picker)
- `--skip-tokens`: Use placeholder grays (fastest start)
- `--use-existing`: Use tokens.json if exists, else error
- (default): Auto-detect: use existing tokens or prompt
**Git Persistence**:
- `--commit`: Add prototype to git (recommended for design assets)
- `--gitignore`: Exclude from git (rapid iteration)
**When to use**: After `/init-project`, BEFORE `/roadmap`. Discover what to build before planning.
</objective>
## Anti-Hallucination Rules
1. **Never generate screens without user input**
- Always ask about screen categories and navigation structure
- Don't assume app structure
2. **Token handling is flexible in discovery mode**
- Check for existing tokens.json first
- If missing, offer quick palette picker OR skip (use grays)
- Never block discovery for missing tokens
3. **Read state.yaml before claiming status**
- Quote actual screen registry
- Report real last_updated timestamp
4. **Check prototype existence before operations**
- `discover`: Can start fresh or add to existing (flexible)
- `create`: Fail if prototype exists (use `update` instead)
- `update`: Fail if prototype doesn't exist (use `create` instead)
- `status`: Fail gracefully with "No prototype found" message
5. **Discovery mode is zero-risk**
- Never warn about "losing work" - scrapping is expected
- Encourage iteration and experimentation
- Don't block on quality gates
---
<process>
## Mode: DISCOVER (Recommended Entry Point)
**Purpose**: Zero-risk exploration to discover what to builExecute multiple sprints in parallel based on dependency graph from sprint-plan.md
Build and validate locally for projects without remote deployment (prototypes, experiments, local-only dev)
Execute multi-sprint epic workflow from interactive scoping through deployment with parallel sprint execution and self-improvement
Execute feature development workflow from specification through production deployment with automated quality gates
Analyze workflow state and provide context-aware guidance with visual progress indicators and recommended next steps
Initialize project documentation, preferences, or design tokens
Implement small bug fixes and features (<100 LOC) without full workflow. Use for single-file changes, bug fixes, refactors, and minor enhancements that can be completed in under 30 minutes.
Enter deep craftsman mode - question everything, plan like Da Vinci, craft insanely great solutions, then materialize to roadmap