@haposoft/cafekit 0.8.15 → 0.8.17

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.
@@ -1,730 +0,0 @@
1
- ---
2
- description: Analyze code change impacts on features and user actions
3
- allowed-tools: Read, Glob, Grep, Bash, WebSearch
4
- argument-hint: <feature-name> [--from <branch>]
5
- ---
6
-
7
- # /impact-analysis - Feature Impact Analysis
8
-
9
- Use this workflow after completing a feature (after `/code`) or before committing.
10
-
11
- <background_information>
12
- - **Mission**: Comprehensive impact analysis for completed features to prevent regression bugs
13
- - **Success Criteria**:
14
- - All affected features identified with user actions mapped
15
- - Edge cases detected and documented
16
- - Test scenarios generated for all critical paths
17
- - Regression risks assessed with mitigation recommendations
18
- - Cross-referenced with spec artifacts when available
19
- - **Timing**: After implementing all tasks for a feature, before running tests
20
- - **Helper Scripts**: Optionally use advanced analysis scripts from `.agent/skills/impact-analysis/scripts/` for automated dependency analysis, AST-based semantic analysis, and risk scoring
21
- </background_information>
22
-
23
- <instructions>
24
- ## Core Task
25
- Analyze the impact of code changes for feature **$ARGUMENTS** to identify affected features, user actions, edge cases, and generate comprehensive test scenarios.
26
-
27
- ## Helper Scripts (Optional Enhancement)
28
-
29
- If available in `.agent/skills/impact-analysis/scripts/`, these scripts provide advanced automated analysis:
30
-
31
- **1. Dependency Analysis**:
32
- ```bash
33
- .agent/skills/impact-analysis/scripts/find-dependencies.sh <file>
34
- ```
35
- - Finds all files importing/using the changed file
36
- - Identifies API consumers and component usage
37
- - Provides impact recommendations
38
-
39
- **2. AST-Based Analysis** (for TypeScript/JavaScript):
40
- ```bash
41
- node .agent/skills/impact-analysis/scripts/ast-analyze.js <file>
42
- ```
43
- - Detects function signature changes
44
- - Identifies breaking changes
45
- - Compares before/after versions
46
-
47
- **3. Risk Calculation**:
48
- ```bash
49
- node .agent/skills/impact-analysis/scripts/calculate-risk.js
50
- ```
51
- - Calculates risk score (0-25)
52
- - Determines risk level (CRITICAL/HIGH/MEDIUM/LOW)
53
- - Provides actionable recommendations with time estimates
54
-
55
- **4. Complete Analysis**:
56
- ```bash
57
- .agent/skills/impact-analysis/scripts/run-analysis.sh
58
- ```
59
- - Runs all techniques
60
- - Generates comprehensive markdown report
61
-
62
- **Usage Strategy**:
63
- - Try to use helper scripts first for automated analysis
64
- - Fall back to manual grep/analysis if scripts not available
65
- - Combine automated results with manual insights for best coverage
66
-
67
- ## Execution Steps
68
-
69
- ### Step 0: Validate Context & Determine Scope
70
-
71
- **Parse Arguments**:
72
- - Extract feature name from `$ARGUMENTS` (first argument)
73
- - Check for flags: `--from <branch>` for branch-based analysis
74
- - If no arguments: Analyze uncommitted changes
75
-
76
- **Load Spec Context (if feature name provided)**:
77
- - Check if `.specs/$FEATURE_NAME/` exists
78
- - If exists:
79
- - Read `.specs/$FEATURE_NAME/spec.json` for metadata
80
- - Read `.specs/$FEATURE_NAME/requirements.md` for requirements
81
- - Read `.specs/$FEATURE_NAME/design.md` for design decisions
82
- - Read `.specs/$FEATURE_NAME/tasks.md` for task list
83
- - Note: This enables cross-referencing and coverage analysis
84
- - If not exists: Continue with standalone analysis (no spec context)
85
-
86
- **Determine Analysis Scope**:
87
- - **Feature-based** (feature name provided): Analyze all changes since feature start
88
- - Use git log to find first commit mentioning feature
89
- - Or analyze all uncommitted + recent commits
90
- - **Branch-based** (`--from` flag): Compare current branch with specified branch
91
- - Example: `--from main` analyzes all changes since branching from main
92
- - **Uncommitted** (no args): Analyze only uncommitted changes
93
- - Use `git diff HEAD` for staged/unstaged changes
94
-
95
- ### Step 1: Detect & Classify Changes
96
-
97
- **Execute Git Analysis**:
98
- ```bash
99
- # Based on scope from Step 0:
100
- # Feature-based: git diff <feature-start-commit>..HEAD
101
- # Branch-based: git diff <branch>...HEAD
102
- # Uncommitted: git diff HEAD
103
- ```
104
-
105
- **Classify Changed Files**:
106
- - **Backend**: Files in `src/api/`, `src/services/`, `src/lib/`, `src/utils/`
107
- - **Frontend**: Files in `src/components/`, `src/pages/`, `src/app/`, `src/hooks/`
108
- - **Database**: Files in `prisma/`, `migrations/`, `schema/`, `*.sql`
109
- - **Config**: Files like `package.json`, `tsconfig.json`, `.env`, config files
110
- - **Tests**: Files in `__tests__/`, `*.test.*`, `*.spec.*`
111
-
112
- **Count & Summarize**:
113
- - Total files changed
114
- - Files per category
115
- - Lines added/removed
116
- - Commits involved (if applicable)
117
-
118
- ### Step 2: Map Features & User Actions
119
-
120
- **Pattern-Based Feature Detection**:
121
-
122
- Use file path patterns to identify affected features:
123
-
124
- | File Pattern | Feature | User Actions |
125
- |-------------|---------|--------------|
126
- | `**/api/auth**`, `**/auth**` | Authentication & Login | Login, Logout, Sign Up, Password Reset, Session Management, 2FA |
127
- | `**/api/users**`, `**/user**`, `**/profile**` | User Profile Management | View Profile, Edit Profile, Upload Avatar, Change Settings, Update Bio |
128
- | `**/api/posts**`, `**/post**`, `**/article**` | Post Management | Create Post, Edit Post, Delete Post, View Posts, Like Post, Share Post |
129
- | `**/api/comments**`, `**/comment**`, `**/reply**` | Comment System | Add Comment, Edit Comment, Delete Comment, View Comments, Reply |
130
- | `**/api/payments**`, `**/payment**`, `**/checkout**` | Payment Processing | Make Payment, Process Refund, View History, Update Payment Method |
131
- | `**/api/notifications**`, `**/notification**` | Notification System | Send Notification, View Notifications, Mark as Read, Settings |
132
- | `**/components/auth**` | Login/Signup UI | Display Forms, Handle Validation, Show Errors |
133
- | `**/hooks/useAuth**` | Authentication State | Check Login Status, Get User Info, Handle Logout |
134
- | `**/prisma/schema**`, `**/migrations**` | Database Structure | All Database Operations, Queries, Mutations |
135
- | `**/middleware/auth**` | Access Control | Check Permissions, Protect Routes, Validate Tokens |
136
-
137
- **Content-Based Feature Detection**:
138
-
139
- Scan file contents for keywords to detect additional features:
140
-
141
- | Keywords | Feature | User Actions |
142
- |----------|---------|--------------|
143
- | `login`, `signin`, `authenticate` | Authentication & Login | Login, Logout, Session Management |
144
- | `profile`, `avatar`, `bio` | User Profile Management | View Profile, Edit Profile, Upload Avatar |
145
- | `post`, `article`, `content` | Post Management | Create, Edit, Delete, View Posts |
146
- | `comment`, `reply` | Comment System | Add, Edit, Delete Comments |
147
- | `payment`, `checkout`, `stripe`, `paypal` | Payment Processing | Make Payment, Process Refund |
148
- | `search`, `filter`, `query` | Search & Filter | Search Content, Apply Filters, Sort Results |
149
- | `upload`, `file`, `image` | File Upload | Upload File, Delete File, View Files |
150
- | `email`, `send mail` | Email System | Send Email, Email Verification |
151
-
152
- **Generate Feature Impact Map**:
153
- - List all detected features
154
- - Map user actions to each feature
155
- - Create impact scenarios: "When user tries to [action], [potential impact]"
156
-
157
- ### Step 3: Find Dependencies & Affected Files
158
-
159
- **Automated Dependency Analysis** (using helper script):
160
-
161
- If helper script available, run comprehensive analysis:
162
- ```bash
163
- .agent/skills/impact-analysis/scripts/find-dependencies.sh <file>
164
- ```
165
-
166
- **Manual Dependency Analysis** (fallback):
167
-
168
- For each changed file, find:
169
- 1. **Direct imports**: Files that import the changed file
170
- ```bash
171
- grep -r "from.*<filename>" src/
172
- grep -r "import.*<filename>" src/
173
- ```
174
-
175
- 2. **Function/Class usage**: Files that call functions or use classes from changed file
176
- ```bash
177
- grep -r "<function-name>\|<class-name>" src/
178
- ```
179
-
180
- 3. **API consumers**: If API changed, find frontend components calling it
181
- ```bash
182
- grep -r "fetch.*<api-endpoint>" src/
183
- grep -r "axios.*<api-endpoint>" src/
184
- ```
185
-
186
- 4. **Component usage**: If component changed, find parent components
187
- ```bash
188
- grep -r "<ComponentName>" src/
189
- ```
190
-
191
- **Count Affected Files**:
192
- - Total affected files
193
- - Breakdown by category (backend/frontend/tests)
194
- - Highlight high-impact files (used in many places)
195
-
196
- ### Step 4: Identify Edge Cases
197
-
198
- **Automated Edge Case Detection**:
199
-
200
- **Option 1: Use Helper Scripts** (if available):
201
- ```bash
202
- node .agent/skills/impact-analysis/scripts/ast-analyze.js <file>
203
- node .agent/skills/impact-analysis/scripts/calculate-risk.js
204
- ```
205
-
206
- **Option 2: Manual Detection** (fallback):
207
-
208
- Scan changed files for common issues:
209
-
210
- 1. **Null/Undefined Handling**:
211
- ```bash
212
- # Find property access without optional chaining
213
- grep -E "\.[a-zA-Z]+" <file> | grep -v "?\."
214
- ```
215
- - Issue: Potential null pointer errors
216
- - Action: Add null checks or optional chaining
217
-
218
- 2. **Error Handling**:
219
- ```bash
220
- # Find async calls without try-catch
221
- grep -E "await|fetch|axios" <file>
222
- grep -E "try\s*\{" <file>
223
- ```
224
- - Issue: Missing error handling
225
- - Action: Add try-catch blocks
226
-
227
- 3. **Boundary Conditions**:
228
- - Array access without length check
229
- - Division without zero check
230
- - String operations without empty check
231
-
232
- 4. **Race Conditions**:
233
- - Multiple async operations without proper sequencing
234
- - State updates without locks/mutexes
235
- - Concurrent API calls
236
-
237
- **Categorize by Severity**:
238
- - **Critical**: Will cause crashes or data loss
239
- - **Important**: Will cause incorrect behavior
240
- - **Minor**: Edge cases that rarely occur
241
-
242
- ### Step 5: Cross-Reference with Spec (if available)
243
-
244
- **If spec context loaded in Step 0**:
245
-
246
- **Requirements Coverage**:
247
- - Map changed files to requirement IDs
248
- - Check if all requirements are implemented
249
- - Identify partially implemented requirements
250
- - Flag missing implementations
251
-
252
- **Design Compliance**:
253
- - Verify API endpoints match design
254
- - Check database schema matches design
255
- - Validate component structure follows design
256
- - Note any deviations
257
-
258
- **Task Completion**:
259
- - Check task status in `tasks.md`
260
- - Count completed vs pending tasks
261
- - Identify blocked tasks
262
- - Calculate completion percentage
263
-
264
- **Output**:
265
- ```markdown
266
- ## Requirements Coverage
267
- - FR-1: User Login ✅ Implemented
268
- - FR-2: Password Reset ✅ Implemented
269
- - FR-3: 2FA ⚠️ Partially implemented
270
-
271
- ## Design Compliance
272
- - API endpoints: ✅ Match design
273
- - Database schema: ✅ Match design
274
- - Component structure: ⚠️ Deviation detected
275
-
276
- ## Task Status
277
- - Completed: 8/10 tasks (80%)
278
- - Pending: Task #9, Task #10
279
- ```
280
-
281
- ### Step 6: Generate Test Scenarios
282
-
283
- **Scenario Generation Strategy**:
284
-
285
- For each affected feature and user action, generate:
286
-
287
- 1. **Happy Path Scenarios**:
288
- ```markdown
289
- Given: [precondition]
290
- When: [user action]
291
- Then: [expected result]
292
- And: [additional verification]
293
- ```
294
-
295
- 2. **Error Handling Scenarios**:
296
- ```markdown
297
- Given: [precondition]
298
- When: [user action with invalid input]
299
- Then: [error message shown]
300
- And: [system remains stable]
301
- ```
302
-
303
- 3. **Edge Case Scenarios**:
304
- ```markdown
305
- Given: [edge case condition]
306
- When: [user action]
307
- Then: [graceful handling]
308
- ```
309
-
310
- 4. **Regression Scenarios**:
311
- ```markdown
312
- Given: [existing functionality]
313
- When: [user performs old action]
314
- Then: [still works as before]
315
- ```
316
-
317
- **Prioritize Scenarios**:
318
- - **Critical**: Must test before deployment
319
- - **Important**: Should test before PR
320
- - **Nice to have**: Test if time permits
321
-
322
- ### Step 7: Assess Regression Risks
323
-
324
- **Automated Risk Assessment** (if helper script available):
325
-
326
- ```bash
327
- node .agent/skills/impact-analysis/scripts/calculate-risk.js
328
-
329
- # Output includes:
330
- # - Risk score (0-25)
331
- # - Risk level (CRITICAL/HIGH/MEDIUM/LOW)
332
- # - Risk breakdown by factors
333
- # - Actionable recommendations with time estimates
334
- ```
335
-
336
- **Manual Risk Assessment** (fallback):
337
-
338
- Categorize changes by risk level:
339
-
340
- **High Risk**:
341
- - Database schema changes
342
- - Authentication/authorization changes
343
- - Payment processing changes
344
- - API contract changes (breaking)
345
- - Core business logic modifications
346
-
347
- **Medium Risk**:
348
- - UI component refactoring
349
- - New features with existing integrations
350
- - Configuration changes
351
- - Dependency updates
352
-
353
- **Low Risk**:
354
- - Documentation updates
355
- - Code formatting
356
- - Minor UI tweaks
357
- - Test additions
358
-
359
- **For Each Risk Area**:
360
- - Identify what could break
361
- - List affected user workflows
362
- - Suggest mitigation strategies
363
-
364
- ### Step 8: Create Comprehensive Report
365
-
366
- **Generate Report Structure**:
367
-
368
- ```markdown
369
- # Impact Analysis Report - {Feature Name}
370
-
371
- **Generated**: {timestamp}
372
- **Feature**: {feature-name}
373
- **Branch**: {current-branch}
374
- **Commits**: {commit-count}
375
-
376
- ---
377
-
378
- ## 📋 Executive Summary
379
-
380
- - **Files Changed**: {count}
381
- - **Features Affected**: {count}
382
- - **User Scenarios**: {count}
383
- - **Edge Cases**: {count}
384
- - **Risk Level**: {HIGH/MEDIUM/LOW}
385
- - **Estimated Test Time**: {estimate}
386
-
387
- {If spec available:}
388
- - **Requirements Coverage**: {percentage}%
389
- - **Tasks Completed**: {completed}/{total}
390
- - **Design Compliance**: {status}
391
-
392
- ---
393
-
394
- ## 🔍 Change Analysis
395
-
396
- ### Files Changed ({count})
397
-
398
- **Backend** ({count} files):
399
- - {list of backend files}
400
-
401
- **Frontend** ({count} files):
402
- - {list of frontend files}
403
-
404
- **Database** ({count} files):
405
- - {list of database files}
406
-
407
- **Config** ({count} files):
408
- - {list of config files}
409
-
410
- ---
411
-
412
- ## 🎯 Feature Impact Map
413
-
414
- ### Feature 1: {Feature Name}
415
-
416
- **User Actions Affected**:
417
- - {action 1}
418
- - {action 2}
419
- - {action 3}
420
-
421
- **Impact Level**: {HIGH/MEDIUM/LOW}
422
-
423
- **Details**: {explanation of impact}
424
-
425
- ### Feature 2: {Feature Name}
426
- ...
427
-
428
- ---
429
-
430
- ## 🎬 Impact Scenarios
431
-
432
- ### Scenario 1: {Action Name}
433
- - **When user tries to**: {action}
434
- - **Potential impact**: {description}
435
- - **Required action**: {test instruction}
436
- - **Priority**: {CRITICAL/IMPORTANT/MINOR}
437
-
438
- ### Scenario 2: {Action Name}
439
- ...
440
-
441
- ---
442
-
443
- ## 🔗 Dependencies & Affected Files
444
-
445
- ### Direct Dependencies ({count})
446
- - {file 1} → {affected by changes in file X}
447
- - {file 2} → {affected by changes in file Y}
448
-
449
- ### Integration Points ({count})
450
- - {component A} calls {API endpoint B}
451
- - {page X} uses {component Y}
452
-
453
- ---
454
-
455
- ## ⚠️ Edge Cases Detected
456
-
457
- ### Critical ({count})
458
- 1. **{Issue Title}**
459
- - **Location**: {file:line}
460
- - **Issue**: {description}
461
- - **Impact**: {what could go wrong}
462
- - **Action**: {how to fix}
463
-
464
- ### Important ({count})
465
- ...
466
-
467
- ### Minor ({count})
468
- ...
469
-
470
- ---
471
-
472
- {If spec available:}
473
- ## 📊 Spec Cross-Reference
474
-
475
- ### Requirements Coverage
476
- - FR-1: {requirement} ✅ Implemented
477
- - FR-2: {requirement} ⚠️ Partially implemented
478
- - FR-3: {requirement} ❌ Not implemented
479
-
480
- ### Design Compliance
481
- - API Endpoints: {status}
482
- - Database Schema: {status}
483
- - Component Structure: {status}
484
-
485
- ### Task Completion
486
- - Completed: {count}/{total} ({percentage}%)
487
- - Pending: {list}
488
- - Blocked: {list}
489
-
490
- ---
491
-
492
- ## 🧪 Test Scenarios
493
-
494
- ### Critical Scenarios (Must Test)
495
-
496
- #### Scenario 1: {Name}
497
- ```gherkin
498
- Given: {precondition}
499
- When: {action}
500
- Then: {expected result}
501
- And: {verification}
502
- ```
503
-
504
- **Priority**: CRITICAL
505
- **Estimated Time**: {minutes}
506
-
507
- #### Scenario 2: {Name}
508
- ...
509
-
510
- ### Important Scenarios (Should Test)
511
- ...
512
-
513
- ### Regression Scenarios (Verify Old Functionality)
514
- ...
515
-
516
- ---
517
-
518
- ## 🎯 Regression Risk Assessment
519
-
520
- ### High Risk Areas
521
- 1. **{Area Name}**
522
- - **Why**: {reason}
523
- - **Impact**: {what could break}
524
- - **Mitigation**: {how to prevent}
525
-
526
- ### Medium Risk Areas
527
- ...
528
-
529
- ### Low Risk Areas
530
- ...
531
-
532
- ---
533
-
534
- ## 💡 Recommendations
535
-
536
- ### Before Testing
537
- - [ ] {recommendation 1}
538
- - [ ] {recommendation 2}
539
- - [ ] {recommendation 3}
540
-
541
- ### Testing Checklist
542
- - [ ] Test all {count} critical scenarios
543
- - [ ] Verify {count} edge cases fixed
544
- - [ ] Run regression tests
545
- - [ ] Test on multiple devices/browsers
546
- - [ ] Performance testing (if applicable)
547
-
548
- ### Before Deployment
549
- - [ ] Update documentation
550
- - [ ] Notify stakeholders
551
- - [ ] Prepare rollback plan
552
- - [ ] Monitor metrics post-deployment
553
-
554
- ---
555
-
556
- ## 🚀 Next Steps
557
-
558
- 1. **Review this report** - Understand all impacts
559
- 2. **Fix critical edge cases** - Address {count} critical issues
560
- 3. **Run test scenarios** - Execute all critical tests
561
- 4. **Re-run analysis** - Verify fixes with `/impact-analysis {feature-name}`
562
- 5. **Proceed to testing** - Run `/test`
563
- 6. **Code review** - Run `/review`
564
- 7. **Commit & PR** - Create pull request with this report attached
565
-
566
- ---
567
-
568
- **Report saved to**: `.specs/impact-reports/{feature-name}-{timestamp}.md`
569
- ```
570
-
571
- **Save Report**:
572
- - Create `.specs/impact-reports/` directory if not exists
573
- - Save report as `{feature-name}-{timestamp}.md`
574
- - Create symlink `latest.md` pointing to this report
575
-
576
- </instructions>
577
-
578
- ## Tool Guidance
579
-
580
- **Read Operations**:
581
- - Load spec context first (if feature name provided)
582
- - Read all relevant spec files (spec.json, requirements.md, design.md, tasks.md)
583
- - Use Grep for dependency analysis and keyword detection
584
-
585
- **Bash Operations**:
586
- - Use git commands for change detection
587
- - Use grep for pattern matching and content scanning
588
- - Use find for file discovery
589
-
590
- **Analysis Strategy**:
591
- - Start broad (all changes) then narrow down (specific impacts)
592
- - Cross-reference with spec when available
593
- - Prioritize by risk and user impact
594
-
595
- **Output**:
596
- - Generate comprehensive markdown report
597
- - Save to `.specs/impact-reports/`
598
- - Display summary in terminal
599
-
600
- ## Output Description
601
-
602
- **Terminal Output** (concise summary):
603
-
604
- ```markdown
605
- ✅ Impact Analysis Complete
606
-
607
- **Feature**: {feature-name}
608
- **Files Changed**: {count}
609
- **Features Affected**: {count}
610
- **User Scenarios**: {count}
611
- **Edge Cases**: {count} ({critical} critical)
612
- **Risk Level**: {HIGH/MEDIUM/LOW}
613
-
614
- {If spec available:}
615
- **Requirements Coverage**: {percentage}%
616
- **Tasks Completed**: {completed}/{total}
617
-
618
- 📄 **Full Report**: `.specs/impact-reports/{feature-name}-{timestamp}.md`
619
-
620
- 🚀 **Next Steps**:
621
- 1. Review report and fix {count} critical edge cases
622
- 2. Run `/test` to execute test scenarios
623
- 3. Run `/review` for code quality check
624
- ```
625
-
626
- **Report File**: Comprehensive markdown report saved to `.specs/impact-reports/`
627
-
628
- ## Safety & Fallback
629
-
630
- ### Error Scenarios
631
-
632
- **No Changes Detected**:
633
- - **Message**: "No changes detected. Check git status or specify files."
634
- - **Suggested Action**: "Ensure you have uncommitted changes or specify feature name"
635
-
636
- **Feature Not Found**:
637
- - **Message**: "Feature '{name}' not found in .specs/"
638
- - **Suggested Action**: "Continue with standalone analysis (no spec context)"
639
- - **Proceed**: Analyze changes without spec cross-reference
640
-
641
- **Git Not Available**:
642
- - **Message**: "Git not available. Cannot detect changes."
643
- - **Suggested Action**: "Ensure git is installed and repository is initialized"
644
- - **Fallback**: Ask user to specify files manually
645
-
646
- **No Spec Context**:
647
- - **Warning**: "No spec context available. Analysis will be standalone."
648
- - **Proceed**: Continue without requirements/design/tasks cross-reference
649
- - **Note**: Report will not include spec-related sections
650
-
651
- ### Next Phase
652
-
653
- **After Impact Analysis**:
654
- 1. **Review Report**: Read full report at `.specs/impact-reports/latest.md`
655
- 2. **Fix Critical Issues**: Address all critical edge cases
656
- 3. **Run Tests**: Execute `/test` with generated scenarios
657
- 4. **Code Review**: Run `/review` for quality check
658
- 5. **Re-analyze** (optional): Run `/impact-analysis` again to verify fixes
659
- 6. **Commit**: Create commit with report attached to PR
660
-
661
- **Workflow Integration**:
662
- ```
663
- /code {feature-name}
664
- ↓ (implement all tasks)
665
- /impact-analysis {feature-name}
666
- ↓ (review report, fix issues)
667
- /test
668
- ↓
669
- /review
670
- ↓
671
- Commit & PR
672
- ```
673
-
674
- ## Examples
675
-
676
- ### Example 1: Feature-Based Analysis
677
-
678
- ```bash
679
- # After completing user-authentication feature
680
- /impact-analysis user-authentication
681
-
682
- # Output:
683
- # - Analyzes all changes for the feature
684
- # - Cross-references with spec
685
- # - Maps to Authentication & Login feature
686
- # - Lists 5 user actions affected
687
- # - Identifies 3 critical edge cases
688
- # - Generates 12 test scenarios
689
- # - Report saved to .specs/impact-reports/user-authentication-20260320.md
690
- ```
691
-
692
- ### Example 2: Uncommitted Changes
693
-
694
- ```bash
695
- # Quick analysis of current work
696
- /impact-analysis
697
-
698
- # Output:
699
- # - Analyzes uncommitted changes only
700
- # - No spec context (standalone)
701
- # - Maps to affected features
702
- # - Identifies edge cases
703
- # - Generates test scenarios
704
- ```
705
-
706
- ### Example 3: Branch-Based Analysis
707
-
708
- ```bash
709
- # Analyze all changes in feature branch
710
- /impact-analysis --from main
711
-
712
- # Output:
713
- # - Compares current branch with main
714
- # - Analyzes all differences
715
- # - Comprehensive impact report
716
- ```
717
-
718
- ## Best Practices
719
-
720
- 1. **Run After Feature Completion**: Use after implementing all tasks, not after each small change
721
- 2. **Review Report Thoroughly**: Don't skip edge cases and test scenarios
722
- 3. **Fix Critical Issues First**: Address all critical edge cases before testing
723
- 4. **Attach to PR**: Include report in pull request description
724
- 5. **Re-run After Fixes**: Verify fixes by running analysis again
725
- 6. **Use with Spec**: Always provide feature name for spec cross-reference
726
- 7. **Test All Scenarios**: Execute all critical test scenarios before deployment
727
-
728
- ---
729
-
730
- **Preferred workflow**: `/spec-init` → `/spec-requirements` → `/spec-design` → `/spec-validate` → `/spec-tasks` → `/code` → `/impact-analysis` → `/test` → `/review`