Generate Application Design Document
User Request: $ARGUMENTS
Context
- Project root: !
pwd
- Package.json: @package.json
- Existing design docs: !
ls -la .agents/rules/ 2>/dev/null || echo "No .claude/skills 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 .agents/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
.agents/rules/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
.agents/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:
.agents/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 .agents/rules/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 docs .claude/skills
- Save design document:
.agents/rules/1-app-design-document.mdc
- Update Claude rule:
.agents/rules/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---5
6# Generate Application Design Document
7
8**User Request:** $ARGUMENTS
9
10## Context
11
12- Project root: !`pwd`
13- Package.json: @package.json
14- Existing design docs: !`ls -la .agents/rules/ 2>/dev/null || echo "No .claude/skills directory yet"`
15
16## Goal
17
18Create 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".
19
20## Process
21
22### 1. Initial Analysis
23
24- Analyze project structure and existing codebase
25- Review package.json for project name and dependencies
26- Check for existing documentation in .agents/rules/
27- Identify key application features and patterns
28- **Think deeply** about the application's purpose and architecture
29
30### 2. Codebase Deep Dive
31
32**Think harder about the application's architecture and business logic.**
33
34Analyze the codebase to understand:
35
36- **Application Structure:** Main modules, features, and components
37- **User Flows:** Authentication, navigation, key user journeys
38- **Data Models:** Conceptual relationships and entities
39- **Business Logic:** Core rules, workflows, and processes
40- **Integrations:** External services and APIs
41- **Security Patterns:** Authentication and authorization approaches
42
43_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._
44
45### 3. Interactive Q&A Session
46
47**CRITICAL:** Ask project stage question FIRST, then 4-7 additional questions:
48
49- Use lettered/numbered options for easy response
50- Focus on business goals and user needs
51- Gather context for proper documentation
52
53### 4. Update Project Configuration
54
55Based on project stage response:
56
57- Update `.agents/rules/status.mdc` with current stage
58- Set appropriate DO/DON'T priorities for the stage
59- Document stage-specific development guidelines in the Cursor rule
60
61### 5. Generate Document
62
63Create comprehensive app design document following the standard structure
64
65### 6. Save and Organize
66
67- Create `.agents/rules/` directory if needed
68- Save as `1-app-design-document.mdc`
69- Suggest next steps (tech stack doc, PRD, etc.)
70
71## Required Questions Template
72
73### 🎯 CRITICAL: Project Stage Assessment (Ask First!)
74
75**1. What stage is your application currently in?**
76
77a) **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 involved
81
82**2. Based on your selected stage, here are the development priorities:**
83
84- **Pre-MVP Priorities:**
85
86 - ✅ DO: Core functionality, security basics, input validation, working features
87 - ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code
88 - 🚀 Focus: Ship fast with security, iterate based on feedback
89
90- **MVP Priorities:**
91
92 - ✅ DO: Critical path testing, basic monitoring, user feedback loops
93 - ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization
94 - 🚀 Focus: Stability for early users, rapid iteration
95
96- **Production Priorities:**
97
98 - ✅ DO: Testing, monitoring, performance, accessibility, documentation
99 - ❌ DON'T: Skip security reviews, ignore technical debt
100 - 🚀 Focus: Reliability, scalability, user experience
101
102- **Enterprise Priorities:**
103 - ✅ DO: Comprehensive testing, security audits, team coordination, compliance
104 - ❌ DON'T: Skip documentation, ignore code standards
105 - 🚀 Focus: Team efficiency, maintainability, compliance
106
107### 📋 Context-Specific Questions (Ask 4-7 based on analysis)
108
109**3. Application Purpose & Users**
110
111- What is the primary problem your application solves?
112- Who are your target users and what are their main goals?
113
114**4. Unique Value Proposition**
115
116- What makes your application unique compared to existing solutions?
117- What's your competitive advantage?
118
119**5. User Roles & Permissions**
120
121- What different types of users interact with your system?
122- Examples: end users, admins, moderators, content creators, viewers
123
124**6. Core User Journeys**
125
126- What are the 2-3 most critical user flows?
127- Example: Sign up → Create content → Share → Get feedback
128
129**7. Business Model & Growth**
130
131- How does this application generate value?
132- Options: SaaS subscription, marketplace, freemium, advertising, one-time purchase
133
134**8. Integration Ecosystem**
135
136- What external services must you integrate with?
137- Examples: payment processors, email services, analytics, social platforms
138
139**9. Scale & Performance Goals**
140
141- What scale are you planning for in the next 12 months?
142- Users: dozens, hundreds, thousands, millions?
143- Geographic: local, national, global?
144
145**10. Success Metrics**
146
147- How will you measure if your application is successful?
148- Examples: user retention, revenue, engagement, conversion rates
149
150## Document Structure
151
152The generated document must follow this high-level structure:
153
154### **Introduction**
155
156- Application overview and purpose
157- Target audience and user base
158- Core value proposition
159- Business context and goals
160
161### **Core Features**
162
163- **Feature Category 1:** (e.g., User Management)
164 - Purpose and user benefit
165 - Key functionalities
166 - User experience considerations
167- **Feature Category 2:** (e.g., Content Creation)
168 - Purpose and user benefit
169 - Key functionalities
170 - User experience considerations
171- **[Additional feature categories as needed]**
172
173### **User Experience**
174
175- User personas and roles
176- Key user journeys and flows
177- Interface design principles
178- Accessibility and usability considerations
179
180### **System Architecture**
181
182- High-level system components
183- Data flow and relationships
184- Integration points and external services
185- Security and privacy approach
186
187### **Business Logic**
188
189- Core business rules and processes
190- Data models and relationships (conceptual)
191- Workflow and state management
192- Validation and business constraints
193
194### **Future Considerations**
195
196- Planned enhancements and features
197- Scalability considerations
198- Potential integrations
199- Long-term vision and roadmap
200
201## Target Audience
202
203The document should be accessible to:
204
205- **Business stakeholders** who need to understand the application's purpose and capabilities
206- **Product managers** planning features and roadmaps
207- **Designers** creating user interfaces and experiences
208- **New developers** joining the project who need a high-level understanding
209- **Technical leaders** making architectural decisions
210
211The language should be clear, business-focused, and avoid technical implementation details.
212
213## Writing Principles
214
215### DO:
216
217- **Business Focus:** Describe WHAT the application does, not HOW
218- **User Value:** Emphasize benefits and outcomes for users
219- **Clear Language:** Write for non-technical stakeholders
220- **Visual Thinking:** Use diagrams and flows where helpful
221- **Future Ready:** Consider growth and evolution paths
222
223### DON'T:
224
225- **Technical Details:** No code snippets or implementation specifics
226- **Technology Stack:** Save for 2-tech-stack.mdc document
227- **Database Schemas:** Keep data models conceptual
228- **API Specifications:** Focus on capabilities, not endpoints
229- **Performance Metrics:** Describe goals, not technical benchmarks
230
231## Output
232
233- **Format:** Markdown (`.mdc`)
234- **Location:** `.agents/rules/`
235- **Filename:** `1-app-design-document.mdc`
236
237## Execution Steps
238
239### 1. Start with Analysis
240
241- Use Read, Glob, and Grep to explore the codebase
242- Identify key features and patterns
243- Look for existing documentation
244- **Use extended thinking:** "Think deeply about this codebase's architecture, business purpose, and how different components work together to serve users"
245
246### 2. Interactive Q&A
247
248- **MUST ASK PROJECT STAGE FIRST**
249- Present questions with numbered/lettered options
250- Wait for user responses before proceeding
251
252### 3. Update Project Status in Cursor Rule
253
254Update `.agents/rules/status.mdc` with the project stage information:
255
256```markdown
257---
258description: Project status and stage-specific development guidelines
259globs:
260alwaysApply: true
261---
262
263# Project Status Guidelines
264
265## Current Project Stage: [Stage Name]
266
267**Stage**: [Pre-MVP | MVP | Production | Enterprise]
268
269### DO Care About (Current Stage Priorities)
270
271[Stage-specific DO priorities from template below]
272
273### DO NOT Care About (Skip for Velocity)
274
275[Stage-specific DON'T priorities from template below]
276
277### Development Approach
278
279[Stage-specific development focus]
280
281## Stage-Based Development Guidelines
282
283[Keep existing stage categories and guidelines from the original file]
284```
285
286**Stage-Specific Content:**
287
288- **Pre-MVP**:
289
290 - ✅ DO: Core functionality, security basics, input validation, working features
291 - ❌ DON'T: Unit tests, performance optimization, accessibility polish, perfect code
292 - 🚀 Focus: Ship fast with security, iterate based on feedback
293
294- **MVP**:
295
296 - ✅ DO: Critical path testing, basic monitoring, user feedback loops
297 - ❌ DON'T: Comprehensive test coverage, advanced patterns, premature optimization
298 - 🚀 Focus: Stability for early users, rapid iteration
299
300- **Production**:
301
302 - ✅ DO: Testing, monitoring, performance, accessibility, documentation
303 - ❌ DON'T: Skip security reviews, ignore technical debt
304 - 🚀 Focus: Reliability, scalability, user experience
305
306- **Enterprise**:
307 - ✅ DO: Comprehensive testing, security audits, team coordination, compliance
308 - ❌ DON'T: Skip documentation, ignore code standards
309 - 🚀 Focus: Team efficiency, maintainability, compliance
310
311### 4. Generate Document
312
313- Follow the standard structure
314- Tailor content to project stage
315- Keep language accessible
316
317### 5. Save and Next Steps
318
319- Create directories: `mkdir -p docs .claude/skills`
320- Save design document: `.agents/rules/1-app-design-document.mdc`
321- Update Claude rule: `.agents/rules/status.mdc`
322- Suggest: "Would you like me to create a technical stack document next?"