mindsystem-cc 3.0.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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +501 -0
  3. package/agents/ms-codebase-mapper.md +739 -0
  4. package/agents/ms-debugger.md +1184 -0
  5. package/agents/ms-designer.md +414 -0
  6. package/agents/ms-executor.md +760 -0
  7. package/agents/ms-integration-checker.md +423 -0
  8. package/agents/ms-milestone-auditor.md +448 -0
  9. package/agents/ms-mock-generator.md +182 -0
  10. package/agents/ms-plan-checker.md +746 -0
  11. package/agents/ms-research-synthesizer.md +248 -0
  12. package/agents/ms-researcher.md +962 -0
  13. package/agents/ms-roadmapper.md +606 -0
  14. package/agents/ms-verifier.md +779 -0
  15. package/agents/ms-verify-fixer.md +124 -0
  16. package/bin/install.js +296 -0
  17. package/commands/ms/add-phase.md +207 -0
  18. package/commands/ms/add-todo.md +182 -0
  19. package/commands/ms/audit-milestone.md +318 -0
  20. package/commands/ms/check-phase.md +162 -0
  21. package/commands/ms/check-todos.md +217 -0
  22. package/commands/ms/complete-milestone.md +137 -0
  23. package/commands/ms/create-roadmap.md +273 -0
  24. package/commands/ms/debug.md +149 -0
  25. package/commands/ms/define-requirements.md +121 -0
  26. package/commands/ms/design-phase.md +341 -0
  27. package/commands/ms/discuss-milestone.md +48 -0
  28. package/commands/ms/discuss-phase.md +60 -0
  29. package/commands/ms/do-work.md +90 -0
  30. package/commands/ms/execute-phase.md +289 -0
  31. package/commands/ms/help.md +623 -0
  32. package/commands/ms/insert-phase.md +227 -0
  33. package/commands/ms/list-phase-assumptions.md +50 -0
  34. package/commands/ms/map-codebase.md +71 -0
  35. package/commands/ms/new-milestone.md +193 -0
  36. package/commands/ms/new-project.md +338 -0
  37. package/commands/ms/pause-work.md +123 -0
  38. package/commands/ms/plan-milestone-gaps.md +285 -0
  39. package/commands/ms/plan-phase.md +105 -0
  40. package/commands/ms/progress.md +370 -0
  41. package/commands/ms/remove-phase.md +338 -0
  42. package/commands/ms/research-phase.md +175 -0
  43. package/commands/ms/research-project.md +339 -0
  44. package/commands/ms/resume-work.md +40 -0
  45. package/commands/ms/review-design.md +484 -0
  46. package/commands/ms/simplify-flutter.md +193 -0
  47. package/commands/ms/update.md +159 -0
  48. package/commands/ms/verify-work.md +92 -0
  49. package/commands/ms/whats-new.md +124 -0
  50. package/mindsystem/references/checkpoints.md +788 -0
  51. package/mindsystem/references/continuation-format.md +255 -0
  52. package/mindsystem/references/debugging/debugging-mindset.md +11 -0
  53. package/mindsystem/references/debugging/hypothesis-testing.md +11 -0
  54. package/mindsystem/references/debugging/investigation-techniques.md +11 -0
  55. package/mindsystem/references/debugging/verification-patterns.md +11 -0
  56. package/mindsystem/references/debugging/when-to-research.md +11 -0
  57. package/mindsystem/references/git-integration.md +254 -0
  58. package/mindsystem/references/goal-backward.md +286 -0
  59. package/mindsystem/references/mock-patterns.md +294 -0
  60. package/mindsystem/references/plan-format.md +473 -0
  61. package/mindsystem/references/principles.md +73 -0
  62. package/mindsystem/references/questioning.md +140 -0
  63. package/mindsystem/references/research-pitfalls.md +233 -0
  64. package/mindsystem/references/scope-estimation.md +256 -0
  65. package/mindsystem/references/tdd.md +263 -0
  66. package/mindsystem/references/verification-patterns.md +595 -0
  67. package/mindsystem/templates/DEBUG.md +159 -0
  68. package/mindsystem/templates/UAT.md +403 -0
  69. package/mindsystem/templates/adhoc-summary.md +153 -0
  70. package/mindsystem/templates/codebase/architecture.md +255 -0
  71. package/mindsystem/templates/codebase/concerns.md +310 -0
  72. package/mindsystem/templates/codebase/conventions.md +307 -0
  73. package/mindsystem/templates/codebase/integrations.md +280 -0
  74. package/mindsystem/templates/codebase/stack.md +186 -0
  75. package/mindsystem/templates/codebase/structure.md +285 -0
  76. package/mindsystem/templates/codebase/testing.md +480 -0
  77. package/mindsystem/templates/config.json +26 -0
  78. package/mindsystem/templates/context.md +140 -0
  79. package/mindsystem/templates/continue-here.md +78 -0
  80. package/mindsystem/templates/debug-subagent-prompt.md +91 -0
  81. package/mindsystem/templates/design-iteration.md +208 -0
  82. package/mindsystem/templates/design.md +417 -0
  83. package/mindsystem/templates/discovery.md +146 -0
  84. package/mindsystem/templates/milestone-archive.md +123 -0
  85. package/mindsystem/templates/milestone-context.md +93 -0
  86. package/mindsystem/templates/milestone.md +115 -0
  87. package/mindsystem/templates/phase-prompt.md +574 -0
  88. package/mindsystem/templates/project.md +184 -0
  89. package/mindsystem/templates/requirements.md +231 -0
  90. package/mindsystem/templates/research-project/ARCHITECTURE.md +204 -0
  91. package/mindsystem/templates/research-project/FEATURES.md +147 -0
  92. package/mindsystem/templates/research-project/PITFALLS.md +200 -0
  93. package/mindsystem/templates/research-project/STACK.md +120 -0
  94. package/mindsystem/templates/research-project/SUMMARY.md +170 -0
  95. package/mindsystem/templates/research-subagent-prompt.md +92 -0
  96. package/mindsystem/templates/research.md +529 -0
  97. package/mindsystem/templates/roadmap.md +214 -0
  98. package/mindsystem/templates/state.md +224 -0
  99. package/mindsystem/templates/summary.md +269 -0
  100. package/mindsystem/templates/user-setup.md +323 -0
  101. package/mindsystem/templates/verification-report.md +322 -0
  102. package/mindsystem/workflows/complete-milestone.md +759 -0
  103. package/mindsystem/workflows/create-milestone.md +203 -0
  104. package/mindsystem/workflows/debug.md +14 -0
  105. package/mindsystem/workflows/define-requirements.md +330 -0
  106. package/mindsystem/workflows/diagnose-issues.md +241 -0
  107. package/mindsystem/workflows/discovery-phase.md +293 -0
  108. package/mindsystem/workflows/discuss-milestone.md +310 -0
  109. package/mindsystem/workflows/discuss-phase.md +237 -0
  110. package/mindsystem/workflows/do-work.md +359 -0
  111. package/mindsystem/workflows/execute-phase.md +644 -0
  112. package/mindsystem/workflows/execute-plan.md +1828 -0
  113. package/mindsystem/workflows/generate-mocks.md +187 -0
  114. package/mindsystem/workflows/list-phase-assumptions.md +178 -0
  115. package/mindsystem/workflows/map-codebase.md +289 -0
  116. package/mindsystem/workflows/plan-phase.md +876 -0
  117. package/mindsystem/workflows/research-phase.md +17 -0
  118. package/mindsystem/workflows/research-project.md +23 -0
  119. package/mindsystem/workflows/resume-project.md +311 -0
  120. package/mindsystem/workflows/transition.md +564 -0
  121. package/mindsystem/workflows/verify-phase.md +629 -0
  122. package/mindsystem/workflows/verify-work.md +823 -0
  123. package/package.json +32 -0
  124. package/scripts/generate-phase-patch.sh +169 -0
  125. package/scripts/ms-lookup/README.md +112 -0
  126. package/scripts/ms-lookup/ms_lookup/__init__.py +3 -0
  127. package/scripts/ms-lookup/ms_lookup/__main__.py +6 -0
  128. package/scripts/ms-lookup/ms_lookup/backends/__init__.py +6 -0
  129. package/scripts/ms-lookup/ms_lookup/backends/context7.py +219 -0
  130. package/scripts/ms-lookup/ms_lookup/backends/perplexity.py +145 -0
  131. package/scripts/ms-lookup/ms_lookup/cache.py +48 -0
  132. package/scripts/ms-lookup/ms_lookup/cli.py +219 -0
  133. package/scripts/ms-lookup/ms_lookup/config.py +23 -0
  134. package/scripts/ms-lookup/ms_lookup/errors.py +24 -0
  135. package/scripts/ms-lookup/ms_lookup/output.py +49 -0
  136. package/scripts/ms-lookup/ms_lookup/tokens.py +56 -0
  137. package/scripts/ms-lookup/pyproject.toml +17 -0
  138. package/scripts/ms-lookup/uv.lock +207 -0
  139. package/scripts/ms-lookup-wrapper.sh +21 -0
@@ -0,0 +1,788 @@
1
+ <overview>
2
+ Plans execute autonomously. Checkpoints formalize the interaction points where human verification or decisions are needed.
3
+
4
+ **Core principle:** Claude automates everything with CLI/API. Checkpoints are for verification and decisions, not manual work.
5
+ </overview>
6
+
7
+ <checkpoint_types>
8
+
9
+ <type name="human-verify">
10
+ ## checkpoint:human-verify (Most Common - 90%)
11
+
12
+ **When:** Claude completed automated work, human confirms it works correctly.
13
+
14
+ **Use for:**
15
+ - Visual UI checks (layout, styling, responsiveness)
16
+ - Interactive flows (click through wizard, test user flows)
17
+ - Functional verification (feature works as expected)
18
+ - Audio/video playback quality
19
+ - Animation smoothness
20
+ - Accessibility testing
21
+
22
+ **Structure:**
23
+ ```xml
24
+ <task type="checkpoint:human-verify" gate="blocking">
25
+ <what-built>[What Claude automated and deployed/built]</what-built>
26
+ <how-to-verify>
27
+ [Exact steps to test - URLs, commands, expected behavior]
28
+ </how-to-verify>
29
+ <resume-signal>[How to continue - "approved", "yes", or describe issues]</resume-signal>
30
+ </task>
31
+ ```
32
+
33
+ **Key elements:**
34
+ - `<what-built>`: What Claude automated (deployed, built, configured)
35
+ - `<how-to-verify>`: Exact steps to confirm it works (numbered, specific)
36
+ - `<resume-signal>`: Clear indication of how to continue
37
+
38
+ **Example: Vercel Deployment**
39
+ ```xml
40
+ <task type="auto">
41
+ <name>Deploy to Vercel</name>
42
+ <files>.vercel/, vercel.json</files>
43
+ <action>Run `vercel --yes` to create project and deploy. Capture deployment URL from output.</action>
44
+ <verify>vercel ls shows deployment, curl {url} returns 200</verify>
45
+ <done>App deployed, URL captured</done>
46
+ </task>
47
+
48
+ <task type="checkpoint:human-verify" gate="blocking">
49
+ <what-built>Deployed to Vercel at https://myapp-abc123.vercel.app</what-built>
50
+ <how-to-verify>
51
+ Visit https://myapp-abc123.vercel.app and confirm:
52
+ - Homepage loads without errors
53
+ - Login form is visible
54
+ - No console errors in browser DevTools
55
+ </how-to-verify>
56
+ <resume-signal>Type "approved" to continue, or describe issues to fix</resume-signal>
57
+ </task>
58
+ ```
59
+
60
+ **Example: UI Component**
61
+ ```xml
62
+ <task type="auto">
63
+ <name>Build responsive dashboard layout</name>
64
+ <files>src/components/Dashboard.tsx, src/app/dashboard/page.tsx</files>
65
+ <action>Create dashboard with sidebar, header, and content area. Use Tailwind responsive classes for mobile.</action>
66
+ <verify>npm run build succeeds, no TypeScript errors</verify>
67
+ <done>Dashboard component builds without errors</done>
68
+ </task>
69
+
70
+ <task type="checkpoint:human-verify" gate="blocking">
71
+ <what-built>Responsive dashboard layout at /dashboard</what-built>
72
+ <how-to-verify>
73
+ 1. Run: npm run dev
74
+ 2. Visit: http://localhost:3000/dashboard
75
+ 3. Desktop (>1024px): Verify sidebar left, content right, header top
76
+ 4. Tablet (768px): Verify sidebar collapses to hamburger
77
+ 5. Mobile (375px): Verify single column, bottom nav
78
+ 6. Check: No layout shift, no horizontal scroll
79
+ </how-to-verify>
80
+ <resume-signal>Type "approved" or describe layout issues</resume-signal>
81
+ </task>
82
+ ```
83
+
84
+ **Example: Xcode Build**
85
+ ```xml
86
+ <task type="auto">
87
+ <name>Build macOS app with Xcode</name>
88
+ <files>App.xcodeproj, Sources/</files>
89
+ <action>Run `xcodebuild -project App.xcodeproj -scheme App build`. Check for compilation errors in output.</action>
90
+ <verify>Build output contains "BUILD SUCCEEDED", no errors</verify>
91
+ <done>App builds successfully</done>
92
+ </task>
93
+
94
+ <task type="checkpoint:human-verify" gate="blocking">
95
+ <what-built>Built macOS app at DerivedData/Build/Products/Debug/App.app</what-built>
96
+ <how-to-verify>
97
+ Open App.app and test:
98
+ - App launches without crashes
99
+ - Menu bar icon appears
100
+ - Preferences window opens correctly
101
+ - No visual glitches or layout issues
102
+ </how-to-verify>
103
+ <resume-signal>Type "approved" or describe issues</resume-signal>
104
+ </task>
105
+ ```
106
+ </type>
107
+
108
+ <type name="decision">
109
+ ## checkpoint:decision (9%)
110
+
111
+ **When:** Human must make choice that affects implementation direction.
112
+
113
+ **Use for:**
114
+ - Technology selection (which auth provider, which database)
115
+ - Architecture decisions (monorepo vs separate repos)
116
+ - Design choices (color scheme, layout approach)
117
+ - Feature prioritization (which variant to build)
118
+ - Data model decisions (schema structure)
119
+
120
+ **Structure:**
121
+ ```xml
122
+ <task type="checkpoint:decision" gate="blocking">
123
+ <decision>[What's being decided]</decision>
124
+ <context>[Why this decision matters]</context>
125
+ <options>
126
+ <option id="option-a">
127
+ <name>[Option name]</name>
128
+ <pros>[Benefits]</pros>
129
+ <cons>[Tradeoffs]</cons>
130
+ </option>
131
+ <option id="option-b">
132
+ <name>[Option name]</name>
133
+ <pros>[Benefits]</pros>
134
+ <cons>[Tradeoffs]</cons>
135
+ </option>
136
+ </options>
137
+ <resume-signal>[How to indicate choice]</resume-signal>
138
+ </task>
139
+ ```
140
+
141
+ **Key elements:**
142
+ - `<decision>`: What's being decided
143
+ - `<context>`: Why this matters
144
+ - `<options>`: Each option with balanced pros/cons (not prescriptive)
145
+ - `<resume-signal>`: How to indicate choice
146
+
147
+ **Example: Auth Provider Selection**
148
+ ```xml
149
+ <task type="checkpoint:decision" gate="blocking">
150
+ <decision>Select authentication provider</decision>
151
+ <context>
152
+ Need user authentication for the app. Three solid options with different tradeoffs.
153
+ </context>
154
+ <options>
155
+ <option id="supabase">
156
+ <name>Supabase Auth</name>
157
+ <pros>Built-in with Supabase DB we're using, generous free tier, row-level security integration</pros>
158
+ <cons>Less customizable UI, tied to Supabase ecosystem</cons>
159
+ </option>
160
+ <option id="clerk">
161
+ <name>Clerk</name>
162
+ <pros>Beautiful pre-built UI, best developer experience, excellent docs</pros>
163
+ <cons>Paid after 10k MAU, vendor lock-in</cons>
164
+ </option>
165
+ <option id="nextauth">
166
+ <name>NextAuth.js</name>
167
+ <pros>Free, self-hosted, maximum control, widely adopted</pros>
168
+ <cons>More setup work, you manage security updates, UI is DIY</cons>
169
+ </option>
170
+ </options>
171
+ <resume-signal>Select: supabase, clerk, or nextauth</resume-signal>
172
+ </task>
173
+ ```
174
+
175
+ **Example: Database Selection**
176
+ ```xml
177
+ <task type="checkpoint:decision" gate="blocking">
178
+ <decision>Select database for user data</decision>
179
+ <context>
180
+ App needs persistent storage for users, sessions, and user-generated content.
181
+ Expected scale: 10k users, 1M records first year.
182
+ </context>
183
+ <options>
184
+ <option id="supabase">
185
+ <name>Supabase (Postgres)</name>
186
+ <pros>Full SQL, generous free tier, built-in auth, real-time subscriptions</pros>
187
+ <cons>Vendor lock-in for real-time features, less flexible than raw Postgres</cons>
188
+ </option>
189
+ <option id="planetscale">
190
+ <name>PlanetScale (MySQL)</name>
191
+ <pros>Serverless scaling, branching workflow, excellent DX</pros>
192
+ <cons>MySQL not Postgres, no foreign keys in free tier</cons>
193
+ </option>
194
+ <option id="convex">
195
+ <name>Convex</name>
196
+ <pros>Real-time by default, TypeScript-native, automatic caching</pros>
197
+ <cons>Newer platform, different mental model, less SQL flexibility</cons>
198
+ </option>
199
+ </options>
200
+ <resume-signal>Select: supabase, planetscale, or convex</resume-signal>
201
+ </task>
202
+ ```
203
+ </type>
204
+
205
+ <type name="human-action">
206
+ ## checkpoint:human-action (1% - Rare)
207
+
208
+ **When:** Action has NO CLI/API and requires human-only interaction, OR Claude hit an authentication gate during automation.
209
+
210
+ **Use ONLY for:**
211
+ - **Authentication gates** - Claude tried to use CLI/API but needs credentials to continue (this is NOT a failure)
212
+ - Email verification links (account creation requires clicking email)
213
+ - SMS 2FA codes (phone verification)
214
+ - Manual account approvals (platform requires human review before API access)
215
+ - Credit card 3D Secure flows (web-based payment authorization)
216
+ - OAuth app approvals (some platforms require web-based approval)
217
+
218
+ **Do NOT use for pre-planned manual work:**
219
+ - Manually deploying to Vercel (use `vercel` CLI - auth gate if needed)
220
+ - Manually creating Stripe webhooks (use Stripe API - auth gate if needed)
221
+ - Manually creating databases (use provider CLI - auth gate if needed)
222
+ - Running builds/tests manually (use Bash tool)
223
+ - Creating files manually (use Write tool)
224
+
225
+ **Structure:**
226
+ ```xml
227
+ <task type="checkpoint:human-action" gate="blocking">
228
+ <action>[What human must do - Claude already did everything automatable]</action>
229
+ <instructions>
230
+ [What Claude already automated]
231
+ [The ONE thing requiring human action]
232
+ </instructions>
233
+ <verification>[What Claude can check afterward]</verification>
234
+ <resume-signal>[How to continue]</resume-signal>
235
+ </task>
236
+ ```
237
+
238
+ **Key principle:** Claude automates EVERYTHING possible first, only asks human for the truly unavoidable manual step.
239
+
240
+ **Example: Email Verification**
241
+ ```xml
242
+ <task type="auto">
243
+ <name>Create SendGrid account via API</name>
244
+ <action>Use SendGrid API to create subuser account with provided email. Request verification email.</action>
245
+ <verify>API returns 201, account created</verify>
246
+ <done>Account created, verification email sent</done>
247
+ </task>
248
+
249
+ <task type="checkpoint:human-action" gate="blocking">
250
+ <action>Complete email verification for SendGrid account</action>
251
+ <instructions>
252
+ I created the account and requested verification email.
253
+ Check your inbox for SendGrid verification link and click it.
254
+ </instructions>
255
+ <verification>SendGrid API key works: curl test succeeds</verification>
256
+ <resume-signal>Type "done" when email verified</resume-signal>
257
+ </task>
258
+ ```
259
+
260
+ **Example: Credit Card 3D Secure**
261
+ ```xml
262
+ <task type="auto">
263
+ <name>Create Stripe payment intent</name>
264
+ <action>Use Stripe API to create payment intent for $99. Generate checkout URL.</action>
265
+ <verify>Stripe API returns payment intent ID and URL</verify>
266
+ <done>Payment intent created</done>
267
+ </task>
268
+
269
+ <task type="checkpoint:human-action" gate="blocking">
270
+ <action>Complete 3D Secure authentication</action>
271
+ <instructions>
272
+ I created the payment intent: https://checkout.stripe.com/pay/cs_test_abc123
273
+ Visit that URL and complete the 3D Secure verification flow with your test card.
274
+ </instructions>
275
+ <verification>Stripe webhook receives payment_intent.succeeded event</verification>
276
+ <resume-signal>Type "done" when payment completes</resume-signal>
277
+ </task>
278
+ ```
279
+
280
+ **Example: Authentication Gate (Dynamic Checkpoint)**
281
+ ```xml
282
+ <task type="auto">
283
+ <name>Deploy to Vercel</name>
284
+ <files>.vercel/, vercel.json</files>
285
+ <action>Run `vercel --yes` to deploy</action>
286
+ <verify>vercel ls shows deployment, curl returns 200</verify>
287
+ </task>
288
+
289
+ <!-- If vercel returns "Error: Not authenticated", Claude creates checkpoint on the fly -->
290
+
291
+ <task type="checkpoint:human-action" gate="blocking">
292
+ <action>Authenticate Vercel CLI so I can continue deployment</action>
293
+ <instructions>
294
+ I tried to deploy but got authentication error.
295
+ Run: vercel login
296
+ This will open your browser - complete the authentication flow.
297
+ </instructions>
298
+ <verification>vercel whoami returns your account email</verification>
299
+ <resume-signal>Type "done" when authenticated</resume-signal>
300
+ </task>
301
+
302
+ <!-- After authentication, Claude retries the deployment -->
303
+
304
+ <task type="auto">
305
+ <name>Retry Vercel deployment</name>
306
+ <action>Run `vercel --yes` (now authenticated)</action>
307
+ <verify>vercel ls shows deployment, curl returns 200</verify>
308
+ </task>
309
+ ```
310
+
311
+ **Key distinction:** Authentication gates are created dynamically when Claude encounters auth errors during automation. They're NOT pre-planned - Claude tries to automate first, only asks for credentials when blocked.
312
+ </type>
313
+ </checkpoint_types>
314
+
315
+ <execution_protocol>
316
+
317
+ When Claude encounters `type="checkpoint:*"`:
318
+
319
+ 1. **Stop immediately** - do not proceed to next task
320
+ 2. **Display checkpoint clearly** using the format below
321
+ 3. **Wait for user response** - do not hallucinate completion
322
+ 4. **Verify if possible** - check files, run tests, whatever is specified
323
+ 5. **Resume execution** - continue to next task only after confirmation
324
+
325
+ **For checkpoint:human-verify:**
326
+ ```
327
+ ╔═══════════════════════════════════════════════════════╗
328
+ ║ CHECKPOINT: Verification Required ║
329
+ ╚═══════════════════════════════════════════════════════╝
330
+
331
+ Progress: 5/8 tasks complete
332
+ Task: Responsive dashboard layout
333
+
334
+ Built: Responsive dashboard at /dashboard
335
+
336
+ How to verify:
337
+ 1. Run: npm run dev
338
+ 2. Visit: http://localhost:3000/dashboard
339
+ 3. Desktop (>1024px): Sidebar visible, content fills remaining space
340
+ 4. Tablet (768px): Sidebar collapses to icons
341
+ 5. Mobile (375px): Sidebar hidden, hamburger menu appears
342
+
343
+ ────────────────────────────────────────────────────────
344
+ → YOUR ACTION: Type "approved" or describe issues
345
+ ────────────────────────────────────────────────────────
346
+ ```
347
+
348
+ **For checkpoint:decision:**
349
+ ```
350
+ ╔═══════════════════════════════════════════════════════╗
351
+ ║ CHECKPOINT: Decision Required ║
352
+ ╚═══════════════════════════════════════════════════════╝
353
+
354
+ Progress: 2/6 tasks complete
355
+ Task: Select authentication provider
356
+
357
+ Decision: Which auth provider should we use?
358
+
359
+ Context: Need user authentication. Three options with different tradeoffs.
360
+
361
+ Options:
362
+ 1. supabase - Built-in with our DB, free tier
363
+ Pros: Row-level security integration, generous free tier
364
+ Cons: Less customizable UI, ecosystem lock-in
365
+
366
+ 2. clerk - Best DX, paid after 10k users
367
+ Pros: Beautiful pre-built UI, excellent documentation
368
+ Cons: Vendor lock-in, pricing at scale
369
+
370
+ 3. nextauth - Self-hosted, maximum control
371
+ Pros: Free, no vendor lock-in, widely adopted
372
+ Cons: More setup work, DIY security updates
373
+
374
+ ────────────────────────────────────────────────────────
375
+ → YOUR ACTION: Select supabase, clerk, or nextauth
376
+ ────────────────────────────────────────────────────────
377
+ ```
378
+
379
+ **For checkpoint:human-action:**
380
+ ```
381
+ ╔═══════════════════════════════════════════════════════╗
382
+ ║ CHECKPOINT: Action Required ║
383
+ ╚═══════════════════════════════════════════════════════╝
384
+
385
+ Progress: 3/8 tasks complete
386
+ Task: Deploy to Vercel
387
+
388
+ Attempted: vercel --yes
389
+ Error: Not authenticated. Please run 'vercel login'
390
+
391
+ What you need to do:
392
+ 1. Run: vercel login
393
+ 2. Complete browser authentication when it opens
394
+ 3. Return here when done
395
+
396
+ I'll verify: vercel whoami returns your account
397
+
398
+ ────────────────────────────────────────────────────────
399
+ → YOUR ACTION: Type "done" when authenticated
400
+ ────────────────────────────────────────────────────────
401
+ ```
402
+ </execution_protocol>
403
+
404
+ <authentication_gates>
405
+
406
+ **Critical:** When Claude tries CLI/API and gets auth error, this is NOT a failure - it's a gate requiring human input to unblock automation.
407
+
408
+ **Pattern:** Claude tries automation → auth error → creates checkpoint → you authenticate → Claude retries → continues
409
+
410
+ **Gate protocol:**
411
+ 1. Recognize it's not a failure - missing auth is expected
412
+ 2. Stop current task - don't retry repeatedly
413
+ 3. Create checkpoint:human-action dynamically
414
+ 4. Provide exact authentication steps
415
+ 5. Verify authentication works
416
+ 6. Retry the original task
417
+ 7. Continue normally
418
+
419
+ **Example execution flow (Vercel auth gate):**
420
+
421
+ ```
422
+ Claude: Running `vercel --yes` to deploy...
423
+
424
+ Error: Not authenticated. Please run 'vercel login'
425
+
426
+ ╔═══════════════════════════════════════════════════════╗
427
+ ║ CHECKPOINT: Action Required ║
428
+ ╚═══════════════════════════════════════════════════════╝
429
+
430
+ Progress: 2/8 tasks complete
431
+ Task: Deploy to Vercel
432
+
433
+ Attempted: vercel --yes
434
+ Error: Not authenticated
435
+
436
+ What you need to do:
437
+ 1. Run: vercel login
438
+ 2. Complete browser authentication
439
+
440
+ I'll verify: vercel whoami returns your account
441
+
442
+ ────────────────────────────────────────────────────────
443
+ → YOUR ACTION: Type "done" when authenticated
444
+ ────────────────────────────────────────────────────────
445
+
446
+ User: done
447
+
448
+ Claude: Verifying authentication...
449
+ Running: vercel whoami
450
+ ✓ Authenticated as: user@example.com
451
+
452
+ Retrying deployment...
453
+ Running: vercel --yes
454
+ ✓ Deployed to: https://myapp-abc123.vercel.app
455
+
456
+ Task 3 complete. Continuing to task 4...
457
+ ```
458
+
459
+ **Key distinction:**
460
+ - Pre-planned checkpoint: "I need you to do X" (wrong - Claude should automate)
461
+ - Auth gate: "I tried to automate X but need credentials" (correct - unblocks automation)
462
+
463
+ </authentication_gates>
464
+
465
+ <automation_reference>
466
+
467
+ **The rule:** If it has CLI/API, Claude does it. Never ask human to perform automatable work.
468
+
469
+ | Service | CLI/API | Key Commands | Auth Gate |
470
+ |---------|---------|--------------|-----------|
471
+ | Vercel | `vercel` | `--yes`, `env add`, `--prod`, `ls` | `vercel login` |
472
+ | Railway | `railway` | `init`, `up`, `variables set` | `railway login` |
473
+ | Fly | `fly` | `launch`, `deploy`, `secrets set` | `fly auth login` |
474
+ | Stripe | `stripe` + API | `listen`, `trigger`, API calls | API key in .env |
475
+ | Supabase | `supabase` | `init`, `link`, `db push`, `gen types` | `supabase login` |
476
+ | Upstash | `upstash` | `redis create`, `redis get` | `upstash auth login` |
477
+ | PlanetScale | `pscale` | `database create`, `branch create` | `pscale auth login` |
478
+ | GitHub | `gh` | `repo create`, `pr create`, `secret set` | `gh auth login` |
479
+ | Node | `npm`/`pnpm` | `install`, `run build`, `test` | N/A |
480
+ | Xcode | `xcodebuild` | `-project`, `-scheme`, `build`, `test` | N/A |
481
+ | Convex | `npx convex` | `dev`, `deploy`, `import` | `npx convex login` |
482
+
483
+ **Env files:** Use Write/Edit tools. Never ask human to create .env manually.
484
+
485
+ **Quick reference:**
486
+
487
+ | Action | Automatable? | Claude does it? |
488
+ |--------|--------------|-----------------|
489
+ | Deploy to Vercel | Yes (`vercel`) | YES |
490
+ | Create Stripe webhook | Yes (API) | YES |
491
+ | Write .env file | Yes (Write tool) | YES |
492
+ | Create Upstash DB | Yes (`upstash`) | YES |
493
+ | Run tests | Yes (`npm test`) | YES |
494
+ | Click email verification link | No | NO |
495
+ | Enter credit card with 3DS | No | NO |
496
+ | Complete OAuth in browser | No | NO |
497
+
498
+ </automation_reference>
499
+
500
+ <writing_guidelines>
501
+
502
+ **DO:**
503
+ - Automate everything with CLI/API before checkpoint
504
+ - Be specific: "Visit https://myapp.vercel.app" not "check deployment"
505
+ - Number verification steps: easier to follow
506
+ - State expected outcomes: "You should see X"
507
+ - Provide context: why this checkpoint exists
508
+ - Make verification executable: clear, testable steps
509
+
510
+ **DON'T:**
511
+ - Ask human to do work Claude can automate (deploy, create resources, run builds)
512
+ - Assume knowledge: "Configure the usual settings" ❌
513
+ - Skip steps: "Set up database" ❌ (too vague)
514
+ - Mix multiple verifications in one checkpoint (split them)
515
+ - Make verification impossible (Claude can't check visual appearance without user confirmation)
516
+
517
+ **Placement:**
518
+ - **After automation completes** - not before Claude does the work
519
+ - **After UI buildout** - before declaring phase complete
520
+ - **Before dependent work** - decisions before implementation
521
+ - **At integration points** - after configuring external services
522
+
523
+ **Bad placement:**
524
+ - Before Claude automates (asking human to do automatable work) ❌
525
+ - Too frequent (every other task is a checkpoint) ❌
526
+ - Too late (checkpoint is last task, but earlier tasks needed its result) ❌
527
+ </writing_guidelines>
528
+
529
+ <examples>
530
+
531
+ ### Example 1: Deployment Flow (Correct)
532
+
533
+ ```xml
534
+ <!-- Claude automates everything -->
535
+ <task type="auto">
536
+ <name>Deploy to Vercel</name>
537
+ <files>.vercel/, vercel.json, package.json</files>
538
+ <action>
539
+ 1. Run `vercel --yes` to create project and deploy
540
+ 2. Capture deployment URL from output
541
+ 3. Set environment variables with `vercel env add`
542
+ 4. Trigger production deployment with `vercel --prod`
543
+ </action>
544
+ <verify>
545
+ - vercel ls shows deployment
546
+ - curl {url} returns 200
547
+ - Environment variables set correctly
548
+ </verify>
549
+ <done>App deployed to production, URL captured</done>
550
+ </task>
551
+
552
+ <!-- Human verifies visual/functional correctness -->
553
+ <task type="checkpoint:human-verify" gate="blocking">
554
+ <what-built>Deployed to https://myapp.vercel.app</what-built>
555
+ <how-to-verify>
556
+ Visit https://myapp.vercel.app and confirm:
557
+ - Homepage loads correctly
558
+ - All images/assets load
559
+ - Navigation works
560
+ - No console errors
561
+ </how-to-verify>
562
+ <resume-signal>Type "approved" or describe issues</resume-signal>
563
+ </task>
564
+ ```
565
+
566
+ ### Example 2: Database Setup (No Checkpoint Needed)
567
+
568
+ ```xml
569
+ <!-- Claude automates everything -->
570
+ <task type="auto">
571
+ <name>Create Upstash Redis database</name>
572
+ <files>.env</files>
573
+ <action>
574
+ 1. Run `upstash redis create myapp-cache --region us-east-1`
575
+ 2. Capture connection URL from output
576
+ 3. Write to .env: UPSTASH_REDIS_URL={url}
577
+ 4. Verify connection with test command
578
+ </action>
579
+ <verify>
580
+ - upstash redis list shows database
581
+ - .env contains UPSTASH_REDIS_URL
582
+ - Test connection succeeds
583
+ </verify>
584
+ <done>Redis database created and configured</done>
585
+ </task>
586
+
587
+ <!-- NO CHECKPOINT NEEDED - Claude automated everything and verified programmatically -->
588
+ ```
589
+
590
+ ### Example 3: Stripe Webhooks (Correct)
591
+
592
+ ```xml
593
+ <!-- Claude automates everything -->
594
+ <task type="auto">
595
+ <name>Configure Stripe webhooks</name>
596
+ <files>.env, src/app/api/webhooks/route.ts</files>
597
+ <action>
598
+ 1. Use Stripe API to create webhook endpoint pointing to /api/webhooks
599
+ 2. Subscribe to events: payment_intent.succeeded, customer.subscription.updated
600
+ 3. Save webhook signing secret to .env
601
+ 4. Implement webhook handler in route.ts
602
+ </action>
603
+ <verify>
604
+ - Stripe API returns webhook endpoint ID
605
+ - .env contains STRIPE_WEBHOOK_SECRET
606
+ - curl webhook endpoint returns 200
607
+ </verify>
608
+ <done>Stripe webhooks configured and handler implemented</done>
609
+ </task>
610
+
611
+ <!-- Human verifies in Stripe dashboard -->
612
+ <task type="checkpoint:human-verify" gate="blocking">
613
+ <what-built>Stripe webhook configured via API</what-built>
614
+ <how-to-verify>
615
+ Visit Stripe Dashboard > Developers > Webhooks
616
+ Confirm: Endpoint shows https://myapp.com/api/webhooks with correct events
617
+ </how-to-verify>
618
+ <resume-signal>Type "yes" if correct</resume-signal>
619
+ </task>
620
+ ```
621
+
622
+ ### Example 4: Full Auth Flow Verification (Correct)
623
+
624
+ ```xml
625
+ <task type="auto">
626
+ <name>Create user schema</name>
627
+ <files>src/db/schema.ts</files>
628
+ <action>Define User, Session, Account tables with Drizzle ORM</action>
629
+ <verify>npm run db:generate succeeds</verify>
630
+ </task>
631
+
632
+ <task type="auto">
633
+ <name>Create auth API routes</name>
634
+ <files>src/app/api/auth/[...nextauth]/route.ts</files>
635
+ <action>Set up NextAuth with GitHub provider, JWT strategy</action>
636
+ <verify>TypeScript compiles, no errors</verify>
637
+ </task>
638
+
639
+ <task type="auto">
640
+ <name>Create login UI</name>
641
+ <files>src/app/login/page.tsx, src/components/LoginButton.tsx</files>
642
+ <action>Create login page with GitHub OAuth button</action>
643
+ <verify>npm run build succeeds</verify>
644
+ </task>
645
+
646
+ <!-- ONE checkpoint at end verifies the complete flow -->
647
+ <task type="checkpoint:human-verify" gate="blocking">
648
+ <what-built>Complete authentication flow (schema + API + UI)</what-built>
649
+ <how-to-verify>
650
+ 1. Run: npm run dev
651
+ 2. Visit: http://localhost:3000/login
652
+ 3. Click "Sign in with GitHub"
653
+ 4. Complete GitHub OAuth flow
654
+ 5. Verify: Redirected to /dashboard, user name displayed
655
+ 6. Refresh page: Session persists
656
+ 7. Click logout: Session cleared
657
+ </how-to-verify>
658
+ <resume-signal>Type "approved" or describe issues</resume-signal>
659
+ </task>
660
+ ```
661
+ </examples>
662
+
663
+ <anti_patterns>
664
+
665
+ ### ❌ BAD: Asking human to automate
666
+
667
+ ```xml
668
+ <task type="checkpoint:human-action" gate="blocking">
669
+ <action>Deploy to Vercel</action>
670
+ <instructions>
671
+ 1. Visit vercel.com/new
672
+ 2. Import Git repository
673
+ 3. Click Deploy
674
+ 4. Copy deployment URL
675
+ </instructions>
676
+ <verification>Deployment exists</verification>
677
+ <resume-signal>Paste URL</resume-signal>
678
+ </task>
679
+ ```
680
+
681
+ **Why bad:** Vercel has a CLI. Claude should run `vercel --yes`.
682
+
683
+ ### ✅ GOOD: Claude automates, human verifies
684
+
685
+ ```xml
686
+ <task type="auto">
687
+ <name>Deploy to Vercel</name>
688
+ <action>Run `vercel --yes`. Capture URL.</action>
689
+ <verify>vercel ls shows deployment, curl returns 200</verify>
690
+ </task>
691
+
692
+ <task type="checkpoint:human-verify">
693
+ <what-built>Deployed to {url}</what-built>
694
+ <how-to-verify>Visit {url}, check homepage loads</how-to-verify>
695
+ <resume-signal>Type "approved"</resume-signal>
696
+ </task>
697
+ ```
698
+
699
+ ### ❌ BAD: Too many checkpoints
700
+
701
+ ```xml
702
+ <task type="auto">Create schema</task>
703
+ <task type="checkpoint:human-verify">Check schema</task>
704
+ <task type="auto">Create API route</task>
705
+ <task type="checkpoint:human-verify">Check API</task>
706
+ <task type="auto">Create UI form</task>
707
+ <task type="checkpoint:human-verify">Check form</task>
708
+ ```
709
+
710
+ **Why bad:** Verification fatigue. Combine into one checkpoint at end.
711
+
712
+ ### ✅ GOOD: Single verification checkpoint
713
+
714
+ ```xml
715
+ <task type="auto">Create schema</task>
716
+ <task type="auto">Create API route</task>
717
+ <task type="auto">Create UI form</task>
718
+
719
+ <task type="checkpoint:human-verify">
720
+ <what-built>Complete auth flow (schema + API + UI)</what-built>
721
+ <how-to-verify>Test full flow: register, login, access protected page</how-to-verify>
722
+ <resume-signal>Type "approved"</resume-signal>
723
+ </task>
724
+ ```
725
+
726
+ ### ❌ BAD: Asking for automatable file operations
727
+
728
+ ```xml
729
+ <task type="checkpoint:human-action">
730
+ <action>Create .env file</action>
731
+ <instructions>
732
+ 1. Create .env in project root
733
+ 2. Add: DATABASE_URL=...
734
+ 3. Add: STRIPE_KEY=...
735
+ </instructions>
736
+ </task>
737
+ ```
738
+
739
+ **Why bad:** Claude has Write tool. This should be `type="auto"`.
740
+
741
+ ### ❌ BAD: Vague verification steps
742
+
743
+ ```xml
744
+ <task type="checkpoint:human-verify">
745
+ <what-built>Dashboard</what-built>
746
+ <how-to-verify>Check it works</how-to-verify>
747
+ <resume-signal>Continue</resume-signal>
748
+ </task>
749
+ ```
750
+
751
+ **Why bad:** No specifics. User doesn't know what to test or what "works" means.
752
+
753
+ ### ✅ GOOD: Specific verification steps
754
+
755
+ ```xml
756
+ <task type="checkpoint:human-verify">
757
+ <what-built>Responsive dashboard at /dashboard</what-built>
758
+ <how-to-verify>
759
+ 1. Run: npm run dev
760
+ 2. Visit: http://localhost:3000/dashboard
761
+ 3. Desktop (>1024px): Sidebar visible, content area fills remaining space
762
+ 4. Tablet (768px): Sidebar collapses to icons
763
+ 5. Mobile (375px): Sidebar hidden, hamburger menu in header
764
+ 6. Check: No horizontal scroll at any size
765
+ </how-to-verify>
766
+ <resume-signal>Type "approved" or describe layout issues</resume-signal>
767
+ </task>
768
+ ```
769
+
770
+ </anti_patterns>
771
+
772
+ <summary>
773
+
774
+ Checkpoints formalize human-in-the-loop points. Use them when Claude cannot complete a task autonomously OR when human verification is required for correctness.
775
+
776
+ **The golden rule:** If Claude CAN automate it, Claude MUST automate it.
777
+
778
+ **Checkpoint priority:**
779
+ 1. **checkpoint:human-verify** (90% of checkpoints) - Claude automated everything, human confirms visual/functional correctness
780
+ 2. **checkpoint:decision** (9% of checkpoints) - Human makes architectural/technology choices
781
+ 3. **checkpoint:human-action** (1% of checkpoints) - Truly unavoidable manual steps with no API/CLI
782
+
783
+ **When NOT to use checkpoints:**
784
+ - Things Claude can verify programmatically (tests pass, build succeeds)
785
+ - File operations (Claude can read files to verify)
786
+ - Code correctness (use tests and static analysis)
787
+ - Anything automatable via CLI/API
788
+ </summary>