Generate Application Design Document
User Request: $ARGUMENTS
Context
- Project root: !
pwd
- Package.json: @package.json
- Existing design docs: !
ls -la .claude/rules/ 2>/dev/null || echo "No .claude/rules directory yet"
Goal
Create a comprehensive Application Design Document based on deep codebase analysis and user input. The document provides a high-level overview of the application's architecture, core features, user experience, and business logic while remaining technology-agnostic and focused on the "what" rather than the "how".
Process
1. Initial Analysis
- Analyze project structure and existing codebase
- Review package.json for project name and dependencies
- Check for existing documentation in .claude/rules/
- Identify key application features and patterns
- Think deeply about the application's purpose and architecture
2. Codebase Deep Dive
Think harder about the application's architecture and business logic.
Analyze the codebase to understand:
- Application Structure: Main modules, features, and components
- User Flows: Authentication, navigation, key user journeys
- Data Models: Conceptual relationships and entities
- Business Logic: Core rules, workflows, and processes
- Integrations: External services and APIs
- Security Patterns: Authentication and authorization approaches
Extended thinking helps identify non-obvious patterns, understand complex business rules from code, and make strategic decisions about what aspects are most important to document.
3. Interactive Q&A Session
CRITICAL: Ask project stage question FIRST, then 4-7 additional questions:
- Use lettered/numbered options for easy response
- Focus on business goals and user needs
- Gather context for proper documentation
4. Update Project Configuration
Based on project stage response:
- Update
.claude/rules/3-project-status.mdc with current stage
- Set appropriate DO/DON'T priorities for the stage
- Document stage-specific development guidelines in the Cursor rule
5. Generate Document
Create comprehensive app design document following the standard structure
6. Save and Organize
- Create
.claude/rules/ directory if needed
- Save as
1-app-design-document.mdc
- Suggest next steps (tech stack doc, PRD, etc.)
Required Questions Template
🎯 CRITICAL: Project Stage Assessment (Ask First!)
1. What stage is your application currently in?
a) Pre-MVP - Building initial version, not deployed to production yet
b) MVP - Basic version deployed and live with early users
c) Production - Mature application with established user base
d) Enterprise - Large scale deployment, multiple teams involved
2. Based on your selected stage, here are the development priorities:
Pre-MVP Priorities:
- ✅ DO: Core functionality, security basics, input validation, working features
- ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code
- 🚀 Focus: Ship fast with security, iterate based on feedback
MVP Priorities:
- ✅ DO: Critical path testing, basic monitoring, user feedback loops
- ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization
- 🚀 Focus: Stability for early users, rapid iteration
Production Priorities:
- ✅ DO: Testing, monitoring, performance, accessibility, documentation
- ❌ DON'T: Skip security reviews, ignore technical debt
- 🚀 Focus: Reliability, scalability, user experience
Enterprise Priorities:
- ✅ DO: Comprehensive testing, security audits, team coordination, compliance
- ❌ DON'T: Skip documentation, ignore code standards
- 🚀 Focus: Team efficiency, maintainability, compliance
📋 Context-Specific Questions (Ask 4-7 based on analysis)
3. Application Purpose & Users
- What is the primary problem your application solves?
- Who are your target users and what are their main goals?
4. Unique Value Proposition
- What makes your application unique compared to existing solutions?
- What's your competitive advantage?
5. User Roles & Permissions
- What different types of users interact with your system?
- Examples: end users, admins, moderators, content creators, viewers
6. Core User Journeys
- What are the 2-3 most critical user flows?
- Example: Sign up → Create content → Share → Get feedback
7. Business Model & Growth
- How does this application generate value?
- Options: SaaS subscription, marketplace, freemium, advertising, one-time purchase
8. Integration Ecosystem
- What external services must you integrate with?
- Examples: payment processors, email services, analytics, social platforms
9. Scale & Performance Goals
- What scale are you planning for in the next 12 months?
- Users: dozens, hundreds, thousands, millions?
- Geographic: local, national, global?
10. Success Metrics
- How will you measure if your application is successful?
- Examples: user retention, revenue, engagement, conversion rates
Document Structure
The generated document must follow this high-level structure:
Introduction
- Application overview and purpose
- Target audience and user base
- Core value proposition
- Business context and goals
Core Features
- Feature Category 1: (e.g., User Management)
- Purpose and user benefit
- Key functionalities
- User experience considerations
- Feature Category 2: (e.g., Content Creation)
- Purpose and user benefit
- Key functionalities
- User experience considerations
- [Additional feature categories as needed]
User Experience
- User personas and roles
- Key user journeys and flows
- Interface design principles
- Accessibility and usability considerations
System Architecture
- High-level system components
- Data flow and relationships
- Integration points and external services
- Security and privacy approach
Business Logic
- Core business rules and processes
- Data models and relationships (conceptual)
- Workflow and state management
- Validation and business constraints
Future Considerations
- Planned enhancements and features
- Scalability considerations
- Potential integrations
- Long-term vision and roadmap
Target Audience
The document should be accessible to:
- Business stakeholders who need to understand the application's purpose and capabilities
- Product managers planning features and roadmaps
- Designers creating user interfaces and experiences
- New developers joining the project who need a high-level understanding
- Technical leaders making architectural decisions
The language should be clear, business-focused, and avoid technical implementation details.
Writing Principles
DO:
- Business Focus: Describe WHAT the application does, not HOW
- User Value: Emphasize benefits and outcomes for users
- Clear Language: Write for non-technical stakeholders
- Visual Thinking: Use diagrams and flows where helpful
- Future Ready: Consider growth and evolution paths
DON'T:
- Technical Details: No code snippets or implementation specifics
- Technology Stack: Save for 2-tech-stack.mdc document
- Database Schemas: Keep data models conceptual
- API Specifications: Focus on capabilities, not endpoints
- Performance Metrics: Describe goals, not technical benchmarks
Output
- Format: Markdown (
.mdc)
- Location:
.claude/rules/
- Filename:
1-app-design-document.mdc
Execution Steps
1. Start with Analysis
- Use Read, Glob, and Grep to explore the codebase
- Identify key features and patterns
- Look for existing documentation
- Use extended thinking: "Think deeply about this codebase's architecture, business purpose, and how different components work together to serve users"
2. Interactive Q&A
- MUST ASK PROJECT STAGE FIRST
- Present questions with numbered/lettered options
- Wait for user responses before proceeding
3. Update Project Status in Cursor Rule
Update .claude/rules/3-project-status.mdc with the project stage information:
---
description: Project status and stage-specific development guidelines
globs:
alwaysApply: true
---
# Project Status Guidelines
## Current Project Stage: [Stage Name]
**Stage**: [Pre-MVP | MVP | Production | Enterprise]
### DO Care About (Current Stage Priorities)
[Stage-specific DO priorities from template below]
### DO NOT Care About (Skip for Velocity)
[Stage-specific DON'T priorities from template below]
### Development Approach
[Stage-specific development focus]
## Stage-Based Development Guidelines
[Keep existing stage categories and guidelines from the original file]
Stage-Specific Content:
Pre-MVP:
- ✅ DO: Core functionality, security basics, input validation, working features
- ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code
- 🚀 Focus: Ship fast with security, iterate based on feedback
MVP:
- ✅ DO: Critical path testing, basic monitoring, user feedback loops
- ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization
- 🚀 Focus: Stability for early users, rapid iteration
Production:
- ✅ DO: Testing, monitoring, performance, accessibility, documentation
- ❌ DON'T: Skip security reviews, ignore technical debt
- 🚀 Focus: Reliability, scalability, user experience
Enterprise:
- ✅ DO: Comprehensive testing, security audits, team coordination, compliance
- ❌ DON'T: Skip documentation, ignore code standards
- 🚀 Focus: Team efficiency, maintainability, compliance
4. Generate Document
- Follow the standard structure
- Tailor content to project stage
- Keep language accessible
5. Save and Next Steps
- Create directories:
mkdir -p .claude/docs .claude/rules
- Save design document:
.claude/rules/1-app-design-document.mdc
- Update Claude rule:
.claude/rules/3-project-status.mdc
- Suggest: "Would you like me to create a technical stack document next?"
1---2name: create-app-design3description: Generate comprehensive app design document with project stage assessment4---56# Generate Application Design Document78**User Request:** $ARGUMENTS910## Context1112- Project root: !`pwd`13- Package.json: @package.json14- Existing design docs: !`ls -la .claude/rules/ 2>/dev/null || echo "No .claude/rules directory yet"`1516## Goal1718Create a comprehensive Application Design Document based on deep codebase analysis and user input. The document provides a high-level overview of the application's architecture, core features, user experience, and business logic while remaining technology-agnostic and focused on the "what" rather than the "how".1920## Process2122### 1. Initial Analysis2324- Analyze project structure and existing codebase25- Review package.json for project name and dependencies26- Check for existing documentation in .claude/rules/27- Identify key application features and patterns28- **Think deeply** about the application's purpose and architecture2930### 2. Codebase Deep Dive3132**Think harder about the application's architecture and business logic.**3334Analyze the codebase to understand:3536- **Application Structure:** Main modules, features, and components37- **User Flows:** Authentication, navigation, key user journeys38- **Data Models:** Conceptual relationships and entities39- **Business Logic:** Core rules, workflows, and processes40- **Integrations:** External services and APIs41- **Security Patterns:** Authentication and authorization approaches4243_Extended thinking helps identify non-obvious patterns, understand complex business rules from code, and make strategic decisions about what aspects are most important to document._4445### 3. Interactive Q&A Session4647**CRITICAL:** Ask project stage question FIRST, then 4-7 additional questions:4849- Use lettered/numbered options for easy response50- Focus on business goals and user needs51- Gather context for proper documentation5253### 4. Update Project Configuration5455Based on project stage response:5657- Update `.claude/rules/3-project-status.mdc` with current stage58- Set appropriate DO/DON'T priorities for the stage59- Document stage-specific development guidelines in the Cursor rule6061### 5. Generate Document6263Create comprehensive app design document following the standard structure6465### 6. Save and Organize6667- Create `.claude/rules/` directory if needed68- Save as `1-app-design-document.mdc`69- Suggest next steps (tech stack doc, PRD, etc.)7071## Required Questions Template7273### 🎯 CRITICAL: Project Stage Assessment (Ask First!)7475**1. What stage is your application currently in?**7677a) **Pre-MVP** - Building initial version, not deployed to production yet 78 b) **MVP** - Basic version deployed and live with early users 79 c) **Production** - Mature application with established user base 80 d) **Enterprise** - Large scale deployment, multiple teams involved8182**2. Based on your selected stage, here are the development priorities:**8384- **Pre-MVP Priorities:**8586 - ✅ DO: Core functionality, security basics, input validation, working features87 - ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code88 - 🚀 Focus: Ship fast with security, iterate based on feedback8990- **MVP Priorities:**9192 - ✅ DO: Critical path testing, basic monitoring, user feedback loops93 - ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization94 - 🚀 Focus: Stability for early users, rapid iteration9596- **Production Priorities:**9798 - ✅ DO: Testing, monitoring, performance, accessibility, documentation99 - ❌ DON'T: Skip security reviews, ignore technical debt100 - 🚀 Focus: Reliability, scalability, user experience101102- **Enterprise Priorities:**103 - ✅ DO: Comprehensive testing, security audits, team coordination, compliance104 - ❌ DON'T: Skip documentation, ignore code standards105 - 🚀 Focus: Team efficiency, maintainability, compliance106107### 📋 Context-Specific Questions (Ask 4-7 based on analysis)108109**3. Application Purpose & Users**110111- What is the primary problem your application solves?112- Who are your target users and what are their main goals?113114**4. Unique Value Proposition**115116- What makes your application unique compared to existing solutions?117- What's your competitive advantage?118119**5. User Roles & Permissions**120121- What different types of users interact with your system?122- Examples: end users, admins, moderators, content creators, viewers123124**6. Core User Journeys**125126- What are the 2-3 most critical user flows?127- Example: Sign up → Create content → Share → Get feedback128129**7. Business Model & Growth**130131- How does this application generate value?132- Options: SaaS subscription, marketplace, freemium, advertising, one-time purchase133134**8. Integration Ecosystem**135136- What external services must you integrate with?137- Examples: payment processors, email services, analytics, social platforms138139**9. Scale & Performance Goals**140141- What scale are you planning for in the next 12 months?142- Users: dozens, hundreds, thousands, millions?143- Geographic: local, national, global?144145**10. Success Metrics**146147- How will you measure if your application is successful?148- Examples: user retention, revenue, engagement, conversion rates149150## Document Structure151152The generated document must follow this high-level structure:153154### **Introduction**155156- Application overview and purpose157- Target audience and user base158- Core value proposition159- Business context and goals160161### **Core Features**162163- **Feature Category 1:** (e.g., User Management)164 - Purpose and user benefit165 - Key functionalities166 - User experience considerations167- **Feature Category 2:** (e.g., Content Creation)168 - Purpose and user benefit169 - Key functionalities170 - User experience considerations171- **[Additional feature categories as needed]**172173### **User Experience**174175- User personas and roles176- Key user journeys and flows177- Interface design principles178- Accessibility and usability considerations179180### **System Architecture**181182- High-level system components183- Data flow and relationships184- Integration points and external services185- Security and privacy approach186187### **Business Logic**188189- Core business rules and processes190- Data models and relationships (conceptual)191- Workflow and state management192- Validation and business constraints193194### **Future Considerations**195196- Planned enhancements and features197- Scalability considerations198- Potential integrations199- Long-term vision and roadmap200201## Target Audience202203The document should be accessible to:204205- **Business stakeholders** who need to understand the application's purpose and capabilities206- **Product managers** planning features and roadmaps207- **Designers** creating user interfaces and experiences208- **New developers** joining the project who need a high-level understanding209- **Technical leaders** making architectural decisions210211The language should be clear, business-focused, and avoid technical implementation details.212213## Writing Principles214215### DO:216217- **Business Focus:** Describe WHAT the application does, not HOW218- **User Value:** Emphasize benefits and outcomes for users219- **Clear Language:** Write for non-technical stakeholders220- **Visual Thinking:** Use diagrams and flows where helpful221- **Future Ready:** Consider growth and evolution paths222223### DON'T:224225- **Technical Details:** No code snippets or implementation specifics226- **Technology Stack:** Save for 2-tech-stack.mdc document227- **Database Schemas:** Keep data models conceptual228- **API Specifications:** Focus on capabilities, not endpoints229- **Performance Metrics:** Describe goals, not technical benchmarks230231## Output232233- **Format:** Markdown (`.mdc`)234- **Location:** `.claude/rules/`235- **Filename:** `1-app-design-document.mdc`236237## Execution Steps238239### 1. Start with Analysis240241- Use Read, Glob, and Grep to explore the codebase242- Identify key features and patterns243- Look for existing documentation244- **Use extended thinking:** "Think deeply about this codebase's architecture, business purpose, and how different components work together to serve users"245246### 2. Interactive Q&A247248- **MUST ASK PROJECT STAGE FIRST**249- Present questions with numbered/lettered options250- Wait for user responses before proceeding251252### 3. Update Project Status in Cursor Rule253254Update `.claude/rules/3-project-status.mdc` with the project stage information:255256```markdown257---258description: Project status and stage-specific development guidelines259globs:260alwaysApply: true261---262263# Project Status Guidelines264265## Current Project Stage: [Stage Name]266267**Stage**: [Pre-MVP | MVP | Production | Enterprise]268269### DO Care About (Current Stage Priorities)270271[Stage-specific DO priorities from template below]272273### DO NOT Care About (Skip for Velocity)274275[Stage-specific DON'T priorities from template below]276277### Development Approach278279[Stage-specific development focus]280281## Stage-Based Development Guidelines282283[Keep existing stage categories and guidelines from the original file]284```285286**Stage-Specific Content:**287288- **Pre-MVP**:289290 - ✅ DO: Core functionality, security basics, input validation, working features291 - ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code292 - 🚀 Focus: Ship fast with security, iterate based on feedback293294- **MVP**:295296 - ✅ DO: Critical path testing, basic monitoring, user feedback loops297 - ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization298 - 🚀 Focus: Stability for early users, rapid iteration299300- **Production**:301302 - ✅ DO: Testing, monitoring, performance, accessibility, documentation303 - ❌ DON'T: Skip security reviews, ignore technical debt304 - 🚀 Focus: Reliability, scalability, user experience305306- **Enterprise**:307 - ✅ DO: Comprehensive testing, security audits, team coordination, compliance308 - ❌ DON'T: Skip documentation, ignore code standards309 - 🚀 Focus: Team efficiency, maintainability, compliance310311### 4. Generate Document312313- Follow the standard structure314- Tailor content to project stage315- Keep language accessible316317### 5. Save and Next Steps318319- Create directories: `mkdir -p .claude/docs .claude/rules`320- Save design document: `.claude/rules/1-app-design-document.mdc`321- Update Claude rule: `.claude/rules/3-project-status.mdc`322- Suggest: "Would you like me to create a technical stack document next?"