pmp-gywd 3.3.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 (126) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +567 -0
  3. package/bin/install.js +348 -0
  4. package/commands/gywd/add-phase.md +207 -0
  5. package/commands/gywd/anticipate.md +271 -0
  6. package/commands/gywd/bootstrap.md +336 -0
  7. package/commands/gywd/challenge.md +344 -0
  8. package/commands/gywd/check-drift.md +144 -0
  9. package/commands/gywd/complete-milestone.md +106 -0
  10. package/commands/gywd/consider-issues.md +202 -0
  11. package/commands/gywd/context.md +93 -0
  12. package/commands/gywd/create-roadmap.md +115 -0
  13. package/commands/gywd/deps.md +169 -0
  14. package/commands/gywd/digest.md +138 -0
  15. package/commands/gywd/discuss-milestone.md +47 -0
  16. package/commands/gywd/discuss-phase.md +60 -0
  17. package/commands/gywd/execute-plan.md +161 -0
  18. package/commands/gywd/extract-decisions.md +325 -0
  19. package/commands/gywd/health.md +150 -0
  20. package/commands/gywd/help.md +556 -0
  21. package/commands/gywd/history.md +278 -0
  22. package/commands/gywd/impact.md +317 -0
  23. package/commands/gywd/init.md +95 -0
  24. package/commands/gywd/insert-phase.md +227 -0
  25. package/commands/gywd/list-phase-assumptions.md +50 -0
  26. package/commands/gywd/map-codebase.md +84 -0
  27. package/commands/gywd/memory.md +159 -0
  28. package/commands/gywd/new-milestone.md +59 -0
  29. package/commands/gywd/new-project.md +315 -0
  30. package/commands/gywd/pause-work.md +123 -0
  31. package/commands/gywd/plan-fix.md +205 -0
  32. package/commands/gywd/plan-phase.md +93 -0
  33. package/commands/gywd/preview-plan.md +139 -0
  34. package/commands/gywd/profile.md +363 -0
  35. package/commands/gywd/progress.md +317 -0
  36. package/commands/gywd/remove-phase.md +338 -0
  37. package/commands/gywd/research-phase.md +91 -0
  38. package/commands/gywd/resume-work.md +40 -0
  39. package/commands/gywd/rollback.md +179 -0
  40. package/commands/gywd/status.md +42 -0
  41. package/commands/gywd/sync-github.md +234 -0
  42. package/commands/gywd/verify-work.md +71 -0
  43. package/commands/gywd/why.md +251 -0
  44. package/docs/COMMANDS.md +722 -0
  45. package/docs/CONTRIBUTING.md +342 -0
  46. package/docs/EXAMPLES.md +535 -0
  47. package/docs/GETTING-STARTED.md +262 -0
  48. package/docs/README.md +55 -0
  49. package/docs/RELEASING.md +159 -0
  50. package/get-your-work-done/core/agent-patterns.md +331 -0
  51. package/get-your-work-done/core/architecture.md +334 -0
  52. package/get-your-work-done/core/context-model-schema.json +154 -0
  53. package/get-your-work-done/core/decisions-schema.json +193 -0
  54. package/get-your-work-done/core/learning-state-schema.json +133 -0
  55. package/get-your-work-done/core/profile-schema.json +257 -0
  56. package/get-your-work-done/references/adaptive-decomposition.md +175 -0
  57. package/get-your-work-done/references/checkpoints.md +287 -0
  58. package/get-your-work-done/references/confidence-scoring.md +169 -0
  59. package/get-your-work-done/references/continuation-format.md +255 -0
  60. package/get-your-work-done/references/git-integration.md +254 -0
  61. package/get-your-work-done/references/plan-format.md +428 -0
  62. package/get-your-work-done/references/principles.md +157 -0
  63. package/get-your-work-done/references/questioning.md +162 -0
  64. package/get-your-work-done/references/research-pitfalls.md +215 -0
  65. package/get-your-work-done/references/scope-estimation.md +172 -0
  66. package/get-your-work-done/references/tdd.md +263 -0
  67. package/get-your-work-done/templates/codebase/architecture.md +255 -0
  68. package/get-your-work-done/templates/codebase/concerns.md +310 -0
  69. package/get-your-work-done/templates/codebase/conventions.md +307 -0
  70. package/get-your-work-done/templates/codebase/integrations.md +280 -0
  71. package/get-your-work-done/templates/codebase/stack.md +186 -0
  72. package/get-your-work-done/templates/codebase/structure.md +285 -0
  73. package/get-your-work-done/templates/codebase/testing.md +480 -0
  74. package/get-your-work-done/templates/config.json +18 -0
  75. package/get-your-work-done/templates/context.md +161 -0
  76. package/get-your-work-done/templates/continue-here.md +78 -0
  77. package/get-your-work-done/templates/discovery.md +146 -0
  78. package/get-your-work-done/templates/issues.md +32 -0
  79. package/get-your-work-done/templates/milestone-archive.md +123 -0
  80. package/get-your-work-done/templates/milestone-context.md +93 -0
  81. package/get-your-work-done/templates/milestone.md +115 -0
  82. package/get-your-work-done/templates/phase-prompt.md +303 -0
  83. package/get-your-work-done/templates/project.md +184 -0
  84. package/get-your-work-done/templates/research.md +529 -0
  85. package/get-your-work-done/templates/roadmap.md +196 -0
  86. package/get-your-work-done/templates/state.md +210 -0
  87. package/get-your-work-done/templates/summary.md +273 -0
  88. package/get-your-work-done/templates/uat-issues.md +143 -0
  89. package/get-your-work-done/workflows/complete-milestone.md +643 -0
  90. package/get-your-work-done/workflows/create-milestone.md +416 -0
  91. package/get-your-work-done/workflows/create-roadmap.md +481 -0
  92. package/get-your-work-done/workflows/discovery-phase.md +293 -0
  93. package/get-your-work-done/workflows/discuss-milestone.md +236 -0
  94. package/get-your-work-done/workflows/discuss-phase.md +247 -0
  95. package/get-your-work-done/workflows/execute-phase.md +1625 -0
  96. package/get-your-work-done/workflows/list-phase-assumptions.md +178 -0
  97. package/get-your-work-done/workflows/map-codebase.md +434 -0
  98. package/get-your-work-done/workflows/plan-phase.md +488 -0
  99. package/get-your-work-done/workflows/research-phase.md +436 -0
  100. package/get-your-work-done/workflows/resume-project.md +287 -0
  101. package/get-your-work-done/workflows/transition.md +580 -0
  102. package/get-your-work-done/workflows/verify-work.md +202 -0
  103. package/lib/automation/dependency-analyzer.js +635 -0
  104. package/lib/automation/doc-generator.js +643 -0
  105. package/lib/automation/index.js +42 -0
  106. package/lib/automation/test-generator.js +628 -0
  107. package/lib/context/context-analyzer.js +554 -0
  108. package/lib/context/context-cache.js +426 -0
  109. package/lib/context/context-predictor.js +622 -0
  110. package/lib/context/index.js +44 -0
  111. package/lib/memory/confidence-calibrator.js +484 -0
  112. package/lib/memory/feedback-collector.js +551 -0
  113. package/lib/memory/global-memory.js +465 -0
  114. package/lib/memory/index.js +75 -0
  115. package/lib/memory/pattern-aggregator.js +487 -0
  116. package/lib/memory/team-sync.js +501 -0
  117. package/lib/profile/index.js +24 -0
  118. package/lib/profile/pattern-learner.js +303 -0
  119. package/lib/profile/profile-manager.js +445 -0
  120. package/lib/questioning/index.js +49 -0
  121. package/lib/questioning/question-engine.js +311 -0
  122. package/lib/questioning/question-templates.js +315 -0
  123. package/lib/validators/command-validator.js +188 -0
  124. package/lib/validators/index.js +29 -0
  125. package/lib/validators/schema-validator.js +183 -0
  126. package/package.json +61 -0
@@ -0,0 +1,254 @@
1
+ <overview>
2
+ Git integration for GYWD framework.
3
+ </overview>
4
+
5
+ <core_principle>
6
+
7
+ **Commit outcomes, not process.**
8
+
9
+ The git log should read like a changelog of what shipped, not a diary of planning activity.
10
+ </core_principle>
11
+
12
+ <commit_points>
13
+
14
+ | Event | Commit? | Why |
15
+ | ----------------------- | ------- | ------------------------------------------------ |
16
+ | BRIEF + ROADMAP created | YES | Project initialization |
17
+ | PLAN.md created | NO | Intermediate - commit with plan completion |
18
+ | RESEARCH.md created | NO | Intermediate |
19
+ | DISCOVERY.md created | NO | Intermediate |
20
+ | **Task completed** | YES | Atomic unit of work (1 commit per task) |
21
+ | **Plan completed** | YES | Metadata commit (SUMMARY + STATE + ROADMAP) |
22
+ | Handoff created | YES | WIP state preserved |
23
+
24
+ </commit_points>
25
+
26
+ <git_check>
27
+
28
+ ```bash
29
+ [ -d .git ] && echo "GIT_EXISTS" || echo "NO_GIT"
30
+ ```
31
+
32
+ If NO_GIT: Run `git init` silently. GYWD projects always get their own repo.
33
+ </git_check>
34
+
35
+ <commit_formats>
36
+
37
+ <format name="initialization">
38
+ ## Project Initialization (brief + roadmap together)
39
+
40
+ ```
41
+ docs: initialize [project-name] ([N] phases)
42
+
43
+ [One-liner from PROJECT.md]
44
+
45
+ Phases:
46
+ 1. [phase-name]: [goal]
47
+ 2. [phase-name]: [goal]
48
+ 3. [phase-name]: [goal]
49
+ ```
50
+
51
+ What to commit:
52
+
53
+ ```bash
54
+ git add .planning/
55
+ git commit
56
+ ```
57
+
58
+ </format>
59
+
60
+ <format name="task-completion">
61
+ ## Task Completion (During Plan Execution)
62
+
63
+ Each task gets its own commit immediately after completion.
64
+
65
+ ```
66
+ {type}({phase}-{plan}): {task-name}
67
+
68
+ - [Key change 1]
69
+ - [Key change 2]
70
+ - [Key change 3]
71
+ ```
72
+
73
+ **Commit types:**
74
+ - `feat` - New feature/functionality
75
+ - `fix` - Bug fix
76
+ - `test` - Test-only (TDD RED phase)
77
+ - `refactor` - Code cleanup (TDD REFACTOR phase)
78
+ - `perf` - Performance improvement
79
+ - `chore` - Dependencies, config, tooling
80
+
81
+ **Examples:**
82
+
83
+ ```bash
84
+ # Standard task
85
+ git add src/api/auth.ts src/types/user.ts
86
+ git commit -m "feat(08-02): create user registration endpoint
87
+
88
+ - POST /auth/register validates email and password
89
+ - Checks for duplicate users
90
+ - Returns JWT token on success
91
+ "
92
+
93
+ # TDD task - RED phase
94
+ git add src/__tests__/jwt.test.ts
95
+ git commit -m "test(07-02): add failing test for JWT generation
96
+
97
+ - Tests token contains user ID claim
98
+ - Tests token expires in 1 hour
99
+ - Tests signature verification
100
+ "
101
+
102
+ # TDD task - GREEN phase
103
+ git add src/utils/jwt.ts
104
+ git commit -m "feat(07-02): implement JWT generation
105
+
106
+ - Uses jose library for signing
107
+ - Includes user ID and expiry claims
108
+ - Signs with HS256 algorithm
109
+ "
110
+ ```
111
+
112
+ </format>
113
+
114
+ <format name="plan-completion">
115
+ ## Plan Completion (After All Tasks Done)
116
+
117
+ After all tasks committed, one final metadata commit captures plan completion.
118
+
119
+ ```
120
+ docs({phase}-{plan}): complete [plan-name] plan
121
+
122
+ Tasks completed: [N]/[N]
123
+ - [Task 1 name]
124
+ - [Task 2 name]
125
+ - [Task 3 name]
126
+
127
+ SUMMARY: .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md
128
+ ```
129
+
130
+ What to commit:
131
+
132
+ ```bash
133
+ git add .planning/phases/XX-name/{phase}-{plan}-PLAN.md
134
+ git add .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md
135
+ git add .planning/STATE.md
136
+ git add .planning/ROADMAP.md
137
+ git commit
138
+ ```
139
+
140
+ **Note:** Code files NOT included - already committed per-task.
141
+
142
+ </format>
143
+
144
+ <format name="handoff">
145
+ ## Handoff (WIP)
146
+
147
+ ```
148
+ wip: [phase-name] paused at task [X]/[Y]
149
+
150
+ Current: [task name]
151
+ [If blocked:] Blocked: [reason]
152
+ ```
153
+
154
+ What to commit:
155
+
156
+ ```bash
157
+ git add .planning/
158
+ git commit
159
+ ```
160
+
161
+ </format>
162
+ </commit_formats>
163
+
164
+ <example_log>
165
+
166
+ **Old approach (per-plan commits):**
167
+ ```
168
+ a7f2d1 feat(checkout): Stripe payments with webhook verification
169
+ 3e9c4b feat(products): catalog with search, filters, and pagination
170
+ 8a1b2c feat(auth): JWT with refresh rotation using jose
171
+ 5c3d7e feat(foundation): Next.js 15 + Prisma + Tailwind scaffold
172
+ 2f4a8d docs: initialize ecommerce-app (5 phases)
173
+ ```
174
+
175
+ **New approach (per-task commits):**
176
+ ```
177
+ # Phase 04 - Checkout
178
+ 1a2b3c docs(04-01): complete checkout flow plan
179
+ 4d5e6f feat(04-01): add webhook signature verification
180
+ 7g8h9i feat(04-01): implement payment session creation
181
+ 0j1k2l feat(04-01): create checkout page component
182
+
183
+ # Phase 03 - Products
184
+ 3m4n5o docs(03-02): complete product listing plan
185
+ 6p7q8r feat(03-02): add pagination controls
186
+ 9s0t1u feat(03-02): implement search and filters
187
+ 2v3w4x feat(03-01): create product catalog schema
188
+
189
+ # Phase 02 - Auth
190
+ 5y6z7a docs(02-02): complete token refresh plan
191
+ 8b9c0d feat(02-02): implement refresh token rotation
192
+ 1e2f3g test(02-02): add failing test for token refresh
193
+ 4h5i6j docs(02-01): complete JWT setup plan
194
+ 7k8l9m feat(02-01): add JWT generation and validation
195
+ 0n1o2p chore(02-01): install jose library
196
+
197
+ # Phase 01 - Foundation
198
+ 3q4r5s docs(01-01): complete scaffold plan
199
+ 6t7u8v feat(01-01): configure Tailwind and globals
200
+ 9w0x1y feat(01-01): set up Prisma with database
201
+ 2z3a4b feat(01-01): create Next.js 15 project
202
+
203
+ # Initialization
204
+ 5c6d7e docs: initialize ecommerce-app (5 phases)
205
+ ```
206
+
207
+ Each plan produces 2-4 commits (tasks + metadata). Clear, granular, bisectable.
208
+
209
+ </example_log>
210
+
211
+ <anti_patterns>
212
+
213
+ **Still don't commit (intermediate artifacts):**
214
+ - PLAN.md creation (commit with plan completion)
215
+ - RESEARCH.md (intermediate)
216
+ - DISCOVERY.md (intermediate)
217
+ - Minor planning tweaks
218
+ - "Fixed typo in roadmap"
219
+
220
+ **Do commit (outcomes):**
221
+ - Each task completion (feat/fix/test/refactor)
222
+ - Plan completion metadata (docs)
223
+ - Project initialization (docs)
224
+
225
+ **Key principle:** Commit working code and shipped outcomes, not planning process.
226
+
227
+ </anti_patterns>
228
+
229
+ <commit_strategy_rationale>
230
+
231
+ ## Why Per-Task Commits?
232
+
233
+ **Context engineering for AI:**
234
+ - Git history becomes primary context source for future Claude sessions
235
+ - `git log --grep="{phase}-{plan}"` shows all work for a plan
236
+ - `git diff <hash>^..<hash>` shows exact changes per task
237
+ - Less reliance on parsing SUMMARY.md = more context for actual work
238
+
239
+ **Failure recovery:**
240
+ - Task 1 committed ✅, Task 2 failed ❌
241
+ - Claude in next session: sees task 1 complete, can retry task 2
242
+ - Can `git reset --hard` to last successful task
243
+
244
+ **Debugging:**
245
+ - `git bisect` finds exact failing task, not just failing plan
246
+ - `git blame` traces line to specific task context
247
+ - Each commit is independently revertable
248
+
249
+ **Observability:**
250
+ - Solo developer + Claude workflow benefits from granular attribution
251
+ - Atomic commits are git best practice
252
+ - "Commit noise" irrelevant when consumer is Claude, not humans
253
+
254
+ </commit_strategy_rationale>
@@ -0,0 +1,428 @@
1
+ <overview>
2
+ Claude-executable plans have a specific format that enables Claude to implement without interpretation. This reference defines what makes a plan executable vs. vague.
3
+
4
+ **Key insight:** PLAN.md IS the executable prompt. It contains everything Claude needs to execute the phase, including objective, context references, tasks, verification, success criteria, and output specification.
5
+ </overview>
6
+
7
+ <core_principle>
8
+ A plan is Claude-executable when Claude can read the PLAN.md and immediately start implementing without asking clarifying questions.
9
+
10
+ If Claude has to guess, interpret, or make assumptions - the task is too vague.
11
+ </core_principle>
12
+
13
+ <prompt_structure>
14
+ Every PLAN.md follows this XML structure:
15
+
16
+ ```markdown
17
+ ---
18
+ phase: XX-name
19
+ type: execute
20
+ domain: [optional]
21
+ ---
22
+
23
+ <objective>
24
+ [What and why]
25
+ Purpose: [...]
26
+ Output: [...]
27
+ </objective>
28
+
29
+ <context>
30
+ @.planning/PROJECT.md
31
+ @.planning/ROADMAP.md
32
+ @relevant/source/files.ts
33
+ </context>
34
+
35
+ <tasks>
36
+ <task type="auto">
37
+ <name>Task N: [Name]</name>
38
+ <files>[paths]</files>
39
+ <action>[what to do, what to avoid and WHY]</action>
40
+ <verify>[command/check]</verify>
41
+ <done>[criteria]</done>
42
+ </task>
43
+
44
+ <task type="checkpoint:human-verify" gate="blocking">
45
+ <what-built>[what Claude automated]</what-built>
46
+ <how-to-verify>[numbered verification steps]</how-to-verify>
47
+ <resume-signal>[how to continue - "approved" or describe issues]</resume-signal>
48
+ </task>
49
+
50
+ <task type="checkpoint:decision" gate="blocking">
51
+ <decision>[what needs deciding]</decision>
52
+ <context>[why this matters]</context>
53
+ <options>
54
+ <option id="option-a"><name>[Name]</name><pros>[pros]</pros><cons>[cons]</cons></option>
55
+ <option id="option-b"><name>[Name]</name><pros>[pros]</pros><cons>[cons]</cons></option>
56
+ </options>
57
+ <resume-signal>[how to indicate choice]</resume-signal>
58
+ </task>
59
+ </tasks>
60
+
61
+ <verification>
62
+ [Overall phase checks]
63
+ </verification>
64
+
65
+ <success_criteria>
66
+ [Measurable completion]
67
+ </success_criteria>
68
+
69
+ <output>
70
+ [SUMMARY.md specification]
71
+ </output>
72
+ ```
73
+
74
+ </prompt_structure>
75
+
76
+ <task_anatomy>
77
+ Every task has four required fields:
78
+
79
+ <field name="files">
80
+ **What it is**: Exact file paths that will be created or modified.
81
+
82
+ **Good**: `src/app/api/auth/login/route.ts`, `prisma/schema.prisma`
83
+ **Bad**: "the auth files", "relevant components"
84
+
85
+ Be specific. If you don't know the file path, figure it out first.
86
+ </field>
87
+
88
+ <field name="action">
89
+ **What it is**: Specific implementation instructions, including what to avoid and WHY.
90
+
91
+ **Good**: "Create POST endpoint that accepts {email, password}, validates using bcrypt against User table, returns JWT in httpOnly cookie with 15-min expiry. Use jose library (not jsonwebtoken - CommonJS issues with Next.js Edge runtime)."
92
+
93
+ **Bad**: "Add authentication", "Make login work"
94
+
95
+ Include: technology choices, data structures, behavior details, pitfalls to avoid.
96
+ </field>
97
+
98
+ <field name="verify">
99
+ **What it is**: How to prove the task is complete.
100
+
101
+ **Good**:
102
+
103
+ - `npm test` passes
104
+ - `curl -X POST /api/auth/login` returns 200 with Set-Cookie header
105
+ - Build completes without errors
106
+
107
+ **Bad**: "It works", "Looks good", "User can log in"
108
+
109
+ Must be executable - a command, a test, an observable behavior.
110
+ </field>
111
+
112
+ <field name="done">
113
+ **What it is**: Acceptance criteria - the measurable state of completion.
114
+
115
+ **Good**: "Valid credentials return 200 + JWT cookie, invalid credentials return 401"
116
+
117
+ **Bad**: "Authentication is complete"
118
+
119
+ Should be testable without subjective judgment.
120
+ </field>
121
+ </task_anatomy>
122
+
123
+ <task_types>
124
+ Tasks have a `type` attribute that determines how they execute:
125
+
126
+ <type name="auto">
127
+ **Default task type** - Claude executes autonomously.
128
+
129
+ **Structure:**
130
+
131
+ ```xml
132
+ <task type="auto">
133
+ <name>Task 3: Create login endpoint with JWT</name>
134
+ <files>src/app/api/auth/login/route.ts</files>
135
+ <action>POST endpoint accepting {email, password}. Query User by email, compare password with bcrypt. On match, create JWT with jose library, set as httpOnly cookie (15-min expiry). Return 200. On mismatch, return 401.</action>
136
+ <verify>curl -X POST localhost:3000/api/auth/login returns 200 with Set-Cookie header</verify>
137
+ <done>Valid credentials → 200 + cookie. Invalid → 401.</done>
138
+ </task>
139
+ ```
140
+
141
+ Use for: Everything Claude can do independently (code, tests, builds, file operations).
142
+ </type>
143
+
144
+ <type name="checkpoint:human-action">
145
+ **RARELY USED** - Only for actions with NO CLI/API. Claude automates everything possible first.
146
+
147
+ **Structure:**
148
+
149
+ ```xml
150
+ <task type="checkpoint:human-action" gate="blocking">
151
+ <action>[Unavoidable manual step - email link, 2FA code]</action>
152
+ <instructions>
153
+ [What Claude already automated]
154
+ [The ONE thing requiring human action]
155
+ </instructions>
156
+ <verification>[What Claude can check afterward]</verification>
157
+ <resume-signal>[How to continue]</resume-signal>
158
+ </task>
159
+ ```
160
+
161
+ Use ONLY for: Email verification links, SMS 2FA codes, manual approvals with no API, 3D Secure payment flows.
162
+
163
+ Do NOT use for: Anything with a CLI (Vercel, Stripe, Upstash, Railway, GitHub), builds, tests, file creation, deployments.
164
+
165
+ **Execution:** Claude automates everything with CLI/API, stops only for truly unavoidable manual steps.
166
+ </type>
167
+
168
+ <type name="checkpoint:human-verify">
169
+ **Human must verify Claude's work** - Visual checks, UX testing.
170
+
171
+ **Structure:**
172
+
173
+ ```xml
174
+ <task type="checkpoint:human-verify" gate="blocking">
175
+ <what-built>Responsive dashboard layout</what-built>
176
+ <how-to-verify>
177
+ 1. Run: npm run dev
178
+ 2. Visit: http://localhost:3000/dashboard
179
+ 3. Desktop (>1024px): Verify sidebar left, content right
180
+ 4. Tablet (768px): Verify sidebar collapses to hamburger
181
+ 5. Mobile (375px): Verify single column, bottom nav
182
+ 6. Check: No layout shift, no horizontal scroll
183
+ </how-to-verify>
184
+ <resume-signal>Type "approved" or describe issues</resume-signal>
185
+ </task>
186
+ ```
187
+
188
+ Use for: UI/UX verification, visual design checks, animation smoothness, accessibility testing.
189
+
190
+ **Execution:** Claude builds the feature, stops, provides testing instructions, waits for approval/feedback.
191
+ </type>
192
+
193
+ <type name="checkpoint:decision">
194
+ **Human must make implementation choice** - Direction-setting decisions.
195
+
196
+ **Structure:**
197
+
198
+ ```xml
199
+ <task type="checkpoint:decision" gate="blocking">
200
+ <decision>Select authentication provider</decision>
201
+ <context>We need user authentication. Three approaches with different tradeoffs:</context>
202
+ <options>
203
+ <option id="supabase">
204
+ <name>Supabase Auth</name>
205
+ <pros>Built-in with Supabase, generous free tier</pros>
206
+ <cons>Less customizable UI, tied to ecosystem</cons>
207
+ </option>
208
+ <option id="clerk">
209
+ <name>Clerk</name>
210
+ <pros>Beautiful pre-built UI, best DX</pros>
211
+ <cons>Paid after 10k MAU</cons>
212
+ </option>
213
+ <option id="nextauth">
214
+ <name>NextAuth.js</name>
215
+ <pros>Free, self-hosted, maximum control</pros>
216
+ <cons>More setup, you manage security</cons>
217
+ </option>
218
+ </options>
219
+ <resume-signal>Select: supabase, clerk, or nextauth</resume-signal>
220
+ </task>
221
+ ```
222
+
223
+ Use for: Technology selection, architecture decisions, design choices, feature prioritization.
224
+
225
+ **Execution:** Claude presents options with balanced pros/cons, waits for decision, proceeds with chosen direction.
226
+ </type>
227
+
228
+ **When to use checkpoints:**
229
+
230
+ - Visual/UX verification (after Claude builds) → `checkpoint:human-verify`
231
+ - Implementation direction choice → `checkpoint:decision`
232
+ - Truly unavoidable manual actions (email links, 2FA) → `checkpoint:human-action` (rare)
233
+
234
+ **When NOT to use checkpoints:**
235
+
236
+ - Anything with CLI/API (Claude automates it) → `type="auto"`
237
+ - Deployments (Vercel, Railway, Fly) → `type="auto"` with CLI
238
+ - Creating resources (Upstash, Stripe, GitHub) → `type="auto"` with CLI/API
239
+ - File operations, tests, builds → `type="auto"`
240
+
241
+ **Golden rule:** If Claude CAN automate it, Claude MUST automate it.
242
+
243
+ See `./checkpoints.md` for comprehensive checkpoint guidance.
244
+ </task_types>
245
+
246
+ <tdd_plans>
247
+ **TDD work uses dedicated plans.**
248
+
249
+ TDD features require 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. This is fundamentally heavier than standard tasks and would consume 50-60% of context if embedded in a multi-task plan.
250
+
251
+ **When to create a TDD plan:**
252
+ - Business logic with defined inputs/outputs
253
+ - API endpoints with request/response contracts
254
+ - Data transformations and parsing
255
+ - Validation rules
256
+ - Algorithms with testable behavior
257
+
258
+ **When to use standard plans (skip TDD):**
259
+ - UI layout and styling
260
+ - Configuration changes
261
+ - Glue code connecting existing components
262
+ - One-off scripts
263
+
264
+ **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
265
+ → Yes: Create a TDD plan (one feature per plan)
266
+ → No: Use standard plan, add tests after if needed
267
+
268
+ See `./tdd.md` for TDD plan structure and execution guidance.
269
+ </tdd_plans>
270
+
271
+ <context_references>
272
+ Use @file references to load context for the prompt:
273
+
274
+ ```markdown
275
+ <context>
276
+ @.planning/PROJECT.md # Project vision
277
+ @.planning/ROADMAP.md # Phase structure
278
+ @.planning/phases/02-auth/DISCOVERY.md # Discovery results
279
+ @src/lib/db.ts # Existing database setup
280
+ @src/types/user.ts # Existing type definitions
281
+ </context>
282
+ ```
283
+
284
+ Reference files that Claude needs to understand before implementing.
285
+ </context_references>
286
+
287
+ <verification_section>
288
+ Overall phase verification (beyond individual task verification):
289
+
290
+ ```markdown
291
+ <verification>
292
+ Before declaring phase complete:
293
+ - [ ] `npm run build` succeeds without errors
294
+ - [ ] `npm test` passes all tests
295
+ - [ ] No TypeScript errors
296
+ - [ ] Feature works end-to-end manually
297
+ </verification>
298
+ ```
299
+
300
+ </verification_section>
301
+
302
+ <success_criteria_section>
303
+ Measurable criteria for phase completion:
304
+
305
+ ```markdown
306
+ <success_criteria>
307
+
308
+ - All tasks completed
309
+ - All verification checks pass
310
+ - No errors or warnings introduced
311
+ - JWT auth flow works end-to-end
312
+ - Protected routes redirect unauthenticated users
313
+ </success_criteria>
314
+ ```
315
+
316
+ </success_criteria_section>
317
+
318
+ <output_section>
319
+ Specify the SUMMARY.md structure:
320
+
321
+ ```markdown
322
+ <output>
323
+ After completion, create `.planning/phases/XX-name/SUMMARY.md`:
324
+
325
+ # Phase X: Name Summary
326
+
327
+ **[Substantive one-liner]**
328
+
329
+ ## Accomplishments
330
+
331
+ ## Files Created/Modified
332
+
333
+ ## Decisions Made
334
+
335
+ ## Issues Encountered
336
+
337
+ ## Next Phase Readiness
338
+
339
+ </output>
340
+ ```
341
+
342
+ </output_section>
343
+
344
+ <specificity_levels>
345
+ <too_vague>
346
+
347
+ ```xml
348
+ <task type="auto">
349
+ <name>Task 1: Add authentication</name>
350
+ <files>???</files>
351
+ <action>Implement auth</action>
352
+ <verify>???</verify>
353
+ <done>Users can authenticate</done>
354
+ </task>
355
+ ```
356
+
357
+ Claude: "How? What type? What library? Where?"
358
+ </too_vague>
359
+
360
+ <just_right>
361
+
362
+ ```xml
363
+ <task type="auto">
364
+ <name>Task 1: Create login endpoint with JWT</name>
365
+ <files>src/app/api/auth/login/route.ts</files>
366
+ <action>POST endpoint accepting {email, password}. Query User by email, compare password with bcrypt. On match, create JWT with jose library, set as httpOnly cookie (15-min expiry). Return 200. On mismatch, return 401. Use jose instead of jsonwebtoken (CommonJS issues with Edge).</action>
367
+ <verify>curl -X POST localhost:3000/api/auth/login -H "Content-Type: application/json" -d '{"email":"test@test.com","password":"test123"}' returns 200 with Set-Cookie header containing JWT</verify>
368
+ <done>Valid credentials → 200 + cookie. Invalid → 401. Missing fields → 400.</done>
369
+ </task>
370
+ ```
371
+
372
+ Claude can implement this immediately.
373
+ </just_right>
374
+
375
+ <note_on_tdd>
376
+ **TDD candidates get dedicated plans.**
377
+
378
+ If email validation warrants TDD, create a TDD plan for it. See `./tdd.md` for TDD plan structure.
379
+ </note_on_tdd>
380
+
381
+ <too_detailed>
382
+ Writing the actual code in the plan. Trust Claude to implement from clear instructions.
383
+ </too_detailed>
384
+ </specificity_levels>
385
+
386
+ <anti_patterns>
387
+ <vague_actions>
388
+
389
+ - "Set up the infrastructure"
390
+ - "Handle edge cases"
391
+ - "Make it production-ready"
392
+ - "Add proper error handling"
393
+
394
+ These require Claude to decide WHAT to do. Specify it.
395
+ </vague_actions>
396
+
397
+ <unverifiable_completion>
398
+
399
+ - "It works correctly"
400
+ - "User experience is good"
401
+ - "Code is clean"
402
+ - "Tests pass" (which tests? do they exist?)
403
+
404
+ These require subjective judgment. Make it objective.
405
+ </unverifiable_completion>
406
+
407
+ <missing_context>
408
+
409
+ - "Use the standard approach"
410
+ - "Follow best practices"
411
+ - "Like the other endpoints"
412
+
413
+ Claude doesn't know your standards. Be explicit.
414
+ </missing_context>
415
+ </anti_patterns>
416
+
417
+ <sizing_tasks>
418
+ Good task size: 15-60 minutes of Claude work.
419
+
420
+ **Too small**: "Add import statement for bcrypt" (combine with related task)
421
+ **Just right**: "Create login endpoint with JWT validation" (focused, specific)
422
+ **Too big**: "Implement full authentication system" (split into multiple plans)
423
+
424
+ If a task takes multiple sessions, break it down.
425
+ If a task is trivial, combine with related tasks.
426
+
427
+ **Note on scope:** If a phase has >3 tasks or spans multiple subsystems, split into multiple plans using the naming convention `{phase}-{plan}-PLAN.md`. See `./scope-estimation.md` for guidance.
428
+ </sizing_tasks>