@daochild/agents-config 1.0.5 → 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.
Files changed (76) hide show
  1. package/.agents/.gitkeep +0 -0
  2. package/.agents/agents/.gitkeep +0 -0
  3. package/.agents/agents/sdlc-analyst.md +30 -0
  4. package/.agents/agents/sdlc-architect.md +32 -0
  5. package/.agents/agents/sdlc-auditor.md +45 -0
  6. package/.agents/agents/sdlc-dev.md +34 -0
  7. package/.agents/agents/sdlc-orchestrator.md +70 -0
  8. package/.agents/agents/sdlc-pm.md +33 -0
  9. package/.agents/agents/sdlc-qa.md +34 -0
  10. package/.agents/agents/sdlc-reviewer.md +32 -0
  11. package/.agents/agents/sdlc-security.md +37 -0
  12. package/.agents/agents/sdlc-sm.md +32 -0
  13. package/.agents/commands/.gitkeep +0 -0
  14. package/.agents/commands/sdlc.md +18 -0
  15. package/.agents/rules/.gitkeep +0 -0
  16. package/.agents/rules/sdlc-gates.md +45 -0
  17. package/.agents/skills/.gitkeep +0 -0
  18. package/.agents/skills/agents-config/SKILL.md +32 -0
  19. package/.agents/skills/sdlc-regulatory/SKILL.md +515 -0
  20. package/.claude/agents/sdlc-analyst.md +29 -0
  21. package/.claude/agents/sdlc-architect.md +31 -0
  22. package/.claude/agents/sdlc-auditor.md +44 -0
  23. package/.claude/agents/sdlc-dev.md +33 -0
  24. package/.claude/agents/sdlc-orchestrator.md +69 -0
  25. package/.claude/agents/sdlc-pm.md +32 -0
  26. package/.claude/agents/sdlc-qa.md +33 -0
  27. package/.claude/agents/sdlc-reviewer.md +31 -0
  28. package/.claude/agents/sdlc-security.md +36 -0
  29. package/.claude/agents/sdlc-sm.md +31 -0
  30. package/.claude/commands/sdlc.md +18 -0
  31. package/.claude/rules/sdlc-gates.md +45 -0
  32. package/.claude/skills/README.md +3 -0
  33. package/.claude/skills/sdlc-regulatory/SKILL.md +515 -0
  34. package/.opencode/AGENTS.md +11 -0
  35. package/.opencode/agent/sdlc-analyst.md +30 -0
  36. package/.opencode/agent/sdlc-architect.md +32 -0
  37. package/.opencode/agent/sdlc-auditor.md +45 -0
  38. package/.opencode/agent/sdlc-dev.md +34 -0
  39. package/.opencode/agent/sdlc-orchestrator.md +70 -0
  40. package/.opencode/agent/sdlc-pm.md +33 -0
  41. package/.opencode/agent/sdlc-qa.md +34 -0
  42. package/.opencode/agent/sdlc-reviewer.md +32 -0
  43. package/.opencode/agent/sdlc-security.md +37 -0
  44. package/.opencode/agent/sdlc-sm.md +32 -0
  45. package/.opencode/command/sdlc.md +18 -0
  46. package/.opencode/skill/archivarius/SKILL.md +203 -0
  47. package/.opencode/skill/data-engineer/SKILL.md +253 -0
  48. package/.opencode/skill/find-skills/SKILL.md +142 -0
  49. package/.opencode/skill/frontend-design/SKILL.md +54 -0
  50. package/.opencode/skill/sdlc-regulatory/SKILL.md +515 -0
  51. package/.opencode/skill/senior-bitcoin-auditor/SKILL.md +277 -0
  52. package/.opencode/skill/senior-frontend-dev/SKILL.md +72 -0
  53. package/.opencode/skill/senior-qa/SKILL.md +135 -0
  54. package/.opencode/skill/senior-software-developer/SKILL.md +56 -0
  55. package/.opencode/skill/senior-solidity-auditor/SKILL.md +180 -0
  56. package/.opencode/skill/senior-ux-ui-designer/SKILL.md +121 -0
  57. package/AGENTS.md +185 -85
  58. package/ARCHITECTURE.md +143 -0
  59. package/CONTRIBUTING.md +90 -0
  60. package/README.md +53 -24
  61. package/SECURITY.md +79 -0
  62. package/docs/BUSINESS_LOGIC.md +63 -0
  63. package/docs/IMPLEMENTATION.md +59 -0
  64. package/docs/adr/0001-triple-mirror.md +81 -0
  65. package/docs/adr/0002-zero-edit-install.md +237 -0
  66. package/docs/api/.gitkeep +0 -0
  67. package/docs/architecture/.gitkeep +0 -0
  68. package/docs/architecture/zero-edit-install-architecture.md +306 -0
  69. package/docs/business/zero-edit-install-analysis.md +295 -0
  70. package/docs/business/zero-edit-install-prd.md +404 -0
  71. package/docs/database/.gitkeep +0 -0
  72. package/docs/stories/zero-edit-install-assumptions.md +80 -0
  73. package/docs/stories/zero-edit-install-stories.md +256 -0
  74. package/opencode.json +54 -2
  75. package/package.json +14 -4
  76. package/scripts/postinstall.js +163 -0
@@ -0,0 +1,295 @@
1
+ # Analysis — zero-edit-install
2
+
3
+ > SDLC stage 1 (Requirements analysis) artifact. Owner: `sdlc-analyst`.
4
+ > Traceability id (slug): `zero-edit-install`.
5
+ > Prior artifact: verbal requirement from the maintainer (see verbatim context below).
6
+ > Gate: Requirement (partial — first half).
7
+
8
+ ## Verbatim requirement context (from the maintainer)
9
+
10
+ Add a `postinstall` script to `@daochild/agents-config` so that after a consumer
11
+ runs `npm install --save-dev @daochild/agents-config` (or yarn/pnpm/bun
12
+ equivalent), the package automatically and idempotently writes a single pointer
13
+ line into the consumer's `AGENTS.md`:
14
+
15
+ > Primary instructions: node_modules/@daochild/agents-config/AGENTS.md — follow unless overridden below.
16
+
17
+ Goal: zero-edit install for the consumer. Today the user must hand-edit
18
+ `AGENTS.md` (one line, after today's README simplification). With this change,
19
+ `npm install` alone is sufficient; the consumer only restarts their agent session.
20
+
21
+ The maintainer also supplied five hard constraints (facts about the repo, not
22
+ negotiable). They are reproduced under "Constraints" and "Impacted invariants"
23
+ below and are treated as binding inputs to this analysis.
24
+
25
+ ## Problem / opportunity statement
26
+
27
+ ### Problem
28
+ Consumers of `@daochild/agents-config` currently must perform a manual one-line
29
+ edit of their `AGENTS.md` after installing the package. This is a small but real
30
+ adoption friction: a step that can be forgotten, done inconsistently (wrong
31
+ location, typos), or done differently across a team. It also means a fresh clone
32
+ of a consumer repo that forgot the pointer line silently loses all of the
33
+ package's conventions on the next agent session restart — a failure mode that is
34
+ hard to notice (the agent simply behaves as if unconfigured).
35
+
36
+ ### Opportunity
37
+ A `postinstall` script can make `npm install --save-dev @daochild/agents-config`
38
+ *alone* sufficient: the pointer line is written automatically, idempotently, and
39
+ safely. The consumer only restarts their agent session. This aligns the package
40
+ with the "inherit, don't copy" principle (BR-1) by making inheritance the default
41
+ path rather than a manual opt-in.
42
+
43
+ ## Stakeholders and intended users
44
+
45
+ | Stakeholder | Role in this change | Concern |
46
+ |-------------|----------------------|---------|
47
+ | Maintainer (Pavlo Bolhar) | Decides the contract; approves high-risk gates | Correctness, security, the repo's invariants |
48
+ | Consumer developers (npm/yarn/pnpm/bun) | Run `npm install`; expect zero-edit | Install must not break; must not silently mutate unrelated files |
49
+ | Consumer CI pipelines | Run installs, often with `--ignore-scripts` or a postinstall-blocking policy | Must still have a working manual fallback; postinstall must never fail the install |
50
+ | Consumer security reviewers | Review supply-chain risk of any postinstall | Script must be deterministic, no network, no telemetry, safe-append only |
51
+ | `sdlc-security` / `sdlc-reviewer` / human approvers | Validate the Security and Code Review gates | See "Risk classification" below |
52
+
53
+ ## Market / internal context (brief)
54
+
55
+ - `@daochild/agents-config` is published to npm as a dev dependency (v1.1.0
56
+ today). The current install flow is documented in `README.md` → "Installation":
57
+ install, then add one pointer line to `AGENTS.md`, then restart the agent
58
+ session. The README was simplified today (commit `fd9a3a7`, "simplify install")
59
+ to collapse the post-install block into a single pointer line.
60
+ - `postinstall` scripts are a well-known npm supply-chain vector. The npm
61
+ ecosystem has had multiple high-profile incidents of malicious postinstall
62
+ payloads. As a result: (a) many consumers run installs with `--ignore-scripts`,
63
+ (b) some CI policies reject packages that ship `postinstall` outright, and
64
+ (c) consumer security reviewers scrutinize any `postinstall`. Any design that
65
+ ignores this will be rejected at the Security Gate and by consumer security
66
+ teams.
67
+ - This repo's own invariants currently **forbid** runtime code (see "Impacted
68
+ invariants"). A `postinstall` script is runtime code by definition. Therefore
69
+ this change cannot proceed without explicitly superseding those invariants via
70
+ a new ADR. That ADR is **out of scope for this role** (analyst); it is a required
71
+ downstream artifact owned by `sdlc-architect`.
72
+
73
+ ## Crisp, testable restatement of the requirement
74
+
75
+ > Ship a `postinstall` script in `@daochild/agents-config` that, after a consumer
76
+ > installs the package as a dev dependency, automatically and idempotently writes
77
+ > the single pointer line
78
+ > `Primary instructions: node_modules/@daochild/agents-config/AGENTS.md — follow unless overridden below.`
79
+ > into the consumer's `AGENTS.md` — **safe-append only** (prepend or append if the
80
+ > line is missing; no-op if already present; never overwrite existing content),
81
+ > **never creates an `AGENTS.md` silently** (if absent, print a notice and exit 0
82
+ > unless `--init` was passed), **never modifies files outside `cwd`**, is
83
+ > **deterministic** (no network, no telemetry), and **always exits 0** so it can
84
+ > never break `npm install`.
85
+ >
86
+ > Consumers who refuse `postinstall` (via `--ignore-scripts` or policy) MUST still
87
+ > have a fully documented, supported manual fallback (the current one-line edit in
88
+ > `README.md`).
89
+ >
90
+ > The change supersedes repo invariants that forbid runtime code; this requires a
91
+ > new ADR (ADR 0002, produced downstream by `sdlc-architect`) and updates to
92
+ > `ARCHITECTURE.md`, `docs/adr/0001-triple-mirror.md` alt.2, and
93
+ > `docs/BUSINESS_LOGIC.md` non-goals. It also partially resolves backlog item BL-1
94
+ > (the `index.js` stub). `SECURITY.md` must be updated to cover the postinstall
95
+ > supply-chain surface (downstream of this role).
96
+
97
+ ## Constraints (binding, from the maintainer)
98
+
99
+ 1. **Idempotent.** Running `npm install` twice (or any number of times) MUST NOT
100
+ duplicate the pointer line. The script must detect an existing pointer line
101
+ and no-op.
102
+ 2. **Safe-append only.** NEVER overwrite existing `AGENTS.md` content. If the
103
+ pointer line is missing, prepend or append it (the architect decides which; not
104
+ this role). If it is present, no-op. Existing content is sacred.
105
+ 3. **Do not silently create `AGENTS.md`.** If no `AGENTS.md` exists in `cwd`:
106
+ - default behavior: print a notice telling the user how to create one / use the
107
+ manual path, and **exit 0** (never fail the install);
108
+ - if an `--init` flag is passed: create a minimal `AGENTS.md` containing the
109
+ pointer line (the exact minimal shape is an architecture decision, not this
110
+ role's).
111
+ 4. **Never modify files outside `cwd`.** The script operates on the consumer's
112
+ `AGENTS.md` in the install `cwd` only. No traversal, no home dir, no global
113
+ files.
114
+ 5. **Deterministic.** No network access, no telemetry, no randomization, no
115
+ time-based behavior. The output is a pure function of the input
116
+ (`AGENTS.md` content + flags).
117
+ 6. **Always exit 0.** The script must never cause `npm install` to fail. Errors
118
+ are logged to stdout as notices, not thrown.
119
+ 7. **Manual fallback remains documented and supported.** The current README
120
+ one-line edit MUST remain in `README.md` as the supported fallback for
121
+ consumers who use `--ignore-scripts` or whose CI rejects `postinstall`.
122
+ 8. **`SECURITY.md` must be updated** to cover the new supply-chain surface (this
123
+ is a downstream artifact, out of this role's scope; flagged here per the
124
+ maintainer's instruction).
125
+ 9. **Always-on SDLC.** This is a medium/high-risk change per the repo's own
126
+ `sdlc-gates` rule. The orchestrator MUST require human approval at the
127
+ Architecture, Security, and Code Review gates before advancing. (This analysis
128
+ itself runs under that rule.)
129
+
130
+ ## Impacted invariants (MUST be surfaced; supersession is downstream)
131
+
132
+ This change **supersedes / relaxes** three currently-stated repo invariants. The
133
+ analyst MUST surface them; superseding them via an ADR is the architect's job,
134
+ NOT this role's. They are listed here as **required downstream artifacts** so the
135
+ PM can carry them forward as acceptance criteria / dependencies:
136
+
137
+ 1. **`ARCHITECTURE.md` rule 6** — "No runtime code. This repo's 'code' is
138
+ configuration. The only JS is the opencode plugin host
139
+ (`@opencode-ai/plugin` dependency) and any `.opencode/plugin/*.ts|.js` the user
140
+ adds. There is no `src/`, no build output, no deployable service."
141
+ A `postinstall` script is runtime code that runs in the consumer's environment
142
+ at install time. Rule 6 must be superseded (narrowed) to permit *this specific,
143
+ constrained* runtime code while keeping the general "no runtime application
144
+ code" stance.
145
+
146
+ 2. **`docs/adr/0001-triple-mirror.md` alt.2** — "Generate `.claude/` from
147
+ `.opencode/` at install time. Rejected: adds a build step to a config-only
148
+ repo and couples the tools' release cadences."
149
+ A `postinstall` is an install-time step. Alt.2's rationale must be
150
+ distinguished: that rejection was about *generating config* (coupling release
151
+ cadences); this change writes a *one-line pointer in the consumer's file*, not
152
+ config in this repo. ADR 0002 must explicitly carve out the distinction so
153
+ alt.2's rejection is not silently violated.
154
+
155
+ 3. **`docs/BUSINESS_LOGIC.md` non-goal** — "This repo does not ship runtime
156
+ application code."
157
+ The non-goal must be narrowed: this repo does not ship runtime *application*
158
+ code, but it DOES ship a constrained, install-time, file-pointer helper
159
+ (postinstall). The non-goal wording must be updated.
160
+
161
+ > These three are **impacted invariants**, not things this role changes. The
162
+ > analyst explicitly does NOT edit `ARCHITECTURE.md`, `docs/adr/`, or
163
+ > `docs/BUSINESS_LOGIC.md`. The PM MUST carry them forward as required downstream
164
+ > artifacts (acceptance criteria / dependencies), and the architect MUST produce
165
+ > ADR 0002 superseding the relevant clauses.
166
+
167
+ ## Relationship to existing backlog item BL-1
168
+
169
+ `docs/IMPLEMENTATION.md` lists:
170
+
171
+ > BL-1 | Add a real `index.js` entry if plugins need a host hook | low | Only if a
172
+ > plugin requires programmatic registration
173
+
174
+ The existing `package.json` declares `"main": "index.js"` pointing at a
175
+ non-existent stub (flagged in `docs/IMPLEMENTATION.md` as BL-1, status "Stub").
176
+ This change **partially resolves** BL-1: the postinstall script is a real, albeit
177
+ constrained, runtime entry. The PM should note in the PRD that BL-1 moves from
178
+ "Stub" to "Partially resolved (postinstall only)" and that the `main` field may
179
+ need to be reconciled (architecture decision, not this role's). BL-1 is NOT
180
+ fully closed by this change — a full `index.js` host hook for plugins is a
181
+ separate concern.
182
+
183
+ ## Assumptions
184
+
185
+ - The consumer runs `npm install` (or yarn/pnpm/bun equivalent) from their project
186
+ root, and the package is installed under `node_modules/@daochild/agents-config/`
187
+ relative to that root. The `postinstall` script runs with `cwd` set to the
188
+ consumer's project root (npm's documented behavior). *(To be confirmed by the
189
+ architect against current npm/pnpm/bun/yarn behavior; flagged as an
190
+ assumption.)*
191
+ - The pointer line's exact wording is fixed by the maintainer (verbatim above).
192
+ The script writes that exact string; it is not parameterized.
193
+ - The script is plain Node.js (the repo's stack is Node; `type: commonjs`). No
194
+ extra runtime dependency is introduced for the script itself (it uses Node
195
+ built-ins only) — this is a constraint, not an assumption, but restated here
196
+ because it bounds the architect's options.
197
+ - "Restart your agent session" remains a manual consumer step; this change does
198
+ not attempt to hot-reload agent config (rule 5 in `ARCHITECTURE.md`: config is
199
+ loaded once at startup).
200
+
201
+ ## Unknowns (to be resolved downstream)
202
+
203
+ - **Exact placement** of the pointer line (prepend vs. append) when it is missing.
204
+ The maintainer's README says "at the top of your project's `AGENTS.md`,
205
+ immediately after the title". The script should replicate that intent, but the
206
+ robust definition of "immediately after the title" (first `# ` heading? first
207
+ blank line after it?) is an architecture decision. Flagged as unknown.
208
+ - **`--init` minimal `AGENTS.md` shape.** If `--init` creates a minimal
209
+ `AGENTS.md`, what exactly does it contain? (Just the title + pointer? A
210
+ documented template?) Architecture decision.
211
+ - **Cross-package-manager behavior.** npm, yarn (classic + berry), pnpm, and bun
212
+ differ in how (and whether) they run `postinstall`, and in `cwd` semantics. The
213
+ architect MUST verify behavior across the supported set (the README lists all
214
+ four). Some package managers run `postinstall` with a different `cwd` or not at
215
+ all by default (pnpm has historically had different lifecycle behavior). This
216
+ is the single biggest unknown and a likely source of cross-manager
217
+ inconsistency.
218
+ - **`--ignore-scripts` detection.** There is no reliable way for a package to
219
+ detect that the consumer ran with `--ignore-scripts` (the script simply doesn't
220
+ run). The manual fallback's discoverability therefore depends on `README.md`
221
+ being clear. Flagged as an inherent limitation, not something the script can
222
+ solve.
223
+ - **Monorepo / workspace installs.** In a workspace, `postinstall` may run once
224
+ per the root or once per workspace; the pointer line target (`AGENTS.md` at
225
+ which level?) is unclear. Architect must address or scope out.
226
+
227
+ ## Out of scope for this role (analyst)
228
+
229
+ - Acceptance criteria — owned by `sdlc-pm` (next).
230
+ - Architecture / script design / language choice / placement rules / `--init`
231
+ template — owned by `sdlc-architect`.
232
+ - ADR 0002 — owned by `sdlc-architect`.
233
+ - Supersession edits to `ARCHITECTURE.md`, `docs/BUSINESS_LOGIC.md`,
234
+ `docs/adr/0001-triple-mirror.md` — owned by `sdlc-architect` (architecture gate).
235
+ - `SECURITY.md` update — owned downstream (security gate).
236
+ - Implementation, tests, review — downstream roles.
237
+
238
+ ## AI-readable precondition check (per `sdlc-regulatory` skill)
239
+
240
+ Required for any SDLC run:
241
+ - `AGENTS.md` — present, current (commit `fd9a3a7`, today). ✔
242
+ - `ARCHITECTURE.md` — present, current (same commit). ✔
243
+
244
+ Other AI-readable contract files present: `CONTRIBUTING.md`, `SECURITY.md`,
245
+ `docs/BUSINESS_LOGIC.md`, `docs/IMPLEMENTATION.md`, `docs/adr/0001-triple-mirror.md`.
246
+ The repo is AI-readable; no bootstrap pass is required before routing the feature
247
+ work.
248
+
249
+ ## Risk classification (preliminary — `sdlc-sm` assigns the final cap)
250
+
251
+ This change is **medium / high risk** on multiple axes (the maintainer asserts
252
+ medium/high; this analysis concurs and breaks it down):
253
+
254
+ | Axis | Assessment |
255
+ |------|------------|
256
+ | Business impact | Medium — improves adoption; a regression here directly hurts every consumer's install |
257
+ | Technical complexity | Medium — the script is small, but cross-package-manager behavior and idempotent safe-append have real edge cases |
258
+ | Security sensitivity | **High** — `postinstall` is a known supply-chain vector; this is the dominant risk |
259
+ | Data sensitivity | Low — no personal data; the script only touches a local markdown file |
260
+ | Infrastructure impact | Low — no deployable service; npm publish only |
261
+ | Financial impact | Low — no payments/billing surface |
262
+ | Breaking-change probability | Medium — consumers who pin or who run `--ignore-scripts` are unaffected; consumers whose CI rejects `postinstall` may see a *policy* break (not a code break); the manual fallback mitigates |
263
+
264
+ Because security sensitivity is High, the autonomy cap is ≤40% per the
265
+ `sdlc-regulatory` risk-autonomy table (postinstall is closest to
266
+ "Authentication"/"Production infrastructure" in sensitivity, not
267
+ "Documentation"/"Test generation"). This is above the ~50% cap threshold *only in
268
+ the sense that any high-risk change requires human approval* — to be precise: the
269
+ **cap is low** (≤40%), and **human approval is required at Architecture,
270
+ Security, and Code Review gates** before advancing. The orchestrator must request
271
+ and record those approvals.
272
+
273
+ ## Gate self-check (Requirement Gate, partial — analyst's half)
274
+
275
+ - [x] Requirement is clearly defined — crisp restatement above.
276
+ - [x] Business requirements are understood — problem, stakeholders, context documented.
277
+ - [x] Unknowns and assumptions surfaced — listed explicitly, with owners.
278
+ - [x] Impacted invariants surfaced — three listed, flagged as downstream ADR work.
279
+ - [x] AI-readable precondition verified — `AGENTS.md` + `ARCHITECTURE.md` present and current.
280
+
281
+ All analyst-half items pass.
282
+
283
+ ## Handoff
284
+
285
+ ```
286
+ HANDOFF: sdlc-pm | artifact: docs/business/zero-edit-install-analysis.md | gate: pass
287
+ ```
288
+
289
+ The PM MUST carry forward as required downstream artifacts:
290
+ - ADR 0002 superseding `ARCHITECTURE.md` rule 6, `docs/adr/0001-triple-mirror.md`
291
+ alt.2, and `docs/BUSINESS_LOGIC.md` non-goals.
292
+ - `SECURITY.md` update covering the postinstall supply-chain surface.
293
+ - BL-1 partial resolution noted in the PRD.
294
+ - Manual fallback documented in README as a supported path (acceptance criterion).
295
+ - Human approvals required at Architecture, Security, and Code Review gates.