opencodekit 0.20.7 → 0.20.8
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +48 -0
- package/dist/template/.opencode/agent/build.md +3 -2
- package/dist/template/.opencode/agent/explore.md +14 -14
- package/dist/template/.opencode/agent/general.md +1 -1
- package/dist/template/.opencode/agent/plan.md +1 -1
- package/dist/template/.opencode/agent/review.md +1 -1
- package/dist/template/.opencode/agent/vision.md +0 -9
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +0 -5
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/pnpm-lock.yaml +791 -9
- package/dist/template/.opencode/skill/api-and-interface-design/SKILL.md +162 -0
- package/dist/template/.opencode/skill/beads/SKILL.md +10 -9
- package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +10 -10
- package/dist/template/.opencode/skill/ci-cd-and-automation/SKILL.md +202 -0
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +253 -0
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +211 -0
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +12 -0
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +16 -6
- package/dist/template/.opencode/skill/deprecation-and-migration/SKILL.md +189 -0
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +12 -48
- package/dist/template/.opencode/skill/documentation-and-adrs/SKILL.md +220 -0
- package/dist/template/.opencode/skill/incremental-implementation/SKILL.md +191 -0
- package/dist/template/.opencode/skill/performance-optimization/SKILL.md +236 -0
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +11 -0
- package/dist/template/.opencode/skill/security-and-hardening/SKILL.md +296 -0
- package/dist/template/.opencode/skill/structured-edit/SKILL.md +10 -0
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +66 -1
- package/package.json +1 -1
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +0 -321
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +0 -130
- package/dist/template/.opencode/skill/mqdh/SKILL.md +0 -171
- package/dist/template/.opencode/skill/obsidian/SKILL.md +0 -192
- package/dist/template/.opencode/skill/obsidian/mcp.json +0 -22
- package/dist/template/.opencode/skill/pencil/SKILL.md +0 -72
- package/dist/template/.opencode/skill/ralph/SKILL.md +0 -296
- package/dist/template/.opencode/skill/tilth-cli/SKILL.md +0 -207
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +0 -299
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deprecation-and-migration
|
|
3
|
+
description: Use when deprecating APIs, migrating between library versions, removing legacy code, or planning breaking changes — covers deprecation notices, migration guides, codemods, and staged rollout
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [architecture, workflow]
|
|
6
|
+
dependencies: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Deprecation & Migration
|
|
10
|
+
|
|
11
|
+
> **Replaces** sudden breaking changes with structured, communicable transitions that give consumers time to adapt
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Deprecating an API endpoint, function, or module
|
|
16
|
+
- Migrating between major library/framework versions
|
|
17
|
+
- Removing legacy code paths or feature flags
|
|
18
|
+
- Planning breaking changes across multiple consumers
|
|
19
|
+
|
|
20
|
+
## When NOT to Use
|
|
21
|
+
|
|
22
|
+
- Internal refactors that don't affect any public API or consumer
|
|
23
|
+
- Bug fixes that change behavior (that's a fix, not a migration)
|
|
24
|
+
- Adding new features alongside existing ones (no deprecation needed)
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
Deprecation is a communication protocol. Migration is the execution plan. Both must be explicit, gradual, and reversible until the cutover point.
|
|
29
|
+
|
|
30
|
+
**Core principle:** Never remove without warning. Never warn without a replacement. Never migrate without a rollback plan.
|
|
31
|
+
|
|
32
|
+
## Deprecation Process
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
1. ANNOUNCE — Mark as deprecated with notice + replacement + timeline
|
|
36
|
+
2. PROVIDE — Ship the replacement alongside the deprecated code
|
|
37
|
+
3. MIGRATE — Help consumers move (codemods, guides, examples)
|
|
38
|
+
4. MONITOR — Track usage of deprecated paths
|
|
39
|
+
5. REMOVE — Remove only after usage drops to zero (or deadline passes)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Deprecation Notices
|
|
43
|
+
|
|
44
|
+
### In Code
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use `createUser()` instead. Will be removed in v3.0.
|
|
49
|
+
* Migration guide: https://docs.example.com/migrate-v3
|
|
50
|
+
*/
|
|
51
|
+
export function addUser(name: string): User {
|
|
52
|
+
console.warn(
|
|
53
|
+
"addUser() is deprecated. Use createUser() instead. See: https://docs.example.com/migrate-v3",
|
|
54
|
+
);
|
|
55
|
+
return createUser({ name });
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Checklist
|
|
60
|
+
|
|
61
|
+
- [ ] `@deprecated` JSDoc tag with replacement name
|
|
62
|
+
- [ ] Runtime warning on first call (not every call — use a flag)
|
|
63
|
+
- [ ] Migration guide URL in the deprecation message
|
|
64
|
+
- [ ] Removal version/date specified
|
|
65
|
+
- [ ] TypeScript: mark with `@deprecated` for IDE strikethrough
|
|
66
|
+
|
|
67
|
+
## Migration Guide Template
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
# Migration: v2 → v3
|
|
71
|
+
|
|
72
|
+
## Breaking Changes
|
|
73
|
+
|
|
74
|
+
| Change | Before | After | Effort |
|
|
75
|
+
| ------------------------ | --------------- | ---------------------- | ------ |
|
|
76
|
+
| `addUser` → `createUser` | `addUser(name)` | `createUser({ name })` | S |
|
|
77
|
+
| Config format changed | `config.key` | `config.settings.key` | M |
|
|
78
|
+
|
|
79
|
+
## Step-by-Step
|
|
80
|
+
|
|
81
|
+
1. Update dependency: `npm install pkg@3.0.0`
|
|
82
|
+
2. Run codemod: `npx pkg-migrate v2-to-v3`
|
|
83
|
+
3. Manual fixes: [list of manual changes]
|
|
84
|
+
4. Verify: `npm test && npm run typecheck`
|
|
85
|
+
|
|
86
|
+
## Rollback
|
|
87
|
+
|
|
88
|
+
If issues arise: `npm install pkg@2.x.x` — v2 APIs still work until v4.
|
|
89
|
+
|
|
90
|
+
## Timeline
|
|
91
|
+
|
|
92
|
+
- v2.5.0: Deprecation warnings added
|
|
93
|
+
- v3.0.0: New API shipped, old API still works with warnings
|
|
94
|
+
- v3.5.0: Old API removed (6 months after v3.0.0)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Codemod Patterns
|
|
98
|
+
|
|
99
|
+
### Simple Find & Replace
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// jscodeshift transform
|
|
103
|
+
export default function transformer(file, api) {
|
|
104
|
+
const j = api.jscodeshift;
|
|
105
|
+
return j(file.source)
|
|
106
|
+
.find(j.CallExpression, { callee: { name: "addUser" } })
|
|
107
|
+
.forEach((path) => {
|
|
108
|
+
path.node.callee.name = "createUser";
|
|
109
|
+
// Wrap string arg in object: addUser("name") → createUser({ name: "name" })
|
|
110
|
+
const arg = path.node.arguments[0];
|
|
111
|
+
path.node.arguments = [j.objectExpression([j.property("init", j.identifier("name"), arg)])];
|
|
112
|
+
})
|
|
113
|
+
.toSource();
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### When to Write a Codemod
|
|
118
|
+
|
|
119
|
+
| Consumers | Change Complexity | Write Codemod? |
|
|
120
|
+
| --------------- | ------------------- | ------------------------------------------ |
|
|
121
|
+
| 1-5 call sites | Simple rename | No — manual is faster |
|
|
122
|
+
| 5-20 call sites | Simple rename | Maybe — saves time and ensures consistency |
|
|
123
|
+
| 20+ call sites | Any change | Yes — manual migration is error-prone |
|
|
124
|
+
| Any count | Complex restructure | Yes — reduce human error |
|
|
125
|
+
|
|
126
|
+
## Staged Rollout
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Phase 1: Ship new API alongside old (backward compatible)
|
|
130
|
+
└── Duration: 1-2 release cycles
|
|
131
|
+
└── Verify: New API works, old API still works
|
|
132
|
+
|
|
133
|
+
Phase 2: Add deprecation warnings to old API
|
|
134
|
+
└── Duration: 2-4 release cycles
|
|
135
|
+
└── Monitor: Track warning frequency, identify stragglers
|
|
136
|
+
|
|
137
|
+
Phase 3: Remove old API
|
|
138
|
+
└── Only when: Usage is zero OR deadline passed
|
|
139
|
+
└── Verify: No references remain in codebase
|
|
140
|
+
└── Rollback: Revert removal if unexpected breakage
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Common Rationalizations
|
|
144
|
+
|
|
145
|
+
| Excuse | Rebuttal |
|
|
146
|
+
| -------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
147
|
+
| "Nobody uses the old API" | Prove it with usage data. Assumption ≠ evidence. |
|
|
148
|
+
| "It's an internal API, just change it" | Internal consumers break too. Deprecate or coordinate. |
|
|
149
|
+
| "Deprecation warnings are noisy" | That's the point — they surface migration debt before it becomes an emergency. |
|
|
150
|
+
| "We'll document later" | Undocumented breaking changes cause support load that dwarfs documentation effort. |
|
|
151
|
+
| "The codemod is too much work" | One codemod saves N manual migrations. Calculate the actual ROI. |
|
|
152
|
+
| "Just bump the major version" | A version bump without a migration path is abandonment, not deprecation. |
|
|
153
|
+
|
|
154
|
+
## Feature Flag Cleanup
|
|
155
|
+
|
|
156
|
+
Feature flags are a form of deprecation — they accumulate if not cleaned up.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
1. Deploy feature behind flag (OFF)
|
|
160
|
+
2. Enable for team → canary → percentage → 100%
|
|
161
|
+
3. Once stable at 100%: REMOVE the flag
|
|
162
|
+
4. Delete: flag definition, branching code, old code path
|
|
163
|
+
5. Verify: tests pass without the flag
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Flag lifecycle max:** 30 days at 100% before cleanup is mandatory.
|
|
167
|
+
|
|
168
|
+
## Red Flags — STOP
|
|
169
|
+
|
|
170
|
+
- Breaking change shipped without deprecation period
|
|
171
|
+
- Deprecated code removed before usage reaches zero
|
|
172
|
+
- No migration guide or codemod for complex changes
|
|
173
|
+
- Feature flags older than 90 days without cleanup plan
|
|
174
|
+
- Runtime deprecation warnings suppressed instead of addressed
|
|
175
|
+
|
|
176
|
+
## Verification
|
|
177
|
+
|
|
178
|
+
- [ ] Deprecated APIs have `@deprecated` tags with replacement
|
|
179
|
+
- [ ] Runtime warnings fire on deprecated API usage
|
|
180
|
+
- [ ] Migration guide exists with step-by-step + rollback
|
|
181
|
+
- [ ] Usage of deprecated paths is tracked/monitored
|
|
182
|
+
- [ ] Feature flags have documented cleanup dates
|
|
183
|
+
- [ ] Codemod written for changes affecting 20+ call sites
|
|
184
|
+
|
|
185
|
+
## See Also
|
|
186
|
+
|
|
187
|
+
- **api-and-interface-design** — Designing APIs that minimize future deprecation
|
|
188
|
+
- **incremental-implementation** — Migrating in thin vertical slices
|
|
189
|
+
- **documentation-and-adrs** — Recording the decision to deprecate/migrate
|
|
@@ -3,7 +3,16 @@ name: development-lifecycle
|
|
|
3
3
|
description: Orchestrates the full feature development lifecycle from ideation through verification. Guides through phases (brainstorm → design → specify → plan → implement → verify) and loads appropriate sub-skills at each stage.
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
tags: [workflow, planning]
|
|
6
|
-
dependencies:
|
|
6
|
+
dependencies:
|
|
7
|
+
[
|
|
8
|
+
brainstorming,
|
|
9
|
+
prd,
|
|
10
|
+
writing-plans,
|
|
11
|
+
executing-plans,
|
|
12
|
+
verification-before-completion,
|
|
13
|
+
requesting-code-review,
|
|
14
|
+
finishing-a-development-branch,
|
|
15
|
+
]
|
|
7
16
|
---
|
|
8
17
|
|
|
9
18
|
---
|
|
@@ -24,6 +33,8 @@ dependencies: [brainstorming, prd, writing-plans, executing-plans, verification-
|
|
|
24
33
|
|
|
25
34
|
This skill orchestrates the complete feature development workflow, guiding you through each phase and loading the appropriate sub-skills automatically.
|
|
26
35
|
|
|
36
|
+
**Note:** For quick skill routing by intent, see the Intent → Skill Mapping table in `AGENTS.md`. This skill is for full end-to-end orchestration when you need phase-by-phase guidance.
|
|
37
|
+
|
|
27
38
|
**Use when:** Starting any new feature, migration, refactor, or significant change.
|
|
28
39
|
|
|
29
40
|
**Announce at start:** "I'm using development-lifecycle to guide this work through all phases."
|
|
@@ -58,12 +69,6 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
58
69
|
|
|
59
70
|
**When:** You have a rough idea but need to explore and refine it.
|
|
60
71
|
|
|
61
|
-
**Load skill:**
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
skill({ name: "brainstorming" });
|
|
65
|
-
```
|
|
66
|
-
|
|
67
72
|
**Entry criteria:** User has an idea or problem to solve.
|
|
68
73
|
|
|
69
74
|
**Process:**
|
|
@@ -92,12 +97,6 @@ skill({ name: "brainstorming" });
|
|
|
92
97
|
|
|
93
98
|
**When:** Design is validated, need formal requirements and task breakdown.
|
|
94
99
|
|
|
95
|
-
**Load skill:**
|
|
96
|
-
|
|
97
|
-
```typescript
|
|
98
|
-
skill({ name: "prd" });
|
|
99
|
-
```
|
|
100
|
-
|
|
101
100
|
**Entry criteria:** Design document exists and is validated.
|
|
102
101
|
|
|
103
102
|
**Process:**
|
|
@@ -126,12 +125,6 @@ skill({ name: "prd" });
|
|
|
126
125
|
|
|
127
126
|
**When:** PRD is complete, need executable task list.
|
|
128
127
|
|
|
129
|
-
**Load skill:**
|
|
130
|
-
|
|
131
|
-
```typescript
|
|
132
|
-
skill({ name: "prd-task" });
|
|
133
|
-
```
|
|
134
|
-
|
|
135
128
|
**Entry criteria:** PRD exists at `.beads/artifacts/<bead-id>/prd.md`.
|
|
136
129
|
|
|
137
130
|
**Process:**
|
|
@@ -158,12 +151,6 @@ skill({ name: "prd-task" });
|
|
|
158
151
|
|
|
159
152
|
**When:** Tasks defined, need detailed implementation instructions.
|
|
160
153
|
|
|
161
|
-
**Load skill:**
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
skill({ name: "writing-plans" });
|
|
165
|
-
```
|
|
166
|
-
|
|
167
154
|
**Entry criteria:** Task list exists (prd.json or tasks.md).
|
|
168
155
|
|
|
169
156
|
**Process:**
|
|
@@ -192,12 +179,6 @@ skill({ name: "writing-plans" });
|
|
|
192
179
|
|
|
193
180
|
**When:** Plan is ready, time to build.
|
|
194
181
|
|
|
195
|
-
**Load skill:**
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
skill({ name: "executing-plans" });
|
|
199
|
-
```
|
|
200
|
-
|
|
201
182
|
**Entry criteria:** Plan exists at `.beads/artifacts/<bead-id>/plan.md`.
|
|
202
183
|
|
|
203
184
|
**Process:**
|
|
@@ -225,12 +206,6 @@ skill({ name: "executing-plans" });
|
|
|
225
206
|
|
|
226
207
|
**When:** Implementation complete, before claiming done.
|
|
227
208
|
|
|
228
|
-
**Load skill:**
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
skill({ name: "verification-before-completion" });
|
|
232
|
-
```
|
|
233
|
-
|
|
234
209
|
**Entry criteria:** All implementation tasks marked complete.
|
|
235
210
|
|
|
236
211
|
**Process:**
|
|
@@ -250,17 +225,6 @@ skill({ name: "verification-before-completion" });
|
|
|
250
225
|
|
|
251
226
|
## Phase Transitions
|
|
252
227
|
|
|
253
|
-
### Quick Start (Skip to appropriate phase)
|
|
254
|
-
|
|
255
|
-
| Starting Point | Begin At | Command |
|
|
256
|
-
| --------------------------------- | -------- | --------------------------------------------------- |
|
|
257
|
-
| Rough idea | Phase 1 | `skill({ name: "brainstorming" })` |
|
|
258
|
-
| Design done, need requirements | Phase 2 | `skill({ name: "prd" })` |
|
|
259
|
-
| PRD done, need task JSON | Phase 3 | `skill({ name: "prd-task" })` |
|
|
260
|
-
| Tasks defined, need detailed plan | Phase 4 | `skill({ name: "writing-plans" })` |
|
|
261
|
-
| Plan ready, time to build | Phase 5 | `skill({ name: "executing-plans" })` |
|
|
262
|
-
| Done coding, need verification | Phase 6 | `skill({ name: "verification-before-completion" })` |
|
|
263
|
-
|
|
264
228
|
### Skipping Phases
|
|
265
229
|
|
|
266
230
|
For small changes, you can skip early phases:
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-and-adrs
|
|
3
|
+
description: Use when writing technical documentation, Architecture Decision Records (ADRs), API docs, or project READMEs — covers documentation structure, ADR format, and keeping docs in sync with code
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [workflow, code-quality]
|
|
6
|
+
dependencies: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Documentation & ADRs
|
|
10
|
+
|
|
11
|
+
> **Replaces** undocumented architectural decisions and stale wiki pages with living documentation that stays close to code
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Making a significant architectural decision that should be recorded
|
|
16
|
+
- Writing or updating project documentation (README, guides, API docs)
|
|
17
|
+
- Onboarding documentation needs updating
|
|
18
|
+
- Code has complex behavior that isn't obvious from reading it
|
|
19
|
+
|
|
20
|
+
## When NOT to Use
|
|
21
|
+
|
|
22
|
+
- Code is self-documenting (clear naming, simple logic, typed interfaces)
|
|
23
|
+
- Writing comments that restate what the code does (comment the why, not the what)
|
|
24
|
+
- Documentation for throwaway prototypes
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
Documentation has two purposes: **decisions** (why things are the way they are) and **usage** (how to use them). ADRs handle the first. Guides, READMEs, and API docs handle the second.
|
|
29
|
+
|
|
30
|
+
**Core principle:** Document decisions when they're made, not months later when context is lost. Keep docs next to the code they describe.
|
|
31
|
+
|
|
32
|
+
## Architecture Decision Records (ADRs)
|
|
33
|
+
|
|
34
|
+
### When to Write an ADR
|
|
35
|
+
|
|
36
|
+
- Choosing between technologies, frameworks, or approaches
|
|
37
|
+
- Establishing a pattern that the team should follow
|
|
38
|
+
- Deviating from an existing convention (and why)
|
|
39
|
+
- Any decision you'd want to explain to a new team member in 6 months
|
|
40
|
+
|
|
41
|
+
### ADR Template
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
# ADR-NNN: [Decision Title]
|
|
45
|
+
|
|
46
|
+
## Status
|
|
47
|
+
|
|
48
|
+
[Proposed | Accepted | Deprecated | Superseded by ADR-XXX]
|
|
49
|
+
|
|
50
|
+
## Context
|
|
51
|
+
|
|
52
|
+
What is the issue we're facing? What constraints exist?
|
|
53
|
+
[2-5 sentences describing the problem and constraints]
|
|
54
|
+
|
|
55
|
+
## Decision
|
|
56
|
+
|
|
57
|
+
What did we decide to do?
|
|
58
|
+
[1-3 sentences stating the decision clearly]
|
|
59
|
+
|
|
60
|
+
## Alternatives Considered
|
|
61
|
+
|
|
62
|
+
| Option | Pros | Cons | Verdict |
|
|
63
|
+
| -------- | ---- | ---- | ------------------ |
|
|
64
|
+
| Option A | ... | ... | Chosen |
|
|
65
|
+
| Option B | ... | ... | Rejected: [reason] |
|
|
66
|
+
| Option C | ... | ... | Rejected: [reason] |
|
|
67
|
+
|
|
68
|
+
## Consequences
|
|
69
|
+
|
|
70
|
+
### Positive
|
|
71
|
+
|
|
72
|
+
- [Good outcomes]
|
|
73
|
+
|
|
74
|
+
### Negative
|
|
75
|
+
|
|
76
|
+
- [Trade-offs accepted]
|
|
77
|
+
|
|
78
|
+
### Risks
|
|
79
|
+
|
|
80
|
+
- [Things that could go wrong]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### ADR File Location
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
docs/adr/
|
|
87
|
+
├── 001-use-typescript.md
|
|
88
|
+
├── 002-choose-react-over-vue.md
|
|
89
|
+
├── 003-api-versioning-strategy.md
|
|
90
|
+
└── template.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Naming:** `NNN-kebab-case-title.md` — numbered for ordering, kebab-case for readability.
|
|
94
|
+
|
|
95
|
+
## README Structure
|
|
96
|
+
|
|
97
|
+
### Minimum Viable README
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
# Project Name
|
|
101
|
+
|
|
102
|
+
One-line description of what this does.
|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
[3-5 commands to get running]
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
[How to build, test, lint]
|
|
111
|
+
|
|
112
|
+
## Architecture
|
|
113
|
+
|
|
114
|
+
[Brief overview or link to docs/]
|
|
115
|
+
|
|
116
|
+
## Contributing
|
|
117
|
+
|
|
118
|
+
[Link to CONTRIBUTING.md or inline guide]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### README Anti-Patterns
|
|
122
|
+
|
|
123
|
+
| Anti-Pattern | Fix |
|
|
124
|
+
| ----------------------------------- | ------------------------------- |
|
|
125
|
+
| "See wiki for docs" (wiki is stale) | Keep docs in repo, next to code |
|
|
126
|
+
| Huge README (>500 lines) | Split into docs/ directory |
|
|
127
|
+
| No Quick Start section | First thing a new dev needs |
|
|
128
|
+
| Setup instructions that don't work | CI should verify setup steps |
|
|
129
|
+
|
|
130
|
+
## API Documentation
|
|
131
|
+
|
|
132
|
+
### In-Code Documentation
|
|
133
|
+
|
|
134
|
+
````typescript
|
|
135
|
+
/**
|
|
136
|
+
* Create a new project workspace.
|
|
137
|
+
*
|
|
138
|
+
* @param name - Project name (1-100 chars, alphanumeric + hyphens)
|
|
139
|
+
* @param options - Configuration options
|
|
140
|
+
* @returns The created project with generated ID
|
|
141
|
+
* @throws {ValidationError} If name is invalid
|
|
142
|
+
* @throws {ConflictError} If project name already exists
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const project = await createProject('my-app', { template: 'react' });
|
|
147
|
+
* console.log(project.id); // "proj_abc123"
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export async function createProject(
|
|
151
|
+
name: string,
|
|
152
|
+
options?: CreateProjectOptions,
|
|
153
|
+
): Promise<Project> {
|
|
154
|
+
````
|
|
155
|
+
|
|
156
|
+
### Documentation Comments Rules
|
|
157
|
+
|
|
158
|
+
| Do | Don't |
|
|
159
|
+
| ------------------------------------------------ | ------------------------------------ |
|
|
160
|
+
| Document the **why** | Restate the code as prose |
|
|
161
|
+
| Document **contracts** (inputs, outputs, errors) | Document obvious getters/setters |
|
|
162
|
+
| Document **non-obvious behavior** | Document every function |
|
|
163
|
+
| Include **examples** for complex APIs | Write examples for self-evident APIs |
|
|
164
|
+
|
|
165
|
+
## Keeping Docs in Sync
|
|
166
|
+
|
|
167
|
+
### Documentation Debt Signals
|
|
168
|
+
|
|
169
|
+
- README references files that don't exist
|
|
170
|
+
- Setup instructions fail on clean checkout
|
|
171
|
+
- API docs describe removed/renamed endpoints
|
|
172
|
+
- ADRs reference superseded decisions without linking forward
|
|
173
|
+
|
|
174
|
+
### Automation
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
# CI check: verify docs are not stale
|
|
178
|
+
- name: Check links
|
|
179
|
+
run: npx markdown-link-check README.md docs/**/*.md
|
|
180
|
+
|
|
181
|
+
- name: Verify setup instructions
|
|
182
|
+
run: |
|
|
183
|
+
# Run the Quick Start commands from README
|
|
184
|
+
npm install
|
|
185
|
+
npm run build
|
|
186
|
+
npm test
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Common Rationalizations
|
|
190
|
+
|
|
191
|
+
| Excuse | Rebuttal |
|
|
192
|
+
| ------------------------------ | ----------------------------------------------------------------------- |
|
|
193
|
+
| "The code is self-documenting" | Code shows what, not why. Decisions need context. |
|
|
194
|
+
| "Nobody reads the docs" | Because the docs are stale. Fresh docs get read. |
|
|
195
|
+
| "I'll document it later" | You won't. Context decays faster than you think. |
|
|
196
|
+
| "ADRs are overhead" | An ADR takes 10 minutes. Re-debating the decision takes hours. |
|
|
197
|
+
| "We use Notion/Confluence" | Docs in external tools drift from code. Keep docs in repo. |
|
|
198
|
+
| "Comments get stale" | So delete stale comments. But contracts and decisions need documenting. |
|
|
199
|
+
|
|
200
|
+
## Red Flags — STOP
|
|
201
|
+
|
|
202
|
+
- Architecture changed but no ADR recorded
|
|
203
|
+
- README setup instructions haven't been tested in >30 days
|
|
204
|
+
- API docs describe behavior that doesn't match implementation
|
|
205
|
+
- Decision was made in Slack/meeting with no written record
|
|
206
|
+
- New team member can't set up the project from docs alone
|
|
207
|
+
|
|
208
|
+
## Verification
|
|
209
|
+
|
|
210
|
+
- [ ] Significant decisions have ADRs with status, context, and alternatives
|
|
211
|
+
- [ ] README Quick Start works on a clean checkout
|
|
212
|
+
- [ ] API functions with complex behavior have JSDoc with examples
|
|
213
|
+
- [ ] No dead links in documentation
|
|
214
|
+
- [ ] Docs live in the repo (not external wiki only)
|
|
215
|
+
|
|
216
|
+
## See Also
|
|
217
|
+
|
|
218
|
+
- **api-and-interface-design** — API docs are part of the interface contract
|
|
219
|
+
- **deprecation-and-migration** — Deprecation decisions warrant ADRs
|
|
220
|
+
- **prd** — Product requirements docs (higher-level than ADRs)
|