codex-genesis-harness 0.1.1 → 0.1.5
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.
- package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
- package/.codebase/CURRENT_STATE.md +4 -5
- package/.codebase/DOMAIN_MODELS.md +5 -3
- package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -0
- package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -0
- package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -0
- package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -0
- package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -0
- package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
- package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
- package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
- package/.codebase/README.md +139 -0
- package/.codebase/RECOVERY_POINTS.md +438 -0
- package/.codebase/state.json +37 -0
- package/.codex/skills/genesis-api-sync/SKILL.md +354 -0
- package/.codex/skills/genesis-api-sync/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -0
- package/.codex/skills/genesis-api-sync/examples/example.md +68 -0
- package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -0
- package/.codex/skills/genesis-debug-guide/SKILL.md +479 -0
- package/.codex/skills/genesis-debug-guide/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -0
- package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -0
- package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -0
- package/.codex/skills/genesis-debug-guide/examples/example.md +48 -0
- package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -0
- package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -0
- package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -0
- package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -0
- package/.codex/skills/genesis-docs-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -0
- package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -0
- package/.codex/skills/genesis-docs-automation/examples/example.md +59 -0
- package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -0
- package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -0
- package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -0
- package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -0
- package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -0
- package/.codex/skills/genesis-harness/SKILL.md +743 -82
- package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -0
- package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -0
- package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -0
- package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -0
- package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -0
- package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -0
- package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -0
- package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -0
- package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +23 -23
- package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +21 -21
- package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +46 -46
- package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +25 -25
- package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
- package/.codex/skills/genesis-harness/scripts/create-adr.sh +74 -74
- package/.codex/skills/genesis-harness/scripts/create-bug.sh +160 -160
- package/.codex/skills/genesis-harness/scripts/create-feature.sh +217 -217
- package/.codex/skills/genesis-harness/scripts/detect-stack.sh +26 -26
- package/.codex/skills/genesis-harness/scripts/init-planning.sh +750 -719
- package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +12 -12
- package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
- package/.codex/skills/genesis-harness/scripts/run-verification.sh +47 -47
- package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
- package/.codex/skills/genesis-harness/scripts/update-state.sh +33 -33
- package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -0
- package/.codex/skills/genesis-harness-engineering/checklists/checklist.md +48 -0
- package/.codex/skills/genesis-harness-engineering/examples/example.md +57 -0
- package/.codex/skills/genesis-harness-engineering/playbooks/harness-evolution.md +99 -0
- package/.codex/skills/genesis-harness-engineering/templates/harness-change-template.md +37 -0
- package/.codex/skills/genesis-observability-automation/SKILL.md +382 -0
- package/.codex/skills/genesis-observability-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-observability-automation/examples/example.md +86 -0
- package/.codex/skills/genesis-performance-profiling/SKILL.md +510 -0
- package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +6 -0
- package/.codex/skills/genesis-performance-profiling/checklists/optimization-verification.md +199 -0
- package/.codex/skills/genesis-performance-profiling/checklists/performance-baseline.md +183 -0
- package/.codex/skills/genesis-performance-profiling/examples/example.md +234 -0
- package/.codex/skills/genesis-performance-profiling/observability/performance-tracking.md +202 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/load-testing-orchestration.md +593 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/profiling-playbook.md +601 -0
- package/.codex/skills/genesis-performance-profiling/templates/load-test-config-template.md +428 -0
- package/.codex/skills/genesis-performance-profiling/templates/performance-report-template.md +238 -0
- package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -0
- package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -0
- package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -0
- package/.codex/skills/genesis-release-orchestration/examples/example.md +78 -0
- package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -0
- package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -0
- package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -0
- package/.codex/skills/genesis-research-first/SKILL.md +237 -0
- package/.codex/skills/genesis-research-first/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-research-first/examples/example.md +85 -0
- package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -0
- package/.codex/skills/genesis-spec-propagation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -0
- package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -0
- package/.codex/skills/genesis-spec-propagation/examples/example.md +63 -0
- package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -0
- package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -0
- package/.codex/skills/genesis-state-machine/SKILL.md +34 -0
- package/.codex/skills/spec-impact-engine/SKILL.md +504 -0
- package/.codex/skills/spec-impact-engine/agents/openai.yaml +7 -0
- package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +262 -0
- package/.codex/skills/spec-impact-engine/examples/example.md +98 -0
- package/.codex/skills/spec-impact-engine/templates/impact-report.md +248 -0
- package/.codex/skills/spec-impact-engine/templates/migration-guide.md +223 -0
- package/.codex-plugin/plugin.json +7 -7
- package/README.EN.md +730 -0
- package/README.VI.md +723 -0
- package/README.md +266 -107
- package/VERSION +1 -1
- package/bin/genesis-harness.js +20 -11
- package/package.json +62 -43
- package/scripts/README.md +342 -0
- package/scripts/compact-context.sh +54 -0
- package/scripts/detect-changes.sh +152 -0
- package/scripts/install.sh +50 -41
- package/scripts/offload-log.sh +72 -0
- package/scripts/run-evals.sh +70 -43
- package/scripts/run-verify-loop.sh +75 -0
- package/scripts/transition_state.sh +67 -0
- package/scripts/uninstall.sh +52 -43
- package/scripts/validation_gates.sh +46 -0
- package/scripts/verify.sh +165 -73
- package/.codex/skills/harness-engineering-skill/SKILL.md +0 -45
- package/.codex/skills/harness-engineering-skill/checklists/checklist.md +0 -8
- package/.codex/skills/harness-engineering-skill/examples/example.md +0 -4
- package/.codex/skills/harness-engineering-skill/templates/harness-change-template.md +0 -8
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/SKILL.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/agents/openai.yaml +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/checklists/checklist.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/examples/example.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/templates/provider-contract-template.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/SKILL.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/agents/openai.yaml +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/checklists/checklist.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/examples/example.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/templates/api-contract-template.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/SKILL.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/agents/openai.yaml +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/checklists/checklist.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/examples/example.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/templates/architecture-decision-template.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/SKILL.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/agents/openai.yaml +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/checklists/checklist.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/examples/example.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/templates/map-update-template.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/SKILL.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/agents/openai.yaml +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/checklists/checklist.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/examples/example.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/templates/design-spec-template.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/SKILL.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/agents/openai.yaml +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/checklists/checklist.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/examples/example.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/templates/docs-update-template.md +0 -0
- /package/.codex/skills/{harness-engineering-skill → genesis-harness-engineering}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/SKILL.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/checklists/checklist.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/examples/example.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/templates/orchestration-template.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/SKILL.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/agents/openai.yaml +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/checklists/checklist.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/examples/example.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/templates/plan-template.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/SKILL.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/agents/openai.yaml +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/checklists/checklist.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/examples/example.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/templates/release-checklist-template.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/SKILL.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/agents/openai.yaml +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/checklists/checklist.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/examples/example.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/templates/research-note-template.md +0 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# Migration Guide Template
|
|
2
|
+
|
|
3
|
+
## File: docs/migration-{VERSION1}-to-{VERSION2}.md
|
|
4
|
+
|
|
5
|
+
**Use this template** when creating a migration guide for breaking changes.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Migration Guide: API v{OLD} → v{NEW}
|
|
10
|
+
|
|
11
|
+
## 📋 Overview
|
|
12
|
+
|
|
13
|
+
Brief explanation of what changed and why. Keep it to 1-2 sentences.
|
|
14
|
+
|
|
15
|
+
> **In v{NEW}**, we've redesigned the User API to be more RESTful and support new features like avatars and user preferences. This guide helps you migrate from v{OLD} in just a few minutes.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🎯 What's Changing
|
|
20
|
+
|
|
21
|
+
### Summary of Changes
|
|
22
|
+
|
|
23
|
+
- **Removed**: List fields/endpoints being removed
|
|
24
|
+
- **Renamed**: List renamed fields/endpoints
|
|
25
|
+
- **Changed**: List structural changes
|
|
26
|
+
- **Added**: List new optional features (usually not breaking)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📊 Detailed Changes
|
|
31
|
+
|
|
32
|
+
### Change 1: Removed `avatar` Field
|
|
33
|
+
|
|
34
|
+
**What changed**:
|
|
35
|
+
```diff
|
|
36
|
+
- "avatar": "/avatars/john.jpg"
|
|
37
|
+
+ "avatarUrl": "https://cdn.example.com/avatars/john.jpg"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Why**:
|
|
41
|
+
- CDN-based URLs are more flexible
|
|
42
|
+
- URL format validation is clearer
|
|
43
|
+
- Better separation of concerns (CDN vs application)
|
|
44
|
+
|
|
45
|
+
**Impact**:
|
|
46
|
+
- Code accessing `user.avatar` will break
|
|
47
|
+
- Need to update to `user.avatarUrl`
|
|
48
|
+
- Affects: Frontend, mobile clients, backend integrations
|
|
49
|
+
|
|
50
|
+
**Timeline**:
|
|
51
|
+
- **v{OLD}.0** (Current): Deprecated - both fields available for compatibility
|
|
52
|
+
- **v{NEW}.0** (January 15): Removed completely
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Change 2: Renamed Endpoint `/api/users/:id/profile` → `/api/users/:id`
|
|
57
|
+
|
|
58
|
+
**What changed**:
|
|
59
|
+
```diff
|
|
60
|
+
- GET /api/users/:id/profile
|
|
61
|
+
+ GET /api/users/:id
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Why**: Simplify endpoint structure and follow REST conventions
|
|
65
|
+
|
|
66
|
+
**Impact**: Old endpoint URL will return 404
|
|
67
|
+
|
|
68
|
+
**Timeline**: Removed immediately in v{NEW}
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🚀 How to Migrate
|
|
73
|
+
|
|
74
|
+
### Prerequisites
|
|
75
|
+
|
|
76
|
+
Before starting, you need:
|
|
77
|
+
- Node.js 16+ or Python 3.9+
|
|
78
|
+
- API client version {NEW}.0 or higher
|
|
79
|
+
- 15 minutes of uninterrupted time
|
|
80
|
+
|
|
81
|
+
### Step 1: Update Client Library (5 min)
|
|
82
|
+
|
|
83
|
+
Replace the old client with the new version:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# NPM
|
|
87
|
+
npm install @example/api-client@{NEW}.0.0
|
|
88
|
+
|
|
89
|
+
# Pip
|
|
90
|
+
pip install example-api-client=={NEW}.0.0
|
|
91
|
+
|
|
92
|
+
# Yarn
|
|
93
|
+
yarn add @example/api-client@{NEW}.0.0
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 2: Identify Breaking Changes in Your Code (3 min)
|
|
97
|
+
|
|
98
|
+
Search for all usages of deprecated fields:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Find all references to 'avatar' field
|
|
102
|
+
grep -r "\.avatar" src/
|
|
103
|
+
grep -r "user\.avatar" src/
|
|
104
|
+
grep -r "'avatar'" src/
|
|
105
|
+
|
|
106
|
+
# Find all calls to old endpoint
|
|
107
|
+
grep -r "/api/users/.*/profile" src/
|
|
108
|
+
grep -r "users/profile" src/
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 3: Update Field References (5 min)
|
|
112
|
+
|
|
113
|
+
Replace all references to the removed field:
|
|
114
|
+
|
|
115
|
+
**Before**:
|
|
116
|
+
```javascript
|
|
117
|
+
const userAvatar = user.avatar;
|
|
118
|
+
const displayUrl = user.avatar;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**After**:
|
|
122
|
+
```javascript
|
|
123
|
+
const userAvatar = user.avatarUrl; // New field name
|
|
124
|
+
const displayUrl = user.avatarUrl; // New field name
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**UI Example**:
|
|
128
|
+
```html
|
|
129
|
+
<!-- Before -->
|
|
130
|
+
<img src="https://cdn.example.com{{ user.avatar }}" />
|
|
131
|
+
|
|
132
|
+
<!-- After -->
|
|
133
|
+
<img src="{{ user.avatarUrl }}" />
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Step 4: Update API Calls (5 min)
|
|
137
|
+
|
|
138
|
+
Replace old endpoints with new ones:
|
|
139
|
+
|
|
140
|
+
**Before**:
|
|
141
|
+
```javascript
|
|
142
|
+
const profile = await client.get(`/api/users/${userId}/profile`);
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**After**:
|
|
146
|
+
```javascript
|
|
147
|
+
const profile = await client.get(`/api/users/${userId}`);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Step 5: Test Your Changes (5 min)
|
|
151
|
+
|
|
152
|
+
Run your test suite to ensure everything works:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
npm test
|
|
156
|
+
# or
|
|
157
|
+
pytest
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Expected: All tests pass ✅
|
|
161
|
+
|
|
162
|
+
### Step 6: Deploy (5 min)
|
|
163
|
+
|
|
164
|
+
Deploy your changes in normal flow:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
git add .
|
|
168
|
+
git commit -m "chore: migrate to API v{NEW}"
|
|
169
|
+
git push
|
|
170
|
+
# Deploy as usual...
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 📝 Code Examples
|
|
176
|
+
|
|
177
|
+
### Example 1: Fetch User Profile
|
|
178
|
+
|
|
179
|
+
**Before (v{OLD})**:
|
|
180
|
+
```javascript
|
|
181
|
+
async function getUserProfile(userId) {
|
|
182
|
+
const response = await fetch(`https://api.example.com/api/users/${userId}/profile`);
|
|
183
|
+
const user = await response.json();
|
|
184
|
+
return {
|
|
185
|
+
id: user.id,
|
|
186
|
+
name: user.name,
|
|
187
|
+
avatarUrl: user.avatar // Map old field to internal name
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**After (v{NEW})**:
|
|
193
|
+
```javascript
|
|
194
|
+
async function getUserProfile(userId) {
|
|
195
|
+
const response = await fetch(`https://api.example.com/api/users/${userId}`);
|
|
196
|
+
const user = await response.json();
|
|
197
|
+
return {
|
|
198
|
+
id: user.id,
|
|
199
|
+
name: user.name,
|
|
200
|
+
avatarUrl: user.avatarUrl // Field already has right name
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Example 2: Display User Avatar in React
|
|
206
|
+
|
|
207
|
+
**Before (v{OLD})**:
|
|
208
|
+
```jsx
|
|
209
|
+
function UserCard({ userId }) {
|
|
210
|
+
const [user, setUser] = useState(null);
|
|
211
|
+
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
fetch(`/api/users/${userId}/profile`)
|
|
214
|
+
.then(r => r.json())
|
|
215
|
+
.then(data => {
|
|
216
|
+
setUser({
|
|
217
|
+
...data,
|
|
218
|
+
avatar: data.avatar // Old field
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
}, [userId]);
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
<div>
|
|
225
|
+
<h3>{user?.name}</h3>
|
|
226
|
+
<img src={`https://cdn.example.com${user?.avatar}`} />
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**After (v{NEW})**:
|
|
233
|
+
```jsx
|
|
234
|
+
function UserCard({ userId }) {
|
|
235
|
+
const [user, setUser] = useState(null);
|
|
236
|
+
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
fetch(`/api/users/${userId}`) // Updated endpoint
|
|
239
|
+
.then(r => r.json())
|
|
240
|
+
.then(setUser);
|
|
241
|
+
}, [userId]);
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<div>
|
|
245
|
+
<h3>{user?.name}</h3>
|
|
246
|
+
<img src={user?.avatarUrl} /> // New field (full URL)
|
|
247
|
+
</div>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Example 3: TypeScript Types
|
|
253
|
+
|
|
254
|
+
**Before (v{OLD})**:
|
|
255
|
+
```typescript
|
|
256
|
+
interface User {
|
|
257
|
+
id: number;
|
|
258
|
+
name: string;
|
|
259
|
+
avatar: string; // Path like "/avatars/john.jpg"
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**After (v{NEW})**:
|
|
264
|
+
```typescript
|
|
265
|
+
interface User {
|
|
266
|
+
id: number;
|
|
267
|
+
name: string;
|
|
268
|
+
avatarUrl: string | null; // Full URL or null
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 🆘 Troubleshooting
|
|
275
|
+
|
|
276
|
+
### Problem: "404 Not Found" on Old Endpoint
|
|
277
|
+
|
|
278
|
+
**Cause**: Using old endpoint `/api/users/:id/profile`
|
|
279
|
+
|
|
280
|
+
**Solution**: Change to `/api/users/:id`
|
|
281
|
+
|
|
282
|
+
```javascript
|
|
283
|
+
// ❌ Wrong
|
|
284
|
+
await fetch(`/api/users/123/profile`);
|
|
285
|
+
|
|
286
|
+
// ✅ Correct
|
|
287
|
+
await fetch(`/api/users/123`);
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Problem: "user.avatar is undefined"
|
|
291
|
+
|
|
292
|
+
**Cause**: Field was renamed to `avatarUrl`
|
|
293
|
+
|
|
294
|
+
**Solution**: Update field reference
|
|
295
|
+
|
|
296
|
+
```javascript
|
|
297
|
+
// ❌ Wrong
|
|
298
|
+
console.log(user.avatar);
|
|
299
|
+
|
|
300
|
+
// ✅ Correct
|
|
301
|
+
console.log(user.avatarUrl);
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Problem: Images Broken After Update
|
|
305
|
+
|
|
306
|
+
**Cause**: Old field was relative path (`/avatars/john.jpg`), new field is full URL
|
|
307
|
+
|
|
308
|
+
**Solution**: Remove manual URL building
|
|
309
|
+
|
|
310
|
+
```javascript
|
|
311
|
+
// ❌ Wrong - Building URL from relative path
|
|
312
|
+
<img src={`https://cdn.example.com${user.avatar}`} />
|
|
313
|
+
|
|
314
|
+
// ✅ Correct - avatarUrl is complete
|
|
315
|
+
<img src={user.avatarUrl} />
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Problem: "Cannot find module" or Import Error
|
|
319
|
+
|
|
320
|
+
**Cause**: Client library not updated to v{NEW}
|
|
321
|
+
|
|
322
|
+
**Solution**: Reinstall packages
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
rm -rf node_modules package-lock.json
|
|
326
|
+
npm install
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Problem: Tests Still Failing
|
|
330
|
+
|
|
331
|
+
**Cause**: Test fixtures not updated
|
|
332
|
+
|
|
333
|
+
**Solution**: Update test mocks/fixtures
|
|
334
|
+
|
|
335
|
+
```javascript
|
|
336
|
+
// ❌ Old test fixture
|
|
337
|
+
const mockUser = {
|
|
338
|
+
id: 1,
|
|
339
|
+
avatar: '/avatars/test.jpg'
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// ✅ New test fixture
|
|
343
|
+
const mockUser = {
|
|
344
|
+
id: 1,
|
|
345
|
+
avatarUrl: 'https://cdn.example.com/avatars/test.jpg'
|
|
346
|
+
};
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## 📞 Need Help?
|
|
352
|
+
|
|
353
|
+
- **Documentation**: https://docs.example.com/api/v{NEW}
|
|
354
|
+
- **Email**: support@example.com
|
|
355
|
+
- **Slack**: #api-help
|
|
356
|
+
- **GitHub Issues**: https://github.com/example/api/issues
|
|
357
|
+
- **Community Forum**: https://discuss.example.com
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## ⏰ Timeline
|
|
362
|
+
|
|
363
|
+
| Date | Event | Action |
|
|
364
|
+
|------|-------|--------|
|
|
365
|
+
| **Today** | Migration announced | Review this guide |
|
|
366
|
+
| **2 weeks** | Deprecation warning emails sent | Update your code |
|
|
367
|
+
| **4 weeks** | Second reminder email | Ensure all changes deployed |
|
|
368
|
+
| **6 weeks** | v{OLD}.0 support ends | Requests to old endpoints return 404 |
|
|
369
|
+
| **8 weeks** | v{OLD} removed from CDN | Clients must be on v{NEW} |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## ✅ Migration Checklist
|
|
374
|
+
|
|
375
|
+
Use this checklist to track your migration progress:
|
|
376
|
+
|
|
377
|
+
- [ ] Reviewed "What's Changing" section
|
|
378
|
+
- [ ] Updated client library to v{NEW}.0
|
|
379
|
+
- [ ] Found all usages of `avatar` field (via grep)
|
|
380
|
+
- [ ] Updated all field references to `avatarUrl`
|
|
381
|
+
- [ ] Updated old endpoint `/api/users/:id/profile` → `/api/users/:id`
|
|
382
|
+
- [ ] Updated test fixtures and mocks
|
|
383
|
+
- [ ] Updated TypeScript types (if applicable)
|
|
384
|
+
- [ ] Ran test suite - all passing
|
|
385
|
+
- [ ] Deployed changes to staging
|
|
386
|
+
- [ ] Tested on staging environment
|
|
387
|
+
- [ ] Deployed changes to production
|
|
388
|
+
- [ ] Monitored for errors in production logs
|
|
389
|
+
- [ ] ✅ Migration complete!
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## 📚 Related Resources
|
|
394
|
+
|
|
395
|
+
- [API Documentation](https://docs.example.com)
|
|
396
|
+
- [API {NEW} Release Notes](https://github.com/example/api/releases/tag/v{NEW}.0.0)
|
|
397
|
+
- [Code Examples](https://github.com/example/api-examples)
|
|
398
|
+
- [Community Examples](https://discuss.example.com/c/examples)
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## 🎉 You're Done!
|
|
403
|
+
|
|
404
|
+
Your application is now running on API v{NEW}. Enjoy the new features and improved performance!
|
|
405
|
+
|
|
406
|
+
If you encounter any issues, don't hesitate to reach out to our support team.
|
|
407
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genesis-state-machine
|
|
3
|
+
description: Formal Finite State Machine for memory, context persistence, and validation gates.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genesis State Machine (FSM)
|
|
7
|
+
|
|
8
|
+
This skill dictates how the Agent tracks, persists, and transitions its internal state to survive session interruptions and enforce strict execution gates.
|
|
9
|
+
|
|
10
|
+
## Core States
|
|
11
|
+
|
|
12
|
+
The Genesis Harness operates in the following strict states:
|
|
13
|
+
|
|
14
|
+
1. `INIT`: The agent has just booted. Needs to gather user intent or resume a previous task.
|
|
15
|
+
2. `REQUIREMENTS_GATHERING`: Clarifying the user's request, doing empirical research.
|
|
16
|
+
3. `PLANNING`: Creating `implementation_plan.md` and writing tests.
|
|
17
|
+
4. `IMPLEMENTATION`: Writing code to satisfy tests and plan.
|
|
18
|
+
5. `VERIFICATION`: Running test scripts (`verify.sh`) and validating constraints.
|
|
19
|
+
6. `COMPLETED`: All tests pass, docs are updated, ready for the next task.
|
|
20
|
+
|
|
21
|
+
## Rules of State Transition
|
|
22
|
+
|
|
23
|
+
- **NEVER** skip a state directly (e.g., from `REQUIREMENTS_GATHERING` to `IMPLEMENTATION` without `PLANNING`).
|
|
24
|
+
- **ALWAYS** use the strict transition script to change states: `bash scripts/transition_state.sh <NEW_STATE> "Reason for transition"`
|
|
25
|
+
- **ALWAYS** read `.codebase/state.json` when you start a new conversation or wake up, to know exactly where you left off.
|
|
26
|
+
|
|
27
|
+
## Handling Interruptions
|
|
28
|
+
If the user's connection drops or you are restarted:
|
|
29
|
+
1. Read `.codebase/state.json`
|
|
30
|
+
2. If `current_state` is `IMPLEMENTATION`, resume coding based on the `task.md`.
|
|
31
|
+
3. If `current_state` is `VERIFICATION`, resume running test scripts.
|
|
32
|
+
|
|
33
|
+
## The State File
|
|
34
|
+
The state is persisted in `.codebase/state.json`. **Do not edit this file manually.** Always use the `transition_state.sh` script to ensure validation gates are respected.
|