superkit-mcp-server 1.2.3 → 1.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 (161) hide show
  1. package/ARCHITECTURE.md +102 -102
  2. package/README.md +71 -71
  3. package/SUPERKIT.md +168 -168
  4. package/agents/code-archaeologist.md +106 -106
  5. package/agents/coder.md +90 -90
  6. package/agents/data-engineer.md +28 -28
  7. package/agents/devops-engineer.md +242 -242
  8. package/agents/git-manager.md +203 -203
  9. package/agents/orchestrator.md +420 -420
  10. package/agents/penetration-tester.md +188 -188
  11. package/agents/performance-optimizer.md +187 -187
  12. package/agents/planner.md +270 -270
  13. package/agents/qa-automation-engineer.md +103 -103
  14. package/agents/quant-developer.md +32 -32
  15. package/agents/reviewer.md +100 -100
  16. package/agents/scout.md +222 -222
  17. package/agents/tester.md +274 -274
  18. package/agents/ui-designer.md +208 -208
  19. package/build/tools/sessionManager.js +79 -10
  20. package/build/tools/todoTools.js +39 -39
  21. package/build/tools/validators/__tests__/apiSchema.test.js +23 -23
  22. package/build/tools/validators/__tests__/convertRules.test.js +5 -5
  23. package/build/tools/validators/__tests__/frontendDesign.test.js +12 -12
  24. package/build/tools/validators/__tests__/geoChecker.test.js +19 -19
  25. package/build/tools/validators/__tests__/mobileAudit.test.js +12 -12
  26. package/build/tools/validators/__tests__/reactPerformanceChecker.test.js +17 -17
  27. package/build/tools/validators/__tests__/securityScan.test.js +6 -6
  28. package/build/tools/validators/__tests__/seoChecker.test.js +16 -16
  29. package/build/tools/validators/__tests__/typeCoverage.test.js +14 -14
  30. package/commands/README.md +122 -122
  31. package/commands/ask.toml +72 -72
  32. package/commands/brainstorm.toml +119 -119
  33. package/commands/chat.toml +77 -77
  34. package/commands/code-preview.toml +37 -37
  35. package/commands/code.toml +28 -28
  36. package/commands/content.toml +200 -200
  37. package/commands/cook.toml +77 -77
  38. package/commands/copywrite.toml +131 -131
  39. package/commands/db.toml +192 -192
  40. package/commands/debug.toml +166 -166
  41. package/commands/design.toml +158 -158
  42. package/commands/dev-rules.toml +14 -14
  43. package/commands/do.toml +117 -117
  44. package/commands/doc-rules.toml +14 -14
  45. package/commands/docs.toml +148 -148
  46. package/commands/fix.toml +440 -440
  47. package/commands/fullstack.toml +175 -175
  48. package/commands/git.toml +235 -235
  49. package/commands/help.toml +84 -84
  50. package/commands/integrate.toml +127 -127
  51. package/commands/journal.toml +136 -136
  52. package/commands/kit-setup.toml +40 -40
  53. package/commands/mcp.toml +183 -183
  54. package/commands/orchestration.toml +15 -15
  55. package/commands/plan.toml +171 -171
  56. package/commands/pm.toml +148 -148
  57. package/commands/pr.toml +50 -50
  58. package/commands/project.toml +32 -32
  59. package/commands/research.toml +117 -117
  60. package/commands/review-pr.toml +63 -63
  61. package/commands/review.toml +190 -190
  62. package/commands/scout-ext.toml +97 -97
  63. package/commands/scout.toml +79 -79
  64. package/commands/screenshot.toml +65 -65
  65. package/commands/session.toml +102 -102
  66. package/commands/skill.toml +384 -384
  67. package/commands/status.toml +22 -22
  68. package/commands/team.toml +56 -56
  69. package/commands/test.toml +164 -164
  70. package/commands/ticket.toml +70 -70
  71. package/commands/use.toml +106 -106
  72. package/commands/video.toml +83 -83
  73. package/commands/watzup.toml +71 -71
  74. package/commands/workflow.toml +14 -14
  75. package/package.json +35 -35
  76. package/skills/meta/README.md +30 -30
  77. package/skills/meta/api-design/SKILL.md +134 -134
  78. package/skills/meta/code-review/SKILL.md +44 -44
  79. package/skills/meta/code-review/checklists/pre-merge.md +25 -25
  80. package/skills/meta/code-review/workflows/architecture-pass.md +26 -26
  81. package/skills/meta/code-review/workflows/performance-pass.md +27 -27
  82. package/skills/meta/code-review/workflows/security-pass.md +29 -29
  83. package/skills/meta/compound-docs/SKILL.md +133 -133
  84. package/skills/meta/debug/SKILL.md +40 -40
  85. package/skills/meta/debug/templates/bug-report.template.md +31 -31
  86. package/skills/meta/debug/workflows/reproduce-issue.md +20 -20
  87. package/skills/meta/docker/SKILL.md +126 -126
  88. package/skills/meta/examples/supabase/SKILL.md +46 -46
  89. package/skills/meta/examples/supabase/references/best-practices.md +319 -319
  90. package/skills/meta/examples/supabase/references/common-patterns.md +373 -373
  91. package/skills/meta/examples/supabase/templates/migration-template.sql +49 -49
  92. package/skills/meta/examples/supabase/templates/rls-policy-template.sql +77 -77
  93. package/skills/meta/examples/supabase/workflows/debugging.md +260 -260
  94. package/skills/meta/examples/supabase/workflows/migration-workflow.md +211 -211
  95. package/skills/meta/examples/supabase/workflows/rls-policies.md +244 -244
  96. package/skills/meta/examples/supabase/workflows/schema-design.md +321 -321
  97. package/skills/meta/file-todos/SKILL.md +88 -88
  98. package/skills/meta/mobile/SKILL.md +140 -140
  99. package/skills/meta/nextjs/SKILL.md +101 -101
  100. package/skills/meta/performance/SKILL.md +130 -130
  101. package/skills/meta/react-patterns/SKILL.md +83 -83
  102. package/skills/meta/security/SKILL.md +114 -114
  103. package/skills/meta/session-resume/SKILL.md +96 -96
  104. package/skills/meta/tailwind/SKILL.md +139 -139
  105. package/skills/meta/testing/SKILL.md +43 -43
  106. package/skills/meta/testing/references/vitest-patterns.md +45 -45
  107. package/skills/meta/testing/templates/component-test.template.tsx +37 -37
  108. package/skills/tech/alpha-vantage/SKILL.md +142 -142
  109. package/skills/tech/alpha-vantage/references/commodities.md +153 -153
  110. package/skills/tech/alpha-vantage/references/economic-indicators.md +158 -158
  111. package/skills/tech/alpha-vantage/references/forex-crypto.md +154 -154
  112. package/skills/tech/alpha-vantage/references/fundamentals.md +223 -223
  113. package/skills/tech/alpha-vantage/references/intelligence.md +138 -138
  114. package/skills/tech/alpha-vantage/references/options.md +93 -93
  115. package/skills/tech/alpha-vantage/references/technical-indicators.md +374 -374
  116. package/skills/tech/alpha-vantage/references/time-series.md +157 -157
  117. package/skills/tech/financial-modeling/SKILL.md +18 -18
  118. package/skills/tech/financial-modeling/skills/3-statements/SKILL.md +368 -368
  119. package/skills/tech/financial-modeling/skills/3-statements/references/formatting.md +118 -118
  120. package/skills/tech/financial-modeling/skills/3-statements/references/formulas.md +292 -292
  121. package/skills/tech/financial-modeling/skills/3-statements/references/sec-filings.md +125 -125
  122. package/skills/tech/financial-modeling/skills/dcf-model/SKILL.md +1210 -1210
  123. package/skills/tech/financial-modeling/skills/dcf-model/TROUBLESHOOTING.md +40 -40
  124. package/skills/tech/financial-modeling/skills/dcf-model/requirements.txt +8 -8
  125. package/skills/tech/financial-modeling/skills/dcf-model/scripts/validate_dcf.py +292 -292
  126. package/skills/tech/financial-modeling/skills/lbo-model/SKILL.md +236 -236
  127. package/skills/tech/financial-modeling/skills/merger-model/SKILL.md +108 -108
  128. package/skills/workflows/README.md +203 -203
  129. package/skills/workflows/adr.md +174 -174
  130. package/skills/workflows/changelog.md +74 -74
  131. package/skills/workflows/compound.md +323 -323
  132. package/skills/workflows/compound_health.md +74 -74
  133. package/skills/workflows/create-agent-skill.md +138 -138
  134. package/skills/workflows/cycle.md +144 -144
  135. package/skills/workflows/deploy-docs.md +84 -84
  136. package/skills/workflows/development-rules.md +42 -42
  137. package/skills/workflows/doc.md +95 -95
  138. package/skills/workflows/documentation-management.md +34 -34
  139. package/skills/workflows/explore.md +146 -146
  140. package/skills/workflows/generate_command.md +106 -106
  141. package/skills/workflows/heal-skill.md +97 -97
  142. package/skills/workflows/housekeeping.md +229 -229
  143. package/skills/workflows/kit-setup.md +102 -102
  144. package/skills/workflows/map-codebase.md +78 -78
  145. package/skills/workflows/orchestration-protocol.md +43 -43
  146. package/skills/workflows/plan-compound.md +439 -439
  147. package/skills/workflows/plan_review.md +269 -269
  148. package/skills/workflows/primary-workflow.md +37 -37
  149. package/skills/workflows/promote_pattern.md +86 -86
  150. package/skills/workflows/release-docs.md +82 -82
  151. package/skills/workflows/report-bug.md +135 -135
  152. package/skills/workflows/reproduce-bug.md +118 -118
  153. package/skills/workflows/resolve_pr.md +133 -133
  154. package/skills/workflows/resolve_todo.md +128 -128
  155. package/skills/workflows/review-compound.md +376 -376
  156. package/skills/workflows/skill-review.md +127 -127
  157. package/skills/workflows/specs.md +257 -257
  158. package/skills/workflows/triage-sprint.md +102 -102
  159. package/skills/workflows/triage.md +152 -152
  160. package/skills/workflows/work.md +399 -399
  161. package/skills/workflows/xcode-test.md +93 -93
package/commands/fix.toml CHANGED
@@ -1,440 +1,440 @@
1
- # Fix - Smart Fix Commands
2
- # Usage: /fix [mode] [issue]
3
- # Intelligent fix for various issues
4
-
5
- description = "Smart fix for bugs, types, tests, UI, CI"
6
-
7
-
8
-
9
- prompt = """
10
- {{#if args}}
11
- # 🔧 Smart Fix
12
-
13
- **Input:** {{args}}
14
-
15
- ## Parse Mode:
16
-
17
- Check the first word of "{{args}}":
18
-
19
- ### If "fast":
20
- Quick fix mode - minimal analysis, direct action:
21
-
22
- **Step 1: Quick Analysis**
23
- - Read issue description
24
- - Identify location from context
25
- - Minimal codebase scan
26
-
27
- **Step 2: Direct Fix**
28
- - ESLint with `--fix` flag
29
- - Prettier formatting
30
- - Apply obvious fixes
31
-
32
- **Step 3: Testing**
33
- - Run relevant tests
34
- - Validate fix works
35
- - Check for regressions
36
-
37
- **Step 4: Summary Report**
38
- ```
39
- ✓ Files fixed: 3
40
- ✓ Tests: Passing
41
- ✓ Lint: Clean
42
- Confidence: High
43
- ```
44
-
45
- ### If "types":
46
- Fix TypeScript/Dart type errors with full workflow:
47
-
48
- **Step 1: Type Check Execution**
49
- - Detect project type (TypeScript or Dart)
50
- - Run type checker:
51
- ```bash
52
- # TypeScript
53
- tsc --noEmit
54
- npm run typecheck
55
-
56
- # Dart/Flutter
57
- dart analyze
58
- flutter analyze
59
- ```
60
-
61
- **Step 2: Error Analysis**
62
- - Categorize errors by type/severity
63
- - Identify patterns across errors
64
- - Prioritize by dependency order
65
-
66
- **Step 3: Fix Implementation**
67
- - Add proper type annotations
68
- - Fix type mismatches
69
- - Update function signatures
70
- - Resolve generic constraints
71
-
72
- **Step 4: Verification Loop**
73
- - Re-run type checker after fixes
74
- - Continue until clean type check
75
- - Ensure no regressions
76
-
77
- **Common Fix Patterns:**
78
-
79
- | Pattern | Before | After |
80
- |---------|--------|-------|
81
- | Null Safety | `user.profile.name` | `user.profile?.name ?? 'Unknown'` |
82
- | Type Annotation | `function(items)` | `function(items: Item[]): number` |
83
- | Generic Constraint | `<T>` | `<T extends {id: string}>` |
84
- | Union Type | direct access | `typeof value === 'string' ? ...` |
85
-
86
- **Quick Fixes:**
87
- ```typescript
88
- // Null safety
89
- user.profile?.name ?? 'Unknown'
90
-
91
- // Type annotation
92
- function calc(items: CartItem[]): number { }
93
-
94
- // Generic constraint
95
- function findById<T extends {id: string}>(items: T[], id: string): T | undefined
96
-
97
- // Type guard
98
- if (typeof value === 'string') { value.toUpperCase() }
99
- ```
100
-
101
- ### If "hard":
102
- Complex fix mode for difficult bugs (10-15 min):
103
-
104
- **Stage 1: Discovery (2-3 min)**
105
- - Scan entire codebase for related code
106
- - Identify all files involved
107
- - Map dependencies and relationships
108
- ```
109
- Files scanned: 1,247
110
- Files identified: 15
111
- Dependencies mapped: 43
112
- ```
113
-
114
- **Stage 2: Root Cause Analysis (1-2 min)**
115
- - Analyze logs and error traces
116
- - Identify underlying causes
117
- - Distinguish symptoms from root causes
118
- ```
119
- Root cause identified: [description]
120
- ```
121
-
122
- **Stage 3: Research (1-2 min)**
123
- - Search for best practices
124
- - Review similar issues
125
- - Check for known solutions
126
-
127
- **Stage 4: Planning (1 min)**
128
- - Create detailed fix strategy
129
- - Plan implementation steps
130
- - Identify test scenarios
131
- ```
132
- Strategy created: plans/fix-[issue].md
133
- Files to modify: 8
134
- Tests to add: 15
135
- ```
136
-
137
- **Stage 5: Implementation (3-5 min)**
138
- - Implement fix following plan
139
- - Handle edge cases
140
- - Add error handling
141
-
142
- **Stage 6: Validation (1-2 min)**
143
- - Run full test suite
144
- - Validate edge cases
145
- - Check for regressions
146
- ```
147
- ✓ Unit tests: 45/45
148
- ✓ Integration tests: 23/23
149
- ✓ Regression tests: 67/67
150
- Coverage: 96%
151
- ```
152
-
153
- **Use for:**
154
- - Complex authentication bugs
155
- - Memory leak investigation
156
- - Multi-file architecture issues
157
- - Race conditions
158
-
159
- ### If "test":
160
- Fix failing tests with full pipeline:
161
-
162
- **Phase 1: Compile**
163
- - Run `tsc --noEmit` for TypeScript
164
- - Fix any syntax errors first
165
-
166
- **Phase 2: Run Tests**
167
- - Execute test suite (jest/vitest/pytest/go test)
168
- - Capture failures and errors
169
-
170
- **Phase 3: Debug**
171
- - Analyze failure stack traces
172
- - Find root cause of each failure
173
-
174
- **Phase 4: Plan**
175
- - Create fix plan for each failure
176
- - Prioritize by complexity
177
-
178
- **Phase 5: Implement**
179
- - Apply fixes to source code
180
- - Handle edge cases
181
-
182
- **Phase 6: Re-test**
183
- - Run tests again to verify
184
- - If still failing → loop back to Phase 3
185
-
186
- **Phase 7: Review**
187
- - Validate changes don't break other code
188
- - Check for side effects
189
-
190
- **Output:**
191
- ```
192
- ✗ 3 tests failed
193
- - auth/login.test.js: Expected 200, got 401
194
-
195
- Debugging...
196
- Root cause: JWT secret not loaded in test env
197
-
198
- Planning fix...
199
- Implementing...
200
-
201
- ✓ All tests passing (48/48)
202
- ```
203
-
204
- ### If "ui":
205
- Fix UI/styling issues with visual analysis:
206
-
207
- **Step 1: Visual Analysis**
208
- - Analyze screenshot (if provided)
209
- - Extract layout, colors, spacing
210
- - Identify visual inconsistencies
211
-
212
- **Step 2: Code Location**
213
- - Find relevant component files
214
- - Identify CSS/styling files
215
- - Locate responsive breakpoints
216
-
217
- **Step 3: Root Cause Identification**
218
- - Analyze CSS rules
219
- - Check responsive design
220
- - Identify conflicts
221
-
222
- **Step 4: Fix Implementation**
223
- - Update styles
224
- - Adjust layouts
225
- - Fix responsive issues
226
-
227
- **Step 5: Visual Validation**
228
- - Suggest manual testing steps
229
- - Recommend browser testing
230
-
231
- **Common UI Issues:**
232
-
233
- | Type | Examples |
234
- |------|----------|
235
- | Layout | Misalignment, overflow, spacing |
236
- | Responsive | Mobile breaks, tablet overlap |
237
- | Visual | Z-index, colors, animations |
238
- | Interaction | Click/touch, hover, focus |
239
-
240
- **Quick Fixes:**
241
- ```css
242
- /* Flexbox alignment */
243
- display: flex;
244
- align-items: center;
245
- justify-content: center;
246
-
247
- /* Responsive width */
248
- width: 100%;
249
- max-width: 1200px;
250
-
251
- /* Z-index stacking */
252
- position: relative;
253
- z-index: 10;
254
-
255
- /* Text overflow */
256
- overflow: hidden;
257
- text-overflow: ellipsis;
258
- white-space: nowrap;
259
- ```
260
-
261
- ### If "ci":
262
- Fix CI/CD failures with full analysis:
263
-
264
- **Step 1: Log Retrieval**
265
- - Use `gh run view --log-failed` to fetch logs
266
- - Parse error messages and stack traces
267
- - Identify failed steps
268
- ```bash
269
- gh run view <run-id> --log-failed
270
- ```
271
-
272
- **Step 2: Error Analysis**
273
- - Categorize failures (tests, build, lint, deploy)
274
- - Identify root causes
275
- - Distinguish flaky vs real failures
276
- - Map errors to files/lines
277
-
278
- **Step 3: Solution Research**
279
- - Search for similar CI issues
280
- - Review GitHub Actions docs
281
- - Check for known action issues
282
-
283
- **Step 4: Implementation**
284
- - Fix code issues (if code problem)
285
- - Update workflow config (if CI config)
286
- - Add missing dependencies
287
- - Adjust environment settings
288
-
289
- **Step 5: Verification**
290
- - Run tests locally
291
- - Validate workflow syntax: `actionlint`
292
- - Suggest manual verification
293
-
294
- **Common CI Failures:**
295
- | Issue | Solution |
296
- |-------|----------|
297
- | Dependency lock | `npm ci` instead of `npm install` |
298
- | Node version | Specify in `.nvmrc` |
299
- | Test timeout | Increase timeout limit |
300
- | Missing secrets | Check repo secrets |
301
-
302
- ### If "logs":
303
- Analyze log files with full diagnostic workflow:
304
-
305
- **Step 1: Log Collection**
306
- - Read log file (./logs.txt or specified)
307
- - Identify all errors and warnings
308
- - Capture stack traces
309
- - Collect contextual info
310
-
311
- **Step 2: Root Cause Analysis**
312
- - Correlate events across entries
313
- - Identify patterns and anomalies
314
- - Trace execution paths
315
- - Determine underlying causes
316
-
317
- **Step 3: Solution Development**
318
- - Create diagnostic report
319
- - Design targeted fixes
320
- - Implement fixes systematically
321
-
322
- **Step 4: Verification**
323
- - Re-analyze logs after fixes
324
- - Ensure issues are resolved
325
- - Confirm no new issues
326
- - Provide final status report
327
-
328
- **Supported Log Formats:**
329
- ```
330
- # Standard logs
331
- 2025-10-29T14:23:45.123Z [ERROR] Database connection failed
332
-
333
- # JSON logs
334
- {"timestamp":"...","level":"error","message":"Request failed"}
335
-
336
- # Stack traces
337
- Error: Cannot read property 'id' of null
338
- at UserController.getProfile (src/user.ts:89:15)
339
- ```
340
-
341
- **Log Collection Commands:**
342
- ```bash
343
- docker logs <container> > logs.txt # Docker
344
- kubectl logs <pod> > logs.txt # Kubernetes
345
- gh run view <id> --log > logs.txt # GitHub Actions
346
- ```
347
-
348
- ### If "parallel":
349
- Fix multiple independent issues in parallel:
350
-
351
- **Step 1: Parse Issues**
352
- Extract from numbered/bulleted list:
353
- ```
354
- Input: "1. Button bug 2. API error 3. Typo"
355
- Parsed: 3 independent issues
356
- ```
357
-
358
- **Step 2: Validate Independence**
359
- Check files don't overlap:
360
- ```
361
- Issue 1: src/components/Button.tsx
362
- Issue 2: src/api/endpoints.ts
363
- Issue 3: src/components/Footer.tsx
364
- ✓ No overlap - safe to parallelize
365
- ```
366
-
367
- **Step 3: Fix Each Issue**
368
- Process all issues (conceptually parallel):
369
- - Analyze each issue
370
- - Find root cause
371
- - Implement fix
372
- - Verify fix
373
-
374
- **Step 4: Aggregate Results**
375
- ```
376
- Results:
377
- ✓ Issue 1: Fixed - Button.tsx
378
- ✓ Issue 2: Fixed - endpoints.ts
379
- ✓ Issue 3: Fixed - Footer.tsx
380
- Total: 3 files changed
381
- ```
382
-
383
- **Usage:**
384
- ```bash
385
- /fix parallel
386
- 1. Button not clickable
387
- 2. API returns 500
388
- 3. Typo in footer
389
- ```
390
-
391
- **Limits:**
392
- - Max 5 issues per batch
393
- - Issues must be independent
394
- - 10 min timeout per issue
395
-
396
- ### Otherwise (specific issue):
397
- Debug the specific issue:
398
- 1. Analyze the issue description
399
- 2. Search for related code
400
- 3. Provide step-by-step fix
401
-
402
- ---
403
-
404
- Now process: "{{args}}"
405
- {{else}}
406
- # 🔧 Smart Fix Commands
407
-
408
- Intelligent fix for various issues.
409
-
410
- ## Usage:
411
- ```
412
- /fix <mode> [details]
413
- ```
414
-
415
- ## Available Modes:
416
-
417
- | Mode | Description |
418
- |------|-------------|
419
- | `/fix fast` | Quick lint + format |
420
- | `/fix types` | Fix TypeScript errors |
421
- | `/fix test` | Fix failing tests |
422
- | `/fix ui <component>` | Fix UI/CSS issues |
423
- | `/fix ci` | Fix CI/CD config |
424
- | `/fix logs [file]` | Analyze error logs |
425
- | `/fix <issue>` | Debug specific issue |
426
-
427
- ## Examples:
428
- ```
429
- /fix fast
430
- /fix types
431
- /fix test
432
- /fix ui Button component not responsive
433
- /fix ci GitHub Actions failing
434
- /fix logs npm-debug.log
435
- /fix The login form is not submitting
436
- ```
437
-
438
- Choose a mode!
439
- {{/if}}
440
- """
1
+ # Fix - Smart Fix Commands
2
+ # Usage: /fix [mode] [issue]
3
+ # Intelligent fix for various issues
4
+
5
+ description = "Smart fix for bugs, types, tests, UI, CI"
6
+
7
+
8
+
9
+ prompt = """
10
+ {{#if args}}
11
+ # 🔧 Smart Fix
12
+
13
+ **Input:** {{args}}
14
+
15
+ ## Parse Mode:
16
+
17
+ Check the first word of "{{args}}":
18
+
19
+ ### If "fast":
20
+ Quick fix mode - minimal analysis, direct action:
21
+
22
+ **Step 1: Quick Analysis**
23
+ - Read issue description
24
+ - Identify location from context
25
+ - Minimal codebase scan
26
+
27
+ **Step 2: Direct Fix**
28
+ - ESLint with `--fix` flag
29
+ - Prettier formatting
30
+ - Apply obvious fixes
31
+
32
+ **Step 3: Testing**
33
+ - Run relevant tests
34
+ - Validate fix works
35
+ - Check for regressions
36
+
37
+ **Step 4: Summary Report**
38
+ ```
39
+ ✓ Files fixed: 3
40
+ ✓ Tests: Passing
41
+ ✓ Lint: Clean
42
+ Confidence: High
43
+ ```
44
+
45
+ ### If "types":
46
+ Fix TypeScript/Dart type errors with full workflow:
47
+
48
+ **Step 1: Type Check Execution**
49
+ - Detect project type (TypeScript or Dart)
50
+ - Run type checker:
51
+ ```bash
52
+ # TypeScript
53
+ tsc --noEmit
54
+ npm run typecheck
55
+
56
+ # Dart/Flutter
57
+ dart analyze
58
+ flutter analyze
59
+ ```
60
+
61
+ **Step 2: Error Analysis**
62
+ - Categorize errors by type/severity
63
+ - Identify patterns across errors
64
+ - Prioritize by dependency order
65
+
66
+ **Step 3: Fix Implementation**
67
+ - Add proper type annotations
68
+ - Fix type mismatches
69
+ - Update function signatures
70
+ - Resolve generic constraints
71
+
72
+ **Step 4: Verification Loop**
73
+ - Re-run type checker after fixes
74
+ - Continue until clean type check
75
+ - Ensure no regressions
76
+
77
+ **Common Fix Patterns:**
78
+
79
+ | Pattern | Before | After |
80
+ |---------|--------|-------|
81
+ | Null Safety | `user.profile.name` | `user.profile?.name ?? 'Unknown'` |
82
+ | Type Annotation | `function(items)` | `function(items: Item[]): number` |
83
+ | Generic Constraint | `<T>` | `<T extends {id: string}>` |
84
+ | Union Type | direct access | `typeof value === 'string' ? ...` |
85
+
86
+ **Quick Fixes:**
87
+ ```typescript
88
+ // Null safety
89
+ user.profile?.name ?? 'Unknown'
90
+
91
+ // Type annotation
92
+ function calc(items: CartItem[]): number { }
93
+
94
+ // Generic constraint
95
+ function findById<T extends {id: string}>(items: T[], id: string): T | undefined
96
+
97
+ // Type guard
98
+ if (typeof value === 'string') { value.toUpperCase() }
99
+ ```
100
+
101
+ ### If "hard":
102
+ Complex fix mode for difficult bugs (10-15 min):
103
+
104
+ **Stage 1: Discovery (2-3 min)**
105
+ - Scan entire codebase for related code
106
+ - Identify all files involved
107
+ - Map dependencies and relationships
108
+ ```
109
+ Files scanned: 1,247
110
+ Files identified: 15
111
+ Dependencies mapped: 43
112
+ ```
113
+
114
+ **Stage 2: Root Cause Analysis (1-2 min)**
115
+ - Analyze logs and error traces
116
+ - Identify underlying causes
117
+ - Distinguish symptoms from root causes
118
+ ```
119
+ Root cause identified: [description]
120
+ ```
121
+
122
+ **Stage 3: Research (1-2 min)**
123
+ - Search for best practices
124
+ - Review similar issues
125
+ - Check for known solutions
126
+
127
+ **Stage 4: Planning (1 min)**
128
+ - Create detailed fix strategy
129
+ - Plan implementation steps
130
+ - Identify test scenarios
131
+ ```
132
+ Strategy created: plans/fix-[issue].md
133
+ Files to modify: 8
134
+ Tests to add: 15
135
+ ```
136
+
137
+ **Stage 5: Implementation (3-5 min)**
138
+ - Implement fix following plan
139
+ - Handle edge cases
140
+ - Add error handling
141
+
142
+ **Stage 6: Validation (1-2 min)**
143
+ - Run full test suite
144
+ - Validate edge cases
145
+ - Check for regressions
146
+ ```
147
+ ✓ Unit tests: 45/45
148
+ ✓ Integration tests: 23/23
149
+ ✓ Regression tests: 67/67
150
+ Coverage: 96%
151
+ ```
152
+
153
+ **Use for:**
154
+ - Complex authentication bugs
155
+ - Memory leak investigation
156
+ - Multi-file architecture issues
157
+ - Race conditions
158
+
159
+ ### If "test":
160
+ Fix failing tests with full pipeline:
161
+
162
+ **Phase 1: Compile**
163
+ - Run `tsc --noEmit` for TypeScript
164
+ - Fix any syntax errors first
165
+
166
+ **Phase 2: Run Tests**
167
+ - Execute test suite (jest/vitest/pytest/go test)
168
+ - Capture failures and errors
169
+
170
+ **Phase 3: Debug**
171
+ - Analyze failure stack traces
172
+ - Find root cause of each failure
173
+
174
+ **Phase 4: Plan**
175
+ - Create fix plan for each failure
176
+ - Prioritize by complexity
177
+
178
+ **Phase 5: Implement**
179
+ - Apply fixes to source code
180
+ - Handle edge cases
181
+
182
+ **Phase 6: Re-test**
183
+ - Run tests again to verify
184
+ - If still failing → loop back to Phase 3
185
+
186
+ **Phase 7: Review**
187
+ - Validate changes don't break other code
188
+ - Check for side effects
189
+
190
+ **Output:**
191
+ ```
192
+ ✗ 3 tests failed
193
+ - auth/login.test.js: Expected 200, got 401
194
+
195
+ Debugging...
196
+ Root cause: JWT secret not loaded in test env
197
+
198
+ Planning fix...
199
+ Implementing...
200
+
201
+ ✓ All tests passing (48/48)
202
+ ```
203
+
204
+ ### If "ui":
205
+ Fix UI/styling issues with visual analysis:
206
+
207
+ **Step 1: Visual Analysis**
208
+ - Analyze screenshot (if provided)
209
+ - Extract layout, colors, spacing
210
+ - Identify visual inconsistencies
211
+
212
+ **Step 2: Code Location**
213
+ - Find relevant component files
214
+ - Identify CSS/styling files
215
+ - Locate responsive breakpoints
216
+
217
+ **Step 3: Root Cause Identification**
218
+ - Analyze CSS rules
219
+ - Check responsive design
220
+ - Identify conflicts
221
+
222
+ **Step 4: Fix Implementation**
223
+ - Update styles
224
+ - Adjust layouts
225
+ - Fix responsive issues
226
+
227
+ **Step 5: Visual Validation**
228
+ - Suggest manual testing steps
229
+ - Recommend browser testing
230
+
231
+ **Common UI Issues:**
232
+
233
+ | Type | Examples |
234
+ |------|----------|
235
+ | Layout | Misalignment, overflow, spacing |
236
+ | Responsive | Mobile breaks, tablet overlap |
237
+ | Visual | Z-index, colors, animations |
238
+ | Interaction | Click/touch, hover, focus |
239
+
240
+ **Quick Fixes:**
241
+ ```css
242
+ /* Flexbox alignment */
243
+ display: flex;
244
+ align-items: center;
245
+ justify-content: center;
246
+
247
+ /* Responsive width */
248
+ width: 100%;
249
+ max-width: 1200px;
250
+
251
+ /* Z-index stacking */
252
+ position: relative;
253
+ z-index: 10;
254
+
255
+ /* Text overflow */
256
+ overflow: hidden;
257
+ text-overflow: ellipsis;
258
+ white-space: nowrap;
259
+ ```
260
+
261
+ ### If "ci":
262
+ Fix CI/CD failures with full analysis:
263
+
264
+ **Step 1: Log Retrieval**
265
+ - Use `gh run view --log-failed` to fetch logs
266
+ - Parse error messages and stack traces
267
+ - Identify failed steps
268
+ ```bash
269
+ gh run view <run-id> --log-failed
270
+ ```
271
+
272
+ **Step 2: Error Analysis**
273
+ - Categorize failures (tests, build, lint, deploy)
274
+ - Identify root causes
275
+ - Distinguish flaky vs real failures
276
+ - Map errors to files/lines
277
+
278
+ **Step 3: Solution Research**
279
+ - Search for similar CI issues
280
+ - Review GitHub Actions docs
281
+ - Check for known action issues
282
+
283
+ **Step 4: Implementation**
284
+ - Fix code issues (if code problem)
285
+ - Update workflow config (if CI config)
286
+ - Add missing dependencies
287
+ - Adjust environment settings
288
+
289
+ **Step 5: Verification**
290
+ - Run tests locally
291
+ - Validate workflow syntax: `actionlint`
292
+ - Suggest manual verification
293
+
294
+ **Common CI Failures:**
295
+ | Issue | Solution |
296
+ |-------|----------|
297
+ | Dependency lock | `npm ci` instead of `npm install` |
298
+ | Node version | Specify in `.nvmrc` |
299
+ | Test timeout | Increase timeout limit |
300
+ | Missing secrets | Check repo secrets |
301
+
302
+ ### If "logs":
303
+ Analyze log files with full diagnostic workflow:
304
+
305
+ **Step 1: Log Collection**
306
+ - Read log file (./logs.txt or specified)
307
+ - Identify all errors and warnings
308
+ - Capture stack traces
309
+ - Collect contextual info
310
+
311
+ **Step 2: Root Cause Analysis**
312
+ - Correlate events across entries
313
+ - Identify patterns and anomalies
314
+ - Trace execution paths
315
+ - Determine underlying causes
316
+
317
+ **Step 3: Solution Development**
318
+ - Create diagnostic report
319
+ - Design targeted fixes
320
+ - Implement fixes systematically
321
+
322
+ **Step 4: Verification**
323
+ - Re-analyze logs after fixes
324
+ - Ensure issues are resolved
325
+ - Confirm no new issues
326
+ - Provide final status report
327
+
328
+ **Supported Log Formats:**
329
+ ```
330
+ # Standard logs
331
+ 2025-10-29T14:23:45.123Z [ERROR] Database connection failed
332
+
333
+ # JSON logs
334
+ {"timestamp":"...","level":"error","message":"Request failed"}
335
+
336
+ # Stack traces
337
+ Error: Cannot read property 'id' of null
338
+ at UserController.getProfile (src/user.ts:89:15)
339
+ ```
340
+
341
+ **Log Collection Commands:**
342
+ ```bash
343
+ docker logs <container> > logs.txt # Docker
344
+ kubectl logs <pod> > logs.txt # Kubernetes
345
+ gh run view <id> --log > logs.txt # GitHub Actions
346
+ ```
347
+
348
+ ### If "parallel":
349
+ Fix multiple independent issues in parallel:
350
+
351
+ **Step 1: Parse Issues**
352
+ Extract from numbered/bulleted list:
353
+ ```
354
+ Input: "1. Button bug 2. API error 3. Typo"
355
+ Parsed: 3 independent issues
356
+ ```
357
+
358
+ **Step 2: Validate Independence**
359
+ Check files don't overlap:
360
+ ```
361
+ Issue 1: src/components/Button.tsx
362
+ Issue 2: src/api/endpoints.ts
363
+ Issue 3: src/components/Footer.tsx
364
+ ✓ No overlap - safe to parallelize
365
+ ```
366
+
367
+ **Step 3: Fix Each Issue**
368
+ Process all issues (conceptually parallel):
369
+ - Analyze each issue
370
+ - Find root cause
371
+ - Implement fix
372
+ - Verify fix
373
+
374
+ **Step 4: Aggregate Results**
375
+ ```
376
+ Results:
377
+ ✓ Issue 1: Fixed - Button.tsx
378
+ ✓ Issue 2: Fixed - endpoints.ts
379
+ ✓ Issue 3: Fixed - Footer.tsx
380
+ Total: 3 files changed
381
+ ```
382
+
383
+ **Usage:**
384
+ ```bash
385
+ /fix parallel
386
+ 1. Button not clickable
387
+ 2. API returns 500
388
+ 3. Typo in footer
389
+ ```
390
+
391
+ **Limits:**
392
+ - Max 5 issues per batch
393
+ - Issues must be independent
394
+ - 10 min timeout per issue
395
+
396
+ ### Otherwise (specific issue):
397
+ Debug the specific issue:
398
+ 1. Analyze the issue description
399
+ 2. Search for related code
400
+ 3. Provide step-by-step fix
401
+
402
+ ---
403
+
404
+ Now process: "{{args}}"
405
+ {{else}}
406
+ # 🔧 Smart Fix Commands
407
+
408
+ Intelligent fix for various issues.
409
+
410
+ ## Usage:
411
+ ```
412
+ /fix <mode> [details]
413
+ ```
414
+
415
+ ## Available Modes:
416
+
417
+ | Mode | Description |
418
+ |------|-------------|
419
+ | `/fix fast` | Quick lint + format |
420
+ | `/fix types` | Fix TypeScript errors |
421
+ | `/fix test` | Fix failing tests |
422
+ | `/fix ui <component>` | Fix UI/CSS issues |
423
+ | `/fix ci` | Fix CI/CD config |
424
+ | `/fix logs [file]` | Analyze error logs |
425
+ | `/fix <issue>` | Debug specific issue |
426
+
427
+ ## Examples:
428
+ ```
429
+ /fix fast
430
+ /fix types
431
+ /fix test
432
+ /fix ui Button component not responsive
433
+ /fix ci GitHub Actions failing
434
+ /fix logs npm-debug.log
435
+ /fix The login form is not submitting
436
+ ```
437
+
438
+ Choose a mode!
439
+ {{/if}}
440
+ """