@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,418 @@
1
+ # Mermaid Diagram Workflows
2
+
3
+ Step-by-step examples for common diagramming tasks.
4
+
5
+ ## Workflow 1: Document a New API Endpoint
6
+
7
+ **When:** You've built a new API endpoint and need to document the flow for frontend developers.
8
+
9
+ **Steps:**
10
+
11
+ 1. **Choose diagram type:** Sequence diagram (shows temporal interactions)
12
+
13
+ 2. **Identify participants:**
14
+ ```mermaid
15
+ sequenceDiagram
16
+ participant Client
17
+ participant API
18
+ participant Database
19
+ ```
20
+
21
+ 3. **Add the happy path:**
22
+ ```mermaid
23
+ sequenceDiagram
24
+ participant Client
25
+ participant API
26
+ participant Database
27
+
28
+ Client->>API: POST /users
29
+ API->>Database: INSERT user
30
+ Database-->>API: Return user_id
31
+ API-->>Client: 201 Created + user object
32
+ ```
33
+
34
+ 4. **Add error handling:**
35
+ ```mermaid
36
+ sequenceDiagram
37
+ participant Client
38
+ participant API
39
+ participant Database
40
+
41
+ Client->>API: POST /users
42
+ API->>API: Validate input
43
+ alt Valid input
44
+ API->>Database: INSERT user
45
+ Database-->>API: Return user_id
46
+ API-->>Client: 201 Created + user object
47
+ else Invalid input
48
+ API-->>Client: 400 Bad Request + errors
49
+ else Duplicate email
50
+ Database-->>API: Constraint violation
51
+ API-->>Client: 409 Conflict
52
+ end
53
+ ```
54
+
55
+ 5. **Add notes for clarification:**
56
+ ```mermaid
57
+ sequenceDiagram
58
+ participant Client
59
+ participant API
60
+ participant Database
61
+
62
+ Note over Client,Database: User Registration Flow
63
+
64
+ Client->>API: POST /users
65
+ Note right of API: Validates email format,<br/>password strength
66
+
67
+ alt Valid input
68
+ API->>Database: INSERT user
69
+ Database-->>API: Return user_id
70
+ Note left of Database: Email must be unique
71
+ API-->>Client: 201 Created + user object
72
+ else Invalid input
73
+ API-->>Client: 400 Bad Request
74
+ end
75
+ ```
76
+
77
+ ## Workflow 2: Design a Database Schema
78
+
79
+ **When:** You're planning a new feature that needs new tables.
80
+
81
+ **Steps:**
82
+
83
+ 1. **Identify core entities:**
84
+ ```mermaid
85
+ erDiagram
86
+ USER
87
+ ORDER
88
+ PRODUCT
89
+ ```
90
+
91
+ 2. **Define relationships:**
92
+ ```mermaid
93
+ erDiagram
94
+ USER ||--o{ ORDER : places
95
+ ORDER ||--|{ LINE_ITEM : contains
96
+ PRODUCT ||--o{ LINE_ITEM : includes
97
+ ```
98
+
99
+ 3. **Add attributes:**
100
+ ```mermaid
101
+ erDiagram
102
+ USER ||--o{ ORDER : places
103
+ ORDER ||--|{ LINE_ITEM : contains
104
+ PRODUCT ||--o{ LINE_ITEM : includes
105
+
106
+ USER {
107
+ int id PK
108
+ string email UK
109
+ string name
110
+ datetime created_at
111
+ }
112
+
113
+ ORDER {
114
+ int id PK
115
+ int user_id FK
116
+ string status
117
+ decimal total
118
+ datetime created_at
119
+ }
120
+
121
+ PRODUCT {
122
+ int id PK
123
+ string name
124
+ string sku UK
125
+ decimal price
126
+ }
127
+
128
+ LINE_ITEM {
129
+ int id PK
130
+ int order_id FK
131
+ int product_id FK
132
+ int quantity
133
+ decimal price
134
+ }
135
+ ```
136
+
137
+ 4. **Validate design:**
138
+ - Check all foreign keys have corresponding primary keys
139
+ - Verify cardinality matches business rules
140
+ - Ensure unique constraints are marked (UK)
141
+
142
+ ## Workflow 3: Model a Domain (DDD)
143
+
144
+ **When:** You're implementing a new feature using Domain-Driven Design.
145
+
146
+ **Steps:**
147
+
148
+ 1. **Start with aggregates:**
149
+ ```mermaid
150
+ classDiagram
151
+ class Order
152
+ class LineItem
153
+ class Product
154
+ ```
155
+
156
+ 2. **Add relationships:**
157
+ ```mermaid
158
+ classDiagram
159
+ Order *-- LineItem : contains
160
+ LineItem --> Product : references
161
+ ```
162
+
163
+ 3. **Define entities with properties:**
164
+ ```mermaid
165
+ classDiagram
166
+ Order *-- LineItem
167
+ LineItem --> Product
168
+
169
+ class Order {
170
+ +OrderId id
171
+ +CustomerId customerId
172
+ +OrderStatus status
173
+ +Money total
174
+ +addItem(Product, quantity)
175
+ +calculateTotal()
176
+ +submit()
177
+ }
178
+
179
+ class LineItem {
180
+ +ProductId productId
181
+ +int quantity
182
+ +Money price
183
+ +updateQuantity(int)
184
+ }
185
+
186
+ class Product {
187
+ +ProductId id
188
+ +string name
189
+ +Money price
190
+ +bool inStock()
191
+ }
192
+ ```
193
+
194
+ 4. **Add value objects and enums:**
195
+ ```mermaid
196
+ classDiagram
197
+ Order *-- LineItem
198
+ Order --> OrderStatus
199
+ Order --> Money
200
+ LineItem --> Product
201
+ LineItem --> Money
202
+
203
+ class Order {
204
+ +OrderId id
205
+ +CustomerId customerId
206
+ +OrderStatus status
207
+ +Money total
208
+ }
209
+
210
+ class OrderStatus {
211
+ <<enumeration>>
212
+ DRAFT
213
+ SUBMITTED
214
+ PAID
215
+ SHIPPED
216
+ DELIVERED
217
+ CANCELLED
218
+ }
219
+
220
+ class Money {
221
+ <<value object>>
222
+ +decimal amount
223
+ +Currency currency
224
+ +add(Money)
225
+ }
226
+ ```
227
+
228
+ ## Workflow 4: Map a User Journey
229
+
230
+ **When:** You're planning a new feature and need to visualize the user experience.
231
+
232
+ **Steps:**
233
+
234
+ 1. **Define start and end points:**
235
+ ```mermaid
236
+ flowchart TD
237
+ Start([User lands on checkout])
238
+ End([Order confirmed])
239
+ ```
240
+
241
+ 2. **Add main path:**
242
+ ```mermaid
243
+ flowchart TD
244
+ Start([User lands on checkout]) --> Review[Review cart]
245
+ Review --> Payment[Enter payment]
246
+ Payment --> Confirm[Confirm order]
247
+ Confirm --> End([Order confirmed])
248
+ ```
249
+
250
+ 3. **Add decision points:**
251
+ ```mermaid
252
+ flowchart TD
253
+ Start([User lands on checkout]) --> Review[Review cart]
254
+ Review --> HasItems{Cart has items?}
255
+ HasItems -->|Yes| Payment[Enter payment]
256
+ HasItems -->|No| Empty[Show empty cart]
257
+ Payment --> Valid{Payment valid?}
258
+ Valid -->|Yes| Confirm[Confirm order]
259
+ Valid -->|No| Error[Show error]
260
+ Error --> Payment
261
+ Confirm --> End([Order confirmed])
262
+ ```
263
+
264
+ 4. **Add alternative flows:**
265
+ ```mermaid
266
+ flowchart TD
267
+ Start([User lands on checkout]) --> Auth{Logged in?}
268
+ Auth -->|No| Login[Login/Register]
269
+ Auth -->|Yes| Review[Review cart]
270
+ Login --> Review
271
+
272
+ Review --> HasItems{Cart has items?}
273
+ HasItems -->|Yes| Address{Has address?}
274
+ HasItems -->|No| Empty[Empty cart message]
275
+
276
+ Address -->|Yes| Payment[Enter payment]
277
+ Address -->|No| AddAddress[Add shipping address]
278
+ AddAddress --> Payment
279
+
280
+ Payment --> Valid{Payment valid?}
281
+ Valid -->|Yes| Confirm[Confirm order]
282
+ Valid -->|No| PaymentError[Show error]
283
+ PaymentError --> Payment
284
+
285
+ Confirm --> End([Order confirmed])
286
+ ```
287
+
288
+ ## Workflow 5: Document System Architecture
289
+
290
+ **When:** You need to show how your system components interact.
291
+
292
+ **Steps:**
293
+
294
+ 1. **Create context diagram (external view):**
295
+ ```mermaid
296
+ C4Context
297
+ title System Context - E-commerce Platform
298
+
299
+ Person(customer, "Customer", "Shops for products")
300
+ System(ecommerce, "E-commerce System", "Web application")
301
+ System_Ext(payment, "Payment Gateway", "Stripe")
302
+ System_Ext(email, "Email Service", "SendGrid")
303
+ System_Ext(shipping, "Shipping Provider", "FedEx API")
304
+
305
+ Rel(customer, ecommerce, "Browses and purchases")
306
+ Rel(ecommerce, payment, "Processes payments")
307
+ Rel(ecommerce, email, "Sends notifications")
308
+ Rel(ecommerce, shipping, "Creates shipments")
309
+ ```
310
+
311
+ 2. **Create container diagram (components):**
312
+ ```mermaid
313
+ C4Container
314
+ title Container Diagram - E-commerce System
315
+
316
+ Person(customer, "Customer")
317
+
318
+ Container_Boundary(c1, "E-commerce System") {
319
+ Container(web, "Web Application", "React", "SPA")
320
+ Container(api, "API", "Node.js", "REST API")
321
+ ContainerDb(db, "Database", "PostgreSQL", "Product, order data")
322
+ Container(worker, "Background Worker", "Node.js", "Processes async tasks")
323
+ ContainerQueue(queue, "Message Queue", "RabbitMQ")
324
+ }
325
+
326
+ System_Ext(payment, "Payment Gateway")
327
+
328
+ Rel(customer, web, "Uses", "HTTPS")
329
+ Rel(web, api, "Calls", "HTTPS/JSON")
330
+ Rel(api, db, "Reads/Writes")
331
+ Rel(api, queue, "Publishes messages")
332
+ Rel(worker, queue, "Subscribes to messages")
333
+ Rel(api, payment, "Processes payments", "HTTPS")
334
+ ```
335
+
336
+ 3. **Create component diagram (internal structure):**
337
+ ```mermaid
338
+ C4Component
339
+ title Component Diagram - API
340
+
341
+ Container_Boundary(api, "API") {
342
+ Component(controller, "Order Controller", "Express", "Handles HTTP requests")
343
+ Component(service, "Order Service", "TypeScript", "Business logic")
344
+ Component(repo, "Order Repository", "TypeORM", "Data access")
345
+ }
346
+
347
+ ContainerDb(db, "Database")
348
+ ContainerQueue(queue, "Message Queue")
349
+
350
+ Rel(controller, service, "Uses")
351
+ Rel(service, repo, "Uses")
352
+ Rel(repo, db, "Reads/Writes", "SQL")
353
+ Rel(service, queue, "Publishes events")
354
+ ```
355
+
356
+ ## Workflow 6: Plan a Refactoring
357
+
358
+ **When:** You want to document before/after states for a refactoring effort.
359
+
360
+ **Steps:**
361
+
362
+ 1. **Document current state:**
363
+ ```mermaid
364
+ classDiagram
365
+ class OrderController {
366
+ +createOrder(req, res)
367
+ +validatePayment()
368
+ +sendEmail()
369
+ +updateInventory()
370
+ }
371
+
372
+ note for OrderController "Controller doing too much:<br/>- Payment validation<br/>- Email sending<br/>- Inventory management"
373
+ ```
374
+
375
+ 2. **Design target state:**
376
+ ```mermaid
377
+ classDiagram
378
+ OrderController --> OrderService
379
+ OrderService --> PaymentService
380
+ OrderService --> EmailService
381
+ OrderService --> InventoryService
382
+
383
+ class OrderController {
384
+ +createOrder(req, res)
385
+ }
386
+
387
+ class OrderService {
388
+ +processOrder(orderData)
389
+ }
390
+
391
+ class PaymentService {
392
+ +validatePayment(paymentInfo)
393
+ }
394
+
395
+ class EmailService {
396
+ +sendOrderConfirmation(order)
397
+ }
398
+
399
+ class InventoryService {
400
+ +reserveItems(lineItems)
401
+ }
402
+ ```
403
+
404
+ 3. **Create migration steps:**
405
+ - Extract PaymentService
406
+ - Extract EmailService
407
+ - Extract InventoryService
408
+ - Refactor OrderController to use OrderService
409
+
410
+ ## Tips for Effective Workflows
411
+
412
+ 1. **Start with the big picture** - Context before details
413
+ 2. **Iterate incrementally** - Add complexity gradually
414
+ 3. **Validate at each step** - Test syntax at [mermaid.live](https://mermaid.live)
415
+ 4. **Use consistent naming** - Match code/database names
416
+ 5. **Add explanatory notes** - Clarify non-obvious parts
417
+ 6. **Version control** - Commit diagrams with related code changes
418
+ 7. **Update regularly** - Keep diagrams current as code evolves
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: migrate-dir
3
+ description: Rename this repo's legacy `.claudster/` artifact dir to `.caddis/` — dry-run first, `git mv` to keep history, merges a straggler dir, rewrites live refs. Opt-in, never automatic.
4
+ ---
5
+
6
+ # /migrate-dir — rename `.claudster/` → `.caddis/`
7
+
8
+ caddis writes its per-repo artifacts (plans, handoffs, kb, relay, usage log, …) to **`.caddis/`**.
9
+ Repos created before the rename have **`.claudster/`**. Both work — every reader tries `.caddis`
10
+ then `.claudster`, and every writer writes **where the repo already lives** — so this migration is
11
+ about consistency, not function. It is **opt-in and never automatic**: renaming a directory under a
12
+ concurrent session would move files out from under its in-flight writes.
13
+
14
+ Context / args: **$ARGUMENTS** — an optional target repo path (default: this repo) and an optional
15
+ `--apply` (default is a dry run).
16
+
17
+ ## Step 1 — locate the migrator
18
+ It ships with the harness. Try, in order:
19
+ - `${CLAUDE_PLUGIN_ROOT}/scripts/caddis_migrate_dir.py` — a plugin install.
20
+ - `scripts/caddis_migrate_dir.py` — the harness source repo itself.
21
+
22
+ ## Step 2 — check the tree first (L1: shared worktrees)
23
+ ```
24
+ git -C <target> status --short
25
+ ```
26
+ The migration **refuses a dirty tree** (a rename mixed into unrelated edits is unreviewable, and
27
+ these working trees are shared with parallel sessions). If it's dirty: commit or stash first. Never
28
+ pass `--allow-dirty` on a tree whose changes you didn't make.
29
+
30
+ ## Step 3 — dry run
31
+ ```
32
+ python <path>/caddis_migrate_dir.py <target>
33
+ ```
34
+ Read the plan it prints. Two shapes:
35
+ - **Simple** — only `.claudster/` exists → one `git mv .claudster .caddis` (history preserved).
36
+ - **Both exist** — a straggler `.claudster/` was recreated by an out-of-date session → a per-child
37
+ merge into `.caddis/`. Append-only JSONL logs (`usage-log` / `agent-log` / `memory`) are
38
+ **concatenated with the legacy lines first**; directories recurse; anything else that collides is
39
+ reported as a **CONFLICT** and left untouched for a human.
40
+
41
+ Show the user the dry-run output before applying.
42
+
43
+ ## Step 4 — apply
44
+ ```
45
+ python <path>/caddis_migrate_dir.py <target> --apply
46
+ ```
47
+ It also rewrites `.claudster/…` path references inside the repo's **live** state — `.caddis/relay.md`
48
+ and `.caddis/workstreams.json` (parked-workstream plan paths). Historical artifacts (past plans,
49
+ handoffs, reviews) are deliberately **not** rewritten: they record what was true then.
50
+
51
+ Resolve any CONFLICT it reported by hand, then re-run — the command is idempotent.
52
+
53
+ ## Step 5 — verify, then commit
54
+ ```
55
+ git -C <target> status --short # renames should show as R (history preserved)
56
+ python <path>/caddis_migrate_dir.py <target> --check # exit 0 = no legacy dir left
57
+ ```
58
+ Then run the repo's own gate (its tests, and `check_doc_coverage.py --check` if present) and commit
59
+ the rename **on its own**, e.g. `chore(caddis): migrate .claudster/ -> .caddis/`.
60
+
61
+ **Do not push** a repo that deploys on push without its owner's go.
62
+
63
+ ## Notes
64
+ - Also grep the repo for stale refs the migrator leaves alone on purpose:
65
+ `.gitignore`, CI workflows, `.docket/config.json`, and any script hardcoding `.claudster/`.
66
+ Update those by hand in the same commit.
67
+ - Repos that haven't migrated keep working indefinitely — the `.claudster` read-fallback is removed
68
+ only after the whole fleet has migrated and soaked.