super-opencode 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/agents/architect.md +54 -31
- package/.opencode/agents/backend.md +61 -34
- package/.opencode/agents/data-agent.md +422 -0
- package/.opencode/agents/devops-agent.md +331 -0
- package/.opencode/agents/frontend.md +63 -36
- package/.opencode/agents/mobile-agent.md +636 -0
- package/.opencode/agents/optimizer.md +25 -18
- package/.opencode/agents/pm-agent.md +114 -50
- package/.opencode/agents/quality.md +36 -29
- package/.opencode/agents/researcher.md +30 -21
- package/.opencode/agents/reviewer.md +39 -32
- package/.opencode/agents/security.md +42 -34
- package/.opencode/agents/writer.md +42 -31
- package/.opencode/commands/soc-analyze.md +55 -31
- package/.opencode/commands/soc-brainstorm.md +48 -26
- package/.opencode/commands/soc-cleanup.md +47 -25
- package/.opencode/commands/soc-deploy.md +271 -0
- package/.opencode/commands/soc-design.md +51 -26
- package/.opencode/commands/soc-explain.md +46 -23
- package/.opencode/commands/soc-git.md +47 -25
- package/.opencode/commands/soc-help.md +35 -14
- package/.opencode/commands/soc-implement.md +59 -29
- package/.opencode/commands/soc-improve.md +42 -20
- package/.opencode/commands/soc-onboard.md +329 -0
- package/.opencode/commands/soc-plan.md +215 -0
- package/.opencode/commands/soc-pm.md +40 -18
- package/.opencode/commands/soc-research.md +43 -20
- package/.opencode/commands/soc-review.md +39 -18
- package/.opencode/commands/soc-test.md +43 -21
- package/.opencode/commands/soc-validate.md +221 -0
- package/.opencode/commands/soc-workflow.md +38 -17
- package/.opencode/skills/confidence-check/SKILL.md +26 -19
- package/.opencode/skills/debug-protocol/SKILL.md +27 -17
- package/.opencode/skills/decision-log/SKILL.md +236 -0
- package/.opencode/skills/doc-sync/SKILL.md +345 -0
- package/.opencode/skills/package-manager/SKILL.md +502 -0
- package/.opencode/skills/package-manager/scripts/README.md +106 -0
- package/.opencode/skills/package-manager/scripts/detect-package-manager.sh +796 -0
- package/.opencode/skills/reflexion/SKILL.md +18 -11
- package/.opencode/skills/security-audit/SKILL.md +19 -14
- package/.opencode/skills/self-check/SKILL.md +30 -14
- package/.opencode/skills/simplification/SKILL.md +19 -5
- package/.opencode/skills/tech-debt/SKILL.md +245 -0
- package/LICENSE +1 -1
- package/README.md +126 -9
- package/dist/cli.js +143 -41
- package/package.json +27 -12
- package/.opencode/settings.json +0 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: decision-log
|
|
3
|
+
description: Architecture Decision Record (ADR) creation, tracking, and management for informed technical choices.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Decision Log Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
To transform **implicit decisions** into **explicit records**. This skill ensures every significant technical choice is documented with context, alternatives, and consequences—preventing "tribal knowledge" loss and enabling future maintainers to understand the "why" behind the "what."
|
|
11
|
+
|
|
12
|
+
**ROI Metric**: Spending 10 minutes documenting a decision saves hours of debate and prevents costly reversals months later.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- **Trigger**: When `architect` recommends a technology, pattern, or structural change.
|
|
17
|
+
- **Trigger**: When a decision has >1 viable alternative.
|
|
18
|
+
- **Trigger**: When a decision is hard to reverse (high consequence).
|
|
19
|
+
- **Trigger**: When `pm-agent` flags a decision as "architecturally significant."
|
|
20
|
+
|
|
21
|
+
## The ADR Protocol (The 5-Step Process)
|
|
22
|
+
|
|
23
|
+
### 1. Recognition (Is This Significant?)
|
|
24
|
+
|
|
25
|
+
**Ask**: Does this decision impact any of the following?
|
|
26
|
+
- Technology stack (language, framework, database)
|
|
27
|
+
- Architecture style (microservices vs monolith, REST vs GraphQL)
|
|
28
|
+
- Infrastructure (cloud provider, containerization, serverless)
|
|
29
|
+
- Security model (auth strategy, encryption approach)
|
|
30
|
+
- Data strategy (storage, caching, messaging)
|
|
31
|
+
- Team workflow (CI/CD, branching strategy, code review)
|
|
32
|
+
|
|
33
|
+
**If YES** → Create an ADR
|
|
34
|
+
**If NO** → Document briefly in code comments
|
|
35
|
+
|
|
36
|
+
### 2. Context (Why Are We Doing This?)
|
|
37
|
+
|
|
38
|
+
Document the forces at play:
|
|
39
|
+
- Business requirements (scale, compliance, time-to-market)
|
|
40
|
+
- Technical constraints (legacy systems, team expertise)
|
|
41
|
+
- Quality attributes (performance, security, maintainability)
|
|
42
|
+
|
|
43
|
+
### 3. Decision (What Did We Choose?)
|
|
44
|
+
|
|
45
|
+
State the decision clearly:
|
|
46
|
+
- Chosen option with version/variant
|
|
47
|
+
- Configuration details
|
|
48
|
+
- Scope (what's in, what's out)
|
|
49
|
+
|
|
50
|
+
### 4. Alternatives (What Else Did We Consider?)
|
|
51
|
+
|
|
52
|
+
Document at least 2-3 alternatives:
|
|
53
|
+
- Option name and brief description
|
|
54
|
+
- Pros and cons
|
|
55
|
+
- Why it was rejected (be honest: "team familiarity," "cost," "risk")
|
|
56
|
+
|
|
57
|
+
### 5. Consequences (What Happens Now?)
|
|
58
|
+
|
|
59
|
+
List the implications:
|
|
60
|
+
- **Positive**: Benefits we gain
|
|
61
|
+
- **Negative**: Trade-offs we accept
|
|
62
|
+
- **Neutral**: Changes to workflows or expectations
|
|
63
|
+
- **Risks**: What could go wrong
|
|
64
|
+
- **Migration**: Path from current state to new state
|
|
65
|
+
|
|
66
|
+
## ADR Template
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
# ADR-[NUMBER]: [Short Title]
|
|
70
|
+
|
|
71
|
+
## Status
|
|
72
|
+
- Proposed
|
|
73
|
+
- Accepted
|
|
74
|
+
- Deprecated (replaced by ADR-XXX)
|
|
75
|
+
- Superseded by ADR-XXX
|
|
76
|
+
|
|
77
|
+
## Context
|
|
78
|
+
|
|
79
|
+
[The problem statement. What is the issue we're addressing? What forces are at play?]
|
|
80
|
+
|
|
81
|
+
[Example: We need to choose a database for our user service. The service must handle 10k writes/second with ACID compliance. Team has Postgres expertise but limited NoSQL experience.]
|
|
82
|
+
|
|
83
|
+
## Decision
|
|
84
|
+
|
|
85
|
+
**We will use [TECHNOLOGY/Approach] version [X.Y]**
|
|
86
|
+
|
|
87
|
+
[Clear, concise statement of the decision.]
|
|
88
|
+
|
|
89
|
+
### Configuration
|
|
90
|
+
- Setting A: Value
|
|
91
|
+
- Setting B: Value
|
|
92
|
+
|
|
93
|
+
### Scope
|
|
94
|
+
- **In Scope**: User data, session storage
|
|
95
|
+
- **Out of Scope**: Analytics data (see ADR-015)
|
|
96
|
+
|
|
97
|
+
## Alternatives Considered
|
|
98
|
+
|
|
99
|
+
### Option 1: [Name]
|
|
100
|
+
[Description]
|
|
101
|
+
|
|
102
|
+
**Pros:**
|
|
103
|
+
- Benefit A
|
|
104
|
+
- Benefit B
|
|
105
|
+
|
|
106
|
+
**Cons:**
|
|
107
|
+
- Drawback A
|
|
108
|
+
- Drawback B
|
|
109
|
+
|
|
110
|
+
**Decision**: Rejected because [specific reason].
|
|
111
|
+
|
|
112
|
+
### Option 2: [Name]
|
|
113
|
+
[Description]
|
|
114
|
+
|
|
115
|
+
**Pros:**
|
|
116
|
+
- Benefit A
|
|
117
|
+
- Benefit B
|
|
118
|
+
|
|
119
|
+
**Cons:**
|
|
120
|
+
- Drawback A
|
|
121
|
+
- Drawback B
|
|
122
|
+
|
|
123
|
+
**Decision**: Rejected because [specific reason].
|
|
124
|
+
|
|
125
|
+
### Option 3: Status Quo (Do Nothing)
|
|
126
|
+
**Decision**: Rejected because [specific reason].
|
|
127
|
+
|
|
128
|
+
## Consequences
|
|
129
|
+
|
|
130
|
+
### Positive
|
|
131
|
+
- [Benefit 1]
|
|
132
|
+
- [Benefit 2]
|
|
133
|
+
|
|
134
|
+
### Negative / Trade-offs
|
|
135
|
+
- [Trade-off 1]
|
|
136
|
+
- [Trade-off 2]
|
|
137
|
+
|
|
138
|
+
### Neutral
|
|
139
|
+
- [Change 1]
|
|
140
|
+
|
|
141
|
+
### Risks
|
|
142
|
+
- [Risk 1] → Mitigation: [strategy]
|
|
143
|
+
- [Risk 2] → Mitigation: [strategy]
|
|
144
|
+
|
|
145
|
+
### Migration Path
|
|
146
|
+
1. [Step 1]
|
|
147
|
+
2. [Step 2]
|
|
148
|
+
3. [Step 3]
|
|
149
|
+
|
|
150
|
+
## Related Decisions
|
|
151
|
+
- Relates to ADR-XXX
|
|
152
|
+
- Depends on ADR-YYY
|
|
153
|
+
- Supersedes ADR-ZZZ
|
|
154
|
+
|
|
155
|
+
## Notes
|
|
156
|
+
- **Decision Date**: YYYY-MM-DD
|
|
157
|
+
- **Decision Makers**: [Name], [Name]
|
|
158
|
+
- **Stakeholders Consulted**: [Team/Individual]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Execution Template
|
|
162
|
+
|
|
163
|
+
*Use this when documenting a decision.*
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
## 📝 Decision Documentation
|
|
167
|
+
|
|
168
|
+
### 1. Decision Summary
|
|
169
|
+
- **Topic**: [What are we deciding?]
|
|
170
|
+
- **Significance**: High/Medium/Low
|
|
171
|
+
- **Reversibility**: Easy/Moderate/Difficult
|
|
172
|
+
|
|
173
|
+
### 2. Context & Forces
|
|
174
|
+
- Business driver: [What business need drives this?]
|
|
175
|
+
- Technical driver: [What technical need drives this?]
|
|
176
|
+
- Constraints: [Time, budget, expertise, legacy]
|
|
177
|
+
|
|
178
|
+
### 3. Options Analysis
|
|
179
|
+
|
|
180
|
+
| Option | Pros | Cons | Score (1-10) |
|
|
181
|
+
|:-------|:-----|:-----|:------------:|
|
|
182
|
+
| Option A | Fast, proven | Expensive | 7 |
|
|
183
|
+
| Option B | Cheap, flexible | Unproven | 6 |
|
|
184
|
+
| Option C | [Status Quo] | Technical debt | 4 |
|
|
185
|
+
|
|
186
|
+
### 4. Recommendation
|
|
187
|
+
**Chosen**: Option A
|
|
188
|
+
**Rationale**: Best balance of speed and reliability given Q2 deadline. Cost acceptable.
|
|
189
|
+
|
|
190
|
+
### 5. ADR Status
|
|
191
|
+
- [ ] Draft created
|
|
192
|
+
- [ ] Reviewed by architect
|
|
193
|
+
- [ ] Reviewed by team
|
|
194
|
+
- [ ] Accepted
|
|
195
|
+
- [ ] Documented in `docs/adr/`
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## ADR Index Maintenance
|
|
199
|
+
|
|
200
|
+
Maintain an index file for discoverability:
|
|
201
|
+
|
|
202
|
+
```markdown
|
|
203
|
+
# Architecture Decision Records
|
|
204
|
+
|
|
205
|
+
## Active Decisions
|
|
206
|
+
| ADR | Title | Date | Status |
|
|
207
|
+
|:----|:------|:-----|:------:|
|
|
208
|
+
| 001 | Use PostgreSQL for Core Data | 2026-01-15 | Accepted |
|
|
209
|
+
| 002 | Adopt Next.js App Router | 2026-01-20 | Accepted |
|
|
210
|
+
| 003 | Implement JWT Authentication | 2026-01-25 | Accepted |
|
|
211
|
+
|
|
212
|
+
## Deprecated/Superseded
|
|
213
|
+
| ADR | Title | Date | Status |
|
|
214
|
+
|:----|:------|:-----|:------:|
|
|
215
|
+
| 000 | Use MongoDB (pilot) | 2026-01-10 | Superseded by ADR-001 |
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Integration with Agents
|
|
219
|
+
|
|
220
|
+
- **`architect`**: Primary user—creates ADRs for all architectural decisions.
|
|
221
|
+
- **`pm-agent`**: Reviews ADRs for impact on timelines and resources.
|
|
222
|
+
- **`backend` / `frontend`**: Reference ADRs when implementing to understand constraints.
|
|
223
|
+
- **`writer`**: Updates ADRs with implementation details and outcomes.
|
|
224
|
+
|
|
225
|
+
## Storage Location
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
docs/
|
|
229
|
+
└── adr/
|
|
230
|
+
├── README.md # Index of all ADRs
|
|
231
|
+
├── 001-use-postgres.md
|
|
232
|
+
├── 002-nextjs-app-router.md
|
|
233
|
+
└── 003-jwt-auth.md
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Or in `.opencode/memory/adr/` for agent-centric projects.
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc-sync
|
|
3
|
+
description: Documentation synchronization with code to prevent drift and ensure accuracy.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Doc Sync Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
To prevent **documentation drift**—the silent killer of maintainability. This skill ensures documentation stays synchronized with code changes, catching discrepancies before they become "source of truth" conflicts.
|
|
11
|
+
|
|
12
|
+
**ROI Metric**: Accurate docs reduce onboarding time by 50% and prevent costly misimplementations.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- **Trigger**: After any significant code change (new feature, API change, refactor).
|
|
17
|
+
- **Trigger**: When `self-check` flags documentation in implementation reports.
|
|
18
|
+
- **Trigger**: Before releases (ensures public docs are accurate).
|
|
19
|
+
- **Trigger**: When onboarding new team members (docs are tested).
|
|
20
|
+
- **Trigger**: When `pm-agent` schedules a "documentation audit."
|
|
21
|
+
|
|
22
|
+
## The Doc Sync Protocol (The 4-Step Process)
|
|
23
|
+
|
|
24
|
+
### 1. Discovery (What Docs Exist?)
|
|
25
|
+
|
|
26
|
+
**Scan for documentation:**
|
|
27
|
+
```
|
|
28
|
+
docs/
|
|
29
|
+
├── README.md # Project overview
|
|
30
|
+
├── api/ # API documentation
|
|
31
|
+
├── architecture/ # System design docs
|
|
32
|
+
├── setup.md # Developer onboarding
|
|
33
|
+
├── deployment.md # Deployment guide
|
|
34
|
+
└── adr/ # Architecture decisions
|
|
35
|
+
|
|
36
|
+
README.md
|
|
37
|
+
CONTRIBUTING.md
|
|
38
|
+
AGENTS.md
|
|
39
|
+
CHANGELOG.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Identify doc types:**
|
|
43
|
+
- **API Docs**: OpenAPI/Swagger, README endpoints
|
|
44
|
+
- **Architecture Docs**: Diagrams, system descriptions
|
|
45
|
+
- **Setup Docs**: Installation, configuration
|
|
46
|
+
- **ADR Docs**: Decision records
|
|
47
|
+
- **Code Comments**: JSDoc, docstrings
|
|
48
|
+
|
|
49
|
+
### 2. Extraction (What Does Code Say?)
|
|
50
|
+
|
|
51
|
+
**Extract current state from code:**
|
|
52
|
+
|
|
53
|
+
**API Contracts:**
|
|
54
|
+
```typescript
|
|
55
|
+
// From backend code
|
|
56
|
+
@Post('/users')
|
|
57
|
+
async createUser(@Body() dto: CreateUserDto) {
|
|
58
|
+
// Extract: POST /users accepts CreateUserDto
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// From Zod schemas
|
|
62
|
+
export const CreateUserSchema = z.object({
|
|
63
|
+
email: z.string().email(), // Extract: email required, must be valid
|
|
64
|
+
name: z.string().min(2), // Extract: name required, min 2 chars
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Configuration:**
|
|
69
|
+
```typescript
|
|
70
|
+
// From config files
|
|
71
|
+
export const config = {
|
|
72
|
+
database: {
|
|
73
|
+
host: process.env.DB_HOST, // Extract: DB_HOST env var required
|
|
74
|
+
port: parseInt(process.env.DB_PORT || '5432'), // Extract: DB_PORT optional, default 5432
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Dependencies:**
|
|
80
|
+
```json
|
|
81
|
+
// From package.json
|
|
82
|
+
{
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"react": "^18.2.0", // Extract: React 18 required
|
|
85
|
+
"next": "14.0.0" // Extract: Next.js 14 required
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 3. Comparison (Do They Match?)
|
|
91
|
+
|
|
92
|
+
**Compare extracted code state with documented state:**
|
|
93
|
+
|
|
94
|
+
| Source | Documented | Actual | Status |
|
|
95
|
+
|:-------|:-----------|:-------|:-------|
|
|
96
|
+
| API: POST /users | Accepts `name`, `email` | Accepts `name`, `email`, `role` | ⚠️ MISMATCH |
|
|
97
|
+
| DB: Host | Required env var | Has default `localhost` | ⚠️ MISMATCH |
|
|
98
|
+
| Node version | v16 required | v18 in Dockerfile | ⚠️ MISMATCH |
|
|
99
|
+
| Dependency: React | v17 | v18 | ❌ OUTDATED |
|
|
100
|
+
|
|
101
|
+
### 4. Synchronization (Update Docs)
|
|
102
|
+
|
|
103
|
+
**Update strategies:**
|
|
104
|
+
|
|
105
|
+
**A. Immediate Update**
|
|
106
|
+
- Update docs as part of the same PR that changes code.
|
|
107
|
+
- Include in Definition of Done: "Documentation updated."
|
|
108
|
+
|
|
109
|
+
**B. Scheduled Sync**
|
|
110
|
+
- Weekly/bi-weekly doc review sessions.
|
|
111
|
+
- Batch update accumulated drift.
|
|
112
|
+
|
|
113
|
+
**C. Release Gate**
|
|
114
|
+
- Block releases if doc sync check fails.
|
|
115
|
+
- Enforce accuracy before going public.
|
|
116
|
+
|
|
117
|
+
## Doc Sync Checklist Template
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
# Doc Sync Report: [Feature/Release]
|
|
121
|
+
|
|
122
|
+
## Summary
|
|
123
|
+
**Scope**: [What changed?]
|
|
124
|
+
**Date**: YYYY-MM-DD
|
|
125
|
+
**Sync Status**: ✅ In Sync | ⚠️ Minor Drift | ❌ Major Drift
|
|
126
|
+
|
|
127
|
+
## Files Changed
|
|
128
|
+
| File | Change Type | Docs Updated? |
|
|
129
|
+
|:-----|:------------|:-------------:|
|
|
130
|
+
| src/api/users.ts | New endpoint | ⬜ |
|
|
131
|
+
| src/config/db.ts | New env var | ⬜ |
|
|
132
|
+
| package.json | Dependency bump | ⬜ |
|
|
133
|
+
|
|
134
|
+
## API Documentation Sync
|
|
135
|
+
|
|
136
|
+
| Endpoint | Doc Location | Doc Status | Code Status | Match? |
|
|
137
|
+
|:---------|:-------------|:-----------|:------------|:------:|
|
|
138
|
+
| POST /users | docs/api/users.md | v1.0 | v1.1 (added role) | ❌ |
|
|
139
|
+
| GET /users/:id | docs/api/users.md | v1.0 | v1.0 | ✅ |
|
|
140
|
+
|
|
141
|
+
### Required Updates
|
|
142
|
+
- [ ] Add `role` parameter to POST /users documentation
|
|
143
|
+
- [ ] Update example request/response
|
|
144
|
+
- [ ] Add validation rules for role field
|
|
145
|
+
|
|
146
|
+
## Environment Variables Sync
|
|
147
|
+
|
|
148
|
+
| Variable | Doc Location | Doc Status | Code Status | Match? |
|
|
149
|
+
|:---------|:-------------|:-----------|:------------|:------:|
|
|
150
|
+
| DB_HOST | README.md | Required | Required | ✅ |
|
|
151
|
+
| DB_PORT | README.md | Not documented | Optional (5432) | ⚠️ |
|
|
152
|
+
| REDIS_URL | README.md | Required | Optional | ❌ |
|
|
153
|
+
|
|
154
|
+
### Required Updates
|
|
155
|
+
- [ ] Document DB_PORT as optional with default
|
|
156
|
+
- [ ] Update REDIS_URL from required to optional
|
|
157
|
+
|
|
158
|
+
## Dependencies Sync
|
|
159
|
+
|
|
160
|
+
| Dependency | Doc Location | Doc Version | Actual Version | Match? |
|
|
161
|
+
|:-----------|:-------------|:------------|:---------------|:------:|
|
|
162
|
+
| Node.js | README.md | v16.x | v18.x | ❌ |
|
|
163
|
+
| React | README.md | v17.x | v18.2.x | ❌ |
|
|
164
|
+
| PostgreSQL | README.md | v13 | v15 | ⚠️ |
|
|
165
|
+
|
|
166
|
+
### Required Updates
|
|
167
|
+
- [ ] Update Node.js requirement to v18
|
|
168
|
+
- [ ] Update React requirement to v18
|
|
169
|
+
- [ ] Verify PostgreSQL compatibility doc
|
|
170
|
+
|
|
171
|
+
## Architecture Docs Sync
|
|
172
|
+
|
|
173
|
+
| Component | Doc Location | Doc Status | Code Status | Match? |
|
|
174
|
+
|:----------|:-------------|:-----------|:------------|:------:|
|
|
175
|
+
| Auth Service | docs/arch/auth.md | JWT | JWT + OAuth | ⚠️ |
|
|
176
|
+
| Database Schema | docs/arch/db.md | v1 | v2 (added orders) | ❌ |
|
|
177
|
+
|
|
178
|
+
### Required Updates
|
|
179
|
+
- [ ] Add OAuth flow to auth documentation
|
|
180
|
+
- [ ] Update database schema diagram
|
|
181
|
+
- [ ] Document orders table
|
|
182
|
+
|
|
183
|
+
## Action Items
|
|
184
|
+
|
|
185
|
+
### Immediate (Block Release)
|
|
186
|
+
- [ ] Update POST /users API docs
|
|
187
|
+
- [ ] Correct Node.js version requirement
|
|
188
|
+
|
|
189
|
+
### This Week
|
|
190
|
+
- [ ] Document missing env vars
|
|
191
|
+
- [ ] Update architecture diagram
|
|
192
|
+
|
|
193
|
+
### Next Sprint
|
|
194
|
+
- [ ] Full dependency audit
|
|
195
|
+
- [ ] Review all code comments
|
|
196
|
+
|
|
197
|
+
## Verification
|
|
198
|
+
- [ ] All API examples tested and working
|
|
199
|
+
- [ ] Setup instructions verified on clean machine
|
|
200
|
+
- [ ] Architecture diagrams match current system
|
|
201
|
+
- [ ] Code comments are accurate
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Execution Template
|
|
205
|
+
|
|
206
|
+
*Use this during code review or before release.*
|
|
207
|
+
|
|
208
|
+
```markdown
|
|
209
|
+
## 🔄 Doc Sync Check: [PR/Release Name]
|
|
210
|
+
|
|
211
|
+
### 1. Code Changes
|
|
212
|
+
| File | Lines Changed | Doc Impact |
|
|
213
|
+
|:-----|:-------------:|:-----------|
|
|
214
|
+
| api/auth.ts | +45, -12 | Authentication flow |
|
|
215
|
+
| config/app.ts | +8, -2 | New env var |
|
|
216
|
+
| types/user.ts | +23, -0 | User fields |
|
|
217
|
+
|
|
218
|
+
### 2. Extracted Code State
|
|
219
|
+
**API Changes:**
|
|
220
|
+
- New endpoint: `POST /auth/refresh` (added in auth.ts:67)
|
|
221
|
+
- New field: `User.lastLoginAt` (added in types/user.ts:12)
|
|
222
|
+
|
|
223
|
+
**Config Changes:**
|
|
224
|
+
- New env: `JWT_REFRESH_SECRET` (added in config/app.ts:23)
|
|
225
|
+
|
|
226
|
+
### 3. Documentation Audit
|
|
227
|
+
|
|
228
|
+
| Doc File | Section | Needs Update? | Action |
|
|
229
|
+
|:---------|:--------|:-------------:|:-------|
|
|
230
|
+
| docs/api/auth.md | Endpoints | ✅ Yes | Add refresh endpoint |
|
|
231
|
+
| docs/api/auth.md | Examples | ✅ Yes | Add refresh example |
|
|
232
|
+
| README.md | Env Vars | ✅ Yes | Add JWT_REFRESH_SECRET |
|
|
233
|
+
| docs/models/user.md | Schema | ✅ Yes | Add lastLoginAt field |
|
|
234
|
+
|
|
235
|
+
### 4. Sync Plan
|
|
236
|
+
**This PR:**
|
|
237
|
+
- [ ] Update docs/api/auth.md
|
|
238
|
+
- [ ] Update README.md
|
|
239
|
+
- [ ] Update docs/models/user.md
|
|
240
|
+
|
|
241
|
+
**Estimated Time**: 30 minutes
|
|
242
|
+
|
|
243
|
+
### 5. Definition of Done
|
|
244
|
+
- [ ] All code changes reflected in docs
|
|
245
|
+
- [ ] Examples tested and working
|
|
246
|
+
- [ ] Doc review completed
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Automation Strategies
|
|
250
|
+
|
|
251
|
+
### A. CI/CD Integration
|
|
252
|
+
```yaml
|
|
253
|
+
# .github/workflows/doc-sync.yml
|
|
254
|
+
name: Documentation Sync Check
|
|
255
|
+
|
|
256
|
+
on:
|
|
257
|
+
pull_request:
|
|
258
|
+
paths:
|
|
259
|
+
- 'src/**'
|
|
260
|
+
- 'docs/**'
|
|
261
|
+
|
|
262
|
+
jobs:
|
|
263
|
+
doc-sync:
|
|
264
|
+
runs-on: ubuntu-latest
|
|
265
|
+
steps:
|
|
266
|
+
- uses: actions/checkout@v4
|
|
267
|
+
|
|
268
|
+
- name: Check API Docs
|
|
269
|
+
run: |
|
|
270
|
+
# Extract API routes from code
|
|
271
|
+
npm run extract-api > api-current.json
|
|
272
|
+
# Compare with documented API
|
|
273
|
+
npm run verify-docs api-current.json docs/api/
|
|
274
|
+
|
|
275
|
+
- name: Check Type Definitions
|
|
276
|
+
run: |
|
|
277
|
+
# Verify TypeScript types match documented types
|
|
278
|
+
npm run verify-types
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### B. Pre-Commit Hooks
|
|
282
|
+
```bash
|
|
283
|
+
# .husky/pre-commit
|
|
284
|
+
#!/bin/sh
|
|
285
|
+
. "$(dirname "$0")/_/husky.sh"
|
|
286
|
+
|
|
287
|
+
# If API files changed, remind to update docs
|
|
288
|
+
if git diff --cached --name-only | grep -q "src/api/"; then
|
|
289
|
+
echo "⚠️ API files changed. Did you update the documentation?"
|
|
290
|
+
fi
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### C. Living Documentation
|
|
294
|
+
Generate docs from code automatically:
|
|
295
|
+
```typescript
|
|
296
|
+
// Use tools like:
|
|
297
|
+
// - TypeDoc for TypeScript
|
|
298
|
+
// - JSDoc for JavaScript
|
|
299
|
+
// - Swagger/OpenAPI from code annotations
|
|
300
|
+
// - MkDocs with code extraction plugins
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Integration with Agents
|
|
304
|
+
|
|
305
|
+
- **`backend`**: Updates API docs when endpoints change.
|
|
306
|
+
- **`frontend`**: Updates component docs when props change.
|
|
307
|
+
- **`architect`**: Updates architecture docs when system changes.
|
|
308
|
+
- **`writer`**: Reviews and polishes documentation.
|
|
309
|
+
- **`pm-agent`**: Schedules doc sync audits, tracks completion.
|
|
310
|
+
|
|
311
|
+
## Common Doc Drift Scenarios
|
|
312
|
+
|
|
313
|
+
### Scenario 1: API Evolution
|
|
314
|
+
```
|
|
315
|
+
Week 1: API accepts { name, email }
|
|
316
|
+
Week 4: Code adds optional `role` field
|
|
317
|
+
Week 8: Client tries to use `role` from outdated docs → Error
|
|
318
|
+
```
|
|
319
|
+
**Fix**: Update API docs same week role is added.
|
|
320
|
+
|
|
321
|
+
### Scenario 2: Environment Changes
|
|
322
|
+
```
|
|
323
|
+
Original: DB_HOST required, DB_PORT defaults to 5432
|
|
324
|
+
Docs say: Both DB_HOST and DB_PORT are required
|
|
325
|
+
Result: Developer confusion, wasted time
|
|
326
|
+
```
|
|
327
|
+
**Fix**: Sync env var docs with actual config.
|
|
328
|
+
|
|
329
|
+
### Scenario 3: Dependency Updates
|
|
330
|
+
```
|
|
331
|
+
Docs say: Requires Node.js 16
|
|
332
|
+
Dockerfile: Uses Node.js 18
|
|
333
|
+
CI/CD: Uses Node.js 18
|
|
334
|
+
New dev: Installs Node 16, gets deprecation warnings
|
|
335
|
+
```
|
|
336
|
+
**Fix**: Update all version references together.
|
|
337
|
+
|
|
338
|
+
## Success Metrics
|
|
339
|
+
|
|
340
|
+
- **Doc Accuracy Score**: % of documented items that match code
|
|
341
|
+
- **Time to Onboard**: How long for new dev to get running
|
|
342
|
+
- **Support Tickets**: % related to doc confusion
|
|
343
|
+
- **API Error Rate**: % due to clients following outdated docs
|
|
344
|
+
|
|
345
|
+
Target: 95%+ doc accuracy, <1 day onboarding time.
|