@caddis/cli 0.0.0 → 0.1.0

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 (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -1
  3. package/bundles/antigravity-plugin/agents/code-reviewer.md +47 -0
  4. package/bundles/antigravity-plugin/agents/preflight.md +53 -0
  5. package/bundles/antigravity-plugin/guard_agy.py +338 -0
  6. package/bundles/antigravity-plugin/hooks.json +36 -0
  7. package/bundles/antigravity-plugin/mcp_config.json +8 -0
  8. package/bundles/antigravity-plugin/mcp_ping_server.py +55 -0
  9. package/bundles/antigravity-plugin/plugin.json +5 -0
  10. package/bundles/antigravity-plugin/session_end_agy.py +57 -0
  11. package/bundles/antigravity-plugin/skills/_registry.md +115 -0
  12. package/bundles/antigravity-plugin/skills/add-rules/SKILL.md +45 -0
  13. package/bundles/antigravity-plugin/skills/api-design/SKILL.md +249 -0
  14. package/bundles/antigravity-plugin/skills/backend-development/SKILL.md +305 -0
  15. package/bundles/antigravity-plugin/skills/best-practices/SKILL.md +500 -0
  16. package/bundles/antigravity-plugin/skills/best-practices/agents/best-practices-referencer.md +263 -0
  17. package/bundles/antigravity-plugin/skills/best-practices/agents/codebase-context-builder.md +326 -0
  18. package/bundles/antigravity-plugin/skills/best-practices/agents/task-intent-analyzer.md +245 -0
  19. package/bundles/antigravity-plugin/skills/best-practices/references/anti-patterns.md +571 -0
  20. package/bundles/antigravity-plugin/skills/best-practices/references/before-after-examples.md +1114 -0
  21. package/bundles/antigravity-plugin/skills/best-practices/references/best-practices-guide.md +513 -0
  22. package/bundles/antigravity-plugin/skills/best-practices/references/common-workflows.md +692 -0
  23. package/bundles/antigravity-plugin/skills/best-practices/references/prompt-patterns.md +547 -0
  24. package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +57 -0
  25. package/bundles/antigravity-plugin/skills/ci-cd-pipeline/SKILL.md +315 -0
  26. package/bundles/antigravity-plugin/skills/code-documentation/SKILL.md +271 -0
  27. package/bundles/antigravity-plugin/skills/code-review/SKILL.md +122 -0
  28. package/bundles/antigravity-plugin/skills/codebase-audit/SKILL.md +204 -0
  29. package/bundles/antigravity-plugin/skills/context-curator/SKILL.md +157 -0
  30. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +40 -0
  31. package/bundles/antigravity-plugin/skills/css-architecture/SKILL.md +305 -0
  32. package/bundles/antigravity-plugin/skills/css-architecture/references/RESPONSIVE-DESIGN.md +604 -0
  33. package/bundles/antigravity-plugin/skills/database-design/SKILL.md +177 -0
  34. package/bundles/antigravity-plugin/skills/db-diagram/SKILL.md +148 -0
  35. package/bundles/antigravity-plugin/skills/db-diagram/scripts/sql_to_graph.py +1212 -0
  36. package/bundles/antigravity-plugin/skills/digress/SKILL.md +61 -0
  37. package/bundles/antigravity-plugin/skills/draw-io/SKILL.md +162 -0
  38. package/bundles/antigravity-plugin/skills/draw-io/references/aws-icons.md +677 -0
  39. package/bundles/antigravity-plugin/skills/draw-io/references/layout-guidelines.md +142 -0
  40. package/bundles/antigravity-plugin/skills/draw-io/references/troubleshooting.md +118 -0
  41. package/bundles/antigravity-plugin/skills/draw-io/references/workflows.md +103 -0
  42. package/bundles/antigravity-plugin/skills/draw-io/scripts/convert-drawio-to-png.sh +25 -0
  43. package/bundles/antigravity-plugin/skills/draw-io/scripts/find_aws_icon.py +79 -0
  44. package/bundles/antigravity-plugin/skills/error-handling/SKILL.md +260 -0
  45. package/bundles/antigravity-plugin/skills/excalidraw-db/SKILL.md +38 -0
  46. package/bundles/antigravity-plugin/skills/fastapi-dev/SKILL.md +300 -0
  47. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +198 -0
  48. package/bundles/antigravity-plugin/skills/frontend-design/SKILL.md +193 -0
  49. package/bundles/antigravity-plugin/skills/frontend-design/references/my-tech-stack.md +127 -0
  50. package/bundles/antigravity-plugin/skills/gh-cli/SKILL.md +195 -0
  51. package/bundles/antigravity-plugin/skills/git-commit/SKILL.md +285 -0
  52. package/bundles/antigravity-plugin/skills/golden-plan/SKILL.md +577 -0
  53. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +100 -0
  54. package/bundles/antigravity-plugin/skills/implement/SKILL.md +114 -0
  55. package/bundles/antigravity-plugin/skills/javascript-typescript/SKILL.md +142 -0
  56. package/bundles/antigravity-plugin/skills/kb/SKILL.md +60 -0
  57. package/bundles/antigravity-plugin/skills/mermaid-db/SKILL.md +33 -0
  58. package/bundles/antigravity-plugin/skills/mermaid-diagrams/SKILL.md +236 -0
  59. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/ENHANCEMENTS.md +264 -0
  60. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/MERMAID-SUMMARY.md +137 -0
  61. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/advanced-features.md +556 -0
  62. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/architecture-diagrams.md +192 -0
  63. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/c4-diagrams.md +410 -0
  64. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/class-diagrams.md +361 -0
  65. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/erd-diagrams.md +510 -0
  66. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/flowcharts.md +450 -0
  67. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/sequence-diagrams.md +394 -0
  68. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/troubleshooting.md +335 -0
  69. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/workflows.md +418 -0
  70. package/bundles/antigravity-plugin/skills/migrate-dir/SKILL.md +68 -0
  71. package/bundles/antigravity-plugin/skills/mockup/SKILL.md +242 -0
  72. package/bundles/antigravity-plugin/skills/particle-art/SKILL.md +243 -0
  73. package/bundles/antigravity-plugin/skills/particle-art/references/canvas-utils.ts +171 -0
  74. package/bundles/antigravity-plugin/skills/particle-art/references/dot-field.template.tsx +203 -0
  75. package/bundles/antigravity-plugin/skills/particle-art/references/flow-field.template.tsx +263 -0
  76. package/bundles/antigravity-plugin/skills/particle-art/references/node-shape.template.tsx +261 -0
  77. package/bundles/antigravity-plugin/skills/particle-art/references/shape-sampler.ts +281 -0
  78. package/bundles/antigravity-plugin/skills/particle-art/references/stipple-morph.template.tsx +167 -0
  79. package/bundles/antigravity-plugin/skills/particle-art/references/stipple.template.tsx +175 -0
  80. package/bundles/antigravity-plugin/skills/particle-art/references/trail-ghost.template.tsx +266 -0
  81. package/bundles/antigravity-plugin/skills/particle-art/references/usage-examples.md +320 -0
  82. package/bundles/antigravity-plugin/skills/playwright/API_REFERENCE.md +653 -0
  83. package/bundles/antigravity-plugin/skills/playwright/SKILL.md +454 -0
  84. package/bundles/antigravity-plugin/skills/playwright/lib/helpers.js +441 -0
  85. package/bundles/antigravity-plugin/skills/playwright/package.json +26 -0
  86. package/bundles/antigravity-plugin/skills/playwright/run.js +228 -0
  87. package/bundles/antigravity-plugin/skills/prd/SKILL.md +107 -0
  88. package/bundles/antigravity-plugin/skills/preflight/SKILL.md +435 -0
  89. package/bundles/antigravity-plugin/skills/python/SKILL.md +388 -0
  90. package/bundles/antigravity-plugin/skills/react-best-practices/SKILL.md +269 -0
  91. package/bundles/antigravity-plugin/skills/react-dev/README.md +404 -0
  92. package/bundles/antigravity-plugin/skills/react-dev/SKILL.md +459 -0
  93. package/bundles/antigravity-plugin/skills/react-dev/examples/generic-components.md +579 -0
  94. package/bundles/antigravity-plugin/skills/react-dev/examples/server-components.md +579 -0
  95. package/bundles/antigravity-plugin/skills/react-dev/references/event-handlers.md +574 -0
  96. package/bundles/antigravity-plugin/skills/react-dev/references/hooks.md +456 -0
  97. package/bundles/antigravity-plugin/skills/react-dev/references/react-19-patterns.md +638 -0
  98. package/bundles/antigravity-plugin/skills/react-dev/references/react-router.md +1002 -0
  99. package/bundles/antigravity-plugin/skills/react-dev/references/tanstack-router.md +587 -0
  100. package/bundles/antigravity-plugin/skills/refactoring/SKILL.md +486 -0
  101. package/bundles/antigravity-plugin/skills/resume/SKILL.md +36 -0
  102. package/bundles/antigravity-plugin/skills/security-review/SKILL.md +196 -0
  103. package/bundles/antigravity-plugin/skills/setup-project-ai/SKILL.md +61 -0
  104. package/bundles/antigravity-plugin/skills/ship/SKILL.md +107 -0
  105. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +103 -0
  106. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +102 -0
  107. package/bundles/antigravity-plugin/skills/skill-creator/LICENSE.txt +202 -0
  108. package/bundles/antigravity-plugin/skills/skill-creator/SKILL.md +491 -0
  109. package/bundles/antigravity-plugin/skills/skill-creator/agents/analyzer.md +274 -0
  110. package/bundles/antigravity-plugin/skills/skill-creator/agents/comparator.md +202 -0
  111. package/bundles/antigravity-plugin/skills/skill-creator/agents/grader.md +223 -0
  112. package/bundles/antigravity-plugin/skills/skill-creator/assets/eval_review.html +146 -0
  113. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  114. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  115. package/bundles/antigravity-plugin/skills/skill-creator/references/schemas.md +430 -0
  116. package/bundles/antigravity-plugin/skills/skill-creator/scripts/__init__.py +0 -0
  117. package/bundles/antigravity-plugin/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  118. package/bundles/antigravity-plugin/skills/skill-creator/scripts/generate_report.py +326 -0
  119. package/bundles/antigravity-plugin/skills/skill-creator/scripts/improve_description.py +247 -0
  120. package/bundles/antigravity-plugin/skills/skill-creator/scripts/package_skill.py +136 -0
  121. package/bundles/antigravity-plugin/skills/skill-creator/scripts/quick_validate.py +103 -0
  122. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_eval.py +310 -0
  123. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_loop.py +328 -0
  124. package/bundles/antigravity-plugin/skills/skill-creator/scripts/utils.py +47 -0
  125. package/bundles/antigravity-plugin/skills/sql/SKILL.md +321 -0
  126. package/bundles/antigravity-plugin/skills/tdd/SKILL.md +37 -0
  127. package/bundles/antigravity-plugin/skills/tdd-workflow/SKILL.md +188 -0
  128. package/bundles/antigravity-plugin/skills/technical-writing/SKILL.md +286 -0
  129. package/bundles/antigravity-plugin/skills/test-strategy/SKILL.md +155 -0
  130. package/bundles/antigravity-plugin/skills/ui-brief/SKILL.md +84 -0
  131. package/bundles/antigravity-plugin/skills/ui-review/SKILL.md +176 -0
  132. package/bundles/antigravity-plugin/skills/ui-review/references/framework-fixes.md +471 -0
  133. package/bundles/antigravity-plugin/skills/ui-review/references/visual-checklist.md +236 -0
  134. package/bundles/antigravity-plugin/skills/usage-review/SKILL.md +77 -0
  135. package/bundles/antigravity-plugin/skills/use-model/SKILL.md +64 -0
  136. package/bundles/antigravity-plugin/skills/using-git-worktrees/SKILL.md +217 -0
  137. package/bundles/antigravity-plugin/skills/version/SKILL.md +18 -0
  138. package/bundles/antigravity-plugin/skills/warm-editorial-ui/DESIGN_TOKENS.md +487 -0
  139. package/bundles/antigravity-plugin/skills/warm-editorial-ui/IMPLEMENTATION_GUIDE.md +177 -0
  140. package/bundles/antigravity-plugin/skills/warm-editorial-ui/SKILL.md +732 -0
  141. package/bundles/antigravity-plugin/skills/webapp-testing/LICENSE.txt +202 -0
  142. package/bundles/antigravity-plugin/skills/webapp-testing/SKILL.md +97 -0
  143. package/bundles/antigravity-plugin/skills/webapp-testing/examples/console_logging.py +35 -0
  144. package/bundles/antigravity-plugin/skills/webapp-testing/examples/element_discovery.py +40 -0
  145. package/bundles/antigravity-plugin/skills/webapp-testing/examples/static_html_automation.py +33 -0
  146. package/bundles/antigravity-plugin/skills/webapp-testing/scripts/with_server.py +106 -0
  147. package/bundles/antigravity-plugin/skills/windows-deployment/SKILL.md +880 -0
  148. package/bundles/antigravity-plugin/skills/writing-plans/SKILL.md +384 -0
  149. package/bundles/antigravity-plugin/statusline-command-agy.sh +91 -0
  150. package/bundles/antigravity-plugin/warm_start_agy.py +149 -0
  151. package/bundles/manifest.json +6 -0
  152. package/dist/cli.js +5363 -0
  153. package/package.json +61 -4
@@ -0,0 +1,692 @@
1
+ # Common Workflow Prompts
2
+
3
+ This document contains optimized prompts for common development workflows. Use these as templates when transforming prompts for specific task types.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Codebase Understanding](#codebase-understanding)
8
+ 2. [Bug Fixing](#bug-fixing)
9
+ 3. [Feature Development](#feature-development)
10
+ 4. [Testing](#testing)
11
+ 5. [Refactoring](#refactoring)
12
+ 6. [Code Review](#code-review)
13
+ 7. [Documentation](#documentation)
14
+ 8. [Git Operations](#git-operations)
15
+ 9. [DevOps Tasks](#devops-tasks)
16
+ 10. [Database Operations](#database-operations)
17
+
18
+ ---
19
+
20
+ ## Codebase Understanding
21
+
22
+ ### Quick Overview
23
+
24
+ ```
25
+ give me an overview of this codebase:
26
+ - main technologies and frameworks
27
+ - high-level architecture
28
+ - key directories and their purposes
29
+ - entry points (main files, API routes)
30
+ ```
31
+
32
+ ### Understand a Module
33
+
34
+ ```
35
+ explain the [module name] module in @[path]:
36
+ - what problem does it solve?
37
+ - what are the main components/classes/functions?
38
+ - how does it integrate with other parts of the codebase?
39
+ - what are the key data flows?
40
+ ```
41
+
42
+ ### Trace a Flow
43
+
44
+ ```
45
+ trace the [flow name] from start to finish:
46
+ 1. where does it start? (user action, API call, etc.)
47
+ 2. what components/services does it pass through?
48
+ 3. what data transformations happen?
49
+ 4. where does it end? (database, response, side effect)
50
+ list the files involved in order.
51
+ ```
52
+
53
+ ### Find Related Code
54
+
55
+ ```
56
+ find all code related to [feature/concept]:
57
+ - search for [relevant terms]
58
+ - identify the main files that implement it
59
+ - find tests for this functionality
60
+ - note any configuration or environment dependencies
61
+ ```
62
+
63
+ ### Understand a Decision
64
+
65
+ ```
66
+ look through git history for @[file/directory] and explain:
67
+ - when was this approach chosen?
68
+ - what alternatives were considered (check PRs/issues)?
69
+ - why was this decision made?
70
+ - are there any TODO comments or known limitations?
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Bug Fixing
76
+
77
+ ### Investigate and Fix
78
+
79
+ ```
80
+ [describe symptom in detail]
81
+
82
+ INVESTIGATE:
83
+ 1. reproduce the issue using: [steps or conditions]
84
+ 2. check [likely locations]
85
+ 3. add logging if needed to trace the flow
86
+ 4. identify the root cause, not just the symptom
87
+
88
+ FIX:
89
+ 1. write a failing test that reproduces the bug
90
+ 2. implement the fix
91
+ 3. verify the test passes
92
+ 4. check for similar issues elsewhere
93
+
94
+ VERIFY:
95
+ - run the full test suite
96
+ - manually test the fix
97
+ - confirm no regressions
98
+ ```
99
+
100
+ ### Debug Build Failure
101
+
102
+ ```
103
+ the build fails with this error:
104
+ [paste actual error]
105
+
106
+ investigate:
107
+ 1. what file/line is causing the error?
108
+ 2. what changed recently that might have caused this?
109
+ 3. is this a type error, syntax error, or dependency issue?
110
+
111
+ fix the root cause (don't use @ts-ignore or suppress the error).
112
+ run `[build command]` to verify the fix.
113
+ ```
114
+
115
+ ### Debug Runtime Error
116
+
117
+ ```
118
+ getting this error at runtime:
119
+ [paste error with stack trace]
120
+
121
+ investigate:
122
+ 1. what is the immediate cause?
123
+ 2. what input/state leads to this error?
124
+ 3. where should validation/handling be added?
125
+
126
+ fix:
127
+ 1. add proper error handling or validation
128
+ 2. write a test for this case
129
+ 3. verify the error no longer occurs
130
+ ```
131
+
132
+ ### Performance Issue
133
+
134
+ ```
135
+ [describe performance symptom]
136
+
137
+ PROFILE:
138
+ 1. measure current performance: [how]
139
+ 2. identify the bottleneck using [tools/approach]
140
+ 3. document baseline metrics
141
+
142
+ OPTIMIZE:
143
+ 1. implement the most impactful fix first
144
+ 2. measure improvement
145
+ 3. repeat if needed
146
+
147
+ TARGET: [specific metric goal]
148
+ verify with [benchmark/test]
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Feature Development
154
+
155
+ ### New Feature (Full Workflow)
156
+
157
+ ```
158
+ implement [feature description]
159
+
160
+ PHASE 1 - UNDERSTAND:
161
+ - read @[related code] to understand existing patterns
162
+ - identify where the new feature integrates
163
+ - note any dependencies or constraints
164
+
165
+ PHASE 2 - PLAN:
166
+ - list the components/files that need to be created/modified
167
+ - define the data model if applicable
168
+ - identify edge cases to handle
169
+ - write the plan to [location] for review
170
+
171
+ PHASE 3 - IMPLEMENT:
172
+ - follow existing patterns from @[example file]
173
+ - [specific implementation steps]
174
+ - run tests after each significant change
175
+
176
+ PHASE 4 - VERIFY:
177
+ - add tests for: [specific test cases]
178
+ - manual testing: [testing steps]
179
+ - verify [success criteria]
180
+ ```
181
+
182
+ ### Add UI Component
183
+
184
+ ```
185
+ create a [component name] component following existing patterns.
186
+
187
+ REFERENCE: @[similar component path]
188
+
189
+ REQUIREMENTS:
190
+ - [visual/behavior requirement 1]
191
+ - [visual/behavior requirement 2]
192
+ - responsive at [breakpoints]
193
+ - accessible (keyboard navigation, ARIA)
194
+
195
+ IMPLEMENTATION:
196
+ 1. create component in @[path]
197
+ 2. add styles following @[style patterns]
198
+ 3. add to storybook if applicable
199
+ 4. write tests for: [test cases]
200
+
201
+ VERIFY:
202
+ - visual check at all breakpoints
203
+ - keyboard navigation works
204
+ - screen reader announces correctly
205
+ ```
206
+
207
+ ### Add API Endpoint
208
+
209
+ ```
210
+ add [HTTP method] /api/[path] endpoint.
211
+
212
+ REFERENCE: follow the pattern in @[similar endpoint]
213
+
214
+ REQUIREMENTS:
215
+ - input validation: [validation rules]
216
+ - authentication: [auth requirements]
217
+ - response format: [describe response]
218
+ - error handling: [error cases]
219
+
220
+ IMPLEMENTATION:
221
+ 1. add route handler in @[router location]
222
+ 2. add validation middleware/logic
223
+ 3. implement business logic in @[service location]
224
+ 4. add to API documentation
225
+
226
+ TEST:
227
+ - success case
228
+ - validation errors
229
+ - auth errors
230
+ - not found (if applicable)
231
+ ```
232
+
233
+ ### Add Database Feature
234
+
235
+ ```
236
+ add [database feature description].
237
+
238
+ MIGRATION:
239
+ 1. create migration in @[migrations path]
240
+ 2. [describe schema changes]
241
+ 3. make migration reversible
242
+
243
+ MODEL:
244
+ 1. update model in @[model path]
245
+ 2. add types in @[types path]
246
+ 3. update repository methods
247
+
248
+ VERIFY:
249
+ 1. run migration locally
250
+ 2. verify with a query
251
+ 3. run existing tests (no regressions)
252
+ 4. add new tests for the feature
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Testing
258
+
259
+ ### Add Unit Tests
260
+
261
+ ```
262
+ add unit tests for @[file path].
263
+
264
+ COVERAGE:
265
+ - [function 1]: test [cases]
266
+ - [function 2]: test [cases]
267
+ - edge cases: [list]
268
+ - error cases: [list]
269
+
270
+ APPROACH:
271
+ - follow patterns in @[existing test file]
272
+ - mock [external dependencies]
273
+ - use [test data approach]
274
+
275
+ TARGET: [coverage percentage]% coverage for this file
276
+ run tests after implementing each test case.
277
+ ```
278
+
279
+ ### Add Integration Tests
280
+
281
+ ```
282
+ add integration tests for [feature/flow].
283
+
284
+ TEST THE COMPLETE FLOW:
285
+ 1. [step 1]
286
+ 2. [step 2]
287
+ 3. [step 3]
288
+
289
+ SCENARIOS:
290
+ - happy path: [describe]
291
+ - error case 1: [describe]
292
+ - error case 2: [describe]
293
+ - edge case: [describe]
294
+
295
+ SETUP:
296
+ - use @[test setup file] for database/fixtures
297
+ - mock only [external services]
298
+ - use real [internal services]
299
+ ```
300
+
301
+ ### Add E2E Tests
302
+
303
+ ```
304
+ add end-to-end tests for [user flow].
305
+
306
+ USER JOURNEY:
307
+ 1. user [action 1]
308
+ 2. user [action 2]
309
+ 3. user [action 3]
310
+ 4. verify [final state]
311
+
312
+ TEST CASES:
313
+ - complete flow succeeds
314
+ - [error scenario 1]
315
+ - [error scenario 2]
316
+
317
+ IMPLEMENTATION:
318
+ - use [E2E framework] in @[test directory]
319
+ - follow patterns in @[existing E2E test]
320
+ - use test fixtures for data
321
+ ```
322
+
323
+ ### Fix Failing Tests
324
+
325
+ ```
326
+ the following tests are failing:
327
+ [paste test output]
328
+
329
+ INVESTIGATE:
330
+ 1. run each test individually to reproduce
331
+ 2. identify if it's a test problem or code problem
332
+ 3. check recent changes that might have caused this
333
+
334
+ FIX:
335
+ - if test is wrong: update test to match correct behavior
336
+ - if code is wrong: fix code, not the test
337
+ - run full suite to check for ripple effects
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Refactoring
343
+
344
+ ### Extract Component/Function
345
+
346
+ ```
347
+ extract [what to extract] from @[source file] into [new location].
348
+
349
+ IDENTIFY:
350
+ - lines [X-Y] in source file
351
+ - what inputs does it need?
352
+ - what does it return/produce?
353
+
354
+ EXTRACT:
355
+ 1. create new [file/function/component] at @[path]
356
+ 2. move the code, add proper types
357
+ 3. update imports in original file
358
+ 4. export from new location
359
+
360
+ VERIFY:
361
+ - all tests still pass
362
+ - no behavior changes
363
+ - lint passes
364
+ ```
365
+
366
+ ### Consolidate Duplicates
367
+
368
+ ```
369
+ consolidate duplicate [code type] across:
370
+ - @[file 1]: lines [X-Y]
371
+ - @[file 2]: lines [X-Y]
372
+ - @[file 3]: lines [X-Y]
373
+
374
+ CREATE:
375
+ 1. shared utility in @[new location]
376
+ 2. parameterize differences
377
+ 3. add proper types
378
+
379
+ UPDATE:
380
+ 1. replace each duplicate with shared utility
381
+ 2. run tests after each replacement
382
+
383
+ VERIFY:
384
+ - behavior unchanged (tests pass)
385
+ - no more duplicates (search confirms)
386
+ ```
387
+
388
+ ### Modernize Code
389
+
390
+ ```
391
+ modernize @[file path]:
392
+ - convert [old pattern] to [new pattern]
393
+ - update syntax to [standard/version]
394
+ - add TypeScript types if missing
395
+
396
+ CHANGES TO MAKE:
397
+ 1. [specific change 1]
398
+ 2. [specific change 2]
399
+ 3. [specific change 3]
400
+
401
+ CONSTRAINTS:
402
+ - maintain same public API
403
+ - all existing tests must pass
404
+ - make one change at a time, test after each
405
+ ```
406
+
407
+ ---
408
+
409
+ ## Code Review
410
+
411
+ ### Review for Quality
412
+
413
+ ```
414
+ review @[file/PR] for code quality:
415
+ - naming clarity and consistency
416
+ - function/method size and complexity
417
+ - proper error handling
418
+ - appropriate comments (not too many, not too few)
419
+ - following project conventions from @[CLAUDE.md or style guide]
420
+
421
+ provide specific line references for any issues.
422
+ ```
423
+
424
+ ### Review for Security
425
+
426
+ ```
427
+ review @[file/module] for security:
428
+ - input validation completeness
429
+ - SQL injection vulnerabilities
430
+ - XSS vulnerabilities
431
+ - authentication/authorization checks
432
+ - sensitive data handling
433
+ - error messages that leak information
434
+
435
+ rate each issue by severity (critical/high/medium/low).
436
+ provide fix suggestions.
437
+ ```
438
+
439
+ ### Review for Performance
440
+
441
+ ```
442
+ review @[file/module] for performance:
443
+ - unnecessary re-renders (React)
444
+ - N+1 queries
445
+ - missing indexes (if database)
446
+ - unoptimized loops
447
+ - memory leaks (event listeners, subscriptions)
448
+ - large bundle imports
449
+
450
+ estimate impact of each issue.
451
+ suggest fixes with expected improvement.
452
+ ```
453
+
454
+ ---
455
+
456
+ ## Documentation
457
+
458
+ ### Document API
459
+
460
+ ```
461
+ add documentation for @[API file]:
462
+
463
+ FOR EACH ENDPOINT:
464
+ - HTTP method and path
465
+ - description of what it does
466
+ - request parameters/body (with types)
467
+ - response format (with types)
468
+ - possible error codes
469
+ - authentication requirements
470
+ - example request/response
471
+
472
+ format as [OpenAPI/JSDoc/markdown].
473
+ follow existing docs in @[existing docs].
474
+ ```
475
+
476
+ ### Document Component
477
+
478
+ ```
479
+ add documentation for @[component file]:
480
+ - what the component does
481
+ - props with types and descriptions
482
+ - usage examples
483
+ - accessibility considerations
484
+ - related components
485
+
486
+ add as JSDoc comments and/or storybook stories.
487
+ ```
488
+
489
+ ### Document Function
490
+
491
+ ```
492
+ add JSDoc documentation to functions in @[file]:
493
+ - @description - what it does
494
+ - @param - each parameter with type
495
+ - @returns - return type and meaning
496
+ - @throws - errors that can be thrown
497
+ - @example - usage example
498
+
499
+ follow the documentation style in @[similar documented file].
500
+ ```
501
+
502
+ ---
503
+
504
+ ## Git Operations
505
+
506
+ ### Create Meaningful Commit
507
+
508
+ ```
509
+ review the current changes and create a commit:
510
+ 1. run `git diff` to see all changes
511
+ 2. group related changes if needed
512
+ 3. write a descriptive commit message:
513
+ - first line: type(scope): brief description
514
+ - blank line
515
+ - body: explain WHY, not just WHAT
516
+ 4. commit the changes
517
+ ```
518
+
519
+ ### Create PR
520
+
521
+ ```
522
+ create a pull request for the current changes:
523
+
524
+ 1. verify all changes are committed
525
+ 2. push to remote
526
+ 3. create PR with:
527
+ - clear title summarizing the change
528
+ - description explaining:
529
+ - what changed and why
530
+ - how to test
531
+ - any breaking changes
532
+ - related issues
533
+ 4. request appropriate reviewers
534
+ ```
535
+
536
+ ### Resolve Merge Conflict
537
+
538
+ ```
539
+ resolve merge conflict between [branch A] and [branch B]:
540
+
541
+ 1. understand what each branch changed:
542
+ - [branch A] changed: [what]
543
+ - [branch B] changed: [what]
544
+
545
+ 2. determine correct resolution:
546
+ - keep both changes? how do they combine?
547
+ - keep one? which is correct?
548
+ - need new code? what's the right merge?
549
+
550
+ 3. resolve the conflict
551
+ 4. run tests to verify nothing broke
552
+ 5. commit the resolution with clear message
553
+ ```
554
+
555
+ ---
556
+
557
+ ## DevOps Tasks
558
+
559
+ ### Set Up CI Pipeline
560
+
561
+ ```
562
+ add CI pipeline in .github/workflows/ci.yml:
563
+
564
+ TRIGGERS:
565
+ - push to main
566
+ - all pull requests
567
+
568
+ JOBS:
569
+ 1. install dependencies (cache node_modules)
570
+ 2. lint (npm run lint)
571
+ 3. type check (npm run typecheck)
572
+ 4. test with coverage (npm run test:coverage)
573
+ 5. build (npm run build)
574
+
575
+ REQUIREMENTS:
576
+ - fail if any step fails
577
+ - fail if coverage below [X]%
578
+ - add status checks to PR
579
+
580
+ follow patterns from @[existing workflow file].
581
+ ```
582
+
583
+ ### Create Dockerfile
584
+
585
+ ```
586
+ create Dockerfile for the application:
587
+
588
+ REQUIREMENTS:
589
+ - multi-stage build (builder + production)
590
+ - use [base image]
591
+ - optimize for small final image
592
+ - proper layer caching for dependencies
593
+ - non-root user for security
594
+ - health check endpoint
595
+
596
+ create docker-compose.yml for local development with:
597
+ - app service with hot reloading
598
+ - [database service]
599
+ - [other services]
600
+
601
+ test with `docker-compose up` and verify app works.
602
+ ```
603
+
604
+ ### Add Monitoring
605
+
606
+ ```
607
+ add monitoring/logging to @[service/app]:
608
+
609
+ LOGGING:
610
+ - structured JSON logs
611
+ - include: timestamp, level, message, request ID
612
+ - log levels: error, warn, info, debug
613
+ - sensitive data redaction
614
+
615
+ METRICS:
616
+ - request duration
617
+ - error rate
618
+ - [custom metrics]
619
+
620
+ ALERTS:
621
+ - error rate > [threshold]
622
+ - latency > [threshold]
623
+
624
+ follow patterns in @[existing instrumented service].
625
+ ```
626
+
627
+ ---
628
+
629
+ ## Database Operations
630
+
631
+ ### Create Migration
632
+
633
+ ```
634
+ create database migration for: [describe change]
635
+
636
+ MIGRATION:
637
+ 1. create migration file in @[migrations directory]
638
+ 2. name: [timestamp]_[descriptive_name]
639
+ 3. implement:
640
+ - up: [changes to apply]
641
+ - down: [how to reverse]
642
+
643
+ VERIFY:
644
+ 1. run migration locally
645
+ 2. verify with query
646
+ 3. run rollback
647
+ 4. verify rollback worked
648
+ 5. run migration again
649
+ ```
650
+
651
+ ### Optimize Query
652
+
653
+ ```
654
+ optimize slow query in @[repository/file]:
655
+
656
+ CURRENT QUERY: [describe or paste]
657
+ CURRENT PERFORMANCE: [time/explain output]
658
+
659
+ INVESTIGATE:
660
+ 1. run EXPLAIN ANALYZE
661
+ 2. identify missing indexes
662
+ 3. check for N+1 queries
663
+ 4. look for unnecessary columns/joins
664
+
665
+ OPTIMIZE:
666
+ 1. add indexes if needed (via migration)
667
+ 2. rewrite query if needed
668
+ 3. add pagination if missing
669
+
670
+ TARGET: [performance goal]
671
+ measure and document improvement.
672
+ ```
673
+
674
+ ### Add Seed Data
675
+
676
+ ```
677
+ create seed script for [purpose] in @[seeds directory]:
678
+
679
+ DATA TO CREATE:
680
+ - [X] records of [type 1]
681
+ - [X] records of [type 2]
682
+ - proper relationships between entities
683
+ - realistic data (use Faker if available)
684
+
685
+ REQUIREMENTS:
686
+ - idempotent (safe to run multiple times)
687
+ - clean up option
688
+ - environment-aware (don't run in production)
689
+
690
+ add `npm run db:seed` script to package.json.
691
+ verify by running and checking database.
692
+ ```