prjct-cli 0.10.9 → 0.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -0
- package/CLAUDE.md +121 -996
- package/core/__tests__/agentic/prompt-builder.test.js +7 -3
- package/core/agentic/prompt-builder.js +57 -56
- package/core/commands.js +29 -452
- package/core/domain/architecture-generator.js +51 -519
- package/core/domain/task-analyzer.js +11 -36
- package/package.json +1 -1
- package/templates/analysis/bug-severity.md +74 -0
- package/templates/analysis/complexity.md +54 -0
- package/templates/analysis/health.md +66 -0
- package/templates/analysis/intent.md +66 -0
- package/templates/analysis/patterns.md +27 -173
- package/templates/analysis/task-breakdown.md +53 -0
- package/templates/architect/discovery.md +67 -0
- package/templates/architect/phases.md +59 -0
- package/templates/commands/done.md +129 -15
- package/templates/commands/feature.md +262 -21
- package/templates/commands/ship.md +244 -23
- package/templates/commands/sync.md +235 -44
- package/templates/design/api.md +95 -0
- package/templates/design/architecture.md +77 -0
- package/templates/design/component.md +89 -0
- package/templates/design/database.md +78 -0
- package/templates/design/flow.md +94 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-severity
|
|
3
|
+
description: Assess bug severity from description
|
|
4
|
+
allowed-tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Bug Severity Assessment
|
|
8
|
+
|
|
9
|
+
Analyze the bug description to determine its severity and priority.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Bug: {{description}}
|
|
13
|
+
- Context (if available)
|
|
14
|
+
|
|
15
|
+
## Severity Levels
|
|
16
|
+
|
|
17
|
+
### CRITICAL
|
|
18
|
+
- System crash or data loss
|
|
19
|
+
- Security vulnerability
|
|
20
|
+
- Blocks all users
|
|
21
|
+
- Production is down
|
|
22
|
+
|
|
23
|
+
### HIGH
|
|
24
|
+
- Major feature broken
|
|
25
|
+
- Significant user impact
|
|
26
|
+
- Workaround difficult
|
|
27
|
+
- Affects many users
|
|
28
|
+
|
|
29
|
+
### MEDIUM
|
|
30
|
+
- Feature partially broken
|
|
31
|
+
- Workaround exists
|
|
32
|
+
- Limited user impact
|
|
33
|
+
- Non-essential functionality
|
|
34
|
+
|
|
35
|
+
### LOW
|
|
36
|
+
- Minor inconvenience
|
|
37
|
+
- Cosmetic issue
|
|
38
|
+
- Edge case only
|
|
39
|
+
- Easy workaround
|
|
40
|
+
|
|
41
|
+
## Analysis Steps
|
|
42
|
+
|
|
43
|
+
1. **Assess Impact**
|
|
44
|
+
- Who is affected?
|
|
45
|
+
- How many users?
|
|
46
|
+
- Is there data loss risk?
|
|
47
|
+
|
|
48
|
+
2. **Check Urgency**
|
|
49
|
+
- Is production affected?
|
|
50
|
+
- Is there a deadline?
|
|
51
|
+
- Are users blocked?
|
|
52
|
+
|
|
53
|
+
3. **Evaluate Workaround**
|
|
54
|
+
- Can users continue working?
|
|
55
|
+
- How hard is the workaround?
|
|
56
|
+
|
|
57
|
+
## Output Format
|
|
58
|
+
|
|
59
|
+
Return JSON:
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"severity": "critical|high|medium|low",
|
|
63
|
+
"priority": 1-4,
|
|
64
|
+
"reasoning": "<brief explanation>",
|
|
65
|
+
"suggestedAction": "<what to do next>"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Guidelines
|
|
70
|
+
|
|
71
|
+
- Err on the side of higher severity if unsure
|
|
72
|
+
- Security issues are always CRITICAL
|
|
73
|
+
- Data loss is always CRITICAL
|
|
74
|
+
- User-reported = add weight
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: complexity-analysis
|
|
3
|
+
description: Analyze task complexity semantically
|
|
4
|
+
allowed-tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Task Complexity Analysis
|
|
8
|
+
|
|
9
|
+
Analyze the given task description and determine its complexity level.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Task: {{task}}
|
|
13
|
+
- Project context (if available)
|
|
14
|
+
|
|
15
|
+
## Analysis Steps
|
|
16
|
+
|
|
17
|
+
1. **Understand the Task**
|
|
18
|
+
- What is being asked?
|
|
19
|
+
- What systems/files are affected?
|
|
20
|
+
- Are there dependencies?
|
|
21
|
+
|
|
22
|
+
2. **Evaluate Scope**
|
|
23
|
+
- Single file change → LOW
|
|
24
|
+
- Multiple files, same module → MEDIUM
|
|
25
|
+
- Cross-module or architectural → HIGH
|
|
26
|
+
|
|
27
|
+
3. **Assess Risk**
|
|
28
|
+
- Read-only or additive → LOW risk
|
|
29
|
+
- Modifying existing logic → MEDIUM risk
|
|
30
|
+
- Refactoring or migration → HIGH risk
|
|
31
|
+
|
|
32
|
+
4. **Consider Dependencies**
|
|
33
|
+
- No external deps → LOW
|
|
34
|
+
- Some integration → MEDIUM
|
|
35
|
+
- Multiple systems → HIGH
|
|
36
|
+
|
|
37
|
+
## Output Format
|
|
38
|
+
|
|
39
|
+
Return JSON:
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"complexity": "low|medium|high",
|
|
43
|
+
"type": "feature|bugfix|refactor|testing|docs|chore",
|
|
44
|
+
"estimatedHours": <number>,
|
|
45
|
+
"reasoning": "<brief explanation>"
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Guidelines
|
|
50
|
+
|
|
51
|
+
- Be realistic, not optimistic
|
|
52
|
+
- Consider testing time in estimates
|
|
53
|
+
- If unsure, lean toward higher complexity
|
|
54
|
+
- Don't use keyword matching - analyze semantically
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: health-score
|
|
3
|
+
description: Calculate project health score
|
|
4
|
+
allowed-tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project Health Score
|
|
8
|
+
|
|
9
|
+
Evaluate the project's health based on activity metrics.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Active task: {{hasActiveTask}}
|
|
13
|
+
- Queue size: {{queueSize}}
|
|
14
|
+
- Recent ships: {{recentShips}}
|
|
15
|
+
- Ideas count: {{ideasCount}}
|
|
16
|
+
- Days since last ship: {{daysSinceShip}}
|
|
17
|
+
|
|
18
|
+
## Health Factors
|
|
19
|
+
|
|
20
|
+
### Momentum (40%)
|
|
21
|
+
- Active task = good
|
|
22
|
+
- Regular shipping = good
|
|
23
|
+
- Long gaps = concerning
|
|
24
|
+
|
|
25
|
+
### Focus (30%)
|
|
26
|
+
- Queue < 10 = focused
|
|
27
|
+
- Queue 10-20 = busy
|
|
28
|
+
- Queue > 20 = overloaded
|
|
29
|
+
|
|
30
|
+
### Progress (20%)
|
|
31
|
+
- Ships this week > 0 = active
|
|
32
|
+
- Ships this month > 2 = productive
|
|
33
|
+
- No ships in 7+ days = stalled
|
|
34
|
+
|
|
35
|
+
### Planning (10%)
|
|
36
|
+
- Ideas captured = thinking ahead
|
|
37
|
+
- Too many ideas = unfocused
|
|
38
|
+
|
|
39
|
+
## Score Calculation
|
|
40
|
+
|
|
41
|
+
Evaluate each factor and combine:
|
|
42
|
+
|
|
43
|
+
| Score | Label | Meaning |
|
|
44
|
+
|-------|-------|---------|
|
|
45
|
+
| 80-100 | Excellent | High momentum, focused, shipping |
|
|
46
|
+
| 60-79 | Good | Active, some room to improve |
|
|
47
|
+
| 40-59 | Fair | Slowing down, needs attention |
|
|
48
|
+
| 0-39 | Low | Stalled, intervention needed |
|
|
49
|
+
|
|
50
|
+
## Output Format
|
|
51
|
+
|
|
52
|
+
Return JSON:
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"score": <0-100>,
|
|
56
|
+
"label": "Excellent|Good|Fair|Low",
|
|
57
|
+
"momentum": "<assessment>",
|
|
58
|
+
"suggestions": ["<action 1>", "<action 2>"]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Guidelines
|
|
63
|
+
|
|
64
|
+
- Be encouraging but honest
|
|
65
|
+
- Suggest specific actions
|
|
66
|
+
- Focus on momentum, not perfection
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intent-detection
|
|
3
|
+
description: Detect user intent from natural language
|
|
4
|
+
allowed-tools: []
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Intent Detection
|
|
8
|
+
|
|
9
|
+
Analyze user input to determine their intent and map to appropriate action.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- User message: {{message}}
|
|
13
|
+
|
|
14
|
+
## Intent Categories
|
|
15
|
+
|
|
16
|
+
### Work Intents
|
|
17
|
+
- **start_task**: User wants to begin working on something
|
|
18
|
+
- **complete_task**: User finished current work
|
|
19
|
+
- **ship**: User wants to release/deploy
|
|
20
|
+
- **pause**: User needs to pause current work
|
|
21
|
+
|
|
22
|
+
### Planning Intents
|
|
23
|
+
- **add_feature**: User has a new feature idea
|
|
24
|
+
- **add_idea**: Quick thought to capture
|
|
25
|
+
- **add_bug**: Report a problem
|
|
26
|
+
- **view_queue**: See what's next
|
|
27
|
+
|
|
28
|
+
### Status Intents
|
|
29
|
+
- **check_progress**: View metrics/status
|
|
30
|
+
- **get_recap**: Project overview
|
|
31
|
+
- **get_help**: Need guidance
|
|
32
|
+
|
|
33
|
+
### System Intents
|
|
34
|
+
- **sync**: Update project state
|
|
35
|
+
- **analyze**: Analyze codebase
|
|
36
|
+
- **cleanup**: Clean up files
|
|
37
|
+
|
|
38
|
+
## Analysis
|
|
39
|
+
|
|
40
|
+
Look for semantic meaning, not keywords:
|
|
41
|
+
- "I'm done" → complete_task
|
|
42
|
+
- "Let's ship this" → ship
|
|
43
|
+
- "Quick thought..." → add_idea
|
|
44
|
+
- "What should I do?" → get_help OR view_queue
|
|
45
|
+
|
|
46
|
+
## Output Format
|
|
47
|
+
|
|
48
|
+
Return JSON:
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"intent": "<intent_name>",
|
|
52
|
+
"confidence": <0.0-1.0>,
|
|
53
|
+
"parameters": {
|
|
54
|
+
"task": "<extracted task if any>",
|
|
55
|
+
"feature": "<extracted feature if any>"
|
|
56
|
+
},
|
|
57
|
+
"suggestedCommand": "/p:<command>"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Guidelines
|
|
62
|
+
|
|
63
|
+
- Use semantic understanding, not regex
|
|
64
|
+
- Extract relevant parameters
|
|
65
|
+
- High confidence (>0.8) for clear intents
|
|
66
|
+
- Ask for clarification if < 0.5
|
|
@@ -1,142 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Glob, Grep]
|
|
3
|
-
description: 'Analyze code patterns
|
|
3
|
+
description: 'Analyze code patterns and conventions'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Code Pattern Analysis
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Detection Steps
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
1. **Structure** (5-10 files): File org, exports, modules
|
|
11
|
+
2. **Patterns**: SOLID, DRY, factory/singleton/observer
|
|
12
|
+
3. **Conventions**: Naming, style, error handling, async
|
|
13
|
+
4. **Anti-patterns**: God class, spaghetti, copy-paste, magic numbers
|
|
14
|
+
5. **Performance**: Memoization, N+1 queries, leaks
|
|
11
15
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
### File Organization
|
|
15
|
-
- Read 5-10 representative source files
|
|
16
|
-
- Identify: single vs multiple exports per file
|
|
17
|
-
- Check: file size patterns (small focused files vs large files)
|
|
18
|
-
- Note: directory organization (by feature, by layer, by type)
|
|
19
|
-
|
|
20
|
-
### Module Patterns
|
|
21
|
-
- ES Modules vs CommonJS
|
|
22
|
-
- Default exports vs named exports
|
|
23
|
-
- Barrel files (index.js re-exports)
|
|
24
|
-
- Circular dependency patterns
|
|
25
|
-
|
|
26
|
-
## Step 2: Detect Design Patterns
|
|
27
|
-
|
|
28
|
-
### SOLID Principles
|
|
29
|
-
Analyze for evidence of:
|
|
30
|
-
|
|
31
|
-
| Principle | Look For | Example |
|
|
32
|
-
|-----------|----------|---------|
|
|
33
|
-
| **S**ingle Responsibility | Small, focused files/functions | `validateUser()` not `validateAndSaveUser()` |
|
|
34
|
-
| **O**pen/Closed | Extension points, plugins | Base classes, strategy pattern |
|
|
35
|
-
| **L**iskov Substitution | Interface consistency | Subclasses behave like parents |
|
|
36
|
-
| **I**nterface Segregation | Small, specific interfaces | Multiple small interfaces vs one large |
|
|
37
|
-
| **D**ependency Inversion | Dependency injection | Constructor injection, factories |
|
|
38
|
-
|
|
39
|
-
### DRY (Don't Repeat Yourself)
|
|
40
|
-
- Check for utility/helper directories
|
|
41
|
-
- Look for shared constants
|
|
42
|
-
- Identify reusable components/functions
|
|
43
|
-
- Note any obvious duplication
|
|
44
|
-
|
|
45
|
-
### Other Patterns
|
|
46
|
-
- Factory pattern (createX functions)
|
|
47
|
-
- Singleton pattern (shared instances)
|
|
48
|
-
- Observer pattern (event emitters)
|
|
49
|
-
- Repository pattern (data access layer)
|
|
50
|
-
- Strategy pattern (interchangeable algorithms)
|
|
51
|
-
|
|
52
|
-
## Step 3: Identify Conventions
|
|
53
|
-
|
|
54
|
-
### Naming Conventions
|
|
55
|
-
```
|
|
56
|
-
Analyze actual code for:
|
|
57
|
-
- Functions: camelCase, snake_case, PascalCase?
|
|
58
|
-
- Classes: PascalCase?
|
|
59
|
-
- Constants: UPPER_SNAKE_CASE?
|
|
60
|
-
- Files: kebab-case, camelCase, PascalCase?
|
|
61
|
-
- Private members: _prefix, #private?
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Code Style
|
|
65
|
-
- Semicolons: yes/no
|
|
66
|
-
- Quotes: single/double
|
|
67
|
-
- Indentation: tabs/spaces (2/4)
|
|
68
|
-
- Trailing commas: yes/no
|
|
69
|
-
- Max line length observed
|
|
70
|
-
|
|
71
|
-
### Error Handling
|
|
72
|
-
- Try-catch patterns
|
|
73
|
-
- Custom error classes
|
|
74
|
-
- Error propagation (throw vs return)
|
|
75
|
-
- Logging patterns
|
|
76
|
-
|
|
77
|
-
### Async Patterns
|
|
78
|
-
- async/await vs Promises vs callbacks
|
|
79
|
-
- Error handling in async code
|
|
80
|
-
- Parallel execution patterns
|
|
81
|
-
|
|
82
|
-
## Step 4: Detect Anti-Patterns
|
|
83
|
-
|
|
84
|
-
### Code Smells (Flag These)
|
|
85
|
-
|
|
86
|
-
| Anti-Pattern | Detection | Severity |
|
|
87
|
-
|--------------|-----------|----------|
|
|
88
|
-
| **God Class/File** | File > 300 lines, too many responsibilities | HIGH |
|
|
89
|
-
| **Spaghetti Code** | Deep nesting > 4 levels, unclear flow | HIGH |
|
|
90
|
-
| **Copy-Paste Code** | Duplicate blocks across files | MEDIUM |
|
|
91
|
-
| **Magic Numbers** | Hardcoded values without constants | MEDIUM |
|
|
92
|
-
| **Long Functions** | Function > 50 lines | MEDIUM |
|
|
93
|
-
| **Too Many Parameters** | Function with > 4 params | LOW |
|
|
94
|
-
| **Dead Code** | Commented out code, unused exports | LOW |
|
|
95
|
-
| **Mixed Concerns** | I/O mixed with business logic | MEDIUM |
|
|
96
|
-
| **Callback Hell** | Nested callbacks > 3 levels | HIGH |
|
|
97
|
-
| **Mutable Global State** | Global variables modified everywhere | HIGH |
|
|
98
|
-
|
|
99
|
-
### Architecture Smells
|
|
100
|
-
|
|
101
|
-
| Anti-Pattern | Detection | Recommendation |
|
|
102
|
-
|--------------|-----------|----------------|
|
|
103
|
-
| **Circular Dependencies** | A imports B, B imports A | Extract shared module |
|
|
104
|
-
| **Feature Envy** | Function uses other module's data excessively | Move function to that module |
|
|
105
|
-
| **Inappropriate Intimacy** | Classes know too much about each other | Use interfaces/abstractions |
|
|
106
|
-
| **Lazy Class** | Class does almost nothing | Merge with related class |
|
|
107
|
-
| **Speculative Generality** | Unused abstractions "for future" | Remove until needed |
|
|
108
|
-
|
|
109
|
-
## Step 5: Performance Patterns
|
|
110
|
-
|
|
111
|
-
### Good Patterns to Note
|
|
112
|
-
- Memoization usage
|
|
113
|
-
- Lazy loading
|
|
114
|
-
- Caching strategies
|
|
115
|
-
- Batch operations
|
|
116
|
-
- Connection pooling
|
|
117
|
-
|
|
118
|
-
### Performance Anti-Patterns
|
|
119
|
-
- N+1 queries
|
|
120
|
-
- Synchronous I/O in loops
|
|
121
|
-
- Memory leaks (unclosed resources)
|
|
122
|
-
- Unbounded data structures
|
|
123
|
-
|
|
124
|
-
## Output Format
|
|
125
|
-
|
|
126
|
-
Generate `analysis/patterns.md` with:
|
|
16
|
+
## Output: analysis/patterns.md
|
|
127
17
|
|
|
128
18
|
```markdown
|
|
129
|
-
# Code Patterns - {Project
|
|
19
|
+
# Code Patterns - {Project}
|
|
130
20
|
|
|
131
|
-
>
|
|
132
|
-
> Last analyzed: {timestamp}
|
|
21
|
+
> Generated: {GetTimestamp()}
|
|
133
22
|
|
|
134
|
-
##
|
|
23
|
+
## Patterns Detected
|
|
24
|
+
- **{Pattern}**: {Where} - {Example}
|
|
135
25
|
|
|
136
|
-
|
|
137
|
-
- **{Pattern}**: {Where used} - {Example}
|
|
138
|
-
|
|
139
|
-
### SOLID Compliance
|
|
26
|
+
## SOLID Compliance
|
|
140
27
|
| Principle | Status | Evidence |
|
|
141
28
|
|-----------|--------|----------|
|
|
142
29
|
| Single Responsibility | ✅/⚠️/❌ | {evidence} |
|
|
@@ -146,61 +33,28 @@ Generate `analysis/patterns.md` with:
|
|
|
146
33
|
| Dependency Inversion | ✅/⚠️/❌ | {evidence} |
|
|
147
34
|
|
|
148
35
|
## Conventions (MUST FOLLOW)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
- Classes: {convention}
|
|
153
|
-
- Files: {convention}
|
|
154
|
-
- Constants: {convention}
|
|
155
|
-
|
|
156
|
-
### Style
|
|
157
|
-
- Semicolons: {yes/no}
|
|
36
|
+
- Functions: {camelCase/snake_case}
|
|
37
|
+
- Classes: {PascalCase}
|
|
38
|
+
- Files: {kebab-case/camelCase}
|
|
158
39
|
- Quotes: {single/double}
|
|
159
|
-
- Async: {async-await/promises
|
|
160
|
-
|
|
161
|
-
### Structure
|
|
162
|
-
- Exports: {single/multiple per file}
|
|
163
|
-
- Max file size: {observed max}
|
|
164
|
-
- Directory organization: {pattern}
|
|
40
|
+
- Async: {async-await/promises}
|
|
165
41
|
|
|
166
|
-
## Anti-Patterns
|
|
42
|
+
## Anti-Patterns ⚠️
|
|
167
43
|
|
|
168
44
|
### High Priority
|
|
169
|
-
1. **{
|
|
170
|
-
- Problem: {description}
|
|
171
|
-
- Fix: {recommendation}
|
|
45
|
+
1. **{Issue}**: {file:line} - Fix: {action}
|
|
172
46
|
|
|
173
47
|
### Medium Priority
|
|
174
|
-
1. **{
|
|
175
|
-
- Problem: {description}
|
|
176
|
-
- Fix: {recommendation}
|
|
48
|
+
1. **{Issue}**: {file:line} - Fix: {action}
|
|
177
49
|
|
|
178
50
|
## Recommendations
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
1. {Action with specific file/location}
|
|
182
|
-
|
|
183
|
-
### Best Practices for New Code
|
|
184
|
-
1. {Practice based on detected patterns}
|
|
185
|
-
2. {Practice based on conventions}
|
|
186
|
-
3. {Practice to avoid anti-patterns}
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
**IMPORTANT**: All new code MUST follow these patterns and conventions.
|
|
51
|
+
1. {Immediate action}
|
|
52
|
+
2. {Best practice}
|
|
191
53
|
```
|
|
192
54
|
|
|
193
|
-
##
|
|
194
|
-
|
|
195
|
-
When generating new code, Claude MUST:
|
|
196
|
-
|
|
197
|
-
1. **Check patterns.md FIRST** before writing any code
|
|
198
|
-
2. **Match naming conventions** exactly as detected
|
|
199
|
-
3. **Follow file structure** patterns (size, organization)
|
|
200
|
-
4. **Apply detected design patterns** where appropriate
|
|
201
|
-
5. **NEVER introduce anti-patterns** listed in the analysis
|
|
202
|
-
6. **Warn if asked to violate** established patterns
|
|
203
|
-
|
|
204
|
-
---
|
|
55
|
+
## Rules
|
|
205
56
|
|
|
206
|
-
|
|
57
|
+
1. Check patterns.md FIRST before writing code
|
|
58
|
+
2. Match conventions exactly
|
|
59
|
+
3. NEVER introduce anti-patterns
|
|
60
|
+
4. Warn if asked to violate patterns
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-breakdown
|
|
3
|
+
description: Break down a feature into actionable tasks
|
|
4
|
+
allowed-tools: [Read, Glob, Grep]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feature Task Breakdown
|
|
8
|
+
|
|
9
|
+
Analyze the feature description and break it into concrete, actionable tasks.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Feature: {{feature}}
|
|
13
|
+
- Project path: {{projectPath}}
|
|
14
|
+
|
|
15
|
+
## Analysis Steps
|
|
16
|
+
|
|
17
|
+
1. **Understand the Feature**
|
|
18
|
+
- Read related code if paths are obvious
|
|
19
|
+
- Identify affected systems
|
|
20
|
+
- Note existing patterns to follow
|
|
21
|
+
|
|
22
|
+
2. **Identify Components**
|
|
23
|
+
- What new files/modules are needed?
|
|
24
|
+
- What existing code needs modification?
|
|
25
|
+
- What tests are required?
|
|
26
|
+
|
|
27
|
+
3. **Order by Dependencies**
|
|
28
|
+
- Foundation tasks first (models, types, interfaces)
|
|
29
|
+
- Core logic second
|
|
30
|
+
- Integration third
|
|
31
|
+
- Tests and polish last
|
|
32
|
+
|
|
33
|
+
4. **Size Each Task**
|
|
34
|
+
- Each task should be 20-60 minutes
|
|
35
|
+
- If larger, break down further
|
|
36
|
+
- If smaller, combine with related task
|
|
37
|
+
|
|
38
|
+
## Output Format
|
|
39
|
+
|
|
40
|
+
Return a numbered task list:
|
|
41
|
+
```
|
|
42
|
+
1. [20m] Task description - specific action
|
|
43
|
+
2. [30m] Another task - what exactly to do
|
|
44
|
+
3. [45m] Final task - clear deliverable
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Guidelines
|
|
48
|
+
|
|
49
|
+
- Tasks must be specific and actionable
|
|
50
|
+
- Include time estimates in brackets
|
|
51
|
+
- Order matters - dependencies first
|
|
52
|
+
- Don't assume - if unsure, read code first
|
|
53
|
+
- Match project patterns (read existing code)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect-discovery
|
|
3
|
+
description: Discovery phase for architecture generation
|
|
4
|
+
allowed-tools: [Read, AskUserQuestion]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Discovery Phase
|
|
8
|
+
|
|
9
|
+
Conduct discovery for the given idea to understand requirements and constraints.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Idea: {{idea}}
|
|
13
|
+
- Context: {{context}}
|
|
14
|
+
|
|
15
|
+
## Discovery Steps
|
|
16
|
+
|
|
17
|
+
1. **Understand the Problem**
|
|
18
|
+
- What problem does this solve?
|
|
19
|
+
- Who experiences this problem?
|
|
20
|
+
- How critical is it?
|
|
21
|
+
|
|
22
|
+
2. **Identify Target Users**
|
|
23
|
+
- Who are the primary users?
|
|
24
|
+
- What are their goals?
|
|
25
|
+
- What's their technical level?
|
|
26
|
+
|
|
27
|
+
3. **Define Constraints**
|
|
28
|
+
- Budget limitations?
|
|
29
|
+
- Timeline requirements?
|
|
30
|
+
- Team size?
|
|
31
|
+
- Regulatory needs?
|
|
32
|
+
|
|
33
|
+
4. **Set Success Metrics**
|
|
34
|
+
- How will we measure success?
|
|
35
|
+
- What's the MVP threshold?
|
|
36
|
+
- Key performance indicators?
|
|
37
|
+
|
|
38
|
+
## Output Format
|
|
39
|
+
|
|
40
|
+
Return structured discovery:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"problem": {
|
|
44
|
+
"statement": "...",
|
|
45
|
+
"painPoints": ["..."],
|
|
46
|
+
"impact": "high|medium|low"
|
|
47
|
+
},
|
|
48
|
+
"users": {
|
|
49
|
+
"primary": { "persona": "...", "goals": ["..."] },
|
|
50
|
+
"secondary": [...]
|
|
51
|
+
},
|
|
52
|
+
"constraints": {
|
|
53
|
+
"budget": "...",
|
|
54
|
+
"timeline": "...",
|
|
55
|
+
"teamSize": 1
|
|
56
|
+
},
|
|
57
|
+
"successMetrics": {
|
|
58
|
+
"primary": "...",
|
|
59
|
+
"mvpThreshold": "..."
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Guidelines
|
|
65
|
+
- Ask clarifying questions if needed
|
|
66
|
+
- Be realistic about constraints
|
|
67
|
+
- Focus on MVP scope
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect-phases
|
|
3
|
+
description: Determine which architecture phases are needed
|
|
4
|
+
allowed-tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Architecture Phase Selection
|
|
8
|
+
|
|
9
|
+
Analyze the idea and context to determine which phases are needed.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
- Idea: {{idea}}
|
|
13
|
+
- Discovery results: {{discovery}}
|
|
14
|
+
|
|
15
|
+
## Available Phases
|
|
16
|
+
|
|
17
|
+
1. **discovery** - Problem definition, users, constraints
|
|
18
|
+
2. **user-flows** - User journeys and interactions
|
|
19
|
+
3. **domain-modeling** - Entities and relationships
|
|
20
|
+
4. **api-design** - API contracts and endpoints
|
|
21
|
+
5. **architecture** - System components and patterns
|
|
22
|
+
6. **data-design** - Database schema and storage
|
|
23
|
+
7. **tech-stack** - Technology choices
|
|
24
|
+
8. **roadmap** - Implementation plan
|
|
25
|
+
|
|
26
|
+
## Phase Selection Rules
|
|
27
|
+
|
|
28
|
+
**Always include**:
|
|
29
|
+
- discovery (foundation)
|
|
30
|
+
- roadmap (execution plan)
|
|
31
|
+
|
|
32
|
+
**Include if building**:
|
|
33
|
+
- user-flows: Has UI/UX
|
|
34
|
+
- domain-modeling: Has data entities
|
|
35
|
+
- api-design: Has backend API
|
|
36
|
+
- architecture: Complex system
|
|
37
|
+
- data-design: Needs database
|
|
38
|
+
- tech-stack: Greenfield project
|
|
39
|
+
|
|
40
|
+
**Skip if**:
|
|
41
|
+
- Simple script: Skip most phases
|
|
42
|
+
- Frontend only: Skip api-design, data-design
|
|
43
|
+
- CLI tool: Skip user-flows
|
|
44
|
+
- Existing stack: Skip tech-stack
|
|
45
|
+
|
|
46
|
+
## Output Format
|
|
47
|
+
|
|
48
|
+
Return array of needed phases:
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"phases": ["discovery", "domain-modeling", "api-design", "roadmap"],
|
|
52
|
+
"reasoning": "Simple CRUD app needs data model and API"
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Guidelines
|
|
57
|
+
- Don't over-architect
|
|
58
|
+
- Match complexity to project
|
|
59
|
+
- MVP first, expand later
|