codex-genesis-harness 0.1.4 → 0.1.6

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 (153) hide show
  1. package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -216
  2. package/.codebase/CURRENT_STATE.md +9 -7
  3. package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -161
  4. package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -613
  5. package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -429
  6. package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -351
  7. package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -419
  8. package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -292
  9. package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -486
  10. package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -456
  11. package/.codebase/README.md +139 -139
  12. package/.codebase/RECOVERY_POINTS.md +438 -438
  13. package/.codebase/state.json +37 -0
  14. package/.codex/skills/genesis-api-sync/SKILL.md +354 -354
  15. package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -101
  16. package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -257
  17. package/.codex/skills/genesis-debug-guide/SKILL.md +479 -479
  18. package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -339
  19. package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -210
  20. package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -158
  21. package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -365
  22. package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -289
  23. package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -288
  24. package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -1003
  25. package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -359
  26. package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -312
  27. package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -382
  28. package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -851
  29. package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -491
  30. package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -187
  31. package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -297
  32. package/.codex/skills/genesis-harness/SKILL.md +1427 -1418
  33. package/.codex/skills/genesis-harness/agents/openai.yaml +7 -7
  34. package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -169
  35. package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -157
  36. package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -216
  37. package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -211
  38. package/.codex/skills/genesis-harness/references/planning-schema.md +35 -35
  39. package/.codex/skills/genesis-harness/references/quality-rubric.md +21 -21
  40. package/.codex/skills/genesis-harness/references/research-rubric.md +41 -41
  41. package/.codex/skills/genesis-harness/references/workflows.md +33 -33
  42. package/.codex/skills/genesis-harness/resources/agents-template.md +27 -27
  43. package/.codex/skills/genesis-harness/resources/api-docs-template.md +32 -32
  44. package/.codex/skills/genesis-harness/resources/architecture-template.md +30 -30
  45. package/.codex/skills/genesis-harness/resources/audit-template.md +26 -26
  46. package/.codex/skills/genesis-harness/resources/bug-template.md +34 -34
  47. package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -204
  48. package/.codex/skills/genesis-harness/resources/check-template.md +21 -21
  49. package/.codex/skills/genesis-harness/resources/conventions-template.md +42 -42
  50. package/.codex/skills/genesis-harness/resources/decision-template.md +33 -33
  51. package/.codex/skills/genesis-harness/resources/design-template.md +26 -26
  52. package/.codex/skills/genesis-harness/resources/escalation-template.md +21 -21
  53. package/.codex/skills/genesis-harness/resources/feature-template.md +49 -49
  54. package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -131
  55. package/.codex/skills/genesis-harness/resources/integrations-template.md +32 -32
  56. package/.codex/skills/genesis-harness/resources/journeys-template.md +13 -13
  57. package/.codex/skills/genesis-harness/resources/lessons-learned-template.md +12 -12
  58. package/.codex/skills/genesis-harness/resources/observability-template.md +34 -34
  59. package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -76
  60. package/.codex/skills/genesis-harness/resources/phase-template.md +34 -34
  61. package/.codex/skills/genesis-harness/resources/pitfalls-template.md +22 -22
  62. package/.codex/skills/genesis-harness/resources/planning-tree-template.md +39 -39
  63. package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -347
  64. package/.codex/skills/genesis-harness/resources/project-template.md +38 -38
  65. package/.codex/skills/genesis-harness/resources/quality-score-template.md +11 -11
  66. package/.codex/skills/genesis-harness/resources/requirements-template.md +26 -26
  67. package/.codex/skills/genesis-harness/resources/research-template.md +26 -26
  68. package/.codex/skills/genesis-harness/resources/review-template.md +22 -22
  69. package/.codex/skills/genesis-harness/resources/spec-changelog-template.md +6 -6
  70. package/.codex/skills/genesis-harness/resources/stack-template.md +33 -33
  71. package/.codex/skills/genesis-harness/resources/verification-template.md +26 -26
  72. package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +0 -0
  73. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +0 -0
  74. package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +0 -0
  75. package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +0 -0
  76. package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +0 -0
  77. package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +0 -0
  78. package/.codex/skills/genesis-harness/scripts/compact-context.sh +0 -0
  79. package/.codex/skills/genesis-harness/scripts/create-adr.sh +0 -0
  80. package/.codex/skills/genesis-harness/scripts/create-bug.sh +0 -0
  81. package/.codex/skills/genesis-harness/scripts/create-feature.sh +0 -0
  82. package/.codex/skills/genesis-harness/scripts/detect-stack.sh +0 -0
  83. package/.codex/skills/genesis-harness/scripts/init-planning.sh +0 -0
  84. package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +0 -0
  85. package/.codex/skills/genesis-harness/scripts/offload-log.sh +0 -0
  86. package/.codex/skills/genesis-harness/scripts/run-verification.sh +0 -0
  87. package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +0 -0
  88. package/.codex/skills/genesis-harness/scripts/update-state.sh +0 -0
  89. package/.codex/skills/genesis-mvp-planning/SKILL.md +114 -0
  90. package/.codex/skills/genesis-mvp-planning/agents/openai.yaml +6 -0
  91. package/.codex/skills/genesis-mvp-planning/checklists/mvp-readiness.md +18 -0
  92. package/.codex/skills/genesis-mvp-planning/examples/5-phase-roadmap-example.md +43 -0
  93. package/.codex/skills/genesis-mvp-planning/templates/phase-1-core.md +17 -0
  94. package/.codex/skills/genesis-mvp-planning/templates/phase-2-auth.md +17 -0
  95. package/.codex/skills/genesis-mvp-planning/templates/phase-3-features.md +17 -0
  96. package/.codex/skills/genesis-mvp-planning/templates/phase-4-integrations.md +17 -0
  97. package/.codex/skills/genesis-mvp-planning/templates/phase-5-readiness.md +17 -0
  98. package/.codex/skills/genesis-new-design/agents/openai.yaml +3 -3
  99. package/.codex/skills/genesis-observability-automation/checklists/.gitkeep +0 -0
  100. package/.codex/skills/genesis-observability-automation/observability/.gitkeep +0 -0
  101. package/.codex/skills/genesis-observability-automation/playbooks/.gitkeep +0 -0
  102. package/.codex/skills/genesis-observability-automation/templates/.gitkeep +0 -0
  103. package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -653
  104. package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -274
  105. package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -220
  106. package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -253
  107. package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -472
  108. package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -494
  109. package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -303
  110. package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -420
  111. package/.codex/skills/genesis-research-first/SKILL.md +237 -237
  112. package/.codex/skills/genesis-research-first/templates/.gitkeep +0 -0
  113. package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -534
  114. package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -384
  115. package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -257
  116. package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -373
  117. package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -692
  118. package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -434
  119. package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -407
  120. package/.codex/skills/genesis-state-machine/SKILL.md +34 -0
  121. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +3 -3
  122. package/.codex/skills/spec-impact-engine/SKILL.md +504 -504
  123. package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +0 -0
  124. package/.codex-plugin/plugin.json +24 -24
  125. package/CHANGELOG.md +42 -0
  126. package/LICENSE +22 -22
  127. package/README.EN.md +784 -719
  128. package/README.VI.md +776 -712
  129. package/README.md +113 -253
  130. package/VERSION +2 -2
  131. package/bin/genesis-harness.js +90 -87
  132. package/package.json +68 -43
  133. package/scripts/README.md +342 -342
  134. package/scripts/compact-context.sh +0 -0
  135. package/scripts/contract_integrity_gate.js +83 -0
  136. package/scripts/detect-changes.sh +0 -0
  137. package/scripts/healing_telemetry.js +118 -0
  138. package/scripts/install.sh +4 -1
  139. package/scripts/offload-log.sh +0 -0
  140. package/scripts/prompt_sentinel.js +84 -0
  141. package/scripts/run-evals.sh +1 -0
  142. package/scripts/run-verify-loop.sh +11 -0
  143. package/scripts/spec_visual_sync.js +157 -0
  144. package/scripts/test_generator.js +142 -0
  145. package/scripts/transition_state.sh +67 -0
  146. package/scripts/uninstall.sh +1 -0
  147. package/scripts/validation_gates.sh +85 -0
  148. package/scripts/verify.sh +5 -0
  149. package/tests/unit/contract_integrity_gate.test.js +74 -0
  150. package/tests/unit/healing_telemetry.test.js +58 -0
  151. package/tests/unit/prompt_sentinel.test.js +50 -0
  152. package/tests/unit/spec_visual_sync.test.js +77 -0
  153. package/tests/unit/test_generator.test.js +62 -0
@@ -1,347 +1,347 @@
1
- # Post-Implementation Auto-Update Guide
2
-
3
- **Purpose**: Automated state synchronization and documentation updates after successful implementation.
4
-
5
- **Status**: REFERENCE - Use after implementation is verified and tests pass.
6
-
7
- ## Quick Reference: What Updates Automatically
8
-
9
- After passing all tests and verification:
10
-
11
- | Change Type | File to Update | Update Trigger |
12
- |-------------|---|---|
13
- | Code implementation | `.codebase/MODULE_INDEX.md` | New module/export added |
14
- | API changes | `.codebase/API_CONTRACTS.md` | Endpoint behavior changed |
15
- | Database changes | `.codebase/DOMAIN_MODELS.md` | Schema or entity changed |
16
- | Route changes | `.codebase/UI_ROUTES.md` | Frontend route added/modified |
17
- | Test coverage | `.codebase/TEST_MATRIX.md` | New test files created |
18
- | Module dependencies | `.codebase/DEPENDENCY_GRAPH.md` | Import statements changed |
19
- | Architecture | `.codebase/ARCHITECTURE.md` | System design changed |
20
- | Status | `.codebase/CURRENT_STATE.md` | Any public-facing change |
21
-
22
- ---
23
-
24
- ## Automated Update Workflow
25
-
26
- ### Phase 1: Detection (After Implementation Passes Tests)
27
-
28
- ```
29
- Trigger: All tests pass + Manual review approved
30
- ┌─────────────────────────────────────────────┐
31
- │ 1. Scan changed files │
32
- │ 2. Identify type of changes │
33
- │ 3. Check what docs need updating │
34
- └─────────────────────────────────────────────┘
35
- ```
36
-
37
- **Scan categories:**
38
- - New files created?
39
- - Public APIs modified?
40
- - Database queries changed?
41
- - Routes added/removed?
42
- - Configuration changes?
43
-
44
- ### Phase 2: Analysis (Auto-Detect Impact)
45
-
46
- **For each changed file, check:**
47
-
48
- ```javascript
49
- if (file in /api || /endpoint) {
50
- → Update API_CONTRACTS.md
51
- → Run api-contract-skill
52
- }
53
-
54
- if (file contains database/query) {
55
- → Update DOMAIN_MODELS.md
56
- → Validate schema compatibility
57
- }
58
-
59
- if (file is route/page) {
60
- → Update UI_ROUTES.md
61
- → Check navigation flow
62
- }
63
-
64
- if (test file added) {
65
- → Update TEST_MATRIX.md
66
- → Calculate coverage %
67
- }
68
-
69
- if (file in core module) {
70
- → Update MODULE_INDEX.md
71
- → Check import/export statements
72
- }
73
- ```
74
-
75
- ### Phase 3: Documentation Sync
76
-
77
- **AUTO-SYNC checklist:**
78
-
79
- - [ ] **Module Inventory** (`MODULE_INDEX.md`)
80
- ```
81
- When: New file/function/export added
82
- Auto-Action:
83
- - Extract new exports
84
- - Document module purpose
85
- - Update import paths
86
- ```
87
-
88
- - [ ] **API Contracts** (`API_CONTRACTS.md`)
89
- ```
90
- When: API endpoint changed/added
91
- Auto-Action:
92
- - Extract request/response schemas
93
- - Update endpoint paths
94
- - Document breaking changes
95
- ```
96
-
97
- - [ ] **Domain Models** (`DOMAIN_MODELS.md`)
98
- ```
99
- When: Database schema changed
100
- Auto-Action:
101
- - Extract new tables/fields
102
- - Document relationships
103
- - Note migration strategy
104
- ```
105
-
106
- - [ ] **Test Matrix** (`TEST_MATRIX.md`)
107
- ```
108
- When: Test files added/removed
109
- Auto-Action:
110
- - Recalculate coverage %
111
- - Update test counts
112
- - Flag coverage gaps
113
- ```
114
-
115
- - [ ] **UI Routes** (`UI_ROUTES.md`)
116
- ```
117
- When: Frontend routes changed
118
- Auto-Action:
119
- - Extract new routes
120
- - Update navigation flow
121
- - Document route params
122
- ```
123
-
124
- - [ ] **Current State** (`CURRENT_STATE.md`)
125
- ```
126
- When: Any significant change
127
- Auto-Action:
128
- - Increment version/phase
129
- - Record what changed
130
- - Set "Last Updated"
131
- - List next steps
132
- ```
133
-
134
- ### Phase 4: Verification
135
-
136
- ```
137
- After Auto-Sync:
138
-
139
- ✓ All updated docs compile without errors?
140
- ✓ Internal links are valid?
141
- ✓ Examples are still accurate?
142
- ✓ Cross-references consistent?
143
- ✓ No stale information?
144
- ```
145
-
146
- ---
147
-
148
- ## Manual Post-Implementation Checklist
149
-
150
- **Use this AFTER implementation is complete and tests pass:**
151
-
152
- - [ ] **Read updated `.codebase/` files**
153
- - [ ] CURRENT_STATE.md reflects implementation
154
- - [ ] MODULE_INDEX.md includes new modules
155
- - [ ] API_CONTRACTS.md has endpoint changes
156
- - [ ] TEST_MATRIX.md shows new test coverage
157
-
158
- - [ ] **Verify documentation accuracy**
159
- - [ ] README examples still work
160
- - [ ] API docs match implementation
161
- - [ ] Database docs match schema
162
- - [ ] UI docs match routing
163
-
164
- - [ ] **Check for inconsistencies**
165
- - [ ] API_CONTRACTS.md ← → actual endpoints
166
- - [ ] DOMAIN_MODELS.md ← → database schema
167
- - [ ] UI_ROUTES.md ← → frontend routes
168
- - [ ] TEST_MATRIX.md ← → test files
169
-
170
- - [ ] **Update derived documents**
171
- - [ ] EVOLUTION_PLAN.md (next phase?)
172
- - [ ] DEPENDENCY_GRAPH.md (new deps?)
173
- - [ ] ARCHITECTURE.md (design impact?)
174
- - [ ] KNOWN_PROBLEMS.md (issues found?)
175
-
176
- - [ ] **Release documentation**
177
- - [ ] Update VERSION file
178
- - [ ] Add entry to CHANGELOG
179
- - [ ] Update RELEASE_NOTES
180
- - [ ] Tag commit appropriately
181
-
182
- ---
183
-
184
- ## Docs Skill Integration
185
-
186
- ### When to invoke `docs-skill` explicitly:
187
-
188
- ```
189
- AFTER implementation when:
190
- ✓ All tests pass
191
- ✓ Code review approved
192
- ✓ No more changes expected
193
-
194
- RUN: Use docs-skill to:
195
- - Sync all changed docs
196
- - Update README examples
197
- - Verify cross-references
198
- - Generate changelog entry
199
- - Validate installation docs
200
- ```
201
-
202
- **Command reference:**
203
- ```bash
204
- # After code implementation:
205
- invoke docs-skill
206
-
207
- # Parameters:
208
- - changed_files: [list of modified files]
209
- - public_behavior: [what changed from user perspective]
210
- - verification_results: [test results]
211
- - affected_users: [who needs to know about changes]
212
- ```
213
-
214
- ---
215
-
216
- ## State Continuity: Handoff Document
217
-
218
- ### Create after implementation for future resumption:
219
-
220
- ```markdown
221
- ## Implementation Handoff - [Feature/Bug Name]
222
-
223
- ### What Was Done
224
- - Module X: Created new authentication handler
225
- - Module Y: Updated request validation
226
- - Tests: Added 15 new unit tests
227
- - Docs: Updated API_CONTRACTS.md
228
-
229
- ### Files Changed
230
- - `src/auth/handler.ts` (new)
231
- - `src/middleware/validator.ts` (modified)
232
- - `tests/auth.test.ts` (new)
233
- - `.codebase/API_CONTRACTS.md` (updated)
234
-
235
- ### Current State
236
- - All tests passing ✓
237
- - Code review approved ✓
238
- - Docs updated ✓
239
- - Ready for: deployment / next feature
240
-
241
- ### For Continuation
242
- If this needs more work later:
243
- 1. Start with `.codebase/CURRENT_STATE.md`
244
- 2. Check KNOWN_PROBLEMS.md for blockers
245
- 3. Review this handoff document
246
- 4. Pick up from "Next Steps" below
247
-
248
- ### Next Steps
249
- - [ ] Deploy to staging
250
- - [ ] Monitor performance metrics
251
- - [ ] Gather user feedback
252
- - [ ] Plan Phase 2 features
253
- ```
254
-
255
- ---
256
-
257
- ## Auto-Update Triggers (Proposed Implementation)
258
-
259
- ### Git Hook: Post-Merge / Post-Commit
260
-
261
- ```bash
262
- # .git/hooks/post-commit
263
- if (tests pass) {
264
- run-auto-update.sh
265
- }
266
- ```
267
-
268
- ### Build Integration: After Successful Build
269
-
270
- ```bash
271
- # scripts/post-build.sh
272
- detect_changes.js \
273
- | analyze_impact.js \
274
- | update-docs.js
275
- ```
276
-
277
- ### CI/CD: After Successful Test Suite
278
-
279
- ```yaml
280
- # .github/workflows/docs-sync.yml
281
- on: [push]
282
- jobs:
283
- docs-sync:
284
- if: tests passed
285
- runs: docs-skill-sync.sh
286
- ```
287
-
288
- ---
289
-
290
- ## Troubleshooting Auto-Updates
291
-
292
- ### Issue: Docs not updating after implementation
293
-
294
- **Solution:**
295
- 1. Check git has commit all changes
296
- 2. Verify tests actually passing
297
- 3. Run `scripts/detect-changes.sh` manually
298
- 4. Check for errors in auto-update logs
299
-
300
- ### Issue: Docs out of sync with code
301
-
302
- **Solution:**
303
- 1. Read `.codebase/CURRENT_STATE.md`
304
- 2. Identify what's stale (via TEST_MATRIX.md)
305
- 3. Run `docs-skill` explicitly
306
- 4. Verify all links/examples work
307
-
308
- ### Issue: Can't understand what changed
309
-
310
- **Solution:**
311
- 1. Read IMPLEMENTATION_HANDOFF.md (created after each feature)
312
- 2. Check git diff with `.codebase/` baseline
313
- 3. Review decision-logs in `observability/`
314
- 4. Read PR description or commit messages
315
-
316
- ---
317
-
318
- ## Continuous State Tracking
319
-
320
- ### Quick State Check Command
321
-
322
- ```bash
323
- ./scripts/state-check.sh
324
- # Output:
325
- # ✓ CURRENT_STATE.md is recent (updated 2 hrs ago)
326
- # ⚠ TEST_MATRIX.md is 3 days old - may need refresh
327
- # ✓ API_CONTRACTS.md matches current endpoints
328
- # ✗ DEPENDENCY_GRAPH.md - 5 new dependencies not documented
329
- ```
330
-
331
- ---
332
-
333
- ## Next Phase: Full Automation
334
-
335
- When ready to implement:
336
-
337
- 1. **Auto-Detection Script** (detect changes automatically)
338
- 2. **Impact Analysis** (determine what docs to update)
339
- 3. **Docs Regeneration** (auto-update specific sections)
340
- 4. **Validation** (check all links/examples work)
341
- 5. **Notification** (alert team of updates)
342
-
343
- ---
344
-
345
- **Last Updated**: _2026-05-30_
346
- **Owner**: _Genesis Harness Team_
347
- **Status**: _Reference - Ready to implement automation_
1
+ # Post-Implementation Auto-Update Guide
2
+
3
+ **Purpose**: Automated state synchronization and documentation updates after successful implementation.
4
+
5
+ **Status**: REFERENCE - Use after implementation is verified and tests pass.
6
+
7
+ ## Quick Reference: What Updates Automatically
8
+
9
+ After passing all tests and verification:
10
+
11
+ | Change Type | File to Update | Update Trigger |
12
+ |-------------|---|---|
13
+ | Code implementation | `.codebase/MODULE_INDEX.md` | New module/export added |
14
+ | API changes | `.codebase/API_CONTRACTS.md` | Endpoint behavior changed |
15
+ | Database changes | `.codebase/DOMAIN_MODELS.md` | Schema or entity changed |
16
+ | Route changes | `.codebase/UI_ROUTES.md` | Frontend route added/modified |
17
+ | Test coverage | `.codebase/TEST_MATRIX.md` | New test files created |
18
+ | Module dependencies | `.codebase/DEPENDENCY_GRAPH.md` | Import statements changed |
19
+ | Architecture | `.codebase/ARCHITECTURE.md` | System design changed |
20
+ | Status | `.codebase/CURRENT_STATE.md` | Any public-facing change |
21
+
22
+ ---
23
+
24
+ ## Automated Update Workflow
25
+
26
+ ### Phase 1: Detection (After Implementation Passes Tests)
27
+
28
+ ```
29
+ Trigger: All tests pass + Manual review approved
30
+ ┌─────────────────────────────────────────────┐
31
+ │ 1. Scan changed files │
32
+ │ 2. Identify type of changes │
33
+ │ 3. Check what docs need updating │
34
+ └─────────────────────────────────────────────┘
35
+ ```
36
+
37
+ **Scan categories:**
38
+ - New files created?
39
+ - Public APIs modified?
40
+ - Database queries changed?
41
+ - Routes added/removed?
42
+ - Configuration changes?
43
+
44
+ ### Phase 2: Analysis (Auto-Detect Impact)
45
+
46
+ **For each changed file, check:**
47
+
48
+ ```javascript
49
+ if (file in /api || /endpoint) {
50
+ → Update API_CONTRACTS.md
51
+ → Run api-contract-skill
52
+ }
53
+
54
+ if (file contains database/query) {
55
+ → Update DOMAIN_MODELS.md
56
+ → Validate schema compatibility
57
+ }
58
+
59
+ if (file is route/page) {
60
+ → Update UI_ROUTES.md
61
+ → Check navigation flow
62
+ }
63
+
64
+ if (test file added) {
65
+ → Update TEST_MATRIX.md
66
+ → Calculate coverage %
67
+ }
68
+
69
+ if (file in core module) {
70
+ → Update MODULE_INDEX.md
71
+ → Check import/export statements
72
+ }
73
+ ```
74
+
75
+ ### Phase 3: Documentation Sync
76
+
77
+ **AUTO-SYNC checklist:**
78
+
79
+ - [ ] **Module Inventory** (`MODULE_INDEX.md`)
80
+ ```
81
+ When: New file/function/export added
82
+ Auto-Action:
83
+ - Extract new exports
84
+ - Document module purpose
85
+ - Update import paths
86
+ ```
87
+
88
+ - [ ] **API Contracts** (`API_CONTRACTS.md`)
89
+ ```
90
+ When: API endpoint changed/added
91
+ Auto-Action:
92
+ - Extract request/response schemas
93
+ - Update endpoint paths
94
+ - Document breaking changes
95
+ ```
96
+
97
+ - [ ] **Domain Models** (`DOMAIN_MODELS.md`)
98
+ ```
99
+ When: Database schema changed
100
+ Auto-Action:
101
+ - Extract new tables/fields
102
+ - Document relationships
103
+ - Note migration strategy
104
+ ```
105
+
106
+ - [ ] **Test Matrix** (`TEST_MATRIX.md`)
107
+ ```
108
+ When: Test files added/removed
109
+ Auto-Action:
110
+ - Recalculate coverage %
111
+ - Update test counts
112
+ - Flag coverage gaps
113
+ ```
114
+
115
+ - [ ] **UI Routes** (`UI_ROUTES.md`)
116
+ ```
117
+ When: Frontend routes changed
118
+ Auto-Action:
119
+ - Extract new routes
120
+ - Update navigation flow
121
+ - Document route params
122
+ ```
123
+
124
+ - [ ] **Current State** (`CURRENT_STATE.md`)
125
+ ```
126
+ When: Any significant change
127
+ Auto-Action:
128
+ - Increment version/phase
129
+ - Record what changed
130
+ - Set "Last Updated"
131
+ - List next steps
132
+ ```
133
+
134
+ ### Phase 4: Verification
135
+
136
+ ```
137
+ After Auto-Sync:
138
+
139
+ ✓ All updated docs compile without errors?
140
+ ✓ Internal links are valid?
141
+ ✓ Examples are still accurate?
142
+ ✓ Cross-references consistent?
143
+ ✓ No stale information?
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Manual Post-Implementation Checklist
149
+
150
+ **Use this AFTER implementation is complete and tests pass:**
151
+
152
+ - [ ] **Read updated `.codebase/` files**
153
+ - [ ] CURRENT_STATE.md reflects implementation
154
+ - [ ] MODULE_INDEX.md includes new modules
155
+ - [ ] API_CONTRACTS.md has endpoint changes
156
+ - [ ] TEST_MATRIX.md shows new test coverage
157
+
158
+ - [ ] **Verify documentation accuracy**
159
+ - [ ] README examples still work
160
+ - [ ] API docs match implementation
161
+ - [ ] Database docs match schema
162
+ - [ ] UI docs match routing
163
+
164
+ - [ ] **Check for inconsistencies**
165
+ - [ ] API_CONTRACTS.md ← → actual endpoints
166
+ - [ ] DOMAIN_MODELS.md ← → database schema
167
+ - [ ] UI_ROUTES.md ← → frontend routes
168
+ - [ ] TEST_MATRIX.md ← → test files
169
+
170
+ - [ ] **Update derived documents**
171
+ - [ ] EVOLUTION_PLAN.md (next phase?)
172
+ - [ ] DEPENDENCY_GRAPH.md (new deps?)
173
+ - [ ] ARCHITECTURE.md (design impact?)
174
+ - [ ] KNOWN_PROBLEMS.md (issues found?)
175
+
176
+ - [ ] **Release documentation**
177
+ - [ ] Update VERSION file
178
+ - [ ] Add entry to CHANGELOG
179
+ - [ ] Update RELEASE_NOTES
180
+ - [ ] Tag commit appropriately
181
+
182
+ ---
183
+
184
+ ## Docs Skill Integration
185
+
186
+ ### When to invoke `docs-skill` explicitly:
187
+
188
+ ```
189
+ AFTER implementation when:
190
+ ✓ All tests pass
191
+ ✓ Code review approved
192
+ ✓ No more changes expected
193
+
194
+ RUN: Use docs-skill to:
195
+ - Sync all changed docs
196
+ - Update README examples
197
+ - Verify cross-references
198
+ - Generate changelog entry
199
+ - Validate installation docs
200
+ ```
201
+
202
+ **Command reference:**
203
+ ```bash
204
+ # After code implementation:
205
+ invoke docs-skill
206
+
207
+ # Parameters:
208
+ - changed_files: [list of modified files]
209
+ - public_behavior: [what changed from user perspective]
210
+ - verification_results: [test results]
211
+ - affected_users: [who needs to know about changes]
212
+ ```
213
+
214
+ ---
215
+
216
+ ## State Continuity: Handoff Document
217
+
218
+ ### Create after implementation for future resumption:
219
+
220
+ ```markdown
221
+ ## Implementation Handoff - [Feature/Bug Name]
222
+
223
+ ### What Was Done
224
+ - Module X: Created new authentication handler
225
+ - Module Y: Updated request validation
226
+ - Tests: Added 15 new unit tests
227
+ - Docs: Updated API_CONTRACTS.md
228
+
229
+ ### Files Changed
230
+ - `src/auth/handler.ts` (new)
231
+ - `src/middleware/validator.ts` (modified)
232
+ - `tests/auth.test.ts` (new)
233
+ - `.codebase/API_CONTRACTS.md` (updated)
234
+
235
+ ### Current State
236
+ - All tests passing ✓
237
+ - Code review approved ✓
238
+ - Docs updated ✓
239
+ - Ready for: deployment / next feature
240
+
241
+ ### For Continuation
242
+ If this needs more work later:
243
+ 1. Start with `.codebase/CURRENT_STATE.md`
244
+ 2. Check KNOWN_PROBLEMS.md for blockers
245
+ 3. Review this handoff document
246
+ 4. Pick up from "Next Steps" below
247
+
248
+ ### Next Steps
249
+ - [ ] Deploy to staging
250
+ - [ ] Monitor performance metrics
251
+ - [ ] Gather user feedback
252
+ - [ ] Plan Phase 2 features
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Auto-Update Triggers (Proposed Implementation)
258
+
259
+ ### Git Hook: Post-Merge / Post-Commit
260
+
261
+ ```bash
262
+ # .git/hooks/post-commit
263
+ if (tests pass) {
264
+ run-auto-update.sh
265
+ }
266
+ ```
267
+
268
+ ### Build Integration: After Successful Build
269
+
270
+ ```bash
271
+ # scripts/post-build.sh
272
+ detect_changes.js \
273
+ | analyze_impact.js \
274
+ | update-docs.js
275
+ ```
276
+
277
+ ### CI/CD: After Successful Test Suite
278
+
279
+ ```yaml
280
+ # .github/workflows/docs-sync.yml
281
+ on: [push]
282
+ jobs:
283
+ docs-sync:
284
+ if: tests passed
285
+ runs: docs-skill-sync.sh
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Troubleshooting Auto-Updates
291
+
292
+ ### Issue: Docs not updating after implementation
293
+
294
+ **Solution:**
295
+ 1. Check git has commit all changes
296
+ 2. Verify tests actually passing
297
+ 3. Run `scripts/detect-changes.sh` manually
298
+ 4. Check for errors in auto-update logs
299
+
300
+ ### Issue: Docs out of sync with code
301
+
302
+ **Solution:**
303
+ 1. Read `.codebase/CURRENT_STATE.md`
304
+ 2. Identify what's stale (via TEST_MATRIX.md)
305
+ 3. Run `docs-skill` explicitly
306
+ 4. Verify all links/examples work
307
+
308
+ ### Issue: Can't understand what changed
309
+
310
+ **Solution:**
311
+ 1. Read IMPLEMENTATION_HANDOFF.md (created after each feature)
312
+ 2. Check git diff with `.codebase/` baseline
313
+ 3. Review decision-logs in `observability/`
314
+ 4. Read PR description or commit messages
315
+
316
+ ---
317
+
318
+ ## Continuous State Tracking
319
+
320
+ ### Quick State Check Command
321
+
322
+ ```bash
323
+ ./scripts/state-check.sh
324
+ # Output:
325
+ # ✓ CURRENT_STATE.md is recent (updated 2 hrs ago)
326
+ # ⚠ TEST_MATRIX.md is 3 days old - may need refresh
327
+ # ✓ API_CONTRACTS.md matches current endpoints
328
+ # ✗ DEPENDENCY_GRAPH.md - 5 new dependencies not documented
329
+ ```
330
+
331
+ ---
332
+
333
+ ## Next Phase: Full Automation
334
+
335
+ When ready to implement:
336
+
337
+ 1. **Auto-Detection Script** (detect changes automatically)
338
+ 2. **Impact Analysis** (determine what docs to update)
339
+ 3. **Docs Regeneration** (auto-update specific sections)
340
+ 4. **Validation** (check all links/examples work)
341
+ 5. **Notification** (alert team of updates)
342
+
343
+ ---
344
+
345
+ **Last Updated**: _2026-05-30_
346
+ **Owner**: _Genesis Harness Team_
347
+ **Status**: _Reference - Ready to implement automation_