@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,927 @@
1
+ # Phase 4: Finalization
2
+
3
+ This document describes the finalization phase workflow.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ <!-- markdownlint-disable MD051 -->
10
+
11
+ 1. [Overview](#overview)
12
+ 2. [Goals](#goals)
13
+ 3. [Documentation Process](#documentation-process)
14
+ 4. [Commit Preparation](#commit-preparation)
15
+ 5. [Final Checklist](#final-checklist)
16
+
17
+ <!-- markdownlint-enable MD051 -->
18
+
19
+ ---
20
+
21
+ ## Overview
22
+
23
+ **Phase 4** is the finalization phase where we document the work and prepare commits for the user to review and merge.
24
+
25
+ **Duration:** 1-2 hours
26
+
27
+ **Key Principle:** Complete documentation and clean commit history.
28
+
29
+ ---
30
+
31
+ ## Goals
32
+
33
+ ### Primary Goals
34
+
35
+ 1. **Document Work**: Comprehensive documentation in `/docs`
36
+ 2. **Prepare Commits**: Clean, conventional commits ready for user
37
+ 3. **Final Verification**: Everything complete and ready
38
+ 4. **Handoff**: Clear handoff to user for merge
39
+
40
+ ### Success Metrics
41
+
42
+ - ✅ All documentation complete
43
+ - ✅ Commits prepared (not executed)
44
+ - ✅ User has clear next steps
45
+ - ✅ Feature ready for production
46
+
47
+ ---
48
+
49
+ ## Documentation Process
50
+
51
+ ### Step 1: Invoke Tech Writer
52
+
53
+ **Duration:** 30 minutes - 1 hour
54
+
55
+ **Agent:** `tech-writer`
56
+
57
+ **Command:**
58
+
59
+ ```bash
60
+ /update-docs
61
+ ```text
62
+
63
+ ---
64
+
65
+ ### Step 2: Identify Documentation Needs
66
+
67
+ **What needs documentation:**
68
+
69
+ 1. **API Endpoints** (if new/modified)
70
+ - OpenAPI/Swagger docs
71
+ - Endpoint descriptions
72
+ - Request/response examples
73
+ - Error codes
74
+ - Rate limits
75
+
76
+ 2. **Components** (if new/modified)
77
+ - Component README
78
+ - Props documentation
79
+ - Usage examples
80
+ - Variants
81
+ - Accessibility notes
82
+
83
+ 3. **Architecture** (if significant changes)
84
+ - Architecture Decision Records (ADRs)
85
+ - Updated diagrams
86
+ - Pattern explanations
87
+
88
+ 4. **Deployment** (if infrastructure changes)
89
+ - Environment variables
90
+ - Configuration changes
91
+ - Migration steps
92
+ - Rollback procedures
93
+
94
+ ---
95
+
96
+ ### Step 3: API Documentation
97
+
98
+ **Location:** `/docs/api/{entity}.md`
99
+
100
+ **Format:**
101
+
102
+ ```markdown
103
+
104
+ # {Entity} API
105
+
106
+ ## Overview
107
+
108
+ Brief description of the API endpoints for {entity}.
109
+
110
+ ## Endpoints
111
+
112
+ ### List {Entities}
113
+
114
+ `GET /api/{entities}`
115
+
116
+ **Authentication:** Public / Required
117
+
118
+ **Query Parameters:**
119
+ | Parameter | Type | Required | Default | Description |
120
+ |-----------|------|----------|---------|-------------|
121
+ | page | number | No | 1 | Page number |
122
+ | pageSize | number | No | 20 | Items per page |
123
+
124
+ **Response:**
125
+ ```json
126
+
127
+ {
128
+ "success": true,
129
+ "data": {
130
+ "items": [...],
131
+ "pagination": {...}
132
+ }
133
+ }
134
+
135
+ ```text
136
+
137
+ **Example:**
138
+ ```bash
139
+
140
+ curl https://api.example.com/api/entitys?page=1
141
+
142
+ ```text
143
+
144
+ ### Create {Entity}
145
+
146
+ `POST /api/{entities}`
147
+
148
+ [Continue with full endpoint documentation]
149
+ ```text
150
+
151
+ **OpenAPI Generation:**
152
+
153
+ ```typescript
154
+ // Ensure all routes have @openapi comments
155
+ /**
156
+
157
+ * @openapi
158
+ * /api/entitys:
159
+ * post:
160
+ * summary: Create entity
161
+ * ...
162
+
163
+ */
164
+ ```text
165
+
166
+ ---
167
+
168
+ ### Step 4: Component Documentation
169
+
170
+ **Location:** `/docs/components/{Component}.md`
171
+
172
+ **Format:**
173
+
174
+ ```markdown
175
+
176
+ # {Component}
177
+
178
+ Brief description of what the component does.
179
+
180
+ ## Usage
181
+
182
+ \`\`\`tsx
183
+ import { Component } from '@/components';
184
+
185
+ <Component prop1="value" prop2={value} />
186
+ \`\`\`
187
+
188
+ ## Props
189
+
190
+ | Prop | Type | Required | Default | Description |
191
+ |------|------|----------|---------|-------------|
192
+ | prop1 | string | Yes | - | Description |
193
+ | prop2 | number | No | 0 | Description |
194
+
195
+ ## Examples
196
+
197
+ ### Basic usage
198
+
199
+ \`\`\`tsx
200
+ <Component prop1="example" />
201
+ \`\`\`
202
+
203
+ ### Advanced usage
204
+
205
+ \`\`\`tsx
206
+ <Component
207
+ prop1="example"
208
+ prop2={42}
209
+ onAction={handleAction}
210
+ />
211
+ \`\`\`
212
+
213
+ ## Accessibility
214
+
215
+ - Keyboard navigable
216
+ - Screen reader friendly
217
+ - WCAG AA compliant
218
+
219
+ ## Styling
220
+
221
+ Uses Tailwind CSS. Customizable via className prop.
222
+
223
+ ## Dependencies
224
+
225
+ - React 19
226
+ - Tailwind CSS
227
+ - Shadcn UI
228
+
229
+ ```text
230
+
231
+ ---
232
+
233
+ ### Step 5: Architecture Documentation
234
+
235
+ **When needed:**
236
+
237
+ - Significant architectural changes
238
+ - New patterns introduced
239
+ - Technology decisions
240
+
241
+ **Format:** Architecture Decision Record (ADR)
242
+
243
+ **Location:** `/docs/architecture/decisions/ADR-{number}-{title}.md`
244
+
245
+ ```markdown
246
+
247
+ # ADR-{number}: {Title}
248
+
249
+ ## Status
250
+
251
+ Proposed | Accepted | Deprecated | Superseded
252
+
253
+ ## Context
254
+
255
+ What is the issue we're trying to solve?
256
+
257
+ ## Decision
258
+
259
+ What did we decide to do?
260
+
261
+ ## Rationale
262
+
263
+ Why did we make this decision?
264
+
265
+ - Reason 1
266
+ - Reason 2
267
+
268
+ ## Consequences
269
+
270
+ ### Positive
271
+
272
+ - Benefit 1
273
+ - Benefit 2
274
+
275
+ ### Negative
276
+
277
+ - Drawback 1
278
+ - Drawback 2
279
+
280
+ ### Neutral
281
+
282
+ - Note 1
283
+
284
+ ## Alternatives Considered
285
+
286
+ 1. **Option 1**
287
+ - Pros: ...
288
+ - Cons: ...
289
+
290
+ 2. **Option 2**
291
+ - Pros: ...
292
+ - Cons: ...
293
+
294
+ ## References
295
+
296
+ - Link 1
297
+ - Link 2
298
+
299
+ ```text
300
+
301
+ ---
302
+
303
+ ### Step 6: Update README Files
304
+
305
+ **Package READMEs:**
306
+
307
+ If new packages or significant changes:
308
+
309
+ ```markdown
310
+
311
+ # @repo/{package-name}
312
+
313
+ Brief description
314
+
315
+ ## Installation
316
+
317
+ \`\`\`bash
318
+ pnpm add @repo/{package-name}
319
+ \`\`\`
320
+
321
+ ## Usage
322
+
323
+ \`\`\`typescript
324
+ import { Thing } from '@repo/{package-name}';
325
+ \`\`\`
326
+
327
+ ## Documentation
328
+
329
+ See [full documentation](../../docs/{package}.md)
330
+ ```text
331
+
332
+ **Main README:**
333
+
334
+ Update if:
335
+
336
+ - New features for users
337
+ - Changed commands
338
+ - New requirements
339
+
340
+ ---
341
+
342
+ ### Step 7: Generate Diagrams
343
+
344
+ **When needed:**
345
+
346
+ - New data models (ERD)
347
+ - New flows (sequence diagrams)
348
+ - New architecture (system diagrams)
349
+
350
+ **Tools:** Mermaid (in markdown)
351
+
352
+ **Examples:**
353
+
354
+ **Entity Relationship:**
355
+
356
+ ```mermaid
357
+ erDiagram
358
+ USER ||--o{ BOOKING : makes
359
+ ACCOMMODATION ||--o{ BOOKING : has
360
+ BOOKING ||--|| PAYMENT : requires
361
+ ```text
362
+
363
+ **Sequence Diagram:**
364
+
365
+ ```mermaid
366
+ sequenceDiagram
367
+ User->>Frontend: Click "Book"
368
+ Frontend->>API: POST /bookings
369
+ API->>Service: create()
370
+ Service->>Database: insert()
371
+ Database-->>Service: booking
372
+ Service-->>API: result
373
+ API-->>Frontend: 201 Created
374
+ Frontend-->>User: Show confirmation
375
+ ```text
376
+
377
+ **System Diagram:**
378
+
379
+ ```mermaid
380
+ graph TB
381
+ User[User]
382
+ Web[Web App]
383
+ Admin[Admin App]
384
+ API[API]
385
+ DB[(Database)]
386
+
387
+ User -->|HTTPS| Web
388
+ User -->|HTTPS| Admin
389
+ Web -->|REST| API
390
+ Admin -->|REST| API
391
+ API -->|Drizzle| DB
392
+ ```text
393
+
394
+ ---
395
+
396
+ ### Step 8: Document Technical Debt
397
+
398
+ **Location:** `tech-analysis.md` or separate `TECH_DEBT.md`
399
+
400
+ **Format:**
401
+
402
+ ```markdown
403
+
404
+ ## Technical Debt
405
+
406
+ ### TD-001: Optimize entity search
407
+
408
+ **Created:** 2024-01-15
409
+ **Priority:** Medium
410
+ **Effort:** 8 hours
411
+ **Description:** Current search uses full table scan. Need to add indexes.
412
+ **Impact:** Slow for large datasets (>10k records)
413
+ **Plan:** Add composite index in next sprint
414
+
415
+ ### TD-002: Refactor booking service
416
+
417
+ **Created:** 2024-01-15
418
+ **Priority:** Low
419
+ **Effort:** 4 hours
420
+ **Description:** Booking service has too many responsibilities
421
+ **Impact:** Hard to maintain and test
422
+ **Plan:** Extract email notifications to separate service
423
+ ```text
424
+
425
+ ---
426
+
427
+ ## Commit Preparation
428
+
429
+ ### Step 1: Run Commit Command
430
+
431
+ **Command:**
432
+
433
+ ```bash
434
+ /commit
435
+ ```text
436
+
437
+ **What it does:**
438
+
439
+ 1. Analyzes all changed files
440
+ 2. Groups changes by feature/type
441
+ 3. Generates conventional commit messages
442
+ 4. Formats as copy-paste ready commands
443
+
444
+ **Important:** Does NOT execute commits. User does manually.
445
+
446
+ ---
447
+
448
+ ### Step 2: Commit Message Format
449
+
450
+ **Standard:** Conventional Commits
451
+
452
+ **Format:**
453
+
454
+ ```text
455
+ <type>(<scope>): <subject>
456
+
457
+ <body>
458
+ ```text
459
+
460
+ **Types:**
461
+
462
+ - `feat` - New feature
463
+ - `fix` - Bug fix
464
+ - `docs` - Documentation only
465
+ - `style` - Code style (formatting)
466
+ - `refactor` - Code refactoring
467
+ - `perf` - Performance improvements
468
+ - `test` - Tests
469
+ - `build` - Build system
470
+ - `ci` - CI/CD
471
+ - `chore` - Other changes
472
+
473
+ **Scope:** Package or feature name
474
+
475
+ **Subject:** Brief description (imperative mood)
476
+
477
+ **Body:** Detailed explanation with bullet points
478
+
479
+ ---
480
+
481
+ ### Step 3: Example Output
482
+
483
+ ```bash
484
+
485
+ # Commit 1: Add entity listing entity
486
+
487
+ git add packages/schemas/src/entity/
488
+ git add packages/types/src/entity/
489
+ git add packages/db/src/schemas/entity/
490
+ git add packages/db/src/models/entity.model.ts
491
+ git commit -m "feat(entities): add entity listing entity
492
+
493
+ - Add entity types and interfaces
494
+ - Add Zod validation schemas with business rules
495
+ - Add Drizzle schema with relationships
496
+ - Add EntityModel extending BaseModel
497
+ - Include comprehensive unit tests (95% coverage)
498
+ - Add JSDoc documentation for all exports"
499
+
500
+ # Commit 2: Add entity service layer
501
+
502
+ git add packages/service-core/src/services/entity/
503
+ git commit -m "feat(services): add entity business logic
504
+
505
+ - Create EntityService extending BaseCrudService
506
+ - Implement host-only creation rule
507
+ - Add custom search with filters (type, capacity, price)
508
+ - Add availability check logic
509
+ - Include service integration tests (92% coverage)
510
+ - Document all public methods with JSDoc"
511
+
512
+ # Commit 3: Add entity API endpoints
513
+
514
+ git add apps/api/src/routes/entity/
515
+ git commit -m "feat(api): add entity CRUD endpoints
516
+
517
+ - Add protected CRUD routes using factory pattern
518
+ - Add public list/search endpoints
519
+ - Include authentication middleware
520
+ - Add input validation with Zod
521
+ - Add OpenAPI documentation
522
+ - Include API integration tests (90% coverage)"
523
+
524
+ # Commit 4: Add entity UI components
525
+
526
+ git add apps/web/src/components/entity/
527
+ git add apps/web/src/pages/entitys/
528
+ git commit -m "feat(ui): add entity listing UI
529
+
530
+ - Create EntityList component with pagination
531
+ - Create EntityCard component with variants
532
+ - Create EntityForm with TanStack Form
533
+ - Add TanStack Query integration for data fetching
534
+ - Implement responsive design (mobile + desktop)
535
+ - Apply brand guidelines (colors, typography)
536
+ - Include component tests (88% coverage)
537
+ - Add accessibility features (keyboard nav, ARIA labels)"
538
+
539
+ # Commit 5: Add documentation
540
+
541
+ git add docs/api/entitys.md
542
+ git add docs/components/EntityCard.md
543
+ git commit -m "docs: add entity feature documentation
544
+
545
+ - Add API endpoint documentation with examples
546
+ - Add component usage guides
547
+ - Include entity relationship diagrams
548
+ - Document business rules and constraints"
549
+
550
+ # Commit 6: Update configuration
551
+
552
+ git add drizzle.config.ts
553
+ git commit -m "chore: update drizzle config for new schema
554
+
555
+ - Add entity table to schema
556
+ - Update migration path"
557
+
558
+ ```text
559
+
560
+ ---
561
+
562
+ ### Step 4: Commit Grouping Strategy
563
+
564
+ **Group by:**
565
+
566
+ 1. **Layer** (Database, Service, API, Frontend)
567
+ 2. **Type** (feat, fix, docs, test)
568
+ 3. **Logical units** (cohesive changes)
569
+
570
+ **Don't:**
571
+
572
+ - ❌ Mix layers in one commit
573
+ - ❌ Mix types (feat + fix)
574
+ - ❌ Create giant commits (>50 files)
575
+ - ❌ Create tiny commits (1 line changes)
576
+
577
+ **Do:**
578
+
579
+ - ✅ Keep commits focused
580
+ - ✅ Make commits atomic
581
+ - ✅ Write clear messages
582
+ - ✅ Include context in body
583
+
584
+ ---
585
+
586
+ ### Step 5: Present to User
587
+
588
+ **Format:**
589
+
590
+ ```text
591
+ Feature implementation complete! 🎉
592
+
593
+ Summary:
594
+
595
+ - ✅ All acceptance criteria met
596
+ - ✅ 90%+ test coverage achieved
597
+ - ✅ All quality checks passing
598
+ - ✅ Documentation complete
599
+
600
+ I've prepared 6 commits following conventional commits:
601
+
602
+ 1. feat(entities): Add entity entity
603
+ 2. feat(services): Add business logic
604
+ 3. feat(api): Add API endpoints
605
+ 4. feat(ui): Add UI components
606
+ 5. docs: Add documentation
607
+ 6. chore: Update configuration
608
+
609
+ The commits are ready for you to review and execute.
610
+ Each commit is independent and can be reviewed separately.
611
+
612
+ Next steps:
613
+
614
+ 1. Review the commits below
615
+ 2. Copy and paste each git command
616
+ 3. Push to your branch
617
+ 4. Create PR for review
618
+
619
+ [Show formatted commit commands]
620
+ ```text
621
+
622
+ ---
623
+
624
+ ## Final Checklist
625
+
626
+ ### Before Handoff to User
627
+
628
+ **Implementation:**
629
+
630
+ - [ ] All acceptance criteria met
631
+ - [ ] All tasks in TODOs.md complete
632
+ - [ ] All tests passing (100%)
633
+ - [ ] Coverage ≥ 90%
634
+ - [ ] Lint passing (zero errors)
635
+ - [ ] TypeCheck passing (zero errors)
636
+
637
+ **Quality:**
638
+
639
+ - [ ] Code review complete
640
+ - [ ] Security review complete
641
+ - [ ] Performance review complete
642
+ - [ ] Accessibility review complete
643
+ - [ ] Tech lead approved
644
+
645
+ **Documentation:**
646
+
647
+ - [ ] API documentation complete
648
+ - [ ] Component documentation complete
649
+ - [ ] Architecture docs (if needed)
650
+ - [ ] README files updated
651
+ - [ ] Diagrams created
652
+ - [ ] Technical debt documented
653
+
654
+ **Commits:**
655
+
656
+ - [ ] Commits prepared (not executed)
657
+ - [ ] Conventional format followed
658
+ - [ ] Grouped logically
659
+ - [ ] Messages clear and descriptive
660
+ - [ ] Ready for user to copy/paste
661
+
662
+ **Handoff:**
663
+
664
+ - [ ] User notified of completion
665
+ - [ ] Clear next steps provided
666
+ - [ ] Questions anticipated
667
+ - [ ] Success communicated
668
+
669
+ ---
670
+
671
+ ## Handoff Template
672
+
673
+ ```text
674
+
675
+ # Feature Complete: {Feature Name}
676
+
677
+ ## Summary
678
+
679
+ ✅ **Implementation Complete**
680
+
681
+ - All {n} acceptance criteria validated
682
+ - {n} tasks completed over {n} days
683
+ - {n}% test coverage achieved
684
+ - All quality gates passed
685
+
686
+ ## What Was Built
687
+
688
+ ### Database Layer
689
+
690
+ - Added {entity} schema with relationships
691
+ - Created model with custom search
692
+ - Added migration with rollback
693
+
694
+ ### Service Layer
695
+
696
+ - Implemented business logic with validation
697
+ - Added {n} custom methods
698
+ - Enforced business rules: {list}
699
+
700
+ ### API Layer
701
+
702
+ - Added {n} endpoints (CRUD + custom)
703
+ - Implemented authentication/authorization
704
+ - Added rate limiting and validation
705
+
706
+ ### Frontend
707
+
708
+ - Created {n} components (List, Card, Form, Detail)
709
+ - Implemented state management with TanStack Query
710
+ - Applied responsive design and brand guidelines
711
+ - Ensured WCAG AA accessibility
712
+
713
+ ## Quality Metrics
714
+
715
+ - Test Coverage: {n}%
716
+ - Tests Passing: {n}/{n} (100%)
717
+ - Lint Errors: 0
718
+ - Type Errors: 0
719
+ - Security Issues: 0
720
+ - Performance: All benchmarks met
721
+
722
+ ## Documentation
723
+
724
+ Created:
725
+
726
+ - `/docs/api/{entity}.md` - API documentation
727
+ - `/docs/components/{Component}.md` - Component guides
728
+ - Updated README files
729
+
730
+ ## Technical Debt
731
+
732
+ Documented {n} items for future improvement:
733
+
734
+ 1. {Item 1} - Priority: {P}, Effort: {n}h
735
+ 2. {Item 2} - Priority: {P}, Effort: {n}h
736
+
737
+ ## Commits Prepared
738
+
739
+ I've prepared {n} commits following conventional commits standard.
740
+ Each commit is focused, atomic, and well-documented.
741
+
742
+ **Please review and execute the commits below:**
743
+
744
+ [Show commit commands]
745
+
746
+ ## Next Steps
747
+
748
+ 1. **Review Commits**
749
+ - Read through each commit message
750
+ - Verify changes make sense
751
+ - Ask questions if unclear
752
+
753
+ 2. **Execute Commits**
754
+ - Copy and paste each git command
755
+ - Commits will be added to your branch
756
+
757
+ 3. **Push to Main**
758
+
759
+ ```bash
760
+ git push origin main
761
+ ```
762
+
763
+ 4. **Deploy**
764
+ - Automatic deployment via Vercel
765
+ - Monitor for issues
766
+ - Verify feature in production
767
+
768
+ ## Questions?
769
+
770
+ Let me know if you need:
771
+
772
+ - Clarification on any commits
773
+ - Changes to commit grouping
774
+ - Additional documentation
775
+ - Anything else!
776
+
777
+ Ready to proceed? 🚀
778
+
779
+ ```text
780
+
781
+ ---
782
+
783
+ ## 🔥 CRITICAL: Final State Update
784
+
785
+ **Before Closing Phase 4:**
786
+
787
+ When the feature is fully finalized and ready for deployment, you MUST update all state files one last time:
788
+
789
+ ### 1. Update .checkpoint.json (Mark Feature Complete)
790
+
791
+ ```json
792
+ {
793
+ "currentPhase": "completed",
794
+ "status": "feature-complete",
795
+ "phases": {
796
+ "phase-1-planning": {
797
+ "status": "completed",
798
+ "duration": "6h"
799
+ },
800
+ "phase-2-implementation": {
801
+ "status": "completed",
802
+ "duration": "32h",
803
+ "tasksCompleted": 45
804
+ },
805
+ "phase-3-validation": {
806
+ "status": "completed",
807
+ "duration": "4h",
808
+ "issuesFound": 3,
809
+ "issuesFixed": 2
810
+ },
811
+ "phase-4-finalization": {
812
+ "status": "completed",
813
+ "started": "2024-01-16T08:00:00Z",
814
+ "completed": "2024-01-16T12:00:00Z",
815
+ "duration": "4h"
816
+ }
817
+ },
818
+ "summary": {
819
+ "totalDuration": "46h",
820
+ "totalTasks": 45,
821
+ "completedTasks": 45,
822
+ "deferredIssues": 1,
823
+ "technicalDebtItems": 2
824
+ },
825
+ "completedAt": "2024-01-16T12:00:00Z"
826
+ }
827
+ ```
828
+
829
+ ### 2. Update TODOs.md (Mark All Complete)
830
+
831
+ ```markdown
832
+ # Feature: User Authentication System
833
+
834
+ ## Status: ✅ COMPLETED
835
+
836
+ - Started: 2024-01-10
837
+ - Completed: 2024-01-16
838
+ - Total Duration: 46 hours
839
+ - Tasks Completed: 45/45 (100%)
840
+
841
+ ## Phases
842
+
843
+ - ✅ Phase 1: Planning (6h)
844
+ - ✅ Phase 2: Implementation (32h)
845
+ - ✅ Phase 3: Validation (4h)
846
+ - ✅ Phase 4: Finalization (4h)
847
+
848
+ ## Summary
849
+
850
+ All acceptance criteria met. Feature ready for production deployment.
851
+
852
+ [Keep existing detailed task list below]
853
+ ```
854
+
855
+ ### 3. Update .github-workflow/tracking.json (Final Sync)
856
+
857
+ ```json
858
+ {
859
+ "sessionId": "P-001-user-auth",
860
+ "status": "completed",
861
+ "completedAt": "2024-01-16T12:00:00Z",
862
+ "issues": {
863
+ "HOSP-120": { "status": "done" },
864
+ "HOSP-121": { "status": "done" },
865
+ "HOSP-122": { "status": "done" }
866
+ // ... all issues marked as done
867
+ },
868
+ "metadata": {
869
+ "totalIssues": 45,
870
+ "completedIssues": 45,
871
+ "lastSync": "2024-01-16T12:00:00Z",
872
+ "syncStatus": "final-sync-complete"
873
+ }
874
+ }
875
+ ```
876
+
877
+ ### 4. Commit Final State
878
+
879
+ ```bash
880
+ git add .claude/sessions/planning/P-001-user-auth/TODOs.md
881
+ git add .claude/sessions/planning/P-001-user-auth/.checkpoint.json
882
+ git add .github-workflow/tracking.json
883
+ git commit -m "docs: Phase 4 completed - feature ready for deployment
884
+
885
+ - All 45 tasks completed (100%)
886
+ - Documentation finalized
887
+ - Technical debt documented
888
+ - Ready for production deployment"
889
+
890
+ git push origin main
891
+ ```
892
+
893
+ ### 5. Optional: Sync with GitHub
894
+
895
+ ```bash
896
+ pnpm planning:sync .claude/sessions/planning/P-001-user-auth/
897
+ ```
898
+
899
+ This will:
900
+
901
+ - Mark all GitHub issues as "Done"
902
+ - Update project progress to 100%
903
+ - Add final comment with summary
904
+
905
+ ---
906
+
907
+ ## Summary
908
+
909
+ **Phase 4 Checklist:**
910
+
911
+ - [ ] Documentation complete
912
+ - [ ] Commits prepared (not executed)
913
+ - [ ] 🔥 **TODOs.md updated (marked complete)**
914
+ - [ ] 🔥 **.checkpoint.json updated (marked complete)**
915
+ - [ ] 🔥 **.github-workflow/tracking.json updated (final sync)**
916
+ - [ ] 🔥 **State changes committed and pushed**
917
+ - [ ] User notified
918
+ - [ ] Clear next steps
919
+ - [ ] All files in proper locations
920
+ - [ ] Technical debt documented
921
+ - [ ] Success celebrated 🎉
922
+
923
+ ---
924
+
925
+ **Remember: User controls the git history. We prepare, they execute.**
926
+
927
+ **⚠️ CRITICAL**: State files MUST be updated and committed before considering the feature "complete". This ensures accurate project tracking and team visibility.