Create visual JSON diagrams for full-stack web app planning including navigation flows, state machines, infrastructure maps, and UI mockups...
Create and edit StackSketch JSON diagrams that serve as a visual source of truth for full-stack web app planning, including navigation flows, state machines, infrastructure maps, and UI mockups.
Step 1: Print Intro Banner
╔═══════════════════════════════════════════════════════════════╗
║ 📐 StackSketch - Visual Planning ║
╠═══════════════════════════════════════════════════════════════╣
║ Phase 1: Discovery (research + interview) ║
║ Phase 2: Creation (JSON diagrams) ║
║ Phase 3: Iteration (visual feedback loop) ║
╚═══════════════════════════════════════════════════════════════╝
Step 2: Validate Input
Confirm the user's request describes something to visualize. If unclear, ask for clarification.
Step 3: Research Decision
Use AskUserQuestion to offer research options:
Would you like me to research before creating your diagram?
1. Codebase exploration - Examine existing patterns, UI components, navigation, infrastructure
2. Web research - Look up UX patterns, architecture best practices, design systems
3. Both - Comprehensive research from code and web sources
4. Skip - Go directly to interview questions
Step 4: Execute Research (if selected)
Explore subagent with targeted queries (see references/research-protocol.md)WebSearch for relevant patterns and best practices.stacksketch/stacksketch-research.mdStep 5: Interview
Use AskUserQuestion to clarify requirements (see references/interview-protocol.md):
Save transcript to .stacksketch/stacksketch-interview.md
Step 6: Synthesize Requirements
Create .stacksketch/stacksketch-spec.md summarizing:
Step 7: Determine Diagram Types
Based on requirements, create one or more diagrams:
Step 8: Create JSON Files
Author StackSketch JSON following references/schema.md:
.stacksketch/ directoryuser-dashboard.json, checkout-flow.jsondiagram.type in every fileStep 9: Validate Output
Ensure JSON is valid and complete:
Step 10: Open Viewer
Open the diagram in the browser for visual review:
// Using Chrome DevTools MCP
mcp__chrome-devtools__new_page({
url: `file://${process.cwd()}/skills/stack-sketch/viewer/index.html?file=.stacksketch/diagram-name.json`
})
// Or using Claude in Chrome
mcp__claude-in-chrome__navigate({
url: `file://${process.cwd()}/skills/stack-sketch/viewer/index.html?file=.stacksketch/diagram-name.json`,
tabId: currentTabId
})
Step 11: Take Screenshot
Capture the rendered diagram:
// Chrome DevTools
mcp__chrome-devtools__take_screenshot()
// Or Claude in Chrome
mcp__claude-in-chrome__computer({ action: 'screenshot', tabId: currentTabId })
Step 12: Show to User
Present the visual for user review. Ask:
Step 13: Iterate
Based on feedback:
Step 14: Finalize
Mark session complete:
.stacksketch/PROGRESS.md with statusTrack progress with files in .stacksketch/:
.stacksketch/
├── stacksketch-research.md # Research findings (optional)
├── stacksketch-interview.md # Q&A transcript
├── stacksketch-spec.md # Synthesized requirements
├── {diagram-name}.json # Generated diagrams
└── PROGRESS.md # Session tracking
| Files Found | Resume From |
|---|---|
| None | Step 2 (validate input) |
| stacksketch-research.md | Step 5 (interview) |
| + stacksketch-interview.md | Step 7 (create diagrams) |
| + *.json files | Step 10 (iteration) |
| + PROGRESS.md with "complete" | Done |
id values for nodes, edges, and groups across iterationsnode.type for shape and node.kind for semantic rolelabel short; place long descriptions in data.notes.stacksketch/ unless the user requests a different locationuser-dashboard.json, checkout-flow.json, infra-map.jsondiagram.type in every file so the viewer can render correctlyLog progress with timestamps:
[HH:MM] Phase 1: Discovery
[HH:MM] ├─ Research: codebase exploration complete
[HH:MM] ├─ Interview: 4 questions answered
[HH:MM] └─ Spec: requirements synthesized
[HH:MM] Phase 2: Creation
[HH:MM] ├─ Created: user-onboarding-flow.json (flow, 7 nodes, 6 edges)
[HH:MM] └─ Created: dashboard-mockup.json (ui, 12 components)
[HH:MM] Phase 3: Iteration
[HH:MM] ├─ Viewer opened, screenshot captured
[HH:MM] ├─ User feedback: adjust sidebar width
[HH:MM] └─ Updated: dashboard-mockup.json