codex-genesis-harness 0.1.1 → 0.1.4

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 (180) hide show
  1. package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
  2. package/.codebase/CURRENT_STATE.md +2 -0
  3. package/.codebase/DOMAIN_MODELS.md +5 -3
  4. package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -0
  5. package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -0
  6. package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -0
  7. package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -0
  8. package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -0
  9. package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
  10. package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
  11. package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
  12. package/.codebase/README.md +139 -0
  13. package/.codebase/RECOVERY_POINTS.md +438 -0
  14. package/.codex/skills/genesis-api-sync/SKILL.md +354 -0
  15. package/.codex/skills/genesis-api-sync/agents/openai.yaml +7 -0
  16. package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -0
  17. package/.codex/skills/genesis-api-sync/examples/example.md +68 -0
  18. package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -0
  19. package/.codex/skills/genesis-debug-guide/SKILL.md +479 -0
  20. package/.codex/skills/genesis-debug-guide/agents/openai.yaml +7 -0
  21. package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -0
  22. package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -0
  23. package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -0
  24. package/.codex/skills/genesis-debug-guide/examples/example.md +48 -0
  25. package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -0
  26. package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -0
  27. package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -0
  28. package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -0
  29. package/.codex/skills/genesis-docs-automation/agents/openai.yaml +7 -0
  30. package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -0
  31. package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -0
  32. package/.codex/skills/genesis-docs-automation/examples/example.md +59 -0
  33. package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -0
  34. package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -0
  35. package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -0
  36. package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -0
  37. package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -0
  38. package/.codex/skills/genesis-harness/SKILL.md +734 -82
  39. package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -0
  40. package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -0
  41. package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -0
  42. package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -0
  43. package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -0
  44. package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -0
  45. package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -0
  46. package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -0
  47. package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +23 -23
  48. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +24 -24
  49. package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +21 -21
  50. package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +46 -46
  51. package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +24 -24
  52. package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +25 -25
  53. package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
  54. package/.codex/skills/genesis-harness/scripts/create-adr.sh +74 -74
  55. package/.codex/skills/genesis-harness/scripts/create-bug.sh +160 -160
  56. package/.codex/skills/genesis-harness/scripts/create-feature.sh +217 -217
  57. package/.codex/skills/genesis-harness/scripts/detect-stack.sh +26 -26
  58. package/.codex/skills/genesis-harness/scripts/init-planning.sh +750 -719
  59. package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +12 -12
  60. package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
  61. package/.codex/skills/genesis-harness/scripts/run-verification.sh +47 -47
  62. package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
  63. package/.codex/skills/genesis-harness/scripts/update-state.sh +33 -33
  64. package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -0
  65. package/.codex/skills/genesis-harness-engineering/checklists/checklist.md +48 -0
  66. package/.codex/skills/genesis-harness-engineering/examples/example.md +57 -0
  67. package/.codex/skills/genesis-harness-engineering/playbooks/harness-evolution.md +99 -0
  68. package/.codex/skills/genesis-harness-engineering/templates/harness-change-template.md +37 -0
  69. package/.codex/skills/genesis-observability-automation/SKILL.md +382 -0
  70. package/.codex/skills/genesis-observability-automation/agents/openai.yaml +7 -0
  71. package/.codex/skills/genesis-observability-automation/examples/example.md +86 -0
  72. package/.codex/skills/genesis-performance-profiling/SKILL.md +510 -0
  73. package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +6 -0
  74. package/.codex/skills/genesis-performance-profiling/checklists/optimization-verification.md +199 -0
  75. package/.codex/skills/genesis-performance-profiling/checklists/performance-baseline.md +183 -0
  76. package/.codex/skills/genesis-performance-profiling/examples/example.md +234 -0
  77. package/.codex/skills/genesis-performance-profiling/observability/performance-tracking.md +202 -0
  78. package/.codex/skills/genesis-performance-profiling/playbooks/load-testing-orchestration.md +593 -0
  79. package/.codex/skills/genesis-performance-profiling/playbooks/profiling-playbook.md +601 -0
  80. package/.codex/skills/genesis-performance-profiling/templates/load-test-config-template.md +428 -0
  81. package/.codex/skills/genesis-performance-profiling/templates/performance-report-template.md +238 -0
  82. package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -0
  83. package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +7 -0
  84. package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -0
  85. package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -0
  86. package/.codex/skills/genesis-release-orchestration/examples/example.md +78 -0
  87. package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -0
  88. package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -0
  89. package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -0
  90. package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -0
  91. package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -0
  92. package/.codex/skills/genesis-research-first/SKILL.md +237 -0
  93. package/.codex/skills/genesis-research-first/agents/openai.yaml +7 -0
  94. package/.codex/skills/genesis-research-first/examples/example.md +85 -0
  95. package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -0
  96. package/.codex/skills/genesis-spec-propagation/agents/openai.yaml +7 -0
  97. package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -0
  98. package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -0
  99. package/.codex/skills/genesis-spec-propagation/examples/example.md +63 -0
  100. package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -0
  101. package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -0
  102. package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -0
  103. package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -0
  104. package/.codex/skills/spec-impact-engine/SKILL.md +504 -0
  105. package/.codex/skills/spec-impact-engine/agents/openai.yaml +7 -0
  106. package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +262 -0
  107. package/.codex/skills/spec-impact-engine/examples/example.md +98 -0
  108. package/.codex/skills/spec-impact-engine/templates/impact-report.md +248 -0
  109. package/.codex/skills/spec-impact-engine/templates/migration-guide.md +223 -0
  110. package/.codex-plugin/plugin.json +1 -1
  111. package/README.EN.md +719 -0
  112. package/README.VI.md +712 -0
  113. package/README.md +261 -107
  114. package/VERSION +1 -1
  115. package/bin/genesis-harness.js +20 -11
  116. package/package.json +1 -1
  117. package/scripts/README.md +342 -0
  118. package/scripts/compact-context.sh +54 -0
  119. package/scripts/detect-changes.sh +152 -0
  120. package/scripts/install.sh +50 -41
  121. package/scripts/offload-log.sh +72 -0
  122. package/scripts/run-evals.sh +70 -43
  123. package/scripts/run-verify-loop.sh +75 -0
  124. package/scripts/uninstall.sh +52 -43
  125. package/scripts/verify.sh +165 -73
  126. package/.codex/skills/harness-engineering-skill/SKILL.md +0 -45
  127. package/.codex/skills/harness-engineering-skill/checklists/checklist.md +0 -8
  128. package/.codex/skills/harness-engineering-skill/examples/example.md +0 -4
  129. package/.codex/skills/harness-engineering-skill/templates/harness-change-template.md +0 -8
  130. /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/SKILL.md +0 -0
  131. /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/agents/openai.yaml +0 -0
  132. /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/checklists/checklist.md +0 -0
  133. /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/examples/example.md +0 -0
  134. /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/templates/provider-contract-template.md +0 -0
  135. /package/.codex/skills/{api-contract-skill → genesis-api-contract}/SKILL.md +0 -0
  136. /package/.codex/skills/{api-contract-skill → genesis-api-contract}/agents/openai.yaml +0 -0
  137. /package/.codex/skills/{api-contract-skill → genesis-api-contract}/checklists/checklist.md +0 -0
  138. /package/.codex/skills/{api-contract-skill → genesis-api-contract}/examples/example.md +0 -0
  139. /package/.codex/skills/{api-contract-skill → genesis-api-contract}/templates/api-contract-template.md +0 -0
  140. /package/.codex/skills/{architecture-skill → genesis-architecture}/SKILL.md +0 -0
  141. /package/.codex/skills/{architecture-skill → genesis-architecture}/agents/openai.yaml +0 -0
  142. /package/.codex/skills/{architecture-skill → genesis-architecture}/checklists/checklist.md +0 -0
  143. /package/.codex/skills/{architecture-skill → genesis-architecture}/examples/example.md +0 -0
  144. /package/.codex/skills/{architecture-skill → genesis-architecture}/templates/architecture-decision-template.md +0 -0
  145. /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/SKILL.md +0 -0
  146. /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/agents/openai.yaml +0 -0
  147. /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/checklists/checklist.md +0 -0
  148. /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/examples/example.md +0 -0
  149. /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/templates/map-update-template.md +0 -0
  150. /package/.codex/skills/{design-spec-skill → genesis-design-spec}/SKILL.md +0 -0
  151. /package/.codex/skills/{design-spec-skill → genesis-design-spec}/agents/openai.yaml +0 -0
  152. /package/.codex/skills/{design-spec-skill → genesis-design-spec}/checklists/checklist.md +0 -0
  153. /package/.codex/skills/{design-spec-skill → genesis-design-spec}/examples/example.md +0 -0
  154. /package/.codex/skills/{design-spec-skill → genesis-design-spec}/templates/design-spec-template.md +0 -0
  155. /package/.codex/skills/{docs-skill → genesis-docs}/SKILL.md +0 -0
  156. /package/.codex/skills/{docs-skill → genesis-docs}/agents/openai.yaml +0 -0
  157. /package/.codex/skills/{docs-skill → genesis-docs}/checklists/checklist.md +0 -0
  158. /package/.codex/skills/{docs-skill → genesis-docs}/examples/example.md +0 -0
  159. /package/.codex/skills/{docs-skill → genesis-docs}/templates/docs-update-template.md +0 -0
  160. /package/.codex/skills/{harness-engineering-skill → genesis-harness-engineering}/agents/openai.yaml +0 -0
  161. /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/SKILL.md +0 -0
  162. /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/agents/openai.yaml +0 -0
  163. /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/checklists/checklist.md +0 -0
  164. /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/examples/example.md +0 -0
  165. /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/templates/orchestration-template.md +0 -0
  166. /package/.codex/skills/{planning-skill → genesis-planning}/SKILL.md +0 -0
  167. /package/.codex/skills/{planning-skill → genesis-planning}/agents/openai.yaml +0 -0
  168. /package/.codex/skills/{planning-skill → genesis-planning}/checklists/checklist.md +0 -0
  169. /package/.codex/skills/{planning-skill → genesis-planning}/examples/example.md +0 -0
  170. /package/.codex/skills/{planning-skill → genesis-planning}/templates/plan-template.md +0 -0
  171. /package/.codex/skills/{release-skill → genesis-release}/SKILL.md +0 -0
  172. /package/.codex/skills/{release-skill → genesis-release}/agents/openai.yaml +0 -0
  173. /package/.codex/skills/{release-skill → genesis-release}/checklists/checklist.md +0 -0
  174. /package/.codex/skills/{release-skill → genesis-release}/examples/example.md +0 -0
  175. /package/.codex/skills/{release-skill → genesis-release}/templates/release-checklist-template.md +0 -0
  176. /package/.codex/skills/{research-skill → genesis-research}/SKILL.md +0 -0
  177. /package/.codex/skills/{research-skill → genesis-research}/agents/openai.yaml +0 -0
  178. /package/.codex/skills/{research-skill → genesis-research}/checklists/checklist.md +0 -0
  179. /package/.codex/skills/{research-skill → genesis-research}/examples/example.md +0 -0
  180. /package/.codex/skills/{research-skill → genesis-research}/templates/research-note-template.md +0 -0
@@ -0,0 +1,494 @@
1
+ # Semantic Versioning Automation Playbook
2
+
3
+ **Purpose**: Automated semantic version calculation with decision rationale
4
+ **Duration**: 15 minutes end-to-end
5
+ **Outcome**: Version bump approved with migration guide generated
6
+
7
+ ---
8
+
9
+ ## Complete Example: API Evolution v1 → v2 → v3
10
+
11
+ ### **Scenario**: E-Commerce Platform Evolution (3 major releases)
12
+
13
+ **Timeline**:
14
+ - v1.0 (June 2025): Initial user API
15
+ - v2.0 (Sept 2025): Add avatar field, deprecate legacy endpoints
16
+ - v3.0 (May 2026): Remove deprecated endpoints, breaking changes
17
+
18
+ ---
19
+
20
+ ## Release v3.0: Breaking Change Propagation
21
+
22
+ ### **Step 1: Analyze Changes Since v2.5** (2 min)
23
+
24
+ **Current Version**: v2.5.3 (last production release)
25
+ **Git commits since v2.5.3 tag**: 47 commits
26
+
27
+ **Changes Found**:
28
+ 1. Removed: `POST /users/:id/avatar` endpoint (deprecated in v2.0)
29
+ 2. Changed: `GET /users/:id` response format
30
+ - Old: `{ user: { id, name, email, avatar } }`
31
+ - New: `{ data: { id, name, email, avatarUrl } }`
32
+ 3. Added: `PATCH /users/:id/profile` endpoint (new feature)
33
+ 4. Fixed: User role permission calculation bug (role-admin query issue)
34
+ 5. Internal: Refactored database layer (no external behavior change)
35
+
36
+ **Categorization**:
37
+ - BREAKING CHANGES: 2 (endpoint removal, response format change)
38
+ - FEATURE CHANGES: 1 (new endpoint)
39
+ - BUG FIXES: 1 (permission calculation)
40
+ - INTERNAL: 1 (database refactor)
41
+
42
+ ---
43
+
44
+ ### **Step 2: Apply Semantic Versioning Rules** (3 min)
45
+
46
+ **Rule Decision Tree**:
47
+ ```
48
+ Has BREAKING changes?
49
+ YES → Need MAJOR version bump
50
+
51
+ BREAKING changes:
52
+ - Removed POST /users/:id/avatar (breaking: endpoint gone)
53
+ - Changed response format { user: {...} } → { data: {...} } (breaking: clients can't parse)
54
+
55
+ Current version: v2.5.3
56
+ MAJOR: 2 → 3
57
+ MINOR: 5 → 0 (reset on major)
58
+ PATCH: 3 → 0 (reset on major)
59
+
60
+ New version: v3.0.0
61
+ ```
62
+
63
+ **Semantic Versioning Logic**:
64
+ ```
65
+ v{MAJOR}.{MINOR}.{PATCH}
66
+
67
+ MAJOR version bump when:
68
+ - Breaking changes exist (incompatible with current consumers)
69
+ - Examples: Removed endpoint, changed response type, new required field
70
+
71
+ MINOR version bump when:
72
+ - New optional features added
73
+ - No breaking changes
74
+ - Backward compatible
75
+ - Example: New optional field, new optional endpoint
76
+
77
+ PATCH version bump when:
78
+ - Bug fixes only
79
+ - No new features
80
+ - No breaking changes
81
+ - Backward compatible
82
+ - Example: Fixed calculation bug, fixed race condition
83
+ ```
84
+
85
+ **Version Proposal**: v2.5.3 → v3.0.0 ✅
86
+
87
+ ---
88
+
89
+ ### **Step 3: Risk Assessment & Classification** (4 min)
90
+
91
+ **Breaking Change #1: Removed Endpoint**
92
+ ```
93
+ What changed:
94
+ - Endpoint: POST /users/:id/avatar
95
+ - Status: Deprecated in v2.0 (6 months ago)
96
+ - Now: Completely removed
97
+
98
+ Impact:
99
+ - Clients still calling this endpoint: 2 services affected
100
+ * MobileApp v1.0-1.2 (no longer maintained)
101
+ * LegacyAdminTool (internal, 1 team using)
102
+
103
+ Migration requirement:
104
+ - MobileApp: Must update to v1.3+ (uses new avatar API)
105
+ - AdminTool: Must use PATCH /users/:id/profile instead
106
+
107
+ Timeline:
108
+ - Deprecation warning: Since v2.0 (6 months)
109
+ - Final removal: v3.0 (now)
110
+ - Migration deadline: Must complete before v3.0 deployment
111
+
112
+ Consumer notification:
113
+ - MobileApp team: Already migrated (v1.3 exists)
114
+ - AdminTool team: Need immediate notification + support
115
+ ```
116
+
117
+ **Breaking Change #2: Response Format Changed**
118
+ ```
119
+ What changed:
120
+ - Old format: { user: { id, name, email, avatar } }
121
+ - New format: { data: { id, name, email, avatarUrl } }
122
+
123
+ Impact (ALL CLIENTS affected):
124
+ - 12 API consumers affected:
125
+ * WebApp (prod, 2M users) - HIGH IMPACT
126
+ * Dashboard (internal, 500 users)
127
+ * AdminTool (internal, 100 users)
128
+ * Mobile (v2.0+, 5M users) - HIGH IMPACT
129
+ * Partner integrations (3 external clients) - MEDIUM IMPACT
130
+ * Webhooks (consumers of events)
131
+
132
+ Change details:
133
+ - Field renamed: avatar → avatarUrl (object removed from response)
134
+ - Object structure changed: user {...} → data {...}
135
+ - All clients must update parsing
136
+
137
+ Migration requirement:
138
+ - Old code: `const avatar = response.user.avatar`
139
+ - New code: `const avatarUrl = response.data.avatarUrl`
140
+ - Change type: BREAKING (clients will fail if not updated)
141
+
142
+ Timeline:
143
+ - Response format change: Fully breaking (no deprecation period)
144
+ - Migration deadline: All clients must update BEFORE v3.0 deployment
145
+ - Parallel API strategy: Consider running v2 API (in parallel) during transition?
146
+ ```
147
+
148
+ **Risk Score Calculation**:
149
+ ```
150
+ Scoring matrix (1-10):
151
+ 1-2: Patch only, no breaking changes (LOW)
152
+ 3-5: Minor + some fixes, minimal breaking (MEDIUM)
153
+ 6-8: Major + significant breaking changes (HIGH)
154
+ 9-10: Multiple major breaking + complex migration (CRITICAL)
155
+
156
+ This release:
157
+ - BREAKING changes: 2 (heavy weight: 5 points)
158
+ - Affected consumers: 12+ (heavy weight: 2 points)
159
+ - Migration complexity: HIGH (field rename + structure change: 1 point)
160
+ - Timeline pressure: Moderate (6-month deprecation warning: -1 point)
161
+
162
+ RISK SCORE: 7/10 (HIGH RISK)
163
+ ```
164
+
165
+ **Risk Classification**: ⚠️ **HIGH RISK - Requires manual approval + staged deployment**
166
+
167
+ ---
168
+
169
+ ### **Step 4: Generate Migration Guides** (4 min)
170
+
171
+ **Migration Guide #1: Avatar Field Removal**
172
+
173
+ ```markdown
174
+ # Migration Guide: Avatar Endpoint Removal (v3.0)
175
+
176
+ ## What Changed
177
+ - **Removed**: `POST /users/:id/avatar` endpoint
178
+ - **Reason**: Replaced by `PATCH /users/:id/profile` (v2.0)
179
+ - **Timeline**: Deprecated for 6 months, removed in v3.0
180
+
181
+ ## Who is affected
182
+ - Services using `POST /users/:id/avatar`
183
+ - Current: MobileApp (v<1.3), AdminTool
184
+
185
+ ## Migration Steps
186
+
187
+ ### Before (Old Code - v2.5):
188
+ ```javascript
189
+ // Upload user avatar
190
+ async function updateAvatar(userId, file) {
191
+ const formData = new FormData();
192
+ formData.append('file', file);
193
+
194
+ const response = await fetch(`/users/${userId}/avatar`, {
195
+ method: 'POST',
196
+ body: formData
197
+ });
198
+
199
+ return response.json(); // { avatar: "url..." }
200
+ }
201
+ ```
202
+
203
+ ### After (New Code - v3.0):
204
+ ```javascript
205
+ // Upload user profile (includes avatar)
206
+ async function updateProfile(userId, updates) {
207
+ const response = await fetch(`/users/${userId}/profile`, {
208
+ method: 'PATCH',
209
+ headers: { 'Content-Type': 'application/json' },
210
+ body: JSON.stringify(updates)
211
+ });
212
+
213
+ return response.json(); // { data: { avatarUrl: "url..." } }
214
+ }
215
+
216
+ // Usage:
217
+ updateProfile(userId, {
218
+ avatarUrl: 'https://...'
219
+ });
220
+ ```
221
+
222
+ ## Troubleshooting
223
+
224
+ **Q: I get 404 on POST /users/:id/avatar**
225
+ A: This endpoint was removed in v3.0. Use `PATCH /users/:id/profile` instead.
226
+
227
+ **Q: What's the new response format?**
228
+ A: `{ data: { id, name, email, avatarUrl } }` (see response format migration guide)
229
+
230
+ ## Support
231
+ Contact: api-support@company.com
232
+ Slack: #api-migration
233
+ ```
234
+
235
+ **Migration Guide #2: Response Format Change**
236
+
237
+ ```markdown
238
+ # Migration Guide: Response Format Change (v3.0)
239
+
240
+ ## What Changed
241
+ - **Old**: `{ user: { id, name, email, avatar } }`
242
+ - **New**: `{ data: { id, name, email, avatarUrl } }`
243
+
244
+ ## All Affected Endpoints
245
+ GET /users
246
+ GET /users/:id
247
+ PATCH /users/:id/profile
248
+ POST /users/:id/register
249
+ (and 5 more endpoints...)
250
+
251
+ ## Migration Steps
252
+
253
+ ### JavaScript / TypeScript
254
+
255
+ **Before (v2.5)**:
256
+ ```typescript
257
+ const response = await fetch('/users/123');
258
+ const { user } = await response.json();
259
+ console.log(user.avatar); // "https://..."
260
+ ```
261
+
262
+ **After (v3.0)**:
263
+ ```typescript
264
+ const response = await fetch('/users/123');
265
+ const { data } = await response.json();
266
+ console.log(data.avatarUrl); // "https://..."
267
+ ```
268
+
269
+ ### Python
270
+
271
+ **Before**:
272
+ ```python
273
+ response = requests.get('/users/123')
274
+ data = response.json()
275
+ avatar = data['user']['avatar']
276
+ ```
277
+
278
+ **After**:
279
+ ```python
280
+ response = requests.get('/users/123')
281
+ data = response.json()
282
+ avatar_url = data['data']['avatarUrl']
283
+ ```
284
+
285
+ ### cURL
286
+
287
+ **Before**:
288
+ ```bash
289
+ curl https://api.example.com/users/123
290
+ # { "user": { "avatar": "https://..." } }
291
+ ```
292
+
293
+ **After**:
294
+ ```bash
295
+ curl https://api.example.com/users/123
296
+ # { "data": { "avatarUrl": "https://..." } }
297
+ ```
298
+
299
+ ## Migration Timeline
300
+
301
+ | Date | Action |
302
+ |------|--------|
303
+ | 2026-05-31 | v3.0 released |
304
+ | 2026-06-07 | Support deadline for v2.5 (7 days) |
305
+ | 2026-07-31 | v2.5 sunsets, removed from production |
306
+
307
+ **Deadlines**:
308
+ - ⚠️ Complete migration: Before 2026-06-07 (7 days)
309
+ - ⚠️ Final migration: Before 2026-07-31 (sunset date)
310
+
311
+ ## Common Pitfalls
312
+
313
+ ❌ **Mistake #1**: Accessing `response.user` (old format)
314
+ ```javascript
315
+ // This will fail in v3.0:
316
+ const name = response.user.name; // undefined
317
+
318
+ // Correct:
319
+ const name = response.data.name;
320
+ ```
321
+
322
+ ❌ **Mistake #2**: Trying both formats without checking
323
+ ```javascript
324
+ // Don't do this:
325
+ const avatar = response.user?.avatar || response.data?.avatarUrl;
326
+
327
+ // Check API version instead:
328
+ const version = response.headers['x-api-version'];
329
+ const avatar = version === '3' ? response.data.avatarUrl : response.user.avatar;
330
+ ```
331
+
332
+ ## Support
333
+ Contact: api-support@company.com
334
+ Slack: #api-migration
335
+ GitHub: github.com/company/api/issues
336
+ ```
337
+
338
+ ---
339
+
340
+ ### **Step 5: Generate Release Notes** (2 min)
341
+
342
+ ```markdown
343
+ # Release Notes: v3.0.0
344
+
345
+ **Released**: May 31, 2026
346
+ **Version**: v3.0.0 (MAJOR release)
347
+
348
+ ## 🎉 What's New
349
+
350
+ ### New Features
351
+ - ✨ **New Profile Endpoint**: `PATCH /users/:id/profile` for comprehensive user updates
352
+ - ✨ **Improved avatar handling**: `avatarUrl` field with better URL validation
353
+ - ✨ **Enhanced permission system**: More granular role-based access control
354
+
355
+ ### 🐛 Bug Fixes
356
+ - Fixed: User role permission calculation (was incorrectly denying admin-only access)
357
+ - Fixed: Avatar URL edge cases with non-ASCII filenames
358
+
359
+ ### 📚 Documentation
360
+ - Added: API migration guide (breaking changes)
361
+ - Added: Per-endpoint upgrade instructions
362
+ - Added: Code examples in 5+ languages
363
+
364
+ ## ⚠️ BREAKING CHANGES
365
+
366
+ ### 1. Response Format Changed (ALL ENDPOINTS)
367
+ **Affects**: All API consumers
368
+
369
+ **Old Format**:
370
+ ```json
371
+ { "user": { "id": 1, "name": "John", "avatar": "https://..." } }
372
+ ```
373
+
374
+ **New Format**:
375
+ ```json
376
+ { "data": { "id": 1, "name": "John", "avatarUrl": "https://..." } }
377
+ ```
378
+
379
+ **Action required**: Update client code to parse new format
380
+ **Migration guide**: [See Full Migration Guide](https://docs.example.com/v3-migration)
381
+ **Deadline**: Before v3.1 (November 2026)
382
+
383
+ ### 2. Removed Endpoint: POST /users/:id/avatar
384
+ **Deprecated since**: v2.0 (October 2025)
385
+ **Removed in**: v3.0 (May 2026)
386
+
387
+ **Action required**: Use `PATCH /users/:id/profile` instead
388
+ **Migration guide**: [Avatar Endpoint Removal](https://docs.example.com/avatar-migration)
389
+
390
+ ## 🗑️ Deprecated Features
391
+ - Field `user.avatar` → use `data.avatarUrl`
392
+ - Endpoint structure: `/users/{id}` → now returns `{ data: {...} }`
393
+
394
+ ## 📊 Deployment
395
+
396
+ **Deployment Strategy**: Canary (High-Risk Release)
397
+ - Stage 1: 1% traffic (1 hour)
398
+ - Stage 2: 10% traffic (2 hours)
399
+ - Stage 3: 50% traffic (4 hours)
400
+ - Stage 4: 100% traffic (full rollout)
401
+
402
+ **Timeline**: 8+ hours total deployment window
403
+
404
+ ## 🆘 Support
405
+
406
+ **Migration assistance**: api-support@company.com
407
+ **Slack**: #api-v3-migration
408
+ **Status page**: status.example.com
409
+ **Emergency rollback**: Available for 24 hours post-deployment
410
+
411
+ ---
412
+ ```
413
+
414
+ ---
415
+
416
+ ### **Step 6: Generate Deployment Strategy** (2 min)
417
+
418
+ ```
419
+ DEPLOYMENT STRATEGY: Canary (HIGH RISK SCORE 7/10)
420
+
421
+ Breaking Changes: 2 (major)
422
+ Risk Level: HIGH
423
+ Recommended Approach: Canary deployment with staged rollout
424
+
425
+ STAGE 1: 1% Traffic (1 hour)
426
+ Deployment time: 10:00 UTC
427
+ Target: 1% of traffic routed to v3.0
428
+ Monitoring: Continuous
429
+ Alerts: Error rate >5%
430
+ Decision: After 1 hour, go/no-go for Stage 2
431
+
432
+ STAGE 2: 10% Traffic (2 hours)
433
+ Deployment time: 11:15 UTC
434
+ Target: 10% of traffic
435
+ Monitoring: Continuous
436
+ Alerts: Error rate >5%
437
+ Decision: After 2 hours, go/no-go for Stage 3
438
+
439
+ STAGE 3: 50% Traffic (4 hours)
440
+ Deployment time: 13:30 UTC
441
+ Target: 50% of traffic
442
+ Monitoring: Continuous
443
+ Alerts: Error rate >2%
444
+ Decision: After 4 hours, go/no-go for Stage 4
445
+
446
+ STAGE 4: 100% Traffic (Full Rollout)
447
+ Deployment time: 17:45 UTC
448
+ Target: All traffic
449
+ Monitoring: Continue for 24 hours
450
+ Rollback available: For 24 hours post-complete deployment
451
+
452
+ Total timeline: 8 hours
453
+ Team required: On-call for full 8 hours + 24 hours post-deployment monitoring
454
+ ```
455
+
456
+ ---
457
+
458
+ ### **Step 7: Validation & Approval** (2 min)
459
+
460
+ **Pre-Release Validation Checklist**:
461
+ - ✅ Tests pass (85% coverage)
462
+ - ✅ Breaking changes documented (2/2)
463
+ - ✅ Migration guides created (2/2)
464
+ - ✅ Release notes generated
465
+ - ✅ Runbooks prepared (dev, staging, prod)
466
+ - ✅ Rollback tested
467
+ - ✅ Approval obtained (Tech Lead, Product Lead)
468
+
469
+ **Approval Chain**:
470
+ - ✅ Tech Lead approved: 2026-05-30 15:30 UTC (John Doe)
471
+ - ✅ Product Lead approved: 2026-05-30 16:45 UTC (Jane Smith)
472
+ - ✅ Deployment window: 2026-05-31 10:00-18:00 UTC
473
+
474
+ **Status**: ✅ **APPROVED FOR DEPLOYMENT**
475
+
476
+ ---
477
+
478
+ ## Summary: v3.0.0 Release
479
+
480
+ | Aspect | Value |
481
+ |--------|-------|
482
+ | **Current Version** | v2.5.3 |
483
+ | **New Version** | v3.0.0 |
484
+ | **Version Bump Type** | MAJOR (breaking changes) |
485
+ | **Breaking Changes** | 2 |
486
+ | **Affected Consumers** | 12+ |
487
+ | **Risk Score** | 7/10 (HIGH) |
488
+ | **Deployment Strategy** | Canary (1%→10%→50%→100%) |
489
+ | **Timeline** | 8+ hours |
490
+ | **Approval Status** | ✅ APPROVED |
491
+ | **Migration Guides** | 2 created |
492
+ | **Release Notes** | Generated |
493
+
494
+ **Ready for**: Canary deployment beginning Stage 1 (1% traffic)