ai-flow-dev 2.2.0 → 2.2.4

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.
Files changed (74) hide show
  1. package/README.md +28 -24
  2. package/dist/cli.js +228 -418
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +1 -1
  5. package/prompts/backend/flow-build-phase-0.md +286 -4
  6. package/prompts/backend/flow-build-phase-1.md +19 -0
  7. package/prompts/backend/flow-build-phase-2.md +19 -0
  8. package/prompts/backend/flow-build-phase-3.md +19 -0
  9. package/prompts/backend/flow-build-phase-4.md +19 -0
  10. package/prompts/backend/flow-build-phase-5.md +19 -0
  11. package/prompts/backend/flow-build-phase-6.md +19 -0
  12. package/prompts/backend/flow-build-phase-7.md +19 -0
  13. package/prompts/backend/flow-build-phase-9.md +14 -0
  14. package/prompts/backend/flow-build.md +2 -0
  15. package/prompts/backend/flow-check-review.md +20 -0
  16. package/prompts/backend/flow-check-test.md +14 -0
  17. package/prompts/backend/flow-check.md +67 -0
  18. package/prompts/backend/flow-commit.md +53 -0
  19. package/prompts/backend/flow-docs-sync.md +55 -53
  20. package/prompts/backend/flow-work-feature.md +42 -0
  21. package/prompts/backend/flow-work-fix.md +33 -0
  22. package/prompts/backend/flow-work-refactor.md +32 -0
  23. package/prompts/backend/flow-work-resume.md +32 -0
  24. package/prompts/backend/flow-work.md +129 -0
  25. package/prompts/frontend/flow-build-phase-0.md +363 -35
  26. package/prompts/frontend/flow-build-phase-1.md +433 -404
  27. package/prompts/frontend/flow-build-phase-2.md +508 -872
  28. package/prompts/frontend/flow-build-phase-3.md +629 -562
  29. package/prompts/frontend/flow-build-phase-4.md +438 -382
  30. package/prompts/frontend/flow-build-phase-5.md +559 -362
  31. package/prompts/frontend/flow-build-phase-6.md +383 -452
  32. package/prompts/frontend/flow-build-phase-7.md +818 -392
  33. package/prompts/frontend/flow-build-phase-9.md +14 -0
  34. package/prompts/frontend/flow-build.md +2 -0
  35. package/prompts/frontend/flow-check-review.md +20 -0
  36. package/prompts/frontend/flow-check-test.md +14 -0
  37. package/prompts/frontend/flow-check.md +67 -0
  38. package/prompts/frontend/flow-commit.md +53 -0
  39. package/prompts/frontend/flow-docs-sync.md +39 -35
  40. package/prompts/frontend/flow-work-feature.md +42 -0
  41. package/prompts/frontend/flow-work-fix.md +33 -0
  42. package/prompts/frontend/flow-work-refactor.md +32 -0
  43. package/prompts/frontend/flow-work-resume.md +32 -0
  44. package/prompts/frontend/flow-work.md +129 -0
  45. package/prompts/mobile/flow-build-phase-0.md +366 -37
  46. package/prompts/mobile/flow-build-phase-1.md +438 -493
  47. package/prompts/mobile/flow-build-phase-2.md +458 -464
  48. package/prompts/mobile/flow-build-phase-3.md +613 -487
  49. package/prompts/mobile/flow-build-phase-4.md +439 -258
  50. package/prompts/mobile/flow-build-phase-5.md +582 -250
  51. package/prompts/mobile/flow-build-phase-6.md +389 -359
  52. package/prompts/mobile/flow-build-phase-7.md +871 -285
  53. package/prompts/mobile/flow-build-phase-9.md +14 -0
  54. package/prompts/mobile/flow-build.md +2 -0
  55. package/prompts/mobile/flow-check-review.md +20 -0
  56. package/prompts/mobile/flow-check-test.md +14 -0
  57. package/prompts/mobile/flow-check.md +67 -0
  58. package/prompts/mobile/flow-commit.md +53 -0
  59. package/prompts/mobile/flow-docs-sync.md +39 -40
  60. package/prompts/mobile/flow-work-feature.md +42 -0
  61. package/prompts/mobile/flow-work-fix.md +33 -0
  62. package/prompts/mobile/flow-work-refactor.md +32 -0
  63. package/prompts/mobile/flow-work-resume.md +32 -0
  64. package/prompts/mobile/flow-work.md +129 -0
  65. package/prompts/shared/smart-skip-preflight.md +214 -0
  66. package/templates/AGENT.template.md +13 -3
  67. package/templates/backend/.clauderules.template +5 -4
  68. package/templates/backend/.cursorrules.template +1 -1
  69. package/prompts/backend/flow-dev-commit.md +0 -829
  70. package/prompts/backend/flow-dev-feature.md +0 -1948
  71. package/prompts/backend/flow-dev-fix.md +0 -952
  72. package/prompts/backend/flow-dev-refactor.md +0 -690
  73. package/prompts/backend/flow-dev-review.md +0 -372
  74. package/prompts/backend/flow-dev-work.md +0 -1081
@@ -1,690 +0,0 @@
1
- ---
2
- description: Code Refactoring & Impact Analysis
3
- ---
4
-
5
- # AI Flow - Quick Refactor Workflow
6
-
7
- **YOU ARE AN EXPERT REFACTORING SPECIALIST.**
8
-
9
- Your mission is to execute small refactorings quickly without the overhead of full spec and planning when the user executes `/refactor-quick`.
10
- ---
11
- ## Command: `/refactor-quick`
12
-
13
- ### Objective
14
-
15
- Quick refactor for small changes (3-5 minutes) without full specification process.
16
-
17
- **Difference from `/feature refactor`:**
18
-
19
- | Aspect | `/feature refactor` | `/refactor-quick` |
20
- | ----------------- | ------------------- | ----------------- |
21
- | **Time** | 15-20 min | 3-5 min |
22
- | **Spec** | Complete | Not required |
23
- | **Plan** | Detailed | Implicit/brief |
24
- | **Documentation** | Complete | Minimal |
25
- | **Use** | Large refactor | Small refactor |
26
-
27
- ### Usage
28
-
29
- ```bash
30
- /refactor-quick "Extract validateEmail to utils"
31
- /refactor-quick "Rename UserModel to User across codebase"
32
- /refactor-quick "Move auth logic from controller to service"
33
- /refactor-quick "Extract common validation to middleware"
34
- ```
35
- ---
36
- ## Workflow (3-5 minutes)
37
-
38
- ### Step 0: Read Architecture Context (15 seconds)
39
-
40
- **Before refactoring, understand project patterns:**
41
-
42
- 1. **Read `docs/architecture.md`** - System architecture, design patterns, layering rules
43
- 2. **Read `docs/code-standards.md`** - Naming conventions, file organization, code style
44
- 3. **Read `ai-instructions.md`** - NEVER Rules (avoid violations during refactor)
45
-
46
- **Validate refactor against:**
47
-
48
- - Architecture patterns (don't break established design)
49
- - Code standards (maintain consistency)
50
- - NEVER Rules (don't introduce violations)
51
- ---
52
- ### Step 1: Identify Scope (30 seconds)
53
-
54
- 1. **Parse refactor description** from user
55
- 2. **Search affected files** using grep/glob
56
- 3. **Find all occurrences** of code to refactor
57
- 4. **Estimate impact** (lines, files, tests affected)
58
- 5. **Validate against architecture patterns from Step 0**
59
-
60
- **Example interaction:**
61
-
62
- ```
63
- ---
64
- ⚡ Quick Refactor
65
- ---
66
- Refactor: Extract validateEmail to utils
67
-
68
- Scanning codebase...
69
- Found 3 files with email validation logic
70
- ```
71
- ---
72
- ### Step 2: Propose Changes (30 seconds)
73
-
74
- Show brief plan with affected files:
75
-
76
- **Example output:**
77
-
78
- ```
79
- ---
80
- 📋 Refactor Plan
81
- ---
82
- Files affected: 3
83
- - src/utils/validators.ts (create new file)
84
- - src/controllers/UserController.ts (modify)
85
- - src/controllers/AuthController.ts (modify)
86
-
87
- Changes:
88
- 1. Create validateEmail() in utils/validators.ts
89
- 2. Replace inline validation in UserController (2 locations)
90
- 3. Replace inline validation in AuthController (1 location)
91
- 4. Update imports in both controllers
92
-
93
- Tests to update: 2 files
94
- - tests/user.test.ts
95
- - tests/auth.test.ts
96
-
97
- Estimated time: 3-4 minutes
98
-
99
- Proceed? (Y/n)
100
- ```
101
- ---
102
- ### Step 3: Execute Refactor (2-3 minutes)
103
-
104
- 1. **Create new files** if needed
105
- 2. **Move/extract code** to new location
106
- 3. **Update all usages** of refactored code
107
- 4. **Update imports/references** across files
108
- 5. **Adjust tests** if needed
109
-
110
- **Show progress:**
111
-
112
- ```
113
- ---
114
- ⚙️ Executing Refactor
115
- ---
116
- ✅ Created src/utils/validators.ts
117
- ✅ Extracted validateEmail() function
118
- ✅ Updated src/controllers/UserController.ts (2 locations)
119
- ✅ Updated src/controllers/AuthController.ts (1 location)
120
- ✅ Updated imports
121
- ✅ Updated test files
122
- ```
123
- ---
124
- ### Step 4: Validate (30 seconds)
125
-
126
- 1. **Run tests automatically** (if test command exists)
127
- 2. **Verify all tests pass**
128
- 3. **Show summary**
129
-
130
- **Example output:**
131
-
132
- ```
133
- ---
134
- ✅ Refactor Complete!
135
- ---
136
- Changes:
137
- - Created: src/utils/validators.ts
138
- - Modified: src/controllers/UserController.ts (2 locations)
139
- - Modified: src/controllers/AuthController.ts (1 location)
140
- - Updated: 2 test files
141
-
142
- Tests: ✅ All 24 tests passed
143
-
144
- Summary:
145
- - Extracted validateEmail() to utils
146
- - Removed 15 lines of duplicated code
147
- - Improved code reusability
148
-
149
- No documentation update needed (code-only refactor)
150
-
151
- Time: 4 minutes
152
- ```
153
-
154
- **Git Commit (Optional):**
155
-
156
- ```bash
157
- 🔧 Git Commit
158
- ---
159
- Refactor complete. Create Git commit?
160
-
161
- Pre-commit validation:
162
- ✓ Lint passed
163
- ✓ Type check passed
164
- ✓ Tests passed (24 total)
165
-
166
- Commit message:
167
- refactor(validators): extract email validation to utils
168
-
169
- Extracted validateEmail() to utils/validators.ts to reduce
170
- code duplication across UserController and AuthController.
171
-
172
- Changes:
173
- - Created validators.ts with validateEmail()
174
- - Updated UserController (2 locations)
175
- - Updated AuthController (1 location)
176
- - Removed 15 lines of duplicate code
177
-
178
- Files changed: 3
179
- - src/utils/validators.ts (new)
180
- - src/controllers/UserController.ts
181
- - src/controllers/AuthController.ts
182
-
183
- Commit this refactor? (Y/n)
184
- ```
185
-
186
- **User confirms → Create commit:**
187
-
188
- ```bash
189
- git add src/utils/ src/controllers/
190
- git commit -m "refactor(validators): extract email validation to utils
191
-
192
- Extracted validateEmail() to utils/validators.ts to reduce
193
- code duplication across UserController and AuthController.
194
-
195
- Changes:
196
- - Created validators.ts with validateEmail()
197
- - Updated UserController (2 locations)
198
- - Updated AuthController (1 location)
199
- - Removed 15 lines of duplicate code"
200
-
201
- # ✅ Committed as: c9d5f31
202
- ```
203
-
204
- **Final summary with Git info:**
205
-
206
- ```bash
207
- ---
208
- ✅ Refactor Complete
209
- ---
210
- Refactor: Extract email validation to utils
211
- Commit: c9d5f31
212
- Files changed: 3
213
- Tests: ✅ 24 passed
214
- Time: 4 minutes
215
-
216
- ℹ️ Quick refactor complete. No PR needed for internal refactors.
217
- ```
218
- ---
219
- ## Supported Refactor Types
220
-
221
- ### 1. Extract Method/Function
222
-
223
- **Pattern:** Duplicate code or complex logic → Separate function
224
-
225
- **Examples:**
226
-
227
- - "Extract email validation to utils"
228
- - "Extract password hashing to auth utils"
229
- - "Extract error handling to middleware"
230
-
231
- ### 2. Rename
232
-
233
- **Pattern:** Variable/function/class rename → Update all references
234
-
235
- **Examples:**
236
-
237
- - "Rename UserModel to User"
238
- - "Rename getUserData to fetchUserProfile"
239
- - "Rename isValid to isAuthenticated"
240
-
241
- ### 3. Move Logic
242
-
243
- **Pattern:** Logic in wrong place → Move to appropriate layer
244
-
245
- **Examples:**
246
-
247
- - "Move auth logic from controller to service"
248
- - "Move validation from service to middleware"
249
- - "Move formatting from controller to utils"
250
-
251
- ### 4. Extract to Utility
252
-
253
- **Pattern:** Reusable code → Utility module
254
-
255
- **Examples:**
256
-
257
- - "Extract date formatting to utils"
258
- - "Extract string helpers to utils"
259
- - "Extract constants to config file"
260
- ---
261
- ## When NOT to Use
262
-
263
- ### ❌ Don't use `/refactor-quick` if:
264
-
265
- - Refactor affects **>5 files**
266
- - Requires **architectural changes**
267
- - Needs to **modify database schema**
268
- - Requires **detailed planning**
269
- - Has **complex trade-offs** to consider
270
- - **Tests are unclear** how to update
271
-
272
- ### ✅ In those cases, use `/feature refactor`
273
-
274
- The full `/feature refactor` mode provides:
275
-
276
- - Complete specification
277
- - Detailed planning
278
- - Comprehensive testing strategy
279
- - Full documentation update
280
- ---
281
- ## Git Integration
282
-
283
- ### Overview
284
-
285
- The `/refactor-quick` command integrates with Git to:
286
-
287
- - Work on **current branch** (no branch creation for small refactors)
288
- - Optionally commit refactor with **Conventional Commits** format
289
- - Single commit at end (after refactor complete)
290
- - **Never push automatically** (always manual review)
291
- - **No PR suggestion** (internal refactors rarely need PRs)
292
-
293
- ### When Git is Used
294
-
295
- **Quick Refactors:**
296
-
297
- - ✅ Work on current branch (no isolation needed)
298
- - ✅ Single commit after refactor complete
299
- - ✅ Commit is **optional** (user decides)
300
- - ❌ No branch creation (too lightweight)
301
- - ❌ No PR suggestion (internal change)
302
-
303
- **If refactor is large:**
304
-
305
- - Suggest using `/feature refactor` instead
306
- - Larger refactors benefit from branch isolation
307
- - Complex refactors need PR review
308
-
309
- ### Conventional Commits Format
310
-
311
- All refactor commits follow this structure:
312
-
313
- ```
314
- refactor(scope): brief description of refactor
315
-
316
- [Detailed explanation of what was refactored and why]
317
-
318
- Changes:
319
- - [Change 1]
320
- - [Change 2]
321
- - [Change 3]
322
- ```
323
-
324
- **Commit Types:**
325
-
326
- - `refactor` - Code restructuring without behavior change (always used)
327
- - `style` - Code style/formatting only (rarely)
328
- - `perf` - Performance improvement refactor (if applicable)
329
-
330
- **Scopes (examples):**
331
-
332
- - `validators` - Validation utilities
333
- - `utils` - General utilities
334
- - `controllers` - Controller layer
335
- - `services` - Service layer
336
- - `middleware` - Middleware components
337
- - `models` - Data models
338
-
339
- ### Pre-Commit Validation
340
-
341
- Before committing, the following checks run automatically:
342
-
343
- ```bash
344
- 1. Lint check (npm run lint)
345
- 2. Type check (npm run type-check or tsc --noEmit)
346
- 3. Tests (npm test)
347
- ```
348
-
349
- **If validation fails:**
350
-
351
- - Refactor is NOT committed
352
- - User sees clear error message
353
- - Must fix validation issues before retrying
354
- - Can skip with explicit confirmation (not recommended)
355
-
356
- ### Edge Cases
357
-
358
- #### 1. Uncommitted Changes Exist
359
-
360
- ```
361
- ℹ️ You have uncommitted changes:
362
- M src/app.ts
363
- M src/config.ts
364
-
365
- Refactor will work on current branch with these changes.
366
- Consider committing or stashing them first.
367
-
368
- Continue? (Y/n)
369
- ```
370
-
371
- #### 2. Tests Fail After Refactor
372
-
373
- ```
374
- ❌ Pre-commit validation failed:
375
-
376
- ✗ Tests failed:
377
- auth.test.ts: "should validate email format" FAILED
378
-
379
- Expected: validateEmail to be defined
380
- Received: undefined
381
-
382
- Likely cause: Import path incorrect in test file.
383
-
384
- Options:
385
- 1. Fix test imports and retry
386
- 2. Skip commit (manual commit later)
387
- 3. Skip validation (⚠️ not recommended)
388
-
389
- What would you like to do? (1/2/3)
390
- ```
391
-
392
- #### 3. Validation Fails
393
-
394
- ```
395
- ❌ Pre-commit validation failed:
396
-
397
- ✗ Lint errors:
398
- src/utils/validators.ts:12:1 - Missing JSDoc comment
399
-
400
- Please fix these issues before committing.
401
-
402
- Options:
403
- 1. Fix issues and retry
404
- 2. Skip commit (commit manually later)
405
- 3. Skip validation (⚠️ not recommended)
406
-
407
- What would you like to do? (1/2/3)
408
- ```
409
-
410
- #### 4. Not in a Git Repository
411
-
412
- ```
413
- ℹ️ Not a Git repository. Skipping version control.
414
-
415
- Refactor complete. Changes applied without Git commit.
416
- ```
417
-
418
- #### 5. Detached HEAD State
419
-
420
- ```
421
- ⚠️ You are in detached HEAD state.
422
-
423
- Options:
424
- 1. Create branch from current commit first
425
- 2. Checkout existing branch
426
- 3. Continue without commit
427
-
428
- What would you like to do? (1/2/3)
429
- ```
430
-
431
- #### 6. Large Refactor Detected
432
-
433
- ```
434
- ⚠️ Large refactor detected (8 files changed).
435
-
436
- This is too complex for /refactor-quick.
437
-
438
- Recommendation: Use `/feature refactor` instead for:
439
- - Branch isolation
440
- - Detailed planning
441
- - PR review process
442
-
443
- Continue with /refactor-quick anyway? (Y/n)
444
- ```
445
-
446
- #### 7. No Tests Available
447
-
448
- ```
449
- ℹ️ No test framework detected.
450
-
451
- Pre-commit validation will skip test execution.
452
- Consider adding tests to prevent regressions.
453
-
454
- Continue? (Y/n)
455
- ```
456
-
457
- #### 8. User Declines Commit
458
-
459
- ```
460
- Commit this refactor? (Y/n): n
461
-
462
- ℹ️ Skipping commit. You can commit manually:
463
-
464
- git add src/utils/ src/controllers/
465
- git commit -m "refactor(validators): extract email validation"
466
-
467
- Refactor complete without commit.
468
- ```
469
-
470
- ### Workflow Example (Extract Validation)
471
-
472
- ```bash
473
- # User runs: /refactor-quick "Extract email validation to utils"
474
-
475
- # 1. Scan codebase for email validation patterns
476
- # 2. Propose refactor plan (3 files, 2 locations)
477
- # 3. User confirms
478
- # 4. Execute refactor:
479
- # - Create validators.ts
480
- # - Extract validateEmail()
481
- # - Update UserController
482
- # - Update AuthController
483
- # 5. Run tests automatically
484
- # 6. Tests pass ✓
485
-
486
- # 7. Prompt for commit:
487
- 🔧 Git Commit
488
- Pre-commit validation:
489
- ✓ Lint passed
490
- ✓ Type check passed
491
- ✓ Tests passed
492
-
493
- Commit message:
494
- refactor(validators): extract email validation to utils
495
- ...
496
-
497
- Commit this refactor? (Y/n)
498
-
499
- # 8. User confirms → Commit
500
- git commit -m "..."
501
- # ✅ Committed as: c9d5f31
502
-
503
- # 9. Show final summary:
504
- ✅ Refactor Complete
505
- Commit: c9d5f31
506
- Files changed: 3
507
- Tests: ✅ 24 passed
508
- Time: 4 minutes
509
- ```
510
-
511
- ### Configuration
512
-
513
- Git integration can be configured in `.ai-flow/core/config.json`:
514
-
515
- ```json
516
- {
517
- "git": {
518
- "enabled": true,
519
- "autoCommit": "end",
520
- "requireTests": true,
521
- "requireLint": true,
522
- "allowSkipValidation": false,
523
- "autoPush": false
524
- }
525
- }
526
- ```
527
-
528
- **Options:**
529
-
530
- - `enabled` - Enable/disable Git integration (default: true)
531
- - `autoCommit` - "end" = prompt after refactor, "off" = never prompt
532
- - `requireTests` - Fail if tests don't pass (default: true)
533
- - `requireLint` - Fail if lint errors exist (default: true)
534
- - `allowSkipValidation` - Allow skipping validation (default: false)
535
- - `autoPush` - **Never enable** (default: false, not recommended)
536
-
537
- ### Commit Message Style
538
-
539
- **Good commit message:**
540
-
541
- ```
542
- refactor(validators): extract email validation to shared utility
543
-
544
- Extracted validateEmail() to utils/validators.ts to eliminate
545
- code duplication in UserController and AuthController.
546
-
547
- Changes:
548
- - Created validators.ts with validateEmail() and isValidEmail()
549
- - Updated UserController to use shared validator (2 locations)
550
- - Updated AuthController to use shared validator (1 location)
551
- - Added unit tests for validators
552
- - Removed 15 lines of duplicate code
553
-
554
- No behavior changes - pure refactor.
555
- ```
556
-
557
- **Bad commit message:**
558
-
559
- ```
560
- refactor: cleanup
561
- ```
562
-
563
- **Why good messages matter:**
564
-
565
- - Explains WHAT was refactored
566
- - Explains WHY refactor was needed
567
- - Shows impact (files, lines saved)
568
- - Confirms no behavior change
569
- - Future developers understand intent
570
-
571
- ### Differences from `/feature refactor`
572
-
573
- | Aspect | `/refactor-quick` | `/feature refactor` |
574
- | ------------ | ----------------- | ---------------------------- |
575
- | **Branch** | Current branch | New branch `refactor/[name]` |
576
- | **Commits** | Single commit | Multiple commits (per phase) |
577
- | **PR** | No suggestion | PR suggestion |
578
- | **Scope** | 1-3 files | 5+ files |
579
- | **Time** | 3-5 min | 15-20 min |
580
- | **Planning** | Minimal | Detailed spec |
581
- | **Docs** | Minimal | Complete |
582
- ---
583
- ## Important Rules
584
-
585
- ### 1. Scope Limitation
586
-
587
- - Keep refactors **small and focused**
588
- - One refactor at a time
589
- - If scope grows, suggest `/feature refactor` instead
590
-
591
- ### 2. Test Preservation
592
-
593
- - All existing tests **must pass**
594
- - Update test imports/references
595
- - No behavior changes (pure refactor)
596
-
597
- ### 3. No Feature Changes
598
-
599
- - Refactor **only** - no new features
600
- - No behavior modifications
601
- - No API changes
602
-
603
- ### 4. Minimal Documentation
604
-
605
- - Update docs **only if** public API changed
606
- - Skip docs for internal refactors
607
- - Quick summary sufficient
608
- ---
609
- ## Example Scenarios
610
-
611
- ### Scenario 1: Extract Validation
612
-
613
- ```
614
- User: /refactor-quick "Extract email validation to validators.ts"
615
-
616
- AI:
617
- 1. Scans for email validation patterns
618
- 2. Creates validators.ts with validateEmail()
619
- 3. Replaces inline validation (5 locations)
620
- 4. Updates imports
621
- 5. Tests pass ✅
622
- 6. Done in 3 minutes
623
- ```
624
-
625
- ### Scenario 2: Rename Class
626
-
627
- ```
628
- User: /refactor-quick "Rename UserModel to User"
629
-
630
- AI:
631
- 1. Finds all UserModel references (23 locations)
632
- 2. Renames class definition
633
- 3. Updates all imports
634
- 4. Updates all type annotations
635
- 5. Tests pass ✅
636
- 6. Done in 4 minutes
637
- ```
638
-
639
- ### Scenario 3: Move Logic
640
-
641
- ```
642
- User: /refactor-quick "Move auth logic from AuthController to AuthService"
643
-
644
- AI:
645
- 1. Identifies auth logic in controller
646
- 2. Creates/updates AuthService
647
- 3. Moves logic to service layer
648
- 4. Updates controller to call service
649
- 5. Tests pass ✅
650
- 6. Done in 5 minutes
651
- ```
652
- ---
653
- ## Error Handling
654
-
655
- ### If Scope Too Large:
656
-
657
- ```
658
- ⚠️ This refactor affects 8 files and requires architectural changes.
659
-
660
- This is too complex for /refactor-quick.
661
-
662
- Recommendation: Use `/feature refactor` instead for:
663
- - Detailed planning
664
- - Comprehensive testing
665
- - Full documentation
666
-
667
- Continue anyway? (Y/n)
668
- ```
669
-
670
- ### If Tests Fail:
671
-
672
- ```
673
- ❌ Tests Failed After Refactor
674
-
675
- 3 tests failing:
676
- - auth.test.ts: "should validate email format"
677
- - user.test.ts: "should reject invalid emails"
678
- - integration.test.ts: "registration flow"
679
-
680
- Analyzing failures...
681
- [Shows failure details and suggests fixes]
682
-
683
- Fix automatically? (Y/n)
684
- ```
685
- ---
686
- **BEGIN EXECUTION when user runs `/refactor-quick "description"`**
687
-
688
-
689
-
690
-