planflow-ai 1.0.0 → 1.0.2
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/.claude/commands/create-contract.md +1 -1
- package/.claude/commands/create-plan.md +1 -1
- package/.claude/commands/discovery-plan.md +148 -33
- package/.claude/commands/execute-plan.md +1 -1
- package/.claude/commands/review-code.md +1 -1
- package/.claude/commands/review-pr.md +1 -1
- package/.claude/commands/setup.md +1 -1
- package/.claude/commands/write-tests.md +1 -1
- package/.claude/rules/patterns/discovery-patterns.md +100 -9
- package/.claude/rules/patterns/discovery-templates.md +100 -0
- package/package.json +11 -3
|
@@ -46,7 +46,7 @@ WORKFLOW:
|
|
|
46
46
|
3. Generates contract document with endpoints, schemas, and integration notes
|
|
47
47
|
|
|
48
48
|
RECOMMENDED MODEL:
|
|
49
|
-
Claude Opus 4.
|
|
49
|
+
Claude Opus 4.6 or Sonnet 4.5 for best results
|
|
50
50
|
|
|
51
51
|
RELATED COMMANDS:
|
|
52
52
|
/discovery-plan Create discovery document from contract
|
|
@@ -12,6 +12,18 @@ This command creates a discovery document for gathering and clarifying requireme
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
+
> ⚠️ **IMPORTANT - DISCOVERY ONLY**
|
|
16
|
+
>
|
|
17
|
+
> This command ONLY creates a discovery document. It does NOT:
|
|
18
|
+
> - Create implementation plans (use `/create-plan` for that)
|
|
19
|
+
> - Execute code or implementation steps (use `/execute-plan` for that)
|
|
20
|
+
> - Write any source code files
|
|
21
|
+
> - Auto-chain to the next command
|
|
22
|
+
>
|
|
23
|
+
> After creating the discovery document, the command STOPS and waits for user review.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
15
27
|
|
|
16
28
|
## Help
|
|
17
29
|
|
|
@@ -43,14 +55,16 @@ OUTPUT:
|
|
|
43
55
|
|
|
44
56
|
WORKFLOW:
|
|
45
57
|
1. Reads all referenced documents
|
|
46
|
-
2.
|
|
47
|
-
3.
|
|
48
|
-
4.
|
|
49
|
-
5.
|
|
50
|
-
6.
|
|
58
|
+
2. Finds all related code references in codebase
|
|
59
|
+
3. Asks clarifying questions (via Plan mode Questions UI)
|
|
60
|
+
4. Documents requirements (FR, NFR, Constraints)
|
|
61
|
+
5. Proposes high-level approach (no code)
|
|
62
|
+
6. Creates discovery document for review
|
|
63
|
+
7. Asks user if they want to proceed to /create-plan
|
|
64
|
+
8. Waits for user confirmation before proceeding
|
|
51
65
|
|
|
52
66
|
RECOMMENDED MODEL:
|
|
53
|
-
Claude Opus 4.
|
|
67
|
+
Claude Opus 4.6 or Sonnet 4.5 for best results
|
|
54
68
|
|
|
55
69
|
RELATED COMMANDS:
|
|
56
70
|
/create-contract Create contract from API docs first
|
|
@@ -71,8 +85,10 @@ These rules are mandatory. For detailed patterns and guidelines, see `.claude/ru
|
|
|
71
85
|
| **Read First** | Read all referenced documents before asking questions |
|
|
72
86
|
| **High-Level Only** | Technical considerations are conceptual, not code |
|
|
73
87
|
| **Allow Refinement** | User reviews and refines discovery before plan creation |
|
|
74
|
-
| **
|
|
75
|
-
| **
|
|
88
|
+
| **Ask Before Proceeding**| ASK user if they want to proceed to /create-plan |
|
|
89
|
+
| **No Auto-Execution** | Do NOT auto-invoke commands without user confirmation |
|
|
90
|
+
| **NO PLANNING** | Do NOT create implementation plans during discovery |
|
|
91
|
+
| **NO EXECUTION** | Do NOT execute any implementation steps |
|
|
76
92
|
|
|
77
93
|
---
|
|
78
94
|
|
|
@@ -125,13 +141,16 @@ Check `flow/discovery/` for existing discovery documents for this feature:
|
|
|
125
141
|
The skill will:
|
|
126
142
|
|
|
127
143
|
1. Read all referenced documents
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
130
|
-
4.
|
|
131
|
-
5.
|
|
132
|
-
6.
|
|
133
|
-
7.
|
|
134
|
-
8.
|
|
144
|
+
2. Find all related code references in the codebase
|
|
145
|
+
3. Ask clarifying questions via Interactive Questions Tool
|
|
146
|
+
4. Track question status
|
|
147
|
+
5. Document requirements (FR, NFR, Constraints)
|
|
148
|
+
6. Identify technical considerations
|
|
149
|
+
7. Propose high-level approach
|
|
150
|
+
8. Document risks and unknowns
|
|
151
|
+
9. Generate discovery document
|
|
152
|
+
10. Ask user if they want to proceed to /create-plan
|
|
153
|
+
11. Wait for user confirmation before proceeding
|
|
135
154
|
|
|
136
155
|
See: `.claude/rules/skills/discovery-skill.md`
|
|
137
156
|
|
|
@@ -152,13 +171,25 @@ Discovery Complete!
|
|
|
152
171
|
|
|
153
172
|
**Deliverable Created**: `flow/discovery/discovery_<feature>_v1.md`
|
|
154
173
|
|
|
155
|
-
**Next Steps
|
|
174
|
+
**Next Steps**:
|
|
156
175
|
1. Review the discovery document above
|
|
157
|
-
2. Request any refinements or additions
|
|
158
|
-
3.
|
|
176
|
+
2. Request any refinements or additions (if needed)
|
|
177
|
+
3. Proceed to planning when ready
|
|
159
178
|
```
|
|
160
179
|
|
|
161
|
-
**
|
|
180
|
+
**Now ask the user**:
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
Would you like me to proceed with creating the implementation plan?
|
|
184
|
+
|
|
185
|
+
- **Yes**: I'll invoke `/create-plan @flow/discovery/discovery_<feature>_v1.md`
|
|
186
|
+
- **No**: You can review the discovery and invoke `/create-plan` when ready
|
|
187
|
+
- **Refine first**: Let me know what needs to be adjusted in the discovery
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
⚠️ **WAIT for user response before proceeding**
|
|
191
|
+
|
|
192
|
+
Do NOT auto-invoke `/create-plan` without user confirmation.
|
|
162
193
|
|
|
163
194
|
---
|
|
164
195
|
|
|
@@ -303,10 +334,14 @@ This skill is **strictly for gathering and documenting requirements**. The proce
|
|
|
303
334
|
| -------------------------------------- | ----------------------------------------- |
|
|
304
335
|
| Create/edit source code files | Discovery is requirements gathering only |
|
|
305
336
|
| Write implementation code in responses | No code during discovery |
|
|
306
|
-
| Create implementation plans | Plans come after discovery
|
|
337
|
+
| Create implementation plans | Plans come after discovery via /create-plan |
|
|
338
|
+
| Create files in `flow/plans/` | Planning is a separate command |
|
|
339
|
+
| Auto-invoke /create-plan without asking| Must ASK user before proceeding |
|
|
340
|
+
| Execute implementation steps | Discovery does not execute anything |
|
|
307
341
|
| Modify configuration files | No codebase changes |
|
|
308
342
|
| Run build or test commands | No execution commands |
|
|
309
343
|
| Create files outside `flow/discovery/` | Only write discovery documents |
|
|
344
|
+
| Proceed without user confirmation | Must wait for user response |
|
|
310
345
|
|
|
311
346
|
### Allowed Actions
|
|
312
347
|
|
|
@@ -366,7 +401,79 @@ This skill is **strictly for gathering and documenting requirements**. The proce
|
|
|
366
401
|
|
|
367
402
|
---
|
|
368
403
|
|
|
369
|
-
### Step 2:
|
|
404
|
+
### Step 2: Find All Related Code References
|
|
405
|
+
|
|
406
|
+
**BEFORE asking questions**, search the codebase to find **all code locations** related to the feature.
|
|
407
|
+
|
|
408
|
+
**Why**: Understanding where a feature is currently used prevents incomplete implementations and reveals hidden dependencies.
|
|
409
|
+
|
|
410
|
+
**Actions**:
|
|
411
|
+
|
|
412
|
+
1. **Identify key terms** from the user's request (e.g., "user profile", "workflow editor")
|
|
413
|
+
2. **Search for components** using Grep:
|
|
414
|
+
```bash
|
|
415
|
+
Grep: "UserProfile|userProfile|user-profile"
|
|
416
|
+
--output_mode content --type ts --type tsx
|
|
417
|
+
```
|
|
418
|
+
3. **Search for types** using Grep:
|
|
419
|
+
```bash
|
|
420
|
+
Grep: "interface.*User|type.*User"
|
|
421
|
+
--output_mode content --type ts
|
|
422
|
+
```
|
|
423
|
+
4. **Search for API routes** using Glob:
|
|
424
|
+
```bash
|
|
425
|
+
Glob: "**/api/**/user*/**"
|
|
426
|
+
Glob: "**/api/**/profile*/**"
|
|
427
|
+
```
|
|
428
|
+
5. **Search for stores** using Grep:
|
|
429
|
+
```bash
|
|
430
|
+
Grep: "userStore|profileStore|useUser"
|
|
431
|
+
--output_mode content --type ts
|
|
432
|
+
```
|
|
433
|
+
6. **Search for tests** using Glob:
|
|
434
|
+
```bash
|
|
435
|
+
Glob: "**/*user*.test.ts*"
|
|
436
|
+
Glob: "**/*profile*.test.ts*"
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
**Document Format**:
|
|
440
|
+
|
|
441
|
+
```markdown
|
|
442
|
+
## Code Context Analysis
|
|
443
|
+
|
|
444
|
+
### Components Found
|
|
445
|
+
| File | Usage | Line(s) |
|
|
446
|
+
|------|-------|---------|
|
|
447
|
+
| `src/components/UserProfile.tsx` | Main profile component | - |
|
|
448
|
+
| `src/components/Settings/ProfileSettings.tsx` | Settings integration | - |
|
|
449
|
+
|
|
450
|
+
### API Endpoints Found
|
|
451
|
+
| File | Endpoint | Method |
|
|
452
|
+
|------|----------|--------|
|
|
453
|
+
| `src/app/api/user/profile/route.ts` | `/api/user/profile` | GET, PUT |
|
|
454
|
+
|
|
455
|
+
### State Management Found
|
|
456
|
+
| File | Purpose |
|
|
457
|
+
|------|---------|
|
|
458
|
+
| `src/stores/userStore.ts` | User profile state |
|
|
459
|
+
|
|
460
|
+
### Type Definitions Found
|
|
461
|
+
| File | Types |
|
|
462
|
+
|------|-------|
|
|
463
|
+
| `src/types/user.ts` | `User`, `UserProfile` |
|
|
464
|
+
|
|
465
|
+
**Total References**: X files across Y categories
|
|
466
|
+
|
|
467
|
+
### Key Patterns Observed
|
|
468
|
+
- [Pattern 1 from existing code]
|
|
469
|
+
- [Pattern 2 from existing code]
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**Read Key Files**: After finding references, read 2-3 key files to understand current implementation patterns.
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
### Step 3: Ask Clarifying Questions
|
|
370
477
|
|
|
371
478
|
Ask questions about gaps identified in documents and unclear requirements.
|
|
372
479
|
|
|
@@ -396,7 +503,7 @@ Follow `.claude/rules/tools/interactive-questions-tool.md`:
|
|
|
396
503
|
|
|
397
504
|
---
|
|
398
505
|
|
|
399
|
-
### Step
|
|
506
|
+
### Step 4: Track Question Status
|
|
400
507
|
|
|
401
508
|
Maintain a question tracking table:
|
|
402
509
|
|
|
@@ -419,7 +526,7 @@ Maintain a question tracking table:
|
|
|
419
526
|
|
|
420
527
|
---
|
|
421
528
|
|
|
422
|
-
### Step
|
|
529
|
+
### Step 5: Document Requirements
|
|
423
530
|
|
|
424
531
|
Categorize requirements as they are gathered:
|
|
425
532
|
|
|
@@ -438,7 +545,7 @@ Categorize requirements as they are gathered:
|
|
|
438
545
|
|
|
439
546
|
---
|
|
440
547
|
|
|
441
|
-
### Step
|
|
548
|
+
### Step 6: Identify Technical Considerations
|
|
442
549
|
|
|
443
550
|
Document high-level technical insights (NO implementation code):
|
|
444
551
|
|
|
@@ -460,7 +567,7 @@ Document high-level technical insights (NO implementation code):
|
|
|
460
567
|
|
|
461
568
|
---
|
|
462
569
|
|
|
463
|
-
### Step
|
|
570
|
+
### Step 7: Propose High-Level Approach
|
|
464
571
|
|
|
465
572
|
Suggest an approach based on findings (NO implementation code):
|
|
466
573
|
|
|
@@ -481,7 +588,7 @@ Based on the requirements gathered, I recommend:
|
|
|
481
588
|
|
|
482
589
|
---
|
|
483
590
|
|
|
484
|
-
### Step
|
|
591
|
+
### Step 8: Document Risks and Unknowns
|
|
485
592
|
|
|
486
593
|
Capture risks discovered:
|
|
487
594
|
|
|
@@ -500,7 +607,7 @@ Capture risks discovered:
|
|
|
500
607
|
|
|
501
608
|
---
|
|
502
609
|
|
|
503
|
-
### Step
|
|
610
|
+
### Step 9: Generate Discovery Document
|
|
504
611
|
|
|
505
612
|
Create the discovery markdown file:
|
|
506
613
|
|
|
@@ -512,12 +619,13 @@ Create the discovery markdown file:
|
|
|
512
619
|
|
|
513
620
|
1. Context
|
|
514
621
|
2. Referenced Documents
|
|
515
|
-
3.
|
|
516
|
-
4.
|
|
517
|
-
5.
|
|
518
|
-
6.
|
|
519
|
-
7.
|
|
520
|
-
8.
|
|
622
|
+
3. Code Context Analysis
|
|
623
|
+
4. Requirements Gathered (FR, NFR, Constraints)
|
|
624
|
+
5. Open Questions (all answered)
|
|
625
|
+
6. Technical Considerations
|
|
626
|
+
7. Proposed Approach
|
|
627
|
+
8. Risks and Unknowns
|
|
628
|
+
9. Next Steps
|
|
521
629
|
|
|
522
630
|
---
|
|
523
631
|
|
|
@@ -538,6 +646,8 @@ The discovery document should follow the template in `.claude/rules/patterns/dis
|
|
|
538
646
|
Before completing discovery, verify:
|
|
539
647
|
|
|
540
648
|
- [ ] All referenced documents have been read
|
|
649
|
+
- [ ] Code context analysis completed (all related files found)
|
|
650
|
+
- [ ] Key patterns observed and documented
|
|
541
651
|
- [ ] Document is saved in `flow/discovery/` folder
|
|
542
652
|
- [ ] File uses correct naming convention
|
|
543
653
|
- [ ] Open questions table has no "Blocked" status
|
|
@@ -548,6 +658,11 @@ Before completing discovery, verify:
|
|
|
548
658
|
- [ ] Next steps are defined (pointing to `/create-plan`)
|
|
549
659
|
- [ ] **NO implementation code is included**
|
|
550
660
|
- [ ] **NO source files were created or modified**
|
|
661
|
+
- [ ] **NO implementation plans were created**
|
|
662
|
+
- [ ] **NO files created in flow/plans/ directory**
|
|
663
|
+
- [ ] **ASKED user if they want to proceed to /create-plan**
|
|
664
|
+
- [ ] **WAITING for user confirmation before proceeding**
|
|
665
|
+
- [ ] **Did NOT auto-invoke /create-plan without asking**
|
|
551
666
|
|
|
552
667
|
---
|
|
553
668
|
|
|
@@ -74,7 +74,7 @@ DETECTS:
|
|
|
74
74
|
Libraries: Zod, Prisma, Zustand, Redux, TailwindCSS, React Query, and 50+
|
|
75
75
|
|
|
76
76
|
RECOMMENDED MODEL:
|
|
77
|
-
Claude Opus 4.
|
|
77
|
+
Claude Opus 4.6 or Sonnet 4.5 for best results
|
|
78
78
|
|
|
79
79
|
RELATED COMMANDS:
|
|
80
80
|
/discovery-plan Start discovery after setup
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
Discovery is a **pre-planning phase** where we:
|
|
5
5
|
|
|
6
6
|
1. **Gather Information**: Read referenced files, contracts, and documentation
|
|
7
|
-
2. **
|
|
8
|
-
3. **
|
|
9
|
-
4. **
|
|
10
|
-
5. **
|
|
7
|
+
2. **Find Code Context**: Search codebase for all related implementations and dependencies
|
|
8
|
+
3. **Ask Questions**: Clarify every unclear aspect with the user
|
|
9
|
+
4. **Explore Unknowns**: Investigate technical feasibility and constraints
|
|
10
|
+
5. **Document Findings**: Create a comprehensive discovery document
|
|
11
|
+
6. **Prepare for Planning**: Provide all context needed to create an implementation plan
|
|
11
12
|
|
|
12
13
|
**Workflow**: Discovery Output → Implementation Plan → Execution
|
|
13
14
|
|
|
@@ -113,7 +114,96 @@ Categorize all gathered requirements:
|
|
|
113
114
|
|
|
114
115
|
---
|
|
115
116
|
|
|
116
|
-
### 2.
|
|
117
|
+
### 2. Find All Related Code References
|
|
118
|
+
|
|
119
|
+
**Before proceeding with discovery**, search the codebase to find **all code locations** related to the feature being discovered.
|
|
120
|
+
|
|
121
|
+
**Why**: Understanding where a feature is currently used prevents incomplete implementations and reveals hidden dependencies.
|
|
122
|
+
|
|
123
|
+
**Process**:
|
|
124
|
+
|
|
125
|
+
1. **Identify key terms** from the user's request (e.g., "user profile", "workflow editor", "authentication")
|
|
126
|
+
2. **Search for code references** using Grep:
|
|
127
|
+
- Component names
|
|
128
|
+
- Function names
|
|
129
|
+
- Type definitions
|
|
130
|
+
- API endpoints
|
|
131
|
+
- Database models
|
|
132
|
+
- Store actions/selectors
|
|
133
|
+
3. **Search for file patterns** using Glob:
|
|
134
|
+
- Related component directories
|
|
135
|
+
- Test files for the feature
|
|
136
|
+
- API route files
|
|
137
|
+
4. **Document all findings** in the "Code Context Analysis" section of the discovery document
|
|
138
|
+
5. **Read key files** to understand current implementation patterns
|
|
139
|
+
|
|
140
|
+
**Example Search Strategy**:
|
|
141
|
+
|
|
142
|
+
For a request like "edit user profile":
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Search for components/functions
|
|
146
|
+
Grep: "UserProfile|userProfile|user-profile"
|
|
147
|
+
--output_mode content --type ts --type tsx
|
|
148
|
+
|
|
149
|
+
# Search for types
|
|
150
|
+
Grep: "interface.*User|type.*User"
|
|
151
|
+
--output_mode content --type ts
|
|
152
|
+
|
|
153
|
+
# Search for API routes
|
|
154
|
+
Glob: "**/api/**/user*/**" or "**/api/**/profile*/**"
|
|
155
|
+
|
|
156
|
+
# Search for stores
|
|
157
|
+
Grep: "userStore|profileStore|useUser"
|
|
158
|
+
--output_mode content --type ts
|
|
159
|
+
|
|
160
|
+
# Search for tests
|
|
161
|
+
Glob: "**/*user*.test.ts*" or "**/*profile*.test.ts*"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Document Format in Discovery**:
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
## Code Context Analysis
|
|
168
|
+
|
|
169
|
+
### Components Found
|
|
170
|
+
| File | Usage | Line(s) |
|
|
171
|
+
|------|-------|---------|
|
|
172
|
+
| `src/components/UserProfile.tsx` | Main profile component | - |
|
|
173
|
+
| `src/components/Settings/ProfileSettings.tsx` | Settings page usage | - |
|
|
174
|
+
| `src/components/Dashboard/UserCard.tsx` | Dashboard card | - |
|
|
175
|
+
|
|
176
|
+
### API Endpoints Found
|
|
177
|
+
| File | Endpoint | Method |
|
|
178
|
+
|------|----------|--------|
|
|
179
|
+
| `src/app/api/user/profile/route.ts` | `/api/user/profile` | GET, PUT |
|
|
180
|
+
| `src/app/api/user/avatar/route.ts` | `/api/user/avatar` | POST |
|
|
181
|
+
|
|
182
|
+
### State Management Found
|
|
183
|
+
| File | Purpose |
|
|
184
|
+
|------|---------|
|
|
185
|
+
| `src/stores/userStore.ts` | User profile state |
|
|
186
|
+
| `src/stores/authStore.ts` | Authentication state (includes profile data) |
|
|
187
|
+
|
|
188
|
+
### Type Definitions Found
|
|
189
|
+
| File | Types |
|
|
190
|
+
|------|-------|
|
|
191
|
+
| `src/types/user.ts` | `User`, `UserProfile`, `UpdateProfileInput` |
|
|
192
|
+
|
|
193
|
+
### Total References: 12 files across 5 categories
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Benefits**:
|
|
197
|
+
|
|
198
|
+
- **Complete Context**: Know all places where changes will have impact
|
|
199
|
+
- **Prevent Breaking Changes**: Identify all consumers before making modifications
|
|
200
|
+
- **Better Estimates**: Understand full scope for complexity scoring
|
|
201
|
+
- **Pattern Discovery**: Learn existing patterns from actual usage
|
|
202
|
+
- **Test Coverage**: Find existing tests that need updates
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### 3. Ask Questions Using Interactive Questions Tool
|
|
117
207
|
|
|
118
208
|
**Use Plan mode's Questions UI** for a better user experience.
|
|
119
209
|
|
|
@@ -135,7 +225,7 @@ See `.claude/rules/tools/interactive-questions-tool.md` for detailed instruction
|
|
|
135
225
|
|
|
136
226
|
---
|
|
137
227
|
|
|
138
|
-
###
|
|
228
|
+
### 4. Structure Discovery Documents Consistently
|
|
139
229
|
|
|
140
230
|
Every discovery document must include these sections:
|
|
141
231
|
|
|
@@ -154,7 +244,7 @@ See `.claude/rules/patterns/discovery-templates.md` for the full template.
|
|
|
154
244
|
|
|
155
245
|
---
|
|
156
246
|
|
|
157
|
-
###
|
|
247
|
+
### 5. Mark Assumptions Explicitly
|
|
158
248
|
|
|
159
249
|
When making assumptions, always mark them clearly:
|
|
160
250
|
|
|
@@ -171,7 +261,7 @@ When making assumptions, always mark them clearly:
|
|
|
171
261
|
|
|
172
262
|
---
|
|
173
263
|
|
|
174
|
-
###
|
|
264
|
+
### 6. Keep Discovery High-Level
|
|
175
265
|
|
|
176
266
|
Focus on "what" not "how". Discovery captures:
|
|
177
267
|
|
|
@@ -184,7 +274,7 @@ Implementation details belong in the plan, not discovery.
|
|
|
184
274
|
|
|
185
275
|
---
|
|
186
276
|
|
|
187
|
-
###
|
|
277
|
+
### 7. Link Discovery to Plan
|
|
188
278
|
|
|
189
279
|
When discovery is complete:
|
|
190
280
|
|
|
@@ -333,6 +423,7 @@ The discovery document is the **ONLY** deliverable. It must be:
|
|
|
333
423
|
| Pattern | Description |
|
|
334
424
|
| ------------------------------ | ---------------------------------------------- |
|
|
335
425
|
| Read documents first | Always review referenced files before asking |
|
|
426
|
+
| Find all code references | Search codebase for all related implementations|
|
|
336
427
|
| Use interactive questions | Plan mode Questions UI for better UX |
|
|
337
428
|
| Structure consistently | Follow the standard discovery template |
|
|
338
429
|
| Mark assumptions | Always label and validate assumptions |
|
|
@@ -19,6 +19,47 @@ Use this template when creating discovery documents:
|
|
|
19
19
|
| `flow/references/api-contracts.md` | [Summary of relevant content] |
|
|
20
20
|
| `flow/references/sse-events.md` | [Summary of relevant content] |
|
|
21
21
|
|
|
22
|
+
## Code Context Analysis
|
|
23
|
+
|
|
24
|
+
[Analysis of all code locations related to this feature]
|
|
25
|
+
|
|
26
|
+
### Components Found
|
|
27
|
+
|
|
28
|
+
| File | Usage | Line(s) |
|
|
29
|
+
|------|-------|---------|
|
|
30
|
+
| `[file_path]` | [How it's used] | [line references] |
|
|
31
|
+
|
|
32
|
+
### API Endpoints Found
|
|
33
|
+
|
|
34
|
+
| File | Endpoint | Method |
|
|
35
|
+
|------|----------|--------|
|
|
36
|
+
| `[file_path]` | `[endpoint]` | [GET/POST/PUT/DELETE] |
|
|
37
|
+
|
|
38
|
+
### State Management Found
|
|
39
|
+
|
|
40
|
+
| File | Purpose |
|
|
41
|
+
|------|---------|
|
|
42
|
+
| `[file_path]` | [Store/state description] |
|
|
43
|
+
|
|
44
|
+
### Type Definitions Found
|
|
45
|
+
|
|
46
|
+
| File | Types |
|
|
47
|
+
|------|-------|
|
|
48
|
+
| `[file_path]` | [Type names] |
|
|
49
|
+
|
|
50
|
+
### Other Related Files
|
|
51
|
+
|
|
52
|
+
| File | Purpose |
|
|
53
|
+
|------|---------|
|
|
54
|
+
| `[file_path]` | [Description] |
|
|
55
|
+
|
|
56
|
+
**Total References**: [count] files across [count] categories
|
|
57
|
+
|
|
58
|
+
### Key Patterns Observed
|
|
59
|
+
|
|
60
|
+
- [Pattern 1 observed in existing code]
|
|
61
|
+
- [Pattern 2 observed in existing code]
|
|
62
|
+
|
|
22
63
|
## Requirements Gathered
|
|
23
64
|
|
|
24
65
|
### Functional Requirements
|
|
@@ -297,6 +338,65 @@ I've reviewed the following documents:
|
|
|
297
338
|
|
|
298
339
|
---
|
|
299
340
|
|
|
341
|
+
## Code Context Analysis Example
|
|
342
|
+
|
|
343
|
+
```markdown
|
|
344
|
+
## Code Context Analysis
|
|
345
|
+
|
|
346
|
+
I performed a comprehensive search for all code related to "user profile" functionality:
|
|
347
|
+
|
|
348
|
+
### Components Found
|
|
349
|
+
|
|
350
|
+
| File | Usage | Line(s) |
|
|
351
|
+
|------|-------|---------|
|
|
352
|
+
| `src/components/UserProfile/index.tsx` | Main profile display component | - |
|
|
353
|
+
| `src/components/UserProfile/EditForm.tsx` | Profile editing form | - |
|
|
354
|
+
| `src/components/Settings/ProfileSettings.tsx` | Settings page integration | - |
|
|
355
|
+
| `src/components/Dashboard/UserCard.tsx` | Dashboard summary card | 45-78 |
|
|
356
|
+
| `src/components/Navigation/UserMenu.tsx` | Navigation menu with profile link | 23-35 |
|
|
357
|
+
|
|
358
|
+
### API Endpoints Found
|
|
359
|
+
|
|
360
|
+
| File | Endpoint | Method |
|
|
361
|
+
|------|----------|--------|
|
|
362
|
+
| `src/app/api/user/profile/route.ts` | `/api/user/profile` | GET, PUT |
|
|
363
|
+
| `src/app/api/user/avatar/route.ts` | `/api/user/avatar` | POST |
|
|
364
|
+
| `src/app/api/user/settings/route.ts` | `/api/user/settings` | GET, PATCH |
|
|
365
|
+
|
|
366
|
+
### State Management Found
|
|
367
|
+
|
|
368
|
+
| File | Purpose |
|
|
369
|
+
|------|---------|
|
|
370
|
+
| `src/stores/userStore.ts` | User profile state with actions |
|
|
371
|
+
| `src/stores/authStore.ts` | Includes user profile data from auth |
|
|
372
|
+
|
|
373
|
+
### Type Definitions Found
|
|
374
|
+
|
|
375
|
+
| File | Types |
|
|
376
|
+
|------|-------|
|
|
377
|
+
| `src/types/user.ts` | `User`, `UserProfile`, `UpdateProfileInput` |
|
|
378
|
+
| `src/types/rest-inputs.ts` | `UpdateProfileRequestSchema` (Zod) |
|
|
379
|
+
|
|
380
|
+
### Other Related Files
|
|
381
|
+
|
|
382
|
+
| File | Purpose |
|
|
383
|
+
|------|---------|
|
|
384
|
+
| `src/utils/userValidation.ts` | Profile data validation utilities |
|
|
385
|
+
| `src/hooks/useUserProfile.ts` | Custom hook for profile management |
|
|
386
|
+
|
|
387
|
+
**Total References**: 12 files across 5 categories
|
|
388
|
+
|
|
389
|
+
### Key Patterns Observed
|
|
390
|
+
|
|
391
|
+
- **View/Logic Separation**: Components use separate logic hooks (e.g., `useUserProfileLogic.internal.ts`)
|
|
392
|
+
- **Zod Validation**: All API inputs validated with Zod schemas in `types/rest-inputs.ts`
|
|
393
|
+
- **State Management**: Using Zustand stores with immer for immutable updates
|
|
394
|
+
- **Error Handling**: Consistent use of custom error types (`BadRequestError`, `UnauthorizedError`)
|
|
395
|
+
- **Testing**: Each component has co-located `*.client.test.ts` file
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
300
400
|
## Proposed Approach Example
|
|
301
401
|
|
|
302
402
|
```markdown
|
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "planflow-ai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Structured AI-assisted development workflows for discovery, planning, execution, code reviews, and testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
8
|
+
"planflow-ai": "./dist/cli/index.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/brunoscardoso/plan-flow.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/brunoscardoso/plan-flow#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/brunoscardoso/plan-flow/issues"
|
|
9
17
|
},
|
|
10
18
|
"scripts": {
|
|
11
19
|
"build": "tsc",
|
|
@@ -43,7 +51,7 @@
|
|
|
43
51
|
"workflow",
|
|
44
52
|
"ai-assisted"
|
|
45
53
|
],
|
|
46
|
-
"author": "",
|
|
54
|
+
"author": "Bruno Cardoso",
|
|
47
55
|
"license": "MIT",
|
|
48
56
|
"dependencies": {
|
|
49
57
|
"commander": "^14.0.3"
|