create-kuckit-app 2.0.2 → 2.2.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 (62) hide show
  1. package/README.md +24 -14
  2. package/package.json +3 -1
  3. package/templates/base/.claude/skills/beads/CLAUDE.md +87 -0
  4. package/templates/base/.claude/skills/beads/README.md +123 -0
  5. package/templates/base/.claude/skills/beads/SKILL.md +77 -715
  6. package/templates/base/.claude/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +61 -0
  7. package/templates/base/.claude/skills/beads/resources/AGENTS.md +62 -0
  8. package/templates/base/.claude/skills/beads/resources/ASYNC_GATES.md +175 -0
  9. package/templates/base/.claude/skills/beads/resources/BOUNDARIES.md +520 -0
  10. package/templates/base/.claude/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  11. package/templates/base/.claude/skills/beads/resources/CLI_REFERENCE.md +561 -0
  12. package/templates/base/.claude/skills/beads/resources/DEPENDENCIES.md +754 -0
  13. package/templates/base/.claude/skills/beads/resources/INTEGRATION_PATTERNS.md +438 -0
  14. package/templates/base/.claude/skills/beads/resources/ISSUE_CREATION.md +150 -0
  15. package/templates/base/.claude/skills/beads/resources/MOLECULES.md +370 -0
  16. package/templates/base/.claude/skills/beads/resources/PATTERNS.md +363 -0
  17. package/templates/base/.claude/skills/beads/resources/RESUMABILITY.md +239 -0
  18. package/templates/base/.claude/skills/beads/resources/STATIC_DATA.md +61 -0
  19. package/templates/base/.claude/skills/beads/resources/TROUBLESHOOTING.md +537 -0
  20. package/templates/base/.claude/skills/beads/resources/WORKFLOWS.md +638 -0
  21. package/templates/base/.claude/skills/beads/resources/WORKTREES.md +95 -0
  22. package/templates/base/.claude/skills/browser-skill/SKILL.md +72 -0
  23. package/templates/base/.claude/skills/knowledge/SKILL.md +155 -205
  24. package/templates/base/.claude/skills/knowledge/reference/doc-mapping.md +49 -0
  25. package/templates/base/.claude/skills/knowledge/reference/extraction-prompts.md +102 -0
  26. package/templates/base/.claude/skills/kuckit/SKILL.md +15 -9
  27. package/templates/base/.claude/skills/kuckit/references/MODULE-DEVELOPMENT.md +142 -0
  28. package/templates/base/.claude/skills/kuckit/references/PACKAGES.md +22 -17
  29. package/templates/base/.claude/skills/kuckit/references/PUBLISHING.md +92 -0
  30. package/templates/base/.claude/skills/module-testing/SKILL.md +1 -1
  31. package/templates/base/.claude/skills/planning/SKILL.md +26 -1
  32. package/templates/base/.env.example +1 -1
  33. package/templates/base/AGENTS.md +155 -418
  34. package/templates/base/apps/server/package.json +3 -3
  35. package/templates/base/apps/server/src/modules.ts +14 -1
  36. package/templates/base/apps/web/.env.example +1 -1
  37. package/templates/base/apps/web/package.json +2 -2
  38. package/templates/base/apps/web/src/components/dashboard/nav-user.tsx +3 -3
  39. package/templates/base/apps/web/src/components/ui/sidebar.tsx +2 -1
  40. package/templates/base/apps/web/src/routes/$.tsx +0 -1
  41. package/templates/base/apps/web/src/routes/__root.tsx +7 -1
  42. package/templates/base/apps/web/src/routes/dashboard.tsx +3 -1
  43. package/templates/base/apps/web/src/routes/index.tsx +17 -22
  44. package/templates/base/apps/web/src/routes/login.tsx +81 -50
  45. package/templates/base/apps/web/tsconfig.json +1 -0
  46. package/templates/base/docs/ARCHITECTURE.md +689 -0
  47. package/templates/base/docs/DEPENDENCY-INJECTION.md +871 -0
  48. package/templates/base/docs/DEPLOYMENT.md +573 -0
  49. package/templates/base/docs/INDEX.md +135 -0
  50. package/templates/base/docs/MIGRATION.md +989 -0
  51. package/templates/base/docs/MODULE_CSS.md +343 -0
  52. package/templates/base/docs/MODULE_TESTING.md +368 -0
  53. package/templates/base/docs/MULTI_AGENT_WORKFLOW.md +909 -0
  54. package/templates/base/docs/TESTING.md +579 -0
  55. package/templates/base/docs/TROUBLESHOOTING.md +360 -0
  56. package/templates/base/drizzle.config.ts +17 -1
  57. package/templates/base/package.json +8 -6
  58. package/templates/base/packages/items-module/AGENTS.md +3 -1
  59. package/templates/base/packages/items-module/package.json +4 -4
  60. package/templates/base/packages/items-module/src/server/adapters/{item.drizzle.ts → item.repository.ts} +1 -13
  61. package/templates/base/packages/items-module/src/server/module.ts +2 -1
  62. package/templates/base/packages/items-module/src/server/schema/item.ts +13 -0
@@ -0,0 +1,438 @@
1
+ # Integration Patterns with Other Skills
2
+
3
+ How bd-issue-tracking integrates with TodoWrite, writing-plans, and other skills for optimal workflow.
4
+
5
+ ## Contents
6
+
7
+ - [TodoWrite Integration](#todowrite-integration) - Temporal layering pattern
8
+ - [writing-plans Integration](#writing-plans-integration) - Detailed implementation plans
9
+ - [Cross-Skill Workflows](#cross-skill-workflows) - Using multiple skills together
10
+ - [Decision Framework](#decision-framework) - When to use which tool
11
+
12
+ ---
13
+
14
+ ## TodoWrite Integration
15
+
16
+ **Both tools complement each other at different timescales:**
17
+
18
+ ### Temporal Layering Pattern
19
+
20
+ **TodoWrite** (short-term working memory - this hour):
21
+
22
+ - Tactical execution: "Review Section 3", "Expand Q&A answers"
23
+ - Marked completed as you go
24
+ - Present/future tense ("Review", "Expand", "Create")
25
+ - Ephemeral: Disappears when session ends
26
+
27
+ **Beads** (long-term episodic memory - this week/month):
28
+
29
+ - Strategic objectives: "Continue work on strategic planning document"
30
+ - Key decisions and outcomes in notes field
31
+ - Past tense in notes ("COMPLETED", "Discovered", "Blocked by")
32
+ - Persistent: Survives compaction and session boundaries
33
+
34
+ **Key insight**: TodoWrite = working copy for the current hour. Beads = project journal for the current month.
35
+
36
+ ### The Handoff Pattern
37
+
38
+ 1. **Session start**: Read bead → Create TodoWrite items for immediate actions
39
+ 2. **During work**: Mark TodoWrite items completed as you go
40
+ 3. **Reach milestone**: Update bead notes with outcomes + context
41
+ 4. **Session end**: TodoWrite disappears, bead survives with enriched notes
42
+
43
+ **After compaction**: TodoWrite is gone forever, but bead notes reconstruct what happened.
44
+
45
+ ### Example: TodoWrite tracks execution, Beads capture meaning
46
+
47
+ **TodoWrite (ephemeral execution view):**
48
+
49
+ ```
50
+ [completed] Implement login endpoint
51
+ [in_progress] Add password hashing with bcrypt
52
+ [pending] Create session middleware
53
+ ```
54
+
55
+ **Corresponding bead notes (persistent context):**
56
+
57
+ ```bash
58
+ bd update issue-123 --notes "COMPLETED: Login endpoint with bcrypt password
59
+ hashing (12 rounds). KEY DECISION: Using JWT tokens (not sessions) for stateless
60
+ auth - simplifies horizontal scaling. IN PROGRESS: Session middleware implementation.
61
+ NEXT: Need user input on token expiry time (1hr vs 24hr trade-off)."
62
+ ```
63
+
64
+ **What's different**:
65
+
66
+ - TodoWrite: Task names (what to do)
67
+ - Beads: Outcomes and decisions (what was learned, why it matters)
68
+
69
+ **Don't duplicate**: TodoWrite tracks execution, Beads captures meaning and context.
70
+
71
+ ### When to Update Each Tool
72
+
73
+ **Update TodoWrite** (frequently):
74
+
75
+ - Mark task completed as you finish each one
76
+ - Add new tasks as you break down work
77
+ - Update in_progress when switching tasks
78
+
79
+ **Update Beads** (at milestones):
80
+
81
+ - Completed a significant piece of work
82
+ - Made a key decision that needs documentation
83
+ - Hit a blocker that pauses progress
84
+ - About to ask user for input
85
+ - Session token usage > 70%
86
+ - End of session
87
+
88
+ **Pattern**: TodoWrite changes every few minutes. Beads updates every hour or at natural breakpoints.
89
+
90
+ ### Full Workflow Example
91
+
92
+ **Scenario**: Implement OAuth authentication (multi-session work)
93
+
94
+ **Session 1 - Planning**:
95
+
96
+ ```bash
97
+ # Create bd issue
98
+ bd create "Implement OAuth authentication" -t feature -p 0 --design "
99
+ JWT tokens with refresh rotation.
100
+ See BOUNDARIES.md for bd vs TodoWrite decision.
101
+ "
102
+
103
+ # Mark in_progress
104
+ bd update oauth-1 --status in_progress
105
+
106
+ # Create TodoWrite for today's work
107
+ TodoWrite:
108
+ - [ ] Research OAuth 2.0 refresh token flow
109
+ - [ ] Design token schema
110
+ - [ ] Set up test environment
111
+ ```
112
+
113
+ **End of Session 1**:
114
+
115
+ ```bash
116
+ # Update bd with outcomes
117
+ bd update oauth-1 --notes "COMPLETED: Researched OAuth2 refresh flow. Decided on 7-day refresh tokens.
118
+ KEY DECISION: RS256 over HS256 (enables key rotation per security review).
119
+ IN PROGRESS: Need to set up test OAuth provider.
120
+ NEXT: Configure test provider, then implement token endpoint."
121
+
122
+ # TodoWrite disappears when session ends
123
+ ```
124
+
125
+ **Session 2 - Implementation** (after compaction):
126
+
127
+ ```bash
128
+ # Read bd to reconstruct context
129
+ bd show oauth-1
130
+ # See: COMPLETED research, NEXT is configure test provider
131
+
132
+ # Create fresh TodoWrite from NEXT
133
+ TodoWrite:
134
+ - [ ] Configure test OAuth provider
135
+ - [ ] Implement token endpoint
136
+ - [ ] Add basic tests
137
+
138
+ # Work proceeds...
139
+
140
+ # Update bd at milestone
141
+ bd update oauth-1 --notes "COMPLETED: Test provider configured, token endpoint implemented.
142
+ TESTS: 5 passing (token generation, validation, expiry).
143
+ IN PROGRESS: Adding refresh token rotation.
144
+ NEXT: Implement rotation, add rate limiting, security review."
145
+ ```
146
+
147
+ **For complete decision criteria and boundaries, see:** [BOUNDARIES.md](BOUNDARIES.md)
148
+
149
+ ---
150
+
151
+ ## writing-plans Integration
152
+
153
+ **For complex multi-step features**, the design field in bd issues can link to detailed implementation plans that break work into bite-sized RED-GREEN-REFACTOR steps.
154
+
155
+ ### When to Create Detailed Plans
156
+
157
+ **Use detailed plans for:**
158
+
159
+ - Complex features with multiple components
160
+ - Multi-session work requiring systematic breakdown
161
+ - Features where TDD discipline adds value (core logic, critical paths)
162
+ - Work that benefits from explicit task sequencing
163
+
164
+ **Skip detailed plans for:**
165
+
166
+ - Simple features (single function, straightforward logic)
167
+ - Exploratory work (API testing, pattern discovery)
168
+ - Infrastructure setup (configuration, wiring)
169
+
170
+ **The test:** If you can implement it in one session without a checklist, skip the detailed plan.
171
+
172
+ ### Using the writing-plans Skill
173
+
174
+ When design field needs detailed breakdown, reference the **writing-plans** skill:
175
+
176
+ **Pattern:**
177
+
178
+ ```bash
179
+ # Create issue with high-level design
180
+ bd create "Implement OAuth token refresh" --design "
181
+ Add JWT refresh token flow with rotation.
182
+ See docs/plans/2025-10-23-oauth-refresh-design.md for detailed plan.
183
+ "
184
+
185
+ # Then use writing-plans skill to create detailed plan
186
+ # The skill creates: docs/plans/YYYY-MM-DD-<feature-name>.md
187
+ ```
188
+
189
+ **Detailed plan structure** (from writing-plans):
190
+
191
+ - Bite-sized tasks (2-5 minutes each)
192
+ - Explicit RED-GREEN-REFACTOR steps per task
193
+ - Exact file paths and complete code
194
+ - Verification commands with expected output
195
+ - Frequent commit points
196
+
197
+ **Example task from detailed plan:**
198
+
199
+ ````markdown
200
+ ### Task 1: Token Refresh Endpoint
201
+
202
+ **Files:**
203
+
204
+ - Create: `src/auth/refresh.py`
205
+ - Test: `tests/auth/test_refresh.py`
206
+
207
+ **Step 1: Write failing test**
208
+
209
+ ```python
210
+ def test_refresh_token_returns_new_access_token():
211
+ refresh_token = create_valid_refresh_token()
212
+ response = refresh_endpoint(refresh_token)
213
+ assert response.status == 200
214
+ assert response.access_token is not None
215
+ ```
216
+ ````
217
+
218
+ **Step 2: Run test to verify it fails**
219
+ Run: `pytest tests/auth/test_refresh.py::test_refresh_token_returns_new_access_token -v`
220
+ Expected: FAIL with "refresh_endpoint not defined"
221
+
222
+ **Step 3: Implement minimal code**
223
+ [... exact implementation ...]
224
+
225
+ **Step 4: Verify test passes**
226
+ [... verification ...]
227
+
228
+ **Step 5: Commit**
229
+
230
+ ```bash
231
+ git add tests/auth/test_refresh.py src/auth/refresh.py
232
+ git commit -m "feat: add token refresh endpoint"
233
+ ```
234
+
235
+ ````
236
+
237
+ ### Integration with bd Workflow
238
+
239
+ **Three-layer structure**:
240
+ 1. **bd issue**: Strategic objective + high-level design
241
+ 2. **Detailed plan** (writing-plans): Step-by-step execution guide
242
+ 3. **TodoWrite**: Current task within the plan
243
+
244
+ **During planning phase:**
245
+ 1. Create bd issue with high-level design
246
+ 2. If complex: Use writing-plans skill to create detailed plan
247
+ 3. Link plan in design field: `See docs/plans/YYYY-MM-DD-<topic>.md`
248
+
249
+ **During execution phase:**
250
+ 1. Open detailed plan (if exists)
251
+ 2. Use TodoWrite to track current task within plan
252
+ 3. Update bd notes at milestones, not per-task
253
+ 4. Close bd issue when all plan tasks complete
254
+
255
+ **Don't duplicate:** Detailed plan = execution steps. BD notes = outcomes and decisions.
256
+
257
+ **Example bd notes after using detailed plan:**
258
+ ```bash
259
+ bd update oauth-5 --notes "COMPLETED: Token refresh endpoint (5 tasks from plan: endpoint + rotation + tests)
260
+ KEY DECISION: 7-day refresh tokens (vs 30-day) - reduces risk of token theft
261
+ TESTS: All 12 tests passing (auth, rotation, expiry, error handling)"
262
+ ````
263
+
264
+ ### When NOT to Use Detailed Plans
265
+
266
+ **Red flags:**
267
+
268
+ - Feature is simple enough to implement in one pass
269
+ - Work is exploratory (discovering patterns, testing APIs)
270
+ - Infrastructure work (OAuth setup, MCP configuration)
271
+ - Would spend more time planning than implementing
272
+
273
+ **Rule of thumb:** Use detailed plans when systematic breakdown prevents mistakes, not for ceremony.
274
+
275
+ **Pattern summary**:
276
+
277
+ - **Simple feature**: bd issue only
278
+ - **Complex feature**: bd issue + TodoWrite
279
+ - **Very complex feature**: bd issue + writing-plans + TodoWrite
280
+
281
+ ---
282
+
283
+ ## Cross-Skill Workflows
284
+
285
+ ### Pattern: Research Document with Strategic Planning
286
+
287
+ **Scenario**: User asks "Help me write a strategic planning document for Q4"
288
+
289
+ **Tools used**: bd-issue-tracking + developing-strategic-documents skill
290
+
291
+ **Workflow**:
292
+
293
+ 1. Create bd issue for tracking:
294
+
295
+ ```bash
296
+ bd create "Q4 strategic planning document" -t task -p 0
297
+ bd update strat-1 --status in_progress
298
+ ```
299
+
300
+ 2. Use developing-strategic-documents skill for research and writing
301
+
302
+ 3. Update bd notes at milestones:
303
+
304
+ ```bash
305
+ bd update strat-1 --notes "COMPLETED: Research phase (reviewed 5 competitor docs, 3 internal reports)
306
+ KEY DECISION: Focus on market expansion over cost optimization per exec input
307
+ IN PROGRESS: Drafting recommendations section
308
+ NEXT: Get exec review of draft recommendations before finalizing"
309
+ ```
310
+
311
+ 4. TodoWrite tracks immediate writing tasks:
312
+ ```
313
+ - [ ] Draft recommendation 1: Market expansion
314
+ - [ ] Add supporting data from research
315
+ - [ ] Create budget estimates
316
+ ```
317
+
318
+ **Why this works**: bd preserves context across sessions (document might take days), skill provides writing framework, TodoWrite tracks current work.
319
+
320
+ ### Pattern: Multi-File Refactoring
321
+
322
+ **Scenario**: Refactor authentication system across 8 files
323
+
324
+ **Tools used**: bd-issue-tracking + systematic-debugging (if issues found)
325
+
326
+ **Workflow**:
327
+
328
+ 1. Create epic and subtasks:
329
+
330
+ ```bash
331
+ bd create "Refactor auth system to use JWT" -t epic -p 0
332
+ bd create "Update login endpoint" -t task
333
+ bd create "Update token validation" -t task
334
+ bd create "Update middleware" -t task
335
+ bd create "Update tests" -t task
336
+
337
+ # Link hierarchy
338
+ bd dep add auth-epic login-1 --type parent-child
339
+ bd dep add auth-epic validation-2 --type parent-child
340
+ bd dep add auth-epic middleware-3 --type parent-child
341
+ bd dep add auth-epic tests-4 --type parent-child
342
+
343
+ # Add ordering
344
+ bd dep add validation-2 login-1 # validation depends on login
345
+ bd dep add middleware-3 validation-2 # middleware depends on validation
346
+ bd dep add tests-4 middleware-3 # tests depend on middleware
347
+ ```
348
+
349
+ 2. Work through subtasks in order, using TodoWrite for each:
350
+
351
+ ```
352
+ Current: login-1
353
+ TodoWrite:
354
+ - [ ] Update login route signature
355
+ - [ ] Add JWT generation
356
+ - [ ] Update tests
357
+ - [ ] Verify backward compatibility
358
+ ```
359
+
360
+ 3. Update bd notes as each completes:
361
+
362
+ ```bash
363
+ bd close login-1 --reason "Updated to JWT. Tests passing. Backward compatible with session auth."
364
+ ```
365
+
366
+ 4. If issues discovered, use systematic-debugging skill + create blocker issues
367
+
368
+ **Why this works**: bd tracks dependencies and progress across files, TodoWrite focuses on current file, skills provide specialized frameworks when needed.
369
+
370
+ ---
371
+
372
+ ## Decision Framework
373
+
374
+ ### Which Tool for Which Purpose?
375
+
376
+ | Need | Tool | Why |
377
+ | -------------------------------- | ------------------------------ | -------------------------------------- |
378
+ | Track today's execution | TodoWrite | Lightweight, shows current progress |
379
+ | Preserve context across sessions | bd | Survives compaction, persistent memory |
380
+ | Detailed implementation steps | writing-plans | RED-GREEN-REFACTOR breakdown |
381
+ | Research document structure | developing-strategic-documents | Domain-specific framework |
382
+ | Debug complex issue | systematic-debugging | Structured debugging protocol |
383
+
384
+ ### Decision Tree
385
+
386
+ ```
387
+ Is this work done in this session?
388
+ ├─ Yes → Use TodoWrite only
389
+ └─ No → Use bd
390
+ ├─ Simple feature → bd issue + TodoWrite
391
+ └─ Complex feature → bd issue + writing-plans + TodoWrite
392
+
393
+ Will conversation history get compacted?
394
+ ├─ Likely → Use bd (context survives)
395
+ └─ Unlikely → TodoWrite is sufficient
396
+
397
+ Does work have dependencies or blockers?
398
+ ├─ Yes → Use bd (tracks relationships)
399
+ └─ No → TodoWrite is sufficient
400
+
401
+ Is this specialized domain work?
402
+ ├─ Research/writing → developing-strategic-documents
403
+ ├─ Complex debugging → systematic-debugging
404
+ ├─ Detailed implementation → writing-plans
405
+ └─ General tracking → bd + TodoWrite
406
+ ```
407
+
408
+ ### Integration Anti-Patterns
409
+
410
+ **Don't**:
411
+
412
+ - Duplicate TodoWrite tasks into bd notes (different purposes)
413
+ - Create bd issues for single-session linear work (use TodoWrite)
414
+ - Put detailed implementation steps in bd notes (use writing-plans)
415
+ - Update bd after every TodoWrite task (update at milestones)
416
+ - Use writing-plans for exploratory work (defeats the purpose)
417
+
418
+ **Do**:
419
+
420
+ - Update bd when changing tools or reaching milestones
421
+ - Use TodoWrite as "working copy" of bd's NEXT section
422
+ - Link between tools (bd design field → writing-plans file path)
423
+ - Choose the right level of formality for the work complexity
424
+
425
+ ---
426
+
427
+ ## Summary
428
+
429
+ **Key principle**: Each tool operates at a different timescale and level of detail.
430
+
431
+ - **TodoWrite**: Minutes to hours (current execution)
432
+ - **bd**: Hours to weeks (persistent context)
433
+ - **writing-plans**: Days to weeks (detailed breakdown)
434
+ - **Other skills**: As needed (domain frameworks)
435
+
436
+ **Integration pattern**: Use the lightest tool sufficient for the task, add heavier tools only when complexity demands it.
437
+
438
+ **For complete boundaries and decision criteria, see:** [BOUNDARIES.md](BOUNDARIES.md)
@@ -0,0 +1,150 @@
1
+ # Issue Creation Guidelines
2
+
3
+ Guidance on when and how to create bd issues for maximum effectiveness.
4
+
5
+ ## Contents
6
+
7
+ - [When to Ask First vs Create Directly](#when-to-ask)
8
+ - [Issue Quality](#quality)
9
+ - [Making Issues Resumable](#resumable)
10
+ - [Design vs Acceptance Criteria](#design-vs-acceptance)
11
+
12
+ ## When to Ask First vs Create Directly {#when-to-ask}
13
+
14
+ ### Ask the user before creating when:
15
+
16
+ - Knowledge work with fuzzy boundaries
17
+ - Task scope is unclear
18
+ - Multiple valid approaches exist
19
+ - User's intent needs clarification
20
+
21
+ ### Create directly when:
22
+
23
+ - Clear bug discovered during implementation
24
+ - Obvious follow-up work identified
25
+ - Technical debt with clear scope
26
+ - Dependency or blocker found
27
+
28
+ **Why ask first for knowledge work?** Task boundaries in strategic/research work are often unclear until discussed, whereas technical implementation tasks are usually well-defined. Discussion helps structure the work properly before creating issues, preventing poorly-scoped issues that need immediate revision.
29
+
30
+ ## Issue Quality {#quality}
31
+
32
+ Use clear, specific titles and include sufficient context in descriptions to resume work later.
33
+
34
+ ### Field Usage
35
+
36
+ **Use --design flag for:**
37
+
38
+ - Implementation approach decisions
39
+ - Architecture notes
40
+ - Trade-offs considered
41
+
42
+ **Use --acceptance flag for:**
43
+
44
+ - Definition of done
45
+ - Testing requirements
46
+ - Success metrics
47
+
48
+ ## Making Issues Resumable (Complex Technical Work) {#resumable}
49
+
50
+ For complex technical features spanning multiple sessions, enhance notes field with implementation details.
51
+
52
+ ### Optional but valuable for technical work:
53
+
54
+ - Working API query code (tested, with response structure)
55
+ - Sample API responses showing actual data
56
+ - Desired output format examples (show, don't describe)
57
+ - Research context (why this approach, what was discovered)
58
+
59
+ ### Example pattern:
60
+
61
+ ```markdown
62
+ bd update issue-9 --notes "IMPLEMENTATION GUIDE:
63
+ WORKING CODE: service.about().get(fields='importFormats')
64
+ Returns: dict with 49 entries like {'text/markdown': [...]}
65
+ OUTPUT FORMAT: # Drive Import Formats (markdown with categorized list)
66
+ CONTEXT: text/markdown support added July 2024, not in static docs"
67
+ ```
68
+
69
+ **When to add:** Multi-session technical features with APIs or specific formats. Skip for simple tasks.
70
+
71
+ **For detailed patterns and examples, read:** [RESUMABILITY.md](RESUMABILITY.md)
72
+
73
+ ## Design vs Acceptance Criteria (Critical Distinction) {#design-vs-acceptance}
74
+
75
+ Common mistake: Putting implementation details in acceptance criteria. Here's the difference:
76
+
77
+ ### DESIGN field (HOW to build it):
78
+
79
+ - "Use two-phase batchUpdate approach: insert text first, then apply formatting"
80
+ - "Parse with regex to find \* and \_ markers"
81
+ - "Use JWT tokens with 1-hour expiry"
82
+ - Trade-offs: "Chose batchUpdate over streaming API for atomicity"
83
+
84
+ ### ACCEPTANCE CRITERIA (WHAT SUCCESS LOOKS LIKE):
85
+
86
+ - "Bold and italic markdown formatting renders correctly in the Doc"
87
+ - "Solution accepts markdown input and creates Doc with specified title"
88
+ - "Returns doc_id and webViewLink to caller"
89
+ - "User tokens persist across sessions and refresh automatically"
90
+
91
+ ### Why this matters:
92
+
93
+ - Design can change during implementation (e.g., use library instead of regex)
94
+ - Acceptance criteria should remain stable across sessions
95
+ - Criteria should be **outcome-focused** ("what must be true?") not **step-focused** ("do these steps")
96
+ - Each criterion should be **verifiable** - you can definitively say yes/no
97
+
98
+ ### The pitfall
99
+
100
+ Writing criteria like "- [ ] Use batchUpdate approach" locks you into one implementation.
101
+
102
+ Better: "- [ ] Formatting is applied atomically (all at once or not at all)" - allows flexible implementation.
103
+
104
+ ### Test yourself
105
+
106
+ If you rewrote the solution using a different approach, would the acceptance criteria still apply? If not, they're design notes, not criteria.
107
+
108
+ ### Example of correct structure
109
+
110
+ ✅ **Design field:**
111
+
112
+ ```
113
+ Two-phase Docs API approach:
114
+ 1. Parse markdown to positions
115
+ 2. Create doc + insert text in one call
116
+ 3. Apply formatting in second call
117
+ Rationale: Atomic operations, easier to debug formatting separately
118
+ ```
119
+
120
+ ✅ **Acceptance criteria:**
121
+
122
+ ```
123
+ - [ ] Markdown formatting renders in Doc (bold, italic, headings)
124
+ - [ ] Lists preserve order and nesting
125
+ - [ ] Links are clickable
126
+ - [ ] Large documents (>50KB) process without timeout
127
+ ```
128
+
129
+ ❌ **Wrong (design masquerading as criteria):**
130
+
131
+ ```
132
+ - [ ] Use two-phase batchUpdate approach
133
+ - [ ] Apply formatting in second batchUpdate call
134
+ ```
135
+
136
+ ## Quick Reference
137
+
138
+ **Creating good issues:**
139
+
140
+ 1. **Title**: Clear, specific, action-oriented
141
+ 2. **Description**: Problem statement, context, why it matters
142
+ 3. **Design**: Approach, architecture, trade-offs (can change)
143
+ 4. **Acceptance**: Outcomes, success criteria (should be stable)
144
+ 5. **Notes**: Implementation details, session handoffs (evolves over time)
145
+
146
+ **Common mistakes:**
147
+
148
+ - Vague titles: "Fix bug" → "Fix: auth token expires before refresh"
149
+ - Implementation in acceptance: "Use JWT" → "Auth tokens persist across sessions"
150
+ - Missing context: "Update database" → "Update database: add user_last_login for session analytics"