@qazuor/claude-code-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1248 -0
  3. package/dist/bin.cjs +11886 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.d.cts +1 -0
  6. package/dist/bin.d.ts +1 -0
  7. package/dist/bin.js +11869 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/index.cjs +3887 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +1325 -0
  12. package/dist/index.d.ts +1325 -0
  13. package/dist/index.js +3835 -0
  14. package/dist/index.js.map +1 -0
  15. package/package.json +86 -0
  16. package/templates/.log/notifications.log +1775 -0
  17. package/templates/agents/README.md +164 -0
  18. package/templates/agents/_registry.json +443 -0
  19. package/templates/agents/design/content-writer.md +353 -0
  20. package/templates/agents/design/ux-ui-designer.md +382 -0
  21. package/templates/agents/engineering/astro-engineer.md +293 -0
  22. package/templates/agents/engineering/db-drizzle-engineer.md +360 -0
  23. package/templates/agents/engineering/express-engineer.md +316 -0
  24. package/templates/agents/engineering/fastify-engineer.md +399 -0
  25. package/templates/agents/engineering/hono-engineer.md +263 -0
  26. package/templates/agents/engineering/mongoose-engineer.md +473 -0
  27. package/templates/agents/engineering/nestjs-engineer.md +429 -0
  28. package/templates/agents/engineering/nextjs-engineer.md +451 -0
  29. package/templates/agents/engineering/node-typescript-engineer.md +347 -0
  30. package/templates/agents/engineering/prisma-engineer.md +432 -0
  31. package/templates/agents/engineering/react-senior-dev.md +394 -0
  32. package/templates/agents/engineering/tanstack-start-engineer.md +447 -0
  33. package/templates/agents/engineering/tech-lead.md +269 -0
  34. package/templates/agents/product/product-functional.md +329 -0
  35. package/templates/agents/product/product-technical.md +578 -0
  36. package/templates/agents/quality/debugger.md +514 -0
  37. package/templates/agents/quality/qa-engineer.md +390 -0
  38. package/templates/agents/specialized/enrichment-agent.md +277 -0
  39. package/templates/agents/specialized/i18n-specialist.md +322 -0
  40. package/templates/agents/specialized/seo-ai-specialist.md +387 -0
  41. package/templates/agents/specialized/tech-writer.md +300 -0
  42. package/templates/code-style/.editorconfig +27 -0
  43. package/templates/code-style/.prettierignore +25 -0
  44. package/templates/code-style/.prettierrc +12 -0
  45. package/templates/code-style/biome.json +78 -0
  46. package/templates/code-style/commitlint.config.js +44 -0
  47. package/templates/commands/README.md +175 -0
  48. package/templates/commands/_registry.json +420 -0
  49. package/templates/commands/add-new-entity.md +211 -0
  50. package/templates/commands/audit/accessibility-audit.md +360 -0
  51. package/templates/commands/audit/performance-audit.md +290 -0
  52. package/templates/commands/audit/security-audit.md +231 -0
  53. package/templates/commands/code-check.md +127 -0
  54. package/templates/commands/five-why.md +225 -0
  55. package/templates/commands/formatting/format-markdown.md +197 -0
  56. package/templates/commands/git/commit.md +247 -0
  57. package/templates/commands/meta/create-agent.md +257 -0
  58. package/templates/commands/meta/create-command.md +312 -0
  59. package/templates/commands/meta/create-skill.md +321 -0
  60. package/templates/commands/meta/help.md +318 -0
  61. package/templates/commands/planning/check-completed-tasks.md +224 -0
  62. package/templates/commands/planning/cleanup-issues.md +248 -0
  63. package/templates/commands/planning/planning-cleanup.md +251 -0
  64. package/templates/commands/planning/sync-planning-github.md +133 -0
  65. package/templates/commands/planning/sync-todos-github.md +203 -0
  66. package/templates/commands/quality-check.md +211 -0
  67. package/templates/commands/run-tests.md +159 -0
  68. package/templates/commands/start-feature-plan.md +232 -0
  69. package/templates/commands/start-refactor-plan.md +244 -0
  70. package/templates/commands/sync-planning.md +176 -0
  71. package/templates/commands/update-docs.md +242 -0
  72. package/templates/docs/CHECKPOINT-SYSTEM.md +504 -0
  73. package/templates/docs/INDEX.md +677 -0
  74. package/templates/docs/RECOMMENDED-HOOKS.md +415 -0
  75. package/templates/docs/_registry.json +329 -0
  76. package/templates/docs/diagrams/README.md +220 -0
  77. package/templates/docs/diagrams/agent-hierarchy.mmd +55 -0
  78. package/templates/docs/diagrams/documentation-map.mmd +61 -0
  79. package/templates/docs/diagrams/tools-relationship.mmd +55 -0
  80. package/templates/docs/diagrams/workflow-decision-tree.mmd +38 -0
  81. package/templates/docs/doc-sync.md +533 -0
  82. package/templates/docs/examples/end-to-end-workflow.md +1505 -0
  83. package/templates/docs/glossary.md +495 -0
  84. package/templates/docs/guides/mockup-prompt-engineering.md +644 -0
  85. package/templates/docs/guides/mockup-setup.md +737 -0
  86. package/templates/docs/learnings/README.md +250 -0
  87. package/templates/docs/learnings/common-architectural-patterns.md +123 -0
  88. package/templates/docs/learnings/common-mistakes-to-avoid.md +149 -0
  89. package/templates/docs/learnings/markdown-formatting-standards.md +104 -0
  90. package/templates/docs/learnings/monorepo-command-execution.md +64 -0
  91. package/templates/docs/learnings/optimization-tips.md +146 -0
  92. package/templates/docs/learnings/planning-linear-sync-workflow.md +70 -0
  93. package/templates/docs/learnings/shell-compatibility-fish.md +46 -0
  94. package/templates/docs/learnings/test-organization-structure.md +68 -0
  95. package/templates/docs/mcp-installation.md +613 -0
  96. package/templates/docs/mcp-servers.md +989 -0
  97. package/templates/docs/notification-installation.md +570 -0
  98. package/templates/docs/quick-start.md +354 -0
  99. package/templates/docs/standards/architecture-patterns.md +1064 -0
  100. package/templates/docs/standards/atomic-commits.md +513 -0
  101. package/templates/docs/standards/code-standards.md +993 -0
  102. package/templates/docs/standards/design-standards.md +656 -0
  103. package/templates/docs/standards/documentation-standards.md +1160 -0
  104. package/templates/docs/standards/testing-standards.md +969 -0
  105. package/templates/docs/system-maintenance.md +604 -0
  106. package/templates/docs/templates/PDR-template.md +561 -0
  107. package/templates/docs/templates/TODOs-template.md +534 -0
  108. package/templates/docs/templates/tech-analysis-template.md +800 -0
  109. package/templates/docs/workflows/README.md +519 -0
  110. package/templates/docs/workflows/atomic-task-protocol.md +955 -0
  111. package/templates/docs/workflows/decision-tree.md +482 -0
  112. package/templates/docs/workflows/edge-cases.md +856 -0
  113. package/templates/docs/workflows/phase-1-planning.md +957 -0
  114. package/templates/docs/workflows/phase-2-implementation.md +896 -0
  115. package/templates/docs/workflows/phase-3-validation.md +792 -0
  116. package/templates/docs/workflows/phase-4-finalization.md +927 -0
  117. package/templates/docs/workflows/quick-fix-protocol.md +505 -0
  118. package/templates/docs/workflows/task-atomization.md +537 -0
  119. package/templates/docs/workflows/task-completion-protocol.md +448 -0
  120. package/templates/hooks/on-notification.sh +28 -0
  121. package/templates/schemas/checkpoint.schema.json +97 -0
  122. package/templates/schemas/code-registry.schema.json +84 -0
  123. package/templates/schemas/pdr.schema.json +314 -0
  124. package/templates/schemas/problems.schema.json +55 -0
  125. package/templates/schemas/tech-analysis.schema.json +404 -0
  126. package/templates/schemas/telemetry.schema.json +298 -0
  127. package/templates/schemas/todos.schema.json +234 -0
  128. package/templates/schemas/workflows.schema.json +69 -0
  129. package/templates/scripts/add-changelogs.sh +105 -0
  130. package/templates/scripts/generate-code-registry.ts +270 -0
  131. package/templates/scripts/health-check.sh +343 -0
  132. package/templates/scripts/sync-registry.sh +40 -0
  133. package/templates/scripts/telemetry-report.ts +36 -0
  134. package/templates/scripts/validate-docs.sh +224 -0
  135. package/templates/scripts/validate-registry.sh +225 -0
  136. package/templates/scripts/validate-schemas.ts +283 -0
  137. package/templates/scripts/validate-structure.sh +165 -0
  138. package/templates/scripts/worktree-cleanup.sh +81 -0
  139. package/templates/scripts/worktree-create.sh +63 -0
  140. package/templates/sessions/planning/.gitkeep +0 -0
  141. package/templates/sessions/planning/archived/.gitkeep +0 -0
  142. package/templates/settings.json +202 -0
  143. package/templates/settings.local.json +138 -0
  144. package/templates/skills/README.md +197 -0
  145. package/templates/skills/_registry.json +473 -0
  146. package/templates/skills/audit/accessibility-audit.md +309 -0
  147. package/templates/skills/audit/performance-audit.md +257 -0
  148. package/templates/skills/audit/security-audit.md +217 -0
  149. package/templates/skills/auth/nextauth-patterns.md +308 -0
  150. package/templates/skills/brand-guidelines.md +240 -0
  151. package/templates/skills/documentation/markdown-formatter.md +302 -0
  152. package/templates/skills/git/git-commit-helper.md +321 -0
  153. package/templates/skills/i18n/i18n-patterns.md +251 -0
  154. package/templates/skills/patterns/error-handling-patterns.md +242 -0
  155. package/templates/skills/patterns/tdd-methodology.md +342 -0
  156. package/templates/skills/qa/qa-criteria-validator.md +383 -0
  157. package/templates/skills/qa/web-app-testing.md +398 -0
  158. package/templates/skills/react/react-hook-form-patterns.md +359 -0
  159. package/templates/skills/state/redux-toolkit-patterns.md +272 -0
  160. package/templates/skills/state/tanstack-query-patterns.md +299 -0
  161. package/templates/skills/state/zustand-patterns.md +301 -0
  162. package/templates/skills/tech/mermaid-diagram-specialist.md +195 -0
  163. package/templates/skills/tech/shadcn-specialist.md +252 -0
  164. package/templates/skills/tech/vercel-specialist.md +297 -0
  165. package/templates/skills/testing/api-app-testing.md +254 -0
  166. package/templates/skills/testing/performance-testing.md +275 -0
  167. package/templates/skills/testing/security-testing.md +348 -0
  168. package/templates/skills/utils/add-memory.md +295 -0
  169. package/templates/skills/utils/json-data-auditor.md +283 -0
  170. package/templates/skills/utils/pdf-creator-editor.md +342 -0
  171. package/templates/tools/format-markdown.sh +185 -0
@@ -0,0 +1,955 @@
1
+ # Atomic Task Protocol (Level 2 Workflow)
2
+
3
+ ## Overview
4
+
5
+ **Purpose**: Structured workflow for bugfixes and small features requiring planning but not full PDR
6
+
7
+ **Scope**: 30 minutes - 3 hours, 2-10 files, low-medium risk
8
+ **Overhead**: Moderate (simplified tech analysis, no PDR)
9
+ **Risk Level**: Low to Medium
10
+
11
+ ## When to Use Level 2 (Atomic Task)
12
+
13
+ Use this workflow for changes that meet **MOST** criteria:
14
+
15
+ ### Qualifying Criteria ✅
16
+
17
+ - **Time**: 30 minutes - 3 hours to complete
18
+ - **Scope**: 2-10 files affected
19
+ - **Risk**: Low to medium (bugfixes, small features, targeted refactors)
20
+ - **Impact**: Functional changes but well-contained
21
+ - **Testing**: New tests required
22
+ - **Planning**: Some design decisions needed (but not architectural)
23
+
24
+ ### Qualifying Examples
25
+
26
+ **Bugfixes:**
27
+
28
+ - ✅ **Fix validation error** in booking form
29
+ - ✅ **Correct calculation bug** in pricing logic
30
+ - ✅ **Fix race condition** in state updates
31
+ - ✅ **Repair broken API endpoint**
32
+ - ✅ **Fix authentication edge case**
33
+ - ✅ **Correct data transformation bug**
34
+
35
+ **Small Features:**
36
+
37
+ - ✅ **Add search filter** to existing list
38
+ - ✅ **Add sorting option** to table
39
+ - ✅ **Implement pagination** on results
40
+ - ✅ **Add export button** to dashboard
41
+ - ✅ **Add validation rule** to form
42
+ - ✅ **Implement loading state** for async operation
43
+
44
+ **Small Refactors:**
45
+
46
+ - ✅ **Extract reusable component** from page
47
+ - ✅ **Consolidate duplicate code** (2-3 files)
48
+ - ✅ **Rename for clarity** (affecting multiple files)
49
+ - ✅ **Optimize database query** (single endpoint)
50
+ - ✅ **Add error boundary** to component tree
51
+ - ✅ **Improve type safety** in module
52
+
53
+ ### Non-Qualifying Examples (Use Different Level)
54
+
55
+ **Too Small (Use Level 1):**
56
+
57
+ - ❌ Typo fixes
58
+ - ❌ Formatting only
59
+ - ❌ Documentation updates
60
+ - ❌ Single file changes < 30 min
61
+
62
+ **Too Large (Use Level 3):**
63
+
64
+ - ❌ New major features
65
+ - ❌ Database schema changes
66
+ - ❌ API contract changes
67
+ - ❌ Architecture changes
68
+ - ❌ Multi-day features
69
+ - ❌ Requires full PDR
70
+
71
+ ## PB-XXX Code System
72
+
73
+ ### Code Format
74
+
75
+ **Pattern**: `PB-XXX` (Patch/Bugfix - Number)
76
+
77
+ **Examples:**
78
+
79
+ - `PB-001` - First bugfix
80
+ - `PB-042` - 42nd bugfix/small feature
81
+ - `PB-125` - 125th atomic task
82
+
83
+ ### Registry File
84
+
85
+ **Location**: `.claude/sessions/atomic-tasks/REGISTRY.md`
86
+
87
+ **Format:**
88
+
89
+ ```markdown
90
+ # Atomic Tasks Registry
91
+
92
+ ## Active Tasks
93
+
94
+ | Code | Title | Type | Status | Started | Assignee |
95
+ |------|-------|------|--------|---------|----------|
96
+ | PB-001 | Fix booking validation | Bug | In Progress | 2024-02-01 | @hono-engineer |
97
+ | PB-002 | Add search to entitys | Feature | Planning | 2024-02-01 | @astro-engineer |
98
+
99
+ ## Completed Tasks
100
+
101
+ | Code | Title | Type | Completed | Time Spent | Files Changed |
102
+ |------|-------|------|-----------|------------|---------------|
103
+ | PB-000 | Example bugfix | Bug | 2024-01-31 | 2h | 3 |
104
+ ```
105
+
106
+ ### Session Structure
107
+
108
+ ```
109
+ .claude/sessions/atomic-tasks/
110
+ ├── REGISTRY.md # Master registry
111
+ ├── PB-001-fix-booking-validation/
112
+ │ ├── tech-analysis.md # Simplified planning
113
+ │ └── .checkpoint.json # Progress tracking
114
+ ├── PB-002-add-search/
115
+ │ ├── tech-analysis.md
116
+ │ └── .checkpoint.json
117
+ └── ...
118
+ ```
119
+
120
+ ## 11-Step Workflow
121
+
122
+ ### Step 1: Create Atomic Task Session 📁
123
+
124
+ **Objective**: Initialize task tracking
125
+
126
+ **Actions:**
127
+
128
+ 1. **Get next PB code:**
129
+
130
+ ```bash
131
+ # Check REGISTRY.md for last code
132
+ # Increment by 1
133
+ ```
134
+
135
+ 2. **Create session directory:**
136
+
137
+ ```bash
138
+ mkdir -p .claude/sessions/atomic-tasks/PB-XXX-task-name
139
+ ```
140
+
141
+ 3. **Register in REGISTRY.md:**
142
+
143
+ ```markdown
144
+ | PB-XXX | Task title | Type | Not Started | YYYY-MM-DD | @assignee |
145
+ ```
146
+
147
+ 4. **Create checkpoint:**
148
+
149
+ ```json
150
+ {
151
+ "taskCode": "PB-XXX",
152
+ "taskName": "Task Name",
153
+ "type": "bug|feature|refactor",
154
+ "phase": "planning",
155
+ "started": "2024-02-01T10:00:00Z"
156
+ }
157
+ ```
158
+
159
+ **Output**: Task session initialized
160
+
161
+ ---
162
+
163
+ ### Step 2: Create Simplified Tech Analysis 📝
164
+
165
+ **Objective**: Plan the implementation (no PDR needed)
166
+
167
+ **Template**: `.claude/sessions/atomic-tasks/PB-XXX/tech-analysis.md`
168
+
169
+ ```markdown
170
+ # PB-XXX: [Task Title]
171
+
172
+ ## Type
173
+ - [ ] Bug
174
+ - [ ] Small Feature
175
+ - [ ] Small Refactor
176
+
177
+ ## Problem Statement
178
+
179
+ [Brief description of the bug/feature/refactor need]
180
+
181
+ ## Current Behavior (for bugs)
182
+
183
+ [What's happening now]
184
+
185
+ ## Expected Behavior
186
+
187
+ [What should happen]
188
+
189
+ ## Root Cause Analysis (for bugs)
190
+
191
+ [Why is this happening]
192
+
193
+ ## Proposed Solution
194
+
195
+ ### Approach
196
+
197
+ [High-level approach]
198
+
199
+ ### Files to Change
200
+
201
+ 1. `path/to/file1.ts` - [What changes]
202
+ 2. `path/to/file2.ts` - [What changes]
203
+ 3. `path/to/file3.test.ts` - [Test changes]
204
+
205
+ ### Implementation Steps
206
+
207
+ 1. [ ] Step 1
208
+ 2. [ ] Step 2
209
+ 3. [ ] Step 3
210
+
211
+ ## Technical Considerations
212
+
213
+ - **Risk Level**: Low | Medium
214
+ - **Breaking Changes**: Yes | No
215
+ - **Database Impact**: Yes | No
216
+ - **API Changes**: Yes | No
217
+ - **Dependencies**: [Any new dependencies]
218
+
219
+ ## Testing Strategy
220
+
221
+ - [ ] Unit tests for [component/function]
222
+ - [ ] Integration tests for [flow]
223
+ - [ ] Manual testing steps
224
+
225
+ ## Edge Cases
226
+
227
+ 1. [Edge case 1]
228
+ 2. [Edge case 2]
229
+
230
+ ## Time Estimate
231
+
232
+ **Estimated**: X hours
233
+ **Actual**: [Fill after completion]
234
+
235
+ ## Acceptance Criteria
236
+
237
+ - [ ] Criterion 1
238
+ - [ ] Criterion 2
239
+ - [ ] Criterion 3
240
+ - [ ] Tests passing
241
+ - [ ] No regressions
242
+ ```
243
+
244
+ **Actions:**
245
+
246
+ 1. Fill out template
247
+ 2. Keep it concise (1-2 pages max)
248
+ 3. Focus on implementation details
249
+ 4. Identify risks
250
+
251
+ **Output**: Tech analysis document
252
+
253
+ ---
254
+
255
+ ### Step 3: Review & Approve Plan 👀
256
+
257
+ **Objective**: Validate approach before implementation
258
+
259
+ **Actions:**
260
+
261
+ 1. **Self-review:**
262
+ - Is approach sound?
263
+ - Are files identified?
264
+ - Are risks assessed?
265
+ - Is time estimate realistic?
266
+
267
+ 2. **Get approval (if working with team):**
268
+ - Share tech-analysis.md
269
+ - Discuss approach
270
+ - Adjust if needed
271
+
272
+ 3. **Commit planning docs:**
273
+
274
+ ```bash
275
+ git add .claude/sessions/atomic-tasks/PB-XXX/
276
+ git commit -m "docs(PB-XXX): add tech analysis for [task]"
277
+ ```
278
+
279
+ **Output**: Approved plan
280
+
281
+ ---
282
+
283
+ ### Step 4: Write Tests First (TDD) 🧪
284
+
285
+ **Objective**: Define expected behavior through tests
286
+
287
+ **Actions:**
288
+
289
+ 1. **Write failing tests:**
290
+
291
+ ```typescript
292
+ // RED: Write test that fails
293
+ describe('BookingValidation', () => {
294
+ it('should reject past check-in dates', () => {
295
+ const result = validateBooking({
296
+ checkIn: '2020-01-01',
297
+ checkOut: '2020-01-05'
298
+ });
299
+ expect(result.valid).toBe(false);
300
+ expect(result.errors).toContain('Check-in date cannot be in the past');
301
+ });
302
+ });
303
+ ```
304
+
305
+ 2. **Run tests - verify they fail:**
306
+
307
+ ```bash
308
+ pnpm test
309
+ # Should see RED (failing)
310
+ ```
311
+
312
+ 3. **Commit red tests:**
313
+
314
+ ```bash
315
+ git add test/
316
+ git commit -m "test(PB-XXX): add failing tests for [feature]"
317
+ ```
318
+
319
+ **Output**: Failing tests committed
320
+
321
+ ---
322
+
323
+ ### Step 5: Implement Solution (Make Tests Green) ✅
324
+
325
+ **Objective**: Write minimum code to pass tests
326
+
327
+ **Actions:**
328
+
329
+ 1. **Implement changes:**
330
+ - Follow tech-analysis.md plan
331
+ - Keep changes focused
332
+ - One file at a time
333
+ - Commit incrementally
334
+
335
+ 2. **Make tests pass:**
336
+
337
+ ```bash
338
+ pnpm test
339
+ # Should see GREEN (passing)
340
+ ```
341
+
342
+ 3. **Verify no regressions:**
343
+
344
+ ```bash
345
+ pnpm test # All tests
346
+ pnpm typecheck # TypeScript
347
+ pnpm lint # Linting
348
+ ```
349
+
350
+ **Output**: Working implementation
351
+
352
+ ---
353
+
354
+ ### Step 6: Refactor (Keep Tests Green) 🔧
355
+
356
+ **Objective**: Improve code quality while maintaining functionality
357
+
358
+ **Actions:**
359
+
360
+ 1. **Refactor for quality:**
361
+ - Remove duplication
362
+ - Improve names
363
+ - Extract methods
364
+ - Optimize logic
365
+
366
+ 2. **Keep tests green:**
367
+
368
+ ```bash
369
+ pnpm test # After each refactor
370
+ ```
371
+
372
+ 3. **Follow patterns:**
373
+ - Use established patterns
374
+ - Match existing code style
375
+ - Apply SOLID principles
376
+
377
+ **Output**: Refactored, clean code
378
+
379
+ ---
380
+
381
+ ### Step 7: Add Documentation 📚
382
+
383
+ **Objective**: Document changes for future maintenance
384
+
385
+ **Actions:**
386
+
387
+ 1. **Code documentation:**
388
+
389
+ ```typescript
390
+ /**
391
+ * Validates booking dates ensuring check-in is not in the past
392
+ * and check-out is after check-in
393
+ *
394
+ * @param booking - Booking data to validate
395
+ * @returns Validation result with errors if invalid
396
+ *
397
+ * @example
398
+ * ```ts
399
+ * const result = validateBooking({
400
+ * checkIn: '2024-02-01',
401
+ * checkOut: '2024-02-05'
402
+ * });
403
+ * ```
404
+ */
405
+ export function validateBooking(booking: BookingInput): ValidationResult {
406
+ // ...
407
+ }
408
+ ```
409
+
410
+ 2. **Update README if needed**
411
+ 3. **Add comments for complex logic**
412
+
413
+ **Output**: Documented code
414
+
415
+ ---
416
+
417
+ ### Step 8: Test Coverage Check 📊
418
+
419
+ **Objective**: Ensure 90%+ coverage
420
+
421
+ **Actions:**
422
+
423
+ 1. **Run coverage:**
424
+
425
+ ```bash
426
+ pnpm test:coverage
427
+ ```
428
+
429
+ 2. **Check results:**
430
+ - Aim for >= 90% line coverage
431
+ - Aim for >= 85% branch coverage
432
+ - Ensure all edge cases tested
433
+
434
+ 3. **Add missing tests if needed**
435
+
436
+ **Validation:**
437
+
438
+ - [ ] Line coverage >= 90%
439
+ - [ ] Branch coverage >= 85%
440
+ - [ ] All edge cases covered
441
+ - [ ] No untested error paths
442
+
443
+ **Output**: Comprehensive test coverage
444
+
445
+ ---
446
+
447
+ ### Step 9: Quality Checks ✔️
448
+
449
+ **Objective**: Validate all quality gates pass
450
+
451
+ **Actions:**
452
+
453
+ 1. **Run all checks:**
454
+
455
+ ```bash
456
+ pnpm lint # Linting
457
+ pnpm typecheck # TypeScript
458
+ pnpm test # Tests
459
+ pnpm test:coverage # Coverage
460
+ ```
461
+
462
+ 2. **Manual testing:**
463
+ - Test happy path
464
+ - Test edge cases
465
+ - Test error scenarios
466
+ - Test UI if applicable
467
+
468
+ 3. **Fix any issues found**
469
+
470
+ **💡 Consider Using Specialized Agents or Skills:**
471
+
472
+ For complex atomic tasks, consider delegating quality checks:
473
+
474
+ - **`qa-engineer` agent** - Comprehensive testing validation (if task has complex test scenarios)
475
+ - **`tech-lead` with `security-audit` skill** - Security review (if task touches auth, data validation, or sensitive operations)
476
+ - **`tech-lead` with `performance-audit` skill** - Performance analysis (if task affects queries, rendering, or data processing)
477
+
478
+ **When to use specialized checks:**
479
+
480
+ - Task involves authentication/authorization → security-audit skill
481
+ - Task modifies database queries → performance-audit skill
482
+ - Task adds API endpoints with validation → security-audit skill
483
+ - Task has complex business logic → qa-engineer agent
484
+ - Task affects performance-critical paths → performance-audit skill
485
+
486
+ **Example:**
487
+
488
+ ```text
489
+ This task adds user input validation with sanitization.
490
+ I'll coordinate with tech-lead to run security-audit skill for injection vulnerabilities.
491
+ ```
492
+
493
+ **Validation:**
494
+
495
+ - [ ] Lint passing
496
+ - [ ] TypeCheck passing
497
+ - [ ] Tests passing
498
+ - [ ] Coverage >= 90%
499
+ - [ ] Manual testing successful
500
+ - [ ] No console errors/warnings
501
+ - [ ] Specialized agent review (if needed)
502
+
503
+ **Output**: All quality checks passing
504
+
505
+ ---
506
+
507
+ ### Step 10: Commit with Conventional Message 📝
508
+
509
+ **Objective**: Create clean, descriptive commits
510
+
511
+ **🔥 CRITICAL: Only Commit Task-Related Files**
512
+
513
+ Before creating commits, verify which files to include:
514
+
515
+ ```bash
516
+ git status --short
517
+ ```
518
+
519
+ **Rule:** ONLY include files modified during THIS atomic task.
520
+
521
+ If `git status` shows unrelated modified files:
522
+
523
+ - ❌ **DO NOT** include them in this commit
524
+ - ❌ **DO NOT** use `git add .` or `git add -A`
525
+ - ✅ **ONLY** use `git add <specific-file>` for task files
526
+ - ⚠️ **WARN** user about unrelated changes
527
+
528
+ **Example:**
529
+
530
+ ```bash
531
+ # Atomic Task: PB-001 "Fix booking validation"
532
+ # git status shows:
533
+ M packages/service-core/src/booking.service.ts ← INCLUDE (this task)
534
+ M packages/service-core/test/booking.test.ts ← INCLUDE (this task)
535
+ M packages/api/routes/user.ts ← EXCLUDE (different task)
536
+ M .env.local ← EXCLUDE (local config)
537
+
538
+ # CORRECT - Only task files:
539
+ git add packages/service-core/src/booking.service.ts
540
+ git add packages/service-core/test/booking.test.ts
541
+ git commit -m "fix(PB-001): prevent booking with past check-in dates..."
542
+
543
+ # WRONG - Would include unrelated files:
544
+ git add . # ❌ Don't do this!
545
+ ```
546
+
547
+ **If unrelated files detected:**
548
+
549
+ ```text
550
+ ⚠️ Warning: I found modified files NOT related to PB-001:
551
+ - packages/api/routes/user.ts (different task)
552
+ - .env.local (local configuration)
553
+
554
+ I will ONLY commit files related to PB-001.
555
+ Unrelated files will remain uncommitted.
556
+
557
+ Proceeding with PB-001 files only. Continue? (yes/no)
558
+ ```
559
+
560
+ ---
561
+
562
+ **Commit Message Format:**
563
+
564
+ ```
565
+ <type>(PB-XXX): <description>
566
+
567
+ - Change 1
568
+ - Change 2
569
+ - Change 3
570
+
571
+ Closes #issue-number
572
+ ```
573
+
574
+ **Types:**
575
+
576
+ - `fix` - Bug fixes
577
+ - `feat` - New features
578
+ - `refactor` - Code refactoring
579
+
580
+ **Examples:**
581
+
582
+ ```bash
583
+ # Bugfix
584
+ git commit -m "fix(PB-001): prevent booking with past check-in dates
585
+
586
+ - Add date validation in validateBooking function
587
+ - Add tests for past date scenarios
588
+ - Update error messages for clarity
589
+
590
+ Fixes #456"
591
+
592
+ # Small feature
593
+ git commit -m "feat(PB-002): add search to entity list
594
+
595
+ - Add search input component
596
+ - Implement client-side filtering
597
+ - Add debounce for performance
598
+ - Add tests for search functionality
599
+
600
+ Closes #457"
601
+
602
+ # Refactor
603
+ git commit -m "refactor(PB-003): extract BookingCard component
604
+
605
+ - Create reusable BookingCard component
606
+ - Update BookingList to use BookingCard
607
+ - Add tests for BookingCard
608
+ - Improve type safety
609
+
610
+ Closes #458"
611
+ ```
612
+
613
+ **Output**: Clean, conventional commits
614
+
615
+ ---
616
+
617
+ ### Step 11: Update State & Close Task ✅
618
+
619
+ **Objective**: Mark task complete and track metrics
620
+
621
+ **🔥 CRITICAL: Update ALL State Files**
622
+
623
+ When completing an atomic task, you MUST update all state tracking:
624
+
625
+ **Actions:**
626
+
627
+ 1. **Update tech-analysis.md:**
628
+
629
+ ```markdown
630
+ ## Time Estimate
631
+ **Estimated**: 2 hours
632
+ **Actual**: 2.5 hours
633
+
634
+ ## Completion
635
+ **Status**: ✅ Completed
636
+ **Date**: 2024-02-01
637
+ **Files Changed**: 4
638
+ **Lines Added**: 156
639
+ **Lines Removed**: 42
640
+ ```
641
+
642
+ 2. **Update REGISTRY.md:**
643
+
644
+ ```markdown
645
+ ## Completed Tasks
646
+ | PB-001 | Fix booking validation | Bug | 2024-02-01 | 2.5h | 4 |
647
+ ```
648
+
649
+ 3. **Update .checkpoint.json:**
650
+
651
+ ```json
652
+ {
653
+ "taskCode": "PB-001",
654
+ "phase": "completed",
655
+ "completed": "2024-02-01T15:30:00Z",
656
+ "timeSpent": "2.5h",
657
+ "filesChanged": 4,
658
+ "progress": {
659
+ "total": 1,
660
+ "completed": 1,
661
+ "percentage": 100
662
+ }
663
+ }
664
+ ```
665
+
666
+ 4. **If Part of Larger Planning Session:**
667
+
668
+ If this atomic task is a subtask of a feature planning session:
669
+
670
+ a. **Update TODOs.md** in planning session:
671
+
672
+ ```markdown
673
+ - [x] **[2h]** PB-001: Fix booking validation
674
+ - Completed: 2024-02-01
675
+ - Actual time: 2.5h
676
+ - Files: 4
677
+ ```
678
+
679
+ b. **Update planning .checkpoint.json**:
680
+
681
+ ```json
682
+ {
683
+ "tasks": {
684
+ "PB-001": {
685
+ "status": "completed",
686
+ "completed": "2024-02-01T15:30:00Z"
687
+ }
688
+ },
689
+ "progress": {
690
+ "total": 45,
691
+ "completed": 13,
692
+ "percentage": 28.9
693
+ }
694
+ }
695
+ ```
696
+
697
+ c. **Update .github-workflow/tracking.json**:
698
+
699
+ ```json
700
+ {
701
+ "issues": {
702
+ "HOSP-124": {
703
+ "status": "done",
704
+ "linearId": "abc-123-def",
705
+ "lastSync": "2024-02-01T15:30:00Z"
706
+ }
707
+ }
708
+ }
709
+ ```
710
+
711
+ 5. **Commit state updates:**
712
+
713
+ ```bash
714
+ # For standalone atomic task
715
+ git add .claude/sessions/atomic-tasks/PB-001/
716
+ git commit -m "docs(PB-001): mark task complete"
717
+
718
+ # If part of planning session
719
+ git add .claude/sessions/planning/{feature}/TODOs.md
720
+ git add .claude/sessions/planning/{feature}/.checkpoint.json
721
+ git add .github-workflow/tracking.json
722
+ git commit -m "docs: update planning state for PB-001 completion"
723
+ ```
724
+
725
+ **State Files Checklist:**
726
+
727
+ - [ ] tech-analysis.md updated (atomic task)
728
+ - [ ] REGISTRY.md updated (atomic task)
729
+ - [ ] .checkpoint.json updated (atomic task)
730
+ - [ ] TODOs.md updated (if part of planning)
731
+ - [ ] Planning .checkpoint.json updated (if part of planning)
732
+ - [ ] .github-workflow/tracking.json updated (if part of planning)
733
+ - [ ] Changes committed
734
+
735
+ **Output**: Task completed and all state tracking updated
736
+
737
+ ---
738
+
739
+ ## Workflow Summary
740
+
741
+ ```mermaid
742
+ flowchart TD
743
+ Start([Atomic Task Needed]) --> Create[1. Create Session<br/>PB-XXX]
744
+ Create --> Analysis[2. Tech Analysis]
745
+ Analysis --> Review{3. Approve<br/>Plan?}
746
+
747
+ Review -->|No| Analysis
748
+ Review -->|Yes| Tests[4. Write Tests<br/>RED]
749
+
750
+ Tests --> Implement[5. Implement<br/>GREEN]
751
+ Implement --> Refactor[6. Refactor<br/>Keep GREEN]
752
+ Refactor --> Docs[7. Documentation]
753
+ Docs --> Coverage[8. Coverage Check]
754
+
755
+ Coverage --> Pass{>= 90%?}
756
+ Pass -->|No| Tests
757
+ Pass -->|Yes| Quality[9. Quality Checks]
758
+
759
+ Quality --> AllPass{All Pass?}
760
+ AllPass -->|No| Fix[Fix Issues]
761
+ Fix --> Quality
762
+
763
+ AllPass -->|Yes| Commit[10. Commit]
764
+ Commit --> Registry[11. Update Registry]
765
+ Registry --> Done([Done!])
766
+ ```
767
+
768
+ ## Time Breakdown
769
+
770
+ Total: **30 minutes - 3 hours**
771
+
772
+ 1. Create session: **5 min**
773
+ 2. Tech analysis: **15-30 min**
774
+ 3. Review & approve: **5-10 min**
775
+ 4. Write tests (RED): **15-30 min**
776
+ 5. Implement (GREEN): **30 min - 1.5h**
777
+ 6. Refactor: **15-30 min**
778
+ 7. Documentation: **10-15 min**
779
+ 8. Coverage check: **5-10 min**
780
+ 9. Quality checks: **10-15 min**
781
+ 10. Commit: **5 min**
782
+ 11. Update registry: **5 min**
783
+
784
+ ## Examples
785
+
786
+ ### Example 1: Bugfix - Booking Validation
787
+
788
+ **PB-001: Fix booking validation allowing past dates**
789
+
790
+ **Problem:**
791
+ Users can book entitys with check-in dates in the past.
792
+
793
+ **Tech Analysis:**
794
+
795
+ ```markdown
796
+ ## Root Cause
797
+ Missing date validation in `validateBooking` function
798
+
799
+ ## Solution
800
+ Add date validation checking `checkIn >= today`
801
+
802
+ ## Files to Change
803
+ - `packages/service-core/src/booking/validators.ts`
804
+ - `packages/service-core/test/booking/validators.test.ts`
805
+ ```
806
+
807
+ **Implementation:**
808
+
809
+ 1. Write test expecting past dates to fail
810
+ 2. Add validation: `if (checkIn < today) throw ValidationError`
811
+ 3. Refactor for clarity
812
+ 4. Document function
813
+ 5. Commit with `fix(PB-001)`
814
+
815
+ **Time**: 1.5 hours
816
+
817
+ ---
818
+
819
+ ### Example 2: Small Feature - Search Filter
820
+
821
+ **PB-002: Add search to entity list**
822
+
823
+ **Feature:**
824
+ Allow users to search entitys by name/location
825
+
826
+ **Tech Analysis:**
827
+
828
+ ```markdown
829
+ ## Approach
830
+ Client-side search with debounce
831
+
832
+ ## Files to Change
833
+ - `apps/web/src/components/EntityList.tsx` - Add search input
834
+ - `apps/web/src/hooks/useEntitySearch.ts` - Search logic
835
+ - `apps/web/src/components/SearchInput.tsx` - Reusable component
836
+
837
+ ## Implementation
838
+ 1. Create SearchInput component
839
+ 2. Create useEntitySearch hook with debounce
840
+ 3. Update EntityList to use search
841
+ 4. Add tests
842
+ ```
843
+
844
+ **Implementation:**
845
+
846
+ 1. Write tests for search functionality
847
+ 2. Create SearchInput component
848
+ 3. Implement useEntitySearch with debounce
849
+ 4. Integrate into EntityList
850
+ 5. Commit with `feat(PB-002)`
851
+
852
+ **Time**: 2.5 hours
853
+
854
+ ---
855
+
856
+ ### Example 3: Small Refactor - Extract Component
857
+
858
+ **PB-003: Extract BookingCard from BookingList**
859
+
860
+ **Refactor:**
861
+ BookingList component has duplicate card rendering logic
862
+
863
+ **Tech Analysis:**
864
+
865
+ ```markdown
866
+ ## Goal
867
+ Extract reusable BookingCard component
868
+
869
+ ## Files to Change
870
+ - `apps/web/src/components/BookingList.tsx` - Use BookingCard
871
+ - `apps/web/src/components/BookingCard.tsx` - New component
872
+ - `apps/web/src/components/BookingCard.test.tsx` - Tests
873
+
874
+ ## Benefits
875
+ - Reusability
876
+ - Better separation of concerns
877
+ - Easier testing
878
+ ```
879
+
880
+ **Implementation:**
881
+
882
+ 1. Write tests for BookingCard
883
+ 2. Create BookingCard component
884
+ 3. Update BookingList to use BookingCard
885
+ 4. Verify no visual changes
886
+ 5. Commit with `refactor(PB-003)`
887
+
888
+ **Time**: 2 hours
889
+
890
+ ---
891
+
892
+ ## When Atomic Task Becomes Bigger
893
+
894
+ **Signs you need Level 3 workflow:**
895
+
896
+ - ⚠️ Taking > 3 hours
897
+ - ⚠️ More than 10 files affected
898
+ - ⚠️ Architectural decisions needed
899
+ - ⚠️ Database schema changes
900
+ - ⚠️ API contract changes
901
+ - ⚠️ Multiple features bundled
902
+ - ⚠️ Requires stakeholder input
903
+ - ⚠️ Full PDR needed
904
+
905
+ **Action**: Stop and switch to Level 3 (Feature Planning)
906
+
907
+ ## Best Practices
908
+
909
+ 1. **Keep It Atomic**: One logical change per task
910
+ 2. **Follow TDD**: Always RED → GREEN → REFACTOR
911
+ 3. **Time Box**: If > 3h, split into multiple tasks
912
+ 4. **Document Decisions**: Tech analysis is your planning doc
913
+ 5. **Test Thoroughly**: >= 90% coverage required
914
+ 6. **Commit Often**: Incremental commits preferred
915
+ 7. **Update Registry**: Track all tasks
916
+ 8. **Learn & Improve**: Note actual vs estimated time
917
+
918
+ ## Anti-Patterns ❌
919
+
920
+ - ❌ **Skipping Tests**: "I'll add tests later"
921
+ - ❌ **No Planning**: "This is simple, I don't need tech-analysis"
922
+ - ❌ **Scope Creep**: "While I'm here, I'll also fix..."
923
+ - ❌ **No Registry**: Not tracking tasks
924
+ - ❌ **Poor Commits**: "fix stuff"
925
+ - ❌ **Skipping Quality**: "Tests are optional"
926
+ - ❌ **Wrong Level**: Using Level 2 for Level 1 or 3 tasks
927
+
928
+ ## Decision Tree Integration
929
+
930
+ When in doubt, use the [Workflow Decision Tree](./decision-tree.md):
931
+
932
+ ```
933
+ Is it 30min-3h, 2-10 files, low-medium risk?
934
+ ├─ Yes → Level 2 (Atomic Task) ✅
935
+ └─ No → Check Level 1 or Level 3 criteria
936
+ ```
937
+
938
+ ## Related Documentation
939
+
940
+ - [Workflow Decision Tree](./decision-tree.md) - Choose workflow level
941
+ - [Quick Fix Protocol](./quick-fix-protocol.md) - Level 1 workflow
942
+ - [TDD Methodology Skill](../../skills/patterns/tdd-methodology.md) - TDD approach
943
+ - [Git Commit Helper Skill](../../skills/git/git-commit-helper.md) - Conventional commits
944
+
945
+ ## Notes
946
+
947
+ - **Always use TDD**: RED-GREEN-REFACTOR cycle
948
+ - **Track in Registry**: All atomic tasks logged
949
+ - **Simplified Planning**: Tech analysis only, no PDR
950
+ - **Quality Gates**: All checks must pass
951
+ - **90% Coverage**: Non-negotiable minimum
952
+ - **Incremental Commits**: Commit working states
953
+ - **PB-XXX Codes**: Sequential numbering
954
+
955
+ **Remember**: Atomic tasks are focused, well-planned, and thoroughly tested. If it's getting complex, use Level 3.