@daochild/agents-config 1.0.7 → 1.2.1
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/.agents/.gitkeep +0 -0
- package/.agents/agents/.gitkeep +0 -0
- package/.agents/agents/sdlc-analyst.md +30 -0
- package/.agents/agents/sdlc-architect.md +32 -0
- package/.agents/agents/sdlc-auditor.md +45 -0
- package/.agents/agents/sdlc-dev.md +34 -0
- package/.agents/agents/sdlc-orchestrator.md +70 -0
- package/.agents/agents/sdlc-pm.md +33 -0
- package/.agents/agents/sdlc-qa.md +34 -0
- package/.agents/agents/sdlc-reviewer.md +32 -0
- package/.agents/agents/sdlc-security.md +37 -0
- package/.agents/agents/sdlc-sm.md +32 -0
- package/.agents/commands/.gitkeep +0 -0
- package/.agents/commands/sdlc.md +18 -0
- package/.agents/rules/.gitkeep +0 -0
- package/.agents/rules/sdlc-gates.md +45 -0
- package/.agents/skills/.gitkeep +0 -0
- package/.agents/skills/agents-config/SKILL.md +32 -0
- package/.agents/skills/sdlc-regulatory/SKILL.md +515 -0
- package/.claude/agents/sdlc-analyst.md +29 -0
- package/.claude/agents/sdlc-architect.md +31 -0
- package/.claude/agents/sdlc-auditor.md +44 -0
- package/.claude/agents/sdlc-dev.md +33 -0
- package/.claude/agents/sdlc-orchestrator.md +69 -0
- package/.claude/agents/sdlc-pm.md +32 -0
- package/.claude/agents/sdlc-qa.md +33 -0
- package/.claude/agents/sdlc-reviewer.md +31 -0
- package/.claude/agents/sdlc-security.md +36 -0
- package/.claude/agents/sdlc-sm.md +31 -0
- package/.claude/commands/sdlc.md +18 -0
- package/.claude/rules/sdlc-gates.md +45 -0
- package/.claude/skills/sdlc-regulatory/SKILL.md +515 -0
- package/.opencode/AGENTS.md +11 -0
- package/.opencode/agent/sdlc-analyst.md +30 -0
- package/.opencode/agent/sdlc-architect.md +32 -0
- package/.opencode/agent/sdlc-auditor.md +45 -0
- package/.opencode/agent/sdlc-dev.md +34 -0
- package/.opencode/agent/sdlc-orchestrator.md +70 -0
- package/.opencode/agent/sdlc-pm.md +33 -0
- package/.opencode/agent/sdlc-qa.md +34 -0
- package/.opencode/agent/sdlc-reviewer.md +32 -0
- package/.opencode/agent/sdlc-security.md +37 -0
- package/.opencode/agent/sdlc-sm.md +32 -0
- package/.opencode/command/sdlc.md +18 -0
- package/.opencode/skill/sdlc-regulatory/SKILL.md +515 -0
- package/AGENTS.md +174 -86
- package/ARCHITECTURE.md +143 -0
- package/CONTRIBUTING.md +90 -0
- package/README.md +53 -24
- package/SECURITY.md +79 -0
- package/docs/BUSINESS_LOGIC.md +63 -0
- package/docs/IMPLEMENTATION.md +59 -0
- package/docs/adr/0001-triple-mirror.md +81 -0
- package/docs/adr/0002-zero-edit-install.md +237 -0
- package/docs/api/.gitkeep +0 -0
- package/docs/architecture/.gitkeep +0 -0
- package/docs/architecture/zero-edit-install-architecture.md +306 -0
- package/docs/business/zero-edit-install-analysis.md +295 -0
- package/docs/business/zero-edit-install-prd.md +404 -0
- package/docs/database/.gitkeep +0 -0
- package/docs/stories/zero-edit-install-assumptions.md +80 -0
- package/docs/stories/zero-edit-install-stories.md +256 -0
- package/opencode.json +54 -2
- package/package.json +14 -4
- package/scripts/postinstall.js +163 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# Stories — zero-edit-install
|
|
2
|
+
|
|
3
|
+
> SDLC stage 4 (Implementation planning) artifact. Owner: `sdlc-sm`.
|
|
4
|
+
> Traceability id (slug): `zero-edit-install`.
|
|
5
|
+
> Prior artifacts:
|
|
6
|
+
> - `docs/business/zero-edit-install-prd.md` (Revision 2, approved; maintainer approval 2026-08-18).
|
|
7
|
+
> - `docs/architecture/zero-edit-install-architecture.md` (Architecture Gate, pass).
|
|
8
|
+
> - `docs/adr/0002-zero-edit-install.md` (ADR, Architecture Gate, pass).
|
|
9
|
+
> Gate: Architecture (second half — stories + risk classification + autonomy cap). Completes the Architecture Gate.
|
|
10
|
+
|
|
11
|
+
## Risk classification basis
|
|
12
|
+
|
|
13
|
+
Per the `sdlc-regulatory` skill, every story is classified on 7 axes and assigned an AI
|
|
14
|
+
autonomy cap. The change's overall risk tier is **Medium/High** (driven by security sensitivity
|
|
15
|
+
High — postinstall is a supply-chain vector). The architect's recommendation (≤40% for
|
|
16
|
+
script-touching stories; 80–100% for documentation-only stories) is adopted as the default;
|
|
17
|
+
where unsure, the stricter (lower) cap is used.
|
|
18
|
+
|
|
19
|
+
The postinstall contract (ADR 0002) is binding on every implementation story: idempotent,
|
|
20
|
+
safe-append, exit-0, cwd-scoped, deterministic (no network/`child_process`/`http`/`https`/`net`/
|
|
21
|
+
`fetch`/`dns` imports, no `Date`/`Math.random` driving content), direct-dependency-only
|
|
22
|
+
(transitive suppression; `peerDependencies`/`optionalDependencies` do NOT count as direct),
|
|
23
|
+
pointer-line content fixed (em dash `—` U+2014, exact wording).
|
|
24
|
+
|
|
25
|
+
## Story breakdown
|
|
26
|
+
|
|
27
|
+
### zero-edit-install-S01 — ADR 0002 + contract-file supersession edits (architect-owned residual)
|
|
28
|
+
|
|
29
|
+
- **Title:** ADR 0002 + `ARCHITECTURE.md` + `docs/BUSINESS_LOGIC.md` supersession edits.
|
|
30
|
+
- **Description:** The architect (`sdlc-architect`) has ALREADY produced ADR 0002 and edited
|
|
31
|
+
`ARCHITECTURE.md` (rule 6 narrowed, Constraints + Stack + "must NOT change" list updated) and
|
|
32
|
+
`docs/BUSINESS_LOGIC.md` (non-goal narrowed) as part of passing the Architecture Gate. This
|
|
33
|
+
story exists for traceability: it captures the contract-file edits so the DoD audit can verify
|
|
34
|
+
AC-D1/D2/D3 were satisfied. If any residual edit is found missing at DoD, it is routed back to
|
|
35
|
+
the architect (NOT to dev — the architect owns these files).
|
|
36
|
+
- **ACs satisfied:** AC-D1, AC-D2, AC-D3.
|
|
37
|
+
- **Owner:** `sdlc-architect` (already done). Not reassigned to dev.
|
|
38
|
+
- **Risk axes:** business Medium, technical Low, security Medium (touches the invariant
|
|
39
|
+
surface), data Low, infra Low, financial Low, breaking-change Medium.
|
|
40
|
+
- **Risk tier:** Medium.
|
|
41
|
+
- **Autonomy cap:** N/A (architect-owned, not dev-implemented; already complete as of the
|
|
42
|
+
Architecture Gate pass).
|
|
43
|
+
- **Required human approvals:** Architecture Gate (already requested with the architecture
|
|
44
|
+
artifact; recorded in the DoD audit per AC-D6).
|
|
45
|
+
- **Complexity:** S.
|
|
46
|
+
- **Status:** Done (architect passed the gate).
|
|
47
|
+
|
|
48
|
+
### zero-edit-install-S02 — `scripts/postinstall.js` implementation
|
|
49
|
+
|
|
50
|
+
- **Title:** Implement the postinstall script.
|
|
51
|
+
- **Description:** Create `scripts/postinstall.js` (CommonJS, `"type": "commonjs"`) implementing
|
|
52
|
+
the postinstall contract per ADR 0002 and the architecture artifact. The script:
|
|
53
|
+
1. Reads `<cwd>/package.json` (`fs.readFileSync` + `JSON.parse` in try/catch); if missing or
|
|
54
|
+
unreadable → no-op, exit 0 (EC-16).
|
|
55
|
+
2. Checks `dependencies` and `devDependencies` for `@daochild/agents-config`; if not direct
|
|
56
|
+
(including peer/optional-only, EC-17) → no-op, exit 0 (AC-11, EC-14). Optional fast-path:
|
|
57
|
+
`process.env.npm_package_name` hint, but `<cwd>/package.json` is authoritative.
|
|
58
|
+
3. If `AGENTS.md` is a symlink → skip, debug note, exit 0 (EC-8).
|
|
59
|
+
4. If no `AGENTS.md` in cwd:
|
|
60
|
+
- no `--init` → print notice, no file created, exit 0 (AC-5).
|
|
61
|
+
- `--init` → create minimal `AGENTS.md` (`# <cwd-basename>` + blank + pointer line +
|
|
62
|
+
trailing newline) via temp-file + rename, exit 0 (AC-6).
|
|
63
|
+
5. If `AGENTS.md` exists and contains the canonical pointer line (exact byte match,
|
|
64
|
+
present-anywhere) → no-op, exit 0 (AC-2, EC-4, EC-5).
|
|
65
|
+
6. If `AGENTS.md` exists and does NOT contain the canonical line → insert it immediately after
|
|
66
|
+
the first `# ` heading (or at the top if none), with blank-line separation, via temp-file +
|
|
67
|
+
rename (atomic write, EC-15). Exit 0 (AC-1, AC-3).
|
|
68
|
+
7. Every error path prints a notice to stdout and exits 0 (AC-7). No throws to non-zero.
|
|
69
|
+
8. Uses only Node built-ins: `fs`, `path`, `process`. No `http`/`https`/`net`/`fetch`/`dns`/
|
|
70
|
+
`child_process`. No `Date`/`Math.random` driving content (`process.pid` may be used only for
|
|
71
|
+
the temp filename, not content — see architecture artifact EC-15 note) (AC-9).
|
|
72
|
+
- **ACs satisfied:** AC-1, AC-2, AC-3, AC-4, AC-5, AC-6, AC-7, AC-8, AC-9, AC-11, EC-1..EC-8,
|
|
73
|
+
EC-14..EC-18 (the script-behavior ones).
|
|
74
|
+
- **Owner:** `sdlc-dev` (Implementation Gate).
|
|
75
|
+
- **Risk axes:** business Medium, technical Medium, security **High** (supply-chain vector),
|
|
76
|
+
data Low, infra Low, financial Low, breaking-change Low–Medium.
|
|
77
|
+
- **Risk tier:** High (security-driven).
|
|
78
|
+
- **Autonomy cap:** **≤40%**. The dev may implement the script but the Security Gate
|
|
79
|
+
(`sdlc-security`) and Code Review Gate (`sdlc-reviewer` + human) are mandatory and cannot be
|
|
80
|
+
self-validated by dev. Static review + tests MUST block forbidden imports (`http`, `https`,
|
|
81
|
+
`net`, `fetch`, `dns`, `child_process`) and assert exit-0 on every path.
|
|
82
|
+
- **Required human approvals:** Security Gate (high-risk), Code Review Gate (high-risk →
|
|
83
|
+
senior/security review). Architecture Gate approval already covers the design; this story
|
|
84
|
+
needs the Implementation Gate approval to start (AC-D6 — separate maintainer approval before
|
|
85
|
+
dev dispatch).
|
|
86
|
+
- **Complexity:** M.
|
|
87
|
+
- **AI assumptions log:** `docs/stories/zero-edit-install-assumptions.md` (dev must create this
|
|
88
|
+
per the Implementation Gate "AI assumptions are documented" item).
|
|
89
|
+
|
|
90
|
+
### zero-edit-install-S03 — `package.json` `postinstall` field
|
|
91
|
+
|
|
92
|
+
- **Title:** Wire the postinstall script in `package.json`.
|
|
93
|
+
- **Description:** Add `"postinstall": "node scripts/postinstall.js"` to `package.json`
|
|
94
|
+
`scripts`. Do NOT change `main` (stays `"index.js"` — see architecture artifact AC-D5). Do NOT
|
|
95
|
+
add any new dependency. Do NOT change `type` (stays `"commonjs"`).
|
|
96
|
+
- **ACs satisfied:** enables AC-1..AC-9, AC-11 (the script must be wired to run); AC-D5 (BL-1
|
|
97
|
+
note — `main` unchanged).
|
|
98
|
+
- **Owner:** `sdlc-dev` (Implementation Gate). Small edit; pairs with S02.
|
|
99
|
+
- **Risk axes:** business Medium, technical Low, security **High** (this is what makes the
|
|
100
|
+
script run at install time — the supply-chain activation point), data Low, infra Low,
|
|
101
|
+
financial Low, breaking-change Medium (consumers who pin `--ignore-scripts` unaffected; CI
|
|
102
|
+
policy may flag).
|
|
103
|
+
- **Risk tier:** High (security-driven — this is the on-switch).
|
|
104
|
+
- **Autonomy cap:** **≤40%**. Pairs with S02; same gate requirements.
|
|
105
|
+
- **Required human approvals:** Security Gate, Code Review Gate. Implementation Gate approval
|
|
106
|
+
to start (AC-D6).
|
|
107
|
+
- **Complexity:** S.
|
|
108
|
+
|
|
109
|
+
### zero-edit-install-S04 — `README.md` update (both paths)
|
|
110
|
+
|
|
111
|
+
- **Title:** Document both the automatic (postinstall) and manual (one-line edit) paths.
|
|
112
|
+
- **Description:** Update `README.md` → "Installation" to:
|
|
113
|
+
1. Keep the manual one-line edit as the **supported fallback**, explicitly labeled for
|
|
114
|
+
consumers who use `--ignore-scripts` or whose CI rejects `postinstall`.
|
|
115
|
+
2. Document the automatic path: `npm install --save-dev @daochild/agents-config` writes the
|
|
116
|
+
pointer line automatically (idempotent, safe-append, exit-0); the consumer only restarts
|
|
117
|
+
their agent session.
|
|
118
|
+
3. Note the monorepo/workspace limitation (EC-10/EC-18 deferred — check `<cwd>/package.json`
|
|
119
|
+
only; manual fallback covers it).
|
|
120
|
+
4. Note the direct-dependency-only behavior (transitive installs are not modified).
|
|
121
|
+
5. Note `--init` for consumers without an `AGENTS.md`.
|
|
122
|
+
- **ACs satisfied:** AC-10, and documents the EC-10/EC-14/EC-17 behaviors.
|
|
123
|
+
- **Owner:** `sdlc-dev` (Implementation Gate) — documentation, but tied to the change.
|
|
124
|
+
- **Risk axes:** business Low, technical Low, security Low, data Low, infra Low, financial Low,
|
|
125
|
+
breaking-change Low (documentation only; no code).
|
|
126
|
+
- **Risk tier:** Low.
|
|
127
|
+
- **Autonomy cap:** **100%** (documentation, no script/contract touch). Still subject to the
|
|
128
|
+
Code Review Gate (reviewer checks the README accurately describes the script's behavior — a
|
|
129
|
+
wrong README is a contract drift risk, not a security risk).
|
|
130
|
+
- **Required human approvals:** none beyond the normal Code Review Gate (reviewer must confirm
|
|
131
|
+
the README matches the implemented behavior).
|
|
132
|
+
- **Complexity:** S.
|
|
133
|
+
|
|
134
|
+
### zero-edit-install-S05 — `SECURITY.md` update (downstream, Security Gate)
|
|
135
|
+
|
|
136
|
+
- **Title:** Update `SECURITY.md` to cover the postinstall supply-chain surface.
|
|
137
|
+
- **Description:** `sdlc-security` (NOT dev) updates `SECURITY.md` at the Security Gate to cover:
|
|
138
|
+
- the postinstall script is deterministic, network-free, telemetry-free, cwd-scoped,
|
|
139
|
+
exit-0, direct-dependency-only (transitive suppressed);
|
|
140
|
+
- consumers may use `--ignore-scripts`; the manual fallback exists;
|
|
141
|
+
- the script's contract is in the "must NOT change without human approval" list (already
|
|
142
|
+
added to `ARCHITECTURE.md` by the architect);
|
|
143
|
+
- how to report a suspected postinstall-related issue (existing reporting channel).
|
|
144
|
+
- **ACs satisfied:** AC-D4.
|
|
145
|
+
- **Owner:** `sdlc-security` (Security Gate). NOT dev.
|
|
146
|
+
- **Risk axes:** business Low, technical Low, security Medium (touches the security policy
|
|
147
|
+
surface), data Low, infra Low, financial Low, breaking-change Low.
|
|
148
|
+
- **Risk tier:** Medium (security-policy edit).
|
|
149
|
+
- **Autonomy cap:** security-policy edits are human-approval-gated; cap **≤40%** (the
|
|
150
|
+
`sdlc-security` agent produces the update, but human approval at the Security Gate is
|
|
151
|
+
required per AC-D6).
|
|
152
|
+
- **Required human approvals:** Security Gate human approval (high-risk change, AC-D6).
|
|
153
|
+
- **Complexity:** S.
|
|
154
|
+
- **Note:** This story is downstream of dev; it is listed here so SM seeds the traceability
|
|
155
|
+
chain. `sdlc-security` owns it at the Security Gate.
|
|
156
|
+
|
|
157
|
+
### zero-edit-install-S06 — `docs/IMPLEMENTATION.md` update (BL-1 + change log)
|
|
158
|
+
|
|
159
|
+
- **Title:** Update `docs/IMPLEMENTATION.md` — BL-1 status + change log entry.
|
|
160
|
+
- **Description:** Update `docs/IMPLEMENTATION.md`:
|
|
161
|
+
1. BL-1 status: "Stub" → "Partially resolved (postinstall only)". Note: `index.js` remains a
|
|
162
|
+
stub; `main: "index.js"` is unchanged; a full plugin host hook is a separate concern
|
|
163
|
+
(AC-D5).
|
|
164
|
+
2. Add a change log entry for the zero-edit-install change (date, change description, author).
|
|
165
|
+
3. Add `scripts/postinstall.js` and the `package.json` `postinstall` field to the
|
|
166
|
+
"Implemented components" table (status: Done once S02/S03 pass their gates).
|
|
167
|
+
- **ACs satisfied:** AC-D5.
|
|
168
|
+
- **Owner:** `sdlc-dev` (Implementation Gate) — documentation.
|
|
169
|
+
- **Risk axes:** business Low, technical Low, security Low, data Low, infra Low, financial Low,
|
|
170
|
+
breaking-change Low (documentation only).
|
|
171
|
+
- **Risk tier:** Low.
|
|
172
|
+
- **Autonomy cap:** **100%** (documentation). Subject to Code Review Gate (reviewer confirms
|
|
173
|
+
the IMPLEMENTATION status accurately reflects what shipped).
|
|
174
|
+
- **Required human approvals:** none beyond Code Review Gate.
|
|
175
|
+
- **Complexity:** S.
|
|
176
|
+
|
|
177
|
+
### zero-edit-install-S07 — Tests (downstream, Testing Gate)
|
|
178
|
+
|
|
179
|
+
- **Title:** Test plan + test code for the postinstall script.
|
|
180
|
+
- **Description:** `sdlc-qa` produces the test plan at `docs/stories/zero-edit-install-tests.md`
|
|
181
|
+
and test code under `tests/`. Tests MUST cover, at minimum:
|
|
182
|
+
- AC-1: idempotent insert when line missing.
|
|
183
|
+
- AC-2: no-op when line present (byte-for-byte unchanged).
|
|
184
|
+
- AC-3: non-destructive (existing content preserved).
|
|
185
|
+
- AC-4: exact pointer line (em dash).
|
|
186
|
+
- AC-5: no `AGENTS.md`, no `--init` → notice, no file, exit 0.
|
|
187
|
+
- AC-6: no `AGENTS.md`, `--init` → minimal file created.
|
|
188
|
+
- AC-7: every error path exits 0 (permission error, unreadable file, unexpected throw).
|
|
189
|
+
- AC-8: cwd-scoped (no parent/sibling/home write).
|
|
190
|
+
- AC-9: static import block (`http`, `https`, `net`, `fetch`, `dns`, `child_process`
|
|
191
|
+
forbidden; no `Date`/`Math.random` driving content) + runtime determinism.
|
|
192
|
+
- AC-10: README documents both paths (assertion that the manual fallback text is present).
|
|
193
|
+
- AC-11: direct-dependency-only (direct → writes; transitive → no-op; peer/optional-only →
|
|
194
|
+
no-op; missing `package.json` → no-op).
|
|
195
|
+
- EC-1..EC-18: each edge case has a test (symlink skip, atomic write, monorepo limitation
|
|
196
|
+
documented, cross-manager smoke for npm/pnpm/bun at minimum).
|
|
197
|
+
- **ACs satisfied:** all ACs verified via tests; Testing Gate.
|
|
198
|
+
- **Owner:** `sdlc-qa` (Testing Gate). NOT dev.
|
|
199
|
+
- **Risk axes:** business Low, technical Medium (test design for idempotency/atomic/determinism
|
|
200
|
+
has real edges), security Medium (tests enforce the security contract), data Low, infra Low,
|
|
201
|
+
financial Low, breaking-change Low.
|
|
202
|
+
- **Risk tier:** Medium.
|
|
203
|
+
- **Autonomy cap:** **100%** for test generation (per the `sdlc-regulatory` table, test
|
|
204
|
+
generation is 100%) — BUT the tests themselves must be reviewed at the Code Review Gate, and
|
|
205
|
+
the Security Gate verifies the import-block test is effective. QA does not self-validate the
|
|
206
|
+
script; QA validates the script via tests, and the reviewer validates QA.
|
|
207
|
+
- **Required human approvals:** Code Review Gate (human engineering review of the tests).
|
|
208
|
+
- **Complexity:** M.
|
|
209
|
+
- **Note:** Downstream of dev (S02/S03 must exist to test). Listed here to seed traceability.
|
|
210
|
+
|
|
211
|
+
## Cross-story traceability
|
|
212
|
+
|
|
213
|
+
| Story | ACs satisfied | Owner | Gate | Autonomy cap | Human approval |
|
|
214
|
+
|-------|---------------|-------|------|--------------|----------------|
|
|
215
|
+
| S01 | AC-D1, AC-D2, AC-D3 | `sdlc-architect` (done) | Architecture | N/A | Architecture Gate (requested) |
|
|
216
|
+
| S02 | AC-1..9, AC-11, EC-1..8,14..18 | `sdlc-dev` | Implementation | ≤40% | Security + Code Review + Implementation Gate start (AC-D6) |
|
|
217
|
+
| S03 | enables AC-1..9, AC-11; AC-D5 (main unchanged) | `sdlc-dev` | Implementation | ≤40% | Security + Code Review + Implementation Gate start |
|
|
218
|
+
| S04 | AC-10, documents EC-10/14/17 | `sdlc-dev` | Implementation | 100% | Code Review (accuracy) |
|
|
219
|
+
| S05 | AC-D4 | `sdlc-security` | Security | ≤40% | Security Gate human (AC-D6) |
|
|
220
|
+
| S06 | AC-D5 | `sdlc-dev` | Implementation | 100% | Code Review (accuracy) |
|
|
221
|
+
| S07 | all ACs verified | `sdlc-qa` | Testing | 100% (test gen) | Code Review (human review of tests) |
|
|
222
|
+
|
|
223
|
+
## Implementation sequencing
|
|
224
|
+
|
|
225
|
+
1. S02 + S03 (script + wiring) — must be implemented together; the script is dead code without
|
|
226
|
+
the wiring, and the wiring is a no-op without the script.
|
|
227
|
+
2. S04 (README) — may be done in parallel with S02/S03; documents the contract.
|
|
228
|
+
3. S06 (IMPLEMENTATION.md) — after S02/S03 pass, to reflect shipped status.
|
|
229
|
+
4. S07 (tests) — after S02/S03; QA tests the implemented script.
|
|
230
|
+
5. S05 (SECURITY.md) — at the Security Gate, after dev; `sdlc-security` owns it.
|
|
231
|
+
6. S01 — already done (architect).
|
|
232
|
+
|
|
233
|
+
## Gate self-check (Architecture Gate — planning side)
|
|
234
|
+
|
|
235
|
+
- [x] Every story has a risk class and autonomy cap — table above; 7 axes per story.
|
|
236
|
+
- [x] High-risk stories have explicit required human approvals listed — S02/S03/S05 list
|
|
237
|
+
Security + Code Review + (for S02/S03) Implementation Gate start (AC-D6).
|
|
238
|
+
- [x] Story ids are stable and referenced in downstream artifacts — `zero-edit-install-S01`..
|
|
239
|
+
`S07`; downstream PR/tests/review will reference these ids.
|
|
240
|
+
|
|
241
|
+
All Architecture Gate (planning) items pass. No item is unchecked.
|
|
242
|
+
|
|
243
|
+
## Handoff
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
HANDOFF: sdlc-dev | artifact: docs/stories/zero-edit-install-stories.md | gate: pass
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Per the orchestrator's instruction, this run STOPS here. `sdlc-dev` (S02 + S03 + S04 + S06) will
|
|
250
|
+
be dispatched in a separate run AFTER the maintainer approves the Implementation Gate (AC-D6).
|
|
251
|
+
The Security Gate (S05) and Testing Gate (S07) are downstream of dev and are dispatched in
|
|
252
|
+
their own runs after dev passes the Implementation Gate.
|
|
253
|
+
|
|
254
|
+
**Implementation Gate approval required before dev dispatch (AC-D6):** the maintainer must
|
|
255
|
+
explicitly approve starting implementation, because this is a Medium/High-risk change
|
|
256
|
+
(security sensitivity High). The orchestrator will prompt for that approval in the next run.
|
package/opencode.json
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
"instructions": [
|
|
4
4
|
"AGENTS.md",
|
|
5
5
|
".opencode/AGENTS.md",
|
|
6
|
-
".claude/rules/programming-best-practices.md"
|
|
6
|
+
".claude/rules/programming-best-practices.md",
|
|
7
|
+
".claude/rules/sdlc-gates.md"
|
|
7
8
|
],
|
|
8
9
|
"skills": {
|
|
9
10
|
"paths": [
|
|
11
|
+
".agents/skills",
|
|
10
12
|
".opencode/skill",
|
|
11
13
|
".opencode/skills",
|
|
12
14
|
".claude/skills"
|
|
@@ -17,6 +19,56 @@
|
|
|
17
19
|
"description": "Answers questions about this agents-config repo layout and how .claude/ and .opencode/ link together.",
|
|
18
20
|
"mode": "subagent",
|
|
19
21
|
"prompt": "{file:./.opencode/agent/docs.md}"
|
|
22
|
+
},
|
|
23
|
+
"sdlc-orchestrator": {
|
|
24
|
+
"description": "Orchestrates the AI-driven SDLC by routing a product requirement through the BMad-style role subagents (analyst -> pm -> architect -> sm -> dev -> qa -> security -> reviewer -> auditor). Use as the single entry point for any feature/change that touches multiple modules or is medium/high risk.",
|
|
25
|
+
"mode": "subagent",
|
|
26
|
+
"prompt": "{file:./.opencode/agent/sdlc-orchestrator.md}"
|
|
27
|
+
},
|
|
28
|
+
"sdlc-analyst": {
|
|
29
|
+
"description": "Requirements analyst for the AI-driven SDLC. Translates a raw product idea or change request into a market/context analysis and confirms the requirement is well-formed. First role in the BMad-style chain.",
|
|
30
|
+
"mode": "subagent",
|
|
31
|
+
"prompt": "{file:./.opencode/agent/sdlc-analyst.md}"
|
|
32
|
+
},
|
|
33
|
+
"sdlc-pm": {
|
|
34
|
+
"description": "Product Manager for the AI-driven SDLC. Turns the analyst's output into a PRD with acceptance criteria and edge cases. Completes the Requirement Gate.",
|
|
35
|
+
"mode": "subagent",
|
|
36
|
+
"prompt": "{file:./.opencode/agent/sdlc-pm.md}"
|
|
37
|
+
},
|
|
38
|
+
"sdlc-architect": {
|
|
39
|
+
"description": "Architect for the AI-driven SDLC. Analyzes existing architecture, identifies impacted modules and dependencies, proposes a solution, and creates/updates the ADR. Owns the Architecture Gate.",
|
|
40
|
+
"mode": "subagent",
|
|
41
|
+
"prompt": "{file:./.opencode/agent/sdlc-architect.md}"
|
|
42
|
+
},
|
|
43
|
+
"sdlc-sm": {
|
|
44
|
+
"description": "Scrum Master / planner for the AI-driven SDLC. Breaks the architecture into implementable stories, classifies each story's risk, and assigns an AI autonomy cap. Completes the Architecture Gate and seeds traceability.",
|
|
45
|
+
"mode": "subagent",
|
|
46
|
+
"prompt": "{file:./.opencode/agent/sdlc-sm.md}"
|
|
47
|
+
},
|
|
48
|
+
"sdlc-dev": {
|
|
49
|
+
"description": "Developer for the AI-driven SDLC. Implements stories following project patterns, documents AI assumptions, and stays in scope. Owns the Implementation Gate.",
|
|
50
|
+
"mode": "subagent",
|
|
51
|
+
"prompt": "{file:./.opencode/agent/sdlc-dev.md}"
|
|
52
|
+
},
|
|
53
|
+
"sdlc-qa": {
|
|
54
|
+
"description": "QA engineer for the AI-driven SDLC. Designs the test plan, writes unit/integration/regression/edge-case tests, and runs the existing suite. Owns the Testing Gate. Uses the senior-qa skill for methodology.",
|
|
55
|
+
"mode": "subagent",
|
|
56
|
+
"prompt": "{file:./.opencode/agent/sdlc-qa.md}"
|
|
57
|
+
},
|
|
58
|
+
"sdlc-security": {
|
|
59
|
+
"description": "Security reviewer for the AI-driven SDLC. Runs SAST, dependency and secrets scanning, and a security-focused AI review; validates authN/Z where applicable. Owns the Security Gate. Uses domain-specific senior-*-auditor skills when relevant.",
|
|
60
|
+
"mode": "subagent",
|
|
61
|
+
"prompt": "{file:./.opencode/agent/sdlc-security.md}"
|
|
62
|
+
},
|
|
63
|
+
"sdlc-reviewer": {
|
|
64
|
+
"description": "Code reviewer for the AI-driven SDLC. Performs the AI technical code review and aggregates the human engineering review. Owns the Code Review Gate.",
|
|
65
|
+
"mode": "subagent",
|
|
66
|
+
"prompt": "{file:./.opencode/agent/sdlc-reviewer.md}"
|
|
67
|
+
},
|
|
68
|
+
"sdlc-auditor": {
|
|
69
|
+
"description": "Auditor for the AI-driven SDLC. Verifies the Definition of Done across all prior gates, confirms traceability, and produces the final audit artifact. Owns the DoD Gate. Must be a different agent from those who produced the work.",
|
|
70
|
+
"mode": "subagent",
|
|
71
|
+
"prompt": "{file:./.opencode/agent/sdlc-auditor.md}"
|
|
20
72
|
}
|
|
21
73
|
}
|
|
22
|
-
}
|
|
74
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daochild/agents-config",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Shared, version-controlled configuration for AI coding agents (opencode and Claude Code): layout, skills, subagents, commands, rules, and an always-on AI-driven SDLC governance framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
7
7
|
"AI",
|
|
8
8
|
"instructions",
|
|
9
9
|
"pipeline",
|
|
10
10
|
"no-code",
|
|
11
|
-
"less-code"
|
|
11
|
+
"less-code",
|
|
12
|
+
"sdlc",
|
|
13
|
+
"governance",
|
|
14
|
+
"compliance",
|
|
15
|
+
"gates",
|
|
16
|
+
"opencode",
|
|
17
|
+
"claude-code"
|
|
12
18
|
],
|
|
13
19
|
"homepage": "https://github.com/daochild/agents-config#readme",
|
|
14
20
|
"bugs": {
|
|
@@ -23,6 +29,10 @@
|
|
|
23
29
|
"type": "commonjs",
|
|
24
30
|
"main": "index.js",
|
|
25
31
|
"scripts": {
|
|
26
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
|
+
"postinstall": "node scripts/postinstall.js"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@opencode-ai/plugin": "^1.18.18"
|
|
27
37
|
}
|
|
28
38
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const process = require('node:process');
|
|
6
|
+
|
|
7
|
+
const PACKAGE_NAME = '@daochild/agents-config';
|
|
8
|
+
const POINTER_LINE = 'Primary instructions: node_modules/@daochild/agents-config/AGENTS.md — read in full and follow unless overridden below.';
|
|
9
|
+
|
|
10
|
+
function notice(msg) {
|
|
11
|
+
process.stdout.write(msg + '\n');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isDirectDependency(pkg) {
|
|
15
|
+
if (!pkg || typeof pkg !== 'object') return false;
|
|
16
|
+
const deps = pkg.dependencies;
|
|
17
|
+
const devDeps = pkg.devDependencies;
|
|
18
|
+
return (deps && Object.prototype.hasOwnProperty.call(deps, PACKAGE_NAME)) ||
|
|
19
|
+
(devDeps && Object.prototype.hasOwnProperty.call(devDeps, PACKAGE_NAME));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function readConsumerPackageJson(cwd) {
|
|
23
|
+
const pkgPath = path.join(cwd, 'package.json');
|
|
24
|
+
let raw;
|
|
25
|
+
try {
|
|
26
|
+
raw = fs.readFileSync(pkgPath, 'utf8');
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse(raw);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function buildInitContent(cwd) {
|
|
38
|
+
const title = path.basename(cwd);
|
|
39
|
+
return '# ' + title + '\n\n' + POINTER_LINE + '\n';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function insertAfterFirstHeading(content) {
|
|
43
|
+
const lines = content.split('\n');
|
|
44
|
+
const firstHeadingIdx = lines.findIndex(function (line) {
|
|
45
|
+
return line.indexOf('# ') === 0;
|
|
46
|
+
});
|
|
47
|
+
if (firstHeadingIdx === -1) {
|
|
48
|
+
if (content.length === 0) {
|
|
49
|
+
return POINTER_LINE + '\n';
|
|
50
|
+
}
|
|
51
|
+
const prefix = POINTER_LINE + '\n\n';
|
|
52
|
+
return prefix + content;
|
|
53
|
+
}
|
|
54
|
+
const insertIdx = firstHeadingIdx + 1;
|
|
55
|
+
const before = lines.slice(0, insertIdx);
|
|
56
|
+
const after = lines.slice(insertIdx);
|
|
57
|
+
const block = [];
|
|
58
|
+
block.push('');
|
|
59
|
+
block.push(POINTER_LINE);
|
|
60
|
+
if (after.length === 0 || after[0] !== '') {
|
|
61
|
+
block.push('');
|
|
62
|
+
}
|
|
63
|
+
return before.concat(block, after).join('\n');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function containsPointerLine(content) {
|
|
67
|
+
return content.split('\n').some(function (line) {
|
|
68
|
+
return line === POINTER_LINE;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function atomicWrite(targetPath, content) {
|
|
73
|
+
const dir = path.dirname(targetPath);
|
|
74
|
+
const tmpPath = path.join(dir, '.agents-config-postinstall.tmp-' + process.pid);
|
|
75
|
+
let fd;
|
|
76
|
+
try {
|
|
77
|
+
fd = fs.openSync(tmpPath, 'w', 0o600);
|
|
78
|
+
fs.writeFileSync(fd, content);
|
|
79
|
+
fs.closeSync(fd);
|
|
80
|
+
fd = null;
|
|
81
|
+
fs.renameSync(tmpPath, targetPath);
|
|
82
|
+
} finally {
|
|
83
|
+
if (fd) {
|
|
84
|
+
try { fs.closeSync(fd); } catch (e) {}
|
|
85
|
+
}
|
|
86
|
+
try { fs.unlinkSync(tmpPath); } catch (e) {}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function main() {
|
|
91
|
+
const cwd = process.cwd();
|
|
92
|
+
const args = process.argv.slice(2);
|
|
93
|
+
const initFlag = args.indexOf('--init') !== -1;
|
|
94
|
+
|
|
95
|
+
const pkg = readConsumerPackageJson(cwd);
|
|
96
|
+
if (!isDirectDependency(pkg)) {
|
|
97
|
+
notice('[agents-config] not a direct dependency in ' + path.join(cwd, 'package.json') + '; skipping postinstall pointer write.');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const agentsPath = path.join(cwd, 'AGENTS.md');
|
|
102
|
+
|
|
103
|
+
let lstat;
|
|
104
|
+
try {
|
|
105
|
+
lstat = fs.lstatSync(agentsPath);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
lstat = null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (lstat && lstat.isSymbolicLink()) {
|
|
111
|
+
notice('[agents-config] ' + agentsPath + ' is a symlink; skipping to respect cwd-scoped, no-outside-cwd-write contract.');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
let exists = false;
|
|
116
|
+
let existing = '';
|
|
117
|
+
if (lstat) {
|
|
118
|
+
try {
|
|
119
|
+
existing = fs.readFileSync(agentsPath, 'utf8');
|
|
120
|
+
exists = true;
|
|
121
|
+
} catch (e) {
|
|
122
|
+
exists = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (exists) {
|
|
127
|
+
if (containsPointerLine(existing)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const updated = insertAfterFirstHeading(existing);
|
|
131
|
+
try {
|
|
132
|
+
atomicWrite(agentsPath, updated);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
notice('[agents-config] could not write ' + agentsPath + ': ' + (e && e.message ? e.message : String(e)));
|
|
135
|
+
}
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!initFlag) {
|
|
140
|
+
notice('[agents-config] No AGENTS.md found in ' + cwd + '.');
|
|
141
|
+
notice('[agents-config] To create one automatically, re-run with the --init flag:');
|
|
142
|
+
notice('[agents-config] node node_modules/@daochild/agents-config/scripts/postinstall.js --init');
|
|
143
|
+
notice('[agents-config] Or add this line manually at the top of your AGENTS.md, after the title:');
|
|
144
|
+
notice('[agents-config] ' + POINTER_LINE);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const content = buildInitContent(cwd);
|
|
149
|
+
try {
|
|
150
|
+
atomicWrite(agentsPath, content);
|
|
151
|
+
notice('[agents-config] Created ' + agentsPath + ' with the primary instructions pointer line.');
|
|
152
|
+
} catch (e) {
|
|
153
|
+
notice('[agents-config] could not create ' + agentsPath + ': ' + (e && e.message ? e.message : String(e)));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
main();
|
|
159
|
+
} catch (e) {
|
|
160
|
+
notice('[agents-config] postinstall encountered an unexpected error: ' + (e && e.message ? e.message : String(e)));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
process.exit(0);
|