@metasession.co/devaudit-cli 0.1.42 → 0.1.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-cli",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.42",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.43",
37
37
  "commander": "^12.1.0",
38
38
  "consola": "^3.2.3",
39
39
  "env-paths": "^3.0.0",
@@ -98,8 +98,10 @@ Create `compliance/evidence/REQ-XXX/implementation-plan.md`:
98
98
  - `path/to/existing-file.ts` — [what changes and why]
99
99
 
100
100
  ## Architecture Decisions
101
- - [Key decision 1 and rationale]
102
- - [Key decision 2 and rationale]
101
+
102
+ > Populated by the [`adr-author` skill](../skills/adr-author/SKILL.md) at Stage 1 plan APPROVAL. The skill applies a decision tree (new third-party dependency / new database, cache, or queue / new external service / pattern change spanning > 3 files / HIGH-CRITICAL risk) and either drafts `docs/ADR/ADR-NNN-<slug>.md` + injects "Produced ADR-NNN: <title>" here, or injects "No ADR needed — <one-line rationale>" so the question is visibly asked and answered. Don't author this section inline as bullets — the persistent decision lives in `docs/ADR/`, not buried in the plan.
103
+
104
+ - ADR-NNN — <title> (`docs/ADR/ADR-NNN-<slug>.md`) — Operator edits stub + flips to *Accepted* before APPROVAL — OR — No ADR needed — <rationale>
103
105
 
104
106
  ## Dependencies
105
107
  - [New packages needed, or "None"]
@@ -50,7 +50,23 @@ Each section below maps to one (or more) of these clauses. Don't delete sections
50
50
  - **In scope:** REPLACE — list every file / module / surface the change touches.
51
51
  - **Out of scope:** REPLACE — adjacent areas the change deliberately leaves alone.
52
52
 
53
- ## 3. Threat model + security considerations
53
+ ## 3. Architecture decisions
54
+
55
+ > *Populated by the [`adr-author` skill](../skills/adr-author/SKILL.md) at Stage 1 plan APPROVAL.*
56
+
57
+ Either an ADR-NNN reference list (when the skill judges the REQ architecturally significant) OR an explicit "no ADR" rationale. **Don't author this section inline as bullets** — the `adr-author` skill applies its decision tree and either drafts a `docs/ADR/ADR-NNN-<slug>.md` stub the operator edits, or annotates the no-ADR case.
58
+
59
+ When **ADR warranted**:
60
+
61
+ - **ADR-NNN — <decision title>** — Drafted by `adr-author`. File at `docs/ADR/ADR-NNN-<slug>.md`. Operator edits stub to canonical prose + flips status to *Accepted* before plan APPROVAL.
62
+
63
+ When **No ADR needed**:
64
+
65
+ - **No ADR needed** — REPLACE one-line rationale. Examples: "Bug fix touching only `lib/services/order-service.ts:applyDiscount` — no structural change." / "CSS-only adjustment — no behavioural or dependency change." / "Patch-level dependency bump with no API change."
66
+
67
+ The negative case is audit evidence too — auditors examine "no ADR — <rationale>" to confirm the question was asked. Never leave this section empty.
68
+
69
+ ## 4. Threat model + security considerations
54
70
 
55
71
  > *Closes ISO 27001 A.8.25 — secure development life cycle*
56
72
 
@@ -63,7 +79,7 @@ Each section below maps to one (or more) of these clauses. Don't delete sections
63
79
 
64
80
  **Dependencies introduced:** REPLACE — list new npm/pip packages; flag any with known CVEs or transitive concerns.
65
81
 
66
- ## 4. Data protection (GDPR Art. 25)
82
+ ## 5. Data protection (GDPR Art. 25)
67
83
 
68
84
  > *Closes GDPR Art. 25 — data protection by design*
69
85
 
@@ -85,7 +101,7 @@ If **yes**, fill in:
85
101
 
86
102
  If **no**, write: *"N/A — this REQ does not process personal data. <Why — e.g. UI-only change, internal-routing refactor, dev-tooling.>"*
87
103
 
88
- ## 5. AI / model considerations (EU AI Act Art. 11)
104
+ ## 6. AI / model considerations (EU AI Act Art. 11)
89
105
 
90
106
  > *Closes EUAIA Art. 11 — technical documentation*
91
107
 
@@ -103,13 +119,13 @@ If **yes**, fill in:
103
119
 
104
120
  If **no**, write: *"N/A — this REQ does not introduce or change AI behaviour. <Why.>"*
105
121
 
106
- ## 6. Rollback plan
122
+ ## 7. Rollback plan
107
123
 
108
124
  - **Reversible via:** REPLACE — git revert / migration down / config flip / etc.
109
125
  - **Data implications of rollback:** REPLACE — any data written by the new code that an older version can't read?
110
126
  - **Notification path if rollback during a release:** REPLACE — who hears, how quickly?
111
127
 
112
- ## 7. Verification
128
+ ## 8. Verification
113
129
 
114
130
  How the team will know the REQ is correct in production:
115
131
 
@@ -118,7 +134,7 @@ How the team will know the REQ is correct in production:
118
134
  - **Manual smoke after deploy:** REPLACE — bullet-list, or "none" with reason
119
135
  - **Monitoring / alerting:** REPLACE — what dashboards / alerts the change adds or relies on
120
136
 
121
- ## 8. Sign-off
137
+ ## 9. Sign-off
122
138
 
123
139
  - **Plan reviewer (eng):** REPLACE — name + date
124
140
  - **Plan reviewer (security / DPO):** REPLACE — when GDPR or threat-model sections are non-trivial; otherwise "N/A"
@@ -0,0 +1,266 @@
1
+ ---
2
+ name: adr-author
3
+ description: Catch the moment a tracked change makes an architecturally significant decision and either draft the canonical `docs/ADR/ADR-NNN-<slug>.md` artefact or document why no ADR was needed. Runs at Stage 1 (plan APPROVAL) and Stage 3 (evidence pack) of the SDLC. Decides "is this REQ architecturally significant?" via a calibrated heuristic (new third-party dependency, new database/cache/queue, new external service, pattern change spanning >3 files, HIGH/CRITICAL risk class), drafts a Context/Decision/Consequences/Alternatives/Status stub when warranted, allocates the next `ADR-NNN` ID, injects an ADR-NNN reference into the implementation plan, and produces a per-REQ `compliance/evidence/REQ-XXX/architecture-decision.md` artefact. Use when invoking on a single REQ ("draft an ADR for REQ-066", "does this REQ need an ADR?", "is the architectural decision documented?"); when `sdlc-implementer` delegates at Stage 1 plan-approval or Stage 3 evidence-compilation; when an operator asks for ADR-worthiness judgement on an in-flight branch. Do NOT use for authoring full ADR prose end-to-end (the operator edits the stub to canonical wording); for supersession-lifecycle handling (deferred to Phase B); for cross-link maintenance between ADRs and risk-register entries (that's `risk-register-keeper`); for framework-clause mapping of the `architecture_decision` evidence type (that's META-COMPLY's `framework-registry-auditor`).
4
+ ---
5
+
6
+ # ADR Author
7
+
8
+ Catches the moment a tracked REQ makes an architecturally significant decision that should produce a persistent record — and either drafts the ADR or documents why no ADR was needed. Sibling of [`requirements-aligner`](../requirements-aligner/SKILL.md) and `risk-register-keeper` in the SoT-alignment skill family.
9
+
10
+ The skill is **Phase A scope** (per [DevAudit-Installer#120](https://github.com/metasession-dev/DevAudit-Installer/issues/120)): Stage 1 + Stage 3 hooks only. Supersession-lifecycle, stale-decision detection, and cross-link maintenance between ADRs and other SoT artefacts all defer to Phase B — the v1 surface is the safest enforcement points.
11
+
12
+ ## What this skill owns
13
+
14
+ | Artefact | Lives at | Tier |
15
+ |---|---|---|
16
+ | `docs/ADR/ADR-NNN-<slug>.md` (the SoT, project-spanning) | Top-level project docs | 2 (project strategy) |
17
+ | `compliance/evidence/REQ-XXX/architecture-decision.md` (per-REQ Tier 3 evidence) | Per-REQ evidence directory | 3 (per-REQ) |
18
+
19
+ The skill does **not** own the canonical ADR prose. It drafts a stub the operator edits to publication-grade wording. Inventing decision rationale without operator review is exactly the kind of silent-drift this skill exists to prevent.
20
+
21
+ ## Scope
22
+
23
+ **In scope**
24
+
25
+ - Phase 1 (Stage-1 hook) — judge "is this REQ architecturally significant?" → if yes, allocate `ADR-NNN` + draft Context/Decision/Consequences/Alternatives/Status stub → inject ADR-NNN reference into implementation plan's *Architecture Decisions* section.
26
+ - Phase 2 (Stage-3 hook) — drop `compliance/evidence/REQ-XXX/architecture-decision.md` pointing at the ADR file (or recording the no-ADR rationale).
27
+ - Per-REQ ADR-worthiness audit (operator invocation).
28
+
29
+ **Out of scope**
30
+
31
+ - Drafting canonical ADR prose end-to-end — the skill drafts a stub; the operator authors final wording.
32
+ - Supersession lifecycle — when ADR-007 supersedes ADR-003, both stay on disk; ADR-003's status flips to `Superseded by ADR-007`. Deferred to Phase B.
33
+ - Stale-decision detection — when the file referenced by ADR-007's *Decision* section is heavily modified in a new REQ without producing a new ADR. Deferred to Phase B.
34
+ - Cross-link maintenance to SRS items (`requirements-aligner`'s domain) or risk-register entries (`risk-register-keeper`'s domain) — the skills cross-reference each other in their stubs but Phase B owns the bidirectional consistency.
35
+ - Framework-clause mapping of the `architecture_decision` evidence type — that's META-COMPLY's `framework-registry-auditor`.
36
+
37
+ ## The workflow
38
+
39
+ Five phases. Phase 0 routes; Phases 1–2 are the SDLC stage hooks; Phase 3 is the utility audit; Phase 4 reports.
40
+
41
+ ### Phase 0 — Route
42
+
43
+ Determine what's being decided:
44
+
45
+ - **Stage-1 plan APPROVAL** — `sdlc-implementer` (or operator) says *"check ADR-worthiness for REQ-XXX before approving the plan"* / *"does this need an ADR?"* → Phase 1.
46
+ - **Stage-3 evidence pack** — `sdlc-implementer` (or operator) says *"drop the architecture-decision.md for REQ-XXX"* → Phase 2.
47
+ - **Per-REQ ad-hoc audit** — operator says *"is REQ-XXX's architectural decision documented?"* / *"audit ADR-worthiness across this branch"* → Phase 3.
48
+
49
+ The skill does not fire spontaneously. The parent skill (`sdlc-implementer`) invokes it at Stages 1 + 3 per the parent's SKILL.md delegation contract.
50
+
51
+ ### Phase 1 — Stage-1 plan APPROVAL hook
52
+
53
+ Input: the REQ's `compliance/plans/REQ-XXX/implementation-plan.md` plus the working-tree diff.
54
+
55
+ **Step 1 — Read the file list + diff.** Identify which files the REQ touches.
56
+
57
+ **Step 2 — Apply the ADR-worthiness decision tree.** The skill judges *architectural significance* via these signals — any one matching ⇒ ADR warranted:
58
+
59
+ | Signal | Examples | Verdict |
60
+ |---|---|---|
61
+ | New third-party runtime dependency | adding `redis`, `bull`, a new ORM, a new auth provider package | ADR |
62
+ | New external service | introducing Stripe, Twilio, a new SaaS integration | ADR |
63
+ | New database / cache / queue tier | adding Redis alongside Postgres, swapping MongoDB for Postgres | ADR |
64
+ | Pattern change spanning > 3 files | moving from REST handlers to RPC, swapping auth flow across the API surface | ADR |
65
+ | Schema-level data model change | new tables that other tables FK to, fundamental relationship changes | ADR |
66
+ | Risk classification HIGH or CRITICAL | per `Test_Policy.md` §Risk-Based Testing | ADR (operator confirms) |
67
+ | File-path signal | `sdlc-config.json:adr_author.file_paths_signal_architecture` matches a touched file | ADR (operator confirms) |
68
+ | Bug fix touching ≤ 3 files in `app/` or `lib/` | a typo, a copy edit, a null-guard, a one-place validation | no ADR |
69
+ | Single-file refactor | extracting one function, renaming one variable | no ADR |
70
+ | Styling tweak | CSS-only, Tailwind class shuffle | no ADR |
71
+ | Dependency bump | `npm update foo` with no API change | no ADR |
72
+ | Documentation | `docs/`, `README.md`, doc-comments | no ADR |
73
+
74
+ **Step 3 — Branch on verdict:**
75
+
76
+ - **ADR warranted** → Phase 1 Step 4 (draft the stub).
77
+ - **No ADR** → Phase 1 Step 7 (inject the no-ADR rationale).
78
+ - **Ambiguous** → surface a candidate verdict + reasoning to the operator and ask. The operator can confirm or override. Do NOT silently default.
79
+
80
+ **Step 4 — Allocate the next `ADR-NNN`.** Scan `docs/ADR/` for the max-existing `ADR-NNN` (zero-padded to three digits where the project's convention has it) and propose `+1`. If `docs/ADR/` doesn't exist yet, create it + allocate `ADR-001`. The skill does NOT support cross-branch ID coordination — if two parallel branches both consume the same next-free ID, the git merge on the directory is the canonical conflict signal. Re-run the skill post-merge to re-allocate.
81
+
82
+ **Step 5 — Draft the stub `docs/ADR/ADR-NNN-<slug>.md`.** The slug is a kebab-case fragment of the decision (max 6 words). Format:
83
+
84
+ ```markdown
85
+ ---
86
+ adr_id: "ADR-NNN"
87
+ status: "Proposed"
88
+ date: "YYYY-MM-DD"
89
+ authored_by: "REPLACE — operator / agent"
90
+ related_reqs: ["REQ-XXX"]
91
+ supersedes: []
92
+ superseded_by: null
93
+ ---
94
+
95
+ # ADR-NNN: <decision title>
96
+
97
+ ## Status
98
+
99
+ **Proposed** (DRAFT — operator to flip to *Accepted* on plan APPROVAL)
100
+
101
+ ## Context
102
+
103
+ REPLACE — what forces (constraints, requirements, tradeoffs) motivate this decision? Two or three sentences. Reference REQ-XXX and any SRS items it traces to.
104
+
105
+ ## Decision
106
+
107
+ REPLACE — the choice made. One paragraph. Specific (not "we will use a queue" — "we will use Redis Streams as the queue substrate; consumers are FastAPI workers using `redis-py` ≥ 5.x").
108
+
109
+ ## Consequences
110
+
111
+ REPLACE — what follows. List both **good** and **bad** consequences honestly.
112
+
113
+ - **Good:** REPLACE
114
+ - **Bad:** REPLACE
115
+ - **Neutral / tradeoffs:** REPLACE
116
+
117
+ ## Alternatives considered
118
+
119
+ REPLACE — what other paths were on the table and why they were ruled out. At least one alternative; "we considered nothing else" is almost never honest.
120
+
121
+ - **Alternative 1:** REPLACE — ruled out because REPLACE
122
+ - **Alternative 2:** REPLACE — ruled out because REPLACE
123
+
124
+ ## Cross-references
125
+
126
+ - Implementation plan: `compliance/plans/REQ-XXX/implementation-plan.md`
127
+ - SRS items: REPLACE — list `REQ-AREA-NNN` items this decision affects, from `requirements-aligner` output
128
+ - Risk register: REPLACE — list `RISK-NNN` entries this decision touches, from `risk-register-keeper` output (when that skill exists)
129
+ - Supersedes / superseded-by: REPLACE — fill if this ADR replaces a prior one
130
+ ```
131
+
132
+ The stub is **draft-quality**; the operator edits each REPLACE marker before flipping the status from *Proposed* to *Accepted*.
133
+
134
+ **Step 6 — Inject ADR-NNN reference into the implementation plan.** The plan's *Architecture Decisions* section (converted from inline bullets to ADR-NNN references in this PR — see `Implementation_Plan_TEMPLATE.md`) gets a row added:
135
+
136
+ ```markdown
137
+ ## Architecture decisions
138
+
139
+ - **ADR-NNN — <decision title>** — Proposed by `adr-author` skill. Draft at `docs/ADR/ADR-NNN-<slug>.md`. Operator edits + flips status to *Accepted* before plan APPROVAL.
140
+ ```
141
+
142
+ **Step 7 — No-ADR rationale.** When the verdict is *no ADR*, the plan's *Architecture decisions* section gets:
143
+
144
+ ```markdown
145
+ ## Architecture decisions
146
+
147
+ - **No ADR needed** — REPLACE one-line rationale. Examples: "Bug fix touching only `lib/services/order-service.ts:applyDiscount` — no structural change." / "CSS-only adjustment to dashboard layout — no behavioural or dependency change." / "Dependency bump from `foo@1.2.3` to `foo@1.2.5` (patch-level, no API change)."
148
+ ```
149
+
150
+ The annotation is visible audit evidence that the *question was asked and answered* — auditors examine the negative case as well as the positive.
151
+
152
+ **Step 8 — Block plan APPROVAL** until each REQ has either:
153
+ - (a) an ADR file in this PR (status: Proposed → Accepted by operator), OR
154
+ - (b) an explicit "No ADR needed — <rationale>" annotation.
155
+
156
+ The block is configurable via `sdlc-config.json` — see *Configuration* below. Per the [#119 review](https://github.com/metasession-dev/DevAudit-Installer/issues/119#issuecomment-4631840651) defaults, advisory-with-strong-recommend in v1 (`block_on_stage_1: false`).
157
+
158
+ ### Phase 2 — Stage-3 evidence pack hook
159
+
160
+ Input: the REQ's implementation plan (post-approval) and the working-tree diff.
161
+
162
+ **Step 1 — Generate `compliance/evidence/REQ-XXX/architecture-decision.md`.** Format:
163
+
164
+ ```markdown
165
+ ---
166
+ req: REQ-XXX
167
+ generated_by: adr-author
168
+ generated_at: <ISO timestamp>
169
+ ---
170
+
171
+ # Architecture decision — REQ-XXX
172
+
173
+ ## Outcome
174
+
175
+ REPLACE — one of:
176
+
177
+ - "**Produced ADR-NNN:** <title> (`docs/ADR/ADR-NNN-<slug>.md`)" — when an ADR was authored in this cycle
178
+ - "**No ADR needed** — <rationale>" — when the no-ADR branch was taken
179
+
180
+ ## Detail
181
+
182
+ When **Produced ADR-NNN**:
183
+
184
+ - **ADR file:** `docs/ADR/ADR-NNN-<slug>.md`
185
+ - **Status:** Accepted (operator-confirmed during plan APPROVAL)
186
+ - **Summary:** REPLACE — one sentence from the ADR's *Decision* section
187
+ - **Affected files:** REPLACE — the file-path signals that triggered the verdict
188
+ - **Cross-references:** REPLACE — SRS items, risk-register entries
189
+
190
+ When **No ADR needed**:
191
+
192
+ - **Rationale:** REPLACE — one-line description copied from the plan's *Architecture decisions* section
193
+ - **Signals examined:** REPLACE — which signals from the decision tree were checked + how each scored
194
+
195
+ ## Operator sign-off
196
+
197
+ I have reviewed the ADR-worthiness verdict above and confirm:
198
+
199
+ - [ ] The verdict (ADR or no-ADR) matches the actual scope of this REQ.
200
+ - [ ] If ADR: the file at `docs/ADR/ADR-NNN-<slug>.md` is edited from stub to canonical prose and status is Accepted.
201
+ - [ ] If no-ADR: the rationale is specific enough that an auditor reading this in 12 months would agree.
202
+
203
+ **Reviewer:** <operator-name>
204
+ **Date:** <YYYY-MM-DD>
205
+ ```
206
+
207
+ **Step 2 — Tag for upload.** The CI's `compliance-evidence.yml` uploads this file as `evidence_type=architecture_decision` (added to META-COMPLY's `EVIDENCE_TYPE_REGISTRY` in the paired sub-PR). The framework-coverage matrix maps this to clauses per `framework-registry-auditor`'s review — see the META-COMPLY-side PR for the final clause attributions (v1 may ship orphan-by-design if the auditor rejects proposed mappings; see [`requirements-aligner`](../requirements-aligner/SKILL.md) for the precedent).
208
+
209
+ **Step 3 — Hand-off back to `sdlc-implementer`.** The skill's job ends at the artefact + the operator sign-off. The parent orchestrator continues with the rest of Stage 3.
210
+
211
+ ### Phase 3 — Per-REQ ad-hoc audit
212
+
213
+ Same logic as Phase 1's Step 2 + Step 3, but produces a markdown report rather than blocking. Useful when an operator asks *"does REQ-XXX need an ADR?"* outside the SDLC orchestration flow, or runs *"audit ADR-worthiness across this branch"* to surface gaps.
214
+
215
+ ### Phase 4 — Report
216
+
217
+ - For Phase 1 — the plan's injected section + the block/allow decision.
218
+ - For Phase 2 — the artefact path + summary line.
219
+ - For Phase 3 — markdown report (per-REQ verdict + reasoning).
220
+
221
+ ## Configuration (sdlc-config.json)
222
+
223
+ ```json
224
+ {
225
+ "adr_author": {
226
+ "enabled": true,
227
+ "block_on_stage_1": false,
228
+ "block_on_stage_3": true,
229
+ "file_paths_signal_architecture": [
230
+ "lib/services/",
231
+ "lib/repositories/",
232
+ "prisma/schema.prisma",
233
+ "infra/"
234
+ ]
235
+ }
236
+ }
237
+ ```
238
+
239
+ Per the [#119 review](https://github.com/metasession-dev/DevAudit-Installer/issues/119#issuecomment-4631840651) defaults:
240
+
241
+ - `block_on_stage_1: false` — advisory at Stage 1 by default. Operators flip to `true` once the heuristic is calibrated on the project (i.e. the skill's ADR/no-ADR verdicts have agreed with operator judgement on the last N runs).
242
+ - `block_on_stage_3: true` — the per-REQ evidence pack is the hard gate (the Stage 3 artefact is what actually lands as evidence; missing it leaks).
243
+ - `file_paths_signal_architecture` — list of file paths/prefixes that should signal an architectural change when touched. Defaults cover the common load-bearing surfaces; operators add project-specific paths (e.g. `infra/terraform/`, `app/auth/`).
244
+
245
+ ## Principles
246
+
247
+ **Don't author the ADR prose.** The skill drafts a stub the operator edits to publication-grade wording. Inventing decision rationale without operator review is exactly the kind of silent-drift this skill exists to prevent.
248
+
249
+ **Calibrate, don't presume.** The decision tree above is a starting heuristic, not a hard rule. When a verdict surfaces on the edge — say a single-file change that introduces a new dependency — surface the candidate verdict + reasoning and ask. The operator can confirm or override. False-positive ADRs (drafting noise the team has to edit-and-delete) are worse than false-negative no-ADRs (the operator catches the gap in review and asks for one).
250
+
251
+ **Block at Stage 3, advise at Stage 1.** The implementation plan can carry "No ADR needed — <rationale>" and ship. The evidence pack cannot — the per-REQ `architecture-decision.md` artefact must exist before Stage 3 completes. Symmetric with `requirements-aligner` per the [#119 review](https://github.com/metasession-dev/DevAudit-Installer/issues/119#issuecomment-4631840651).
252
+
253
+ **Sibling-skill awareness.** When this skill drafts an ADR, cross-link the SRS items the decision affects (from `requirements-aligner`'s output) and the risk-register entries the decision touches (from `risk-register-keeper` when that skill ships). The three SoT-alignment skills work together; each produces its own per-REQ Tier 3 artefact but they share the per-REQ context. v1 carries the cross-references as inline references the operator fills in; Phase B will own bidirectional consistency.
254
+
255
+ **The negative case is audit evidence too.** A "No ADR needed — <rationale>" annotation is what an auditor examines to confirm the question was asked. An empty *Architecture decisions* section is the silent-drift failure mode. Always inject one or the other; never leave the section unannotated.
256
+
257
+ ## References
258
+
259
+ - [DevAudit-Installer#120](https://github.com/metasession-dev/DevAudit-Installer/issues/120) — the issue this skill closes, with the case study + the locked Phase A scope.
260
+ - `sdlc-implementer/SKILL.md` Phase 1 + Phase 3 — the parent-skill invocation contract.
261
+ - `sdlc/files/_common/Implementation_Plan_TEMPLATE.md` — *Architecture decisions* section converted from inline bullets to ADR-NNN reference list in this PR (companion change).
262
+ - `sdlc/files/_common/1-plan-requirement.md` — stage-1 doc updated to point at the skill (companion change).
263
+ - `sdlc/files/_common/skills/requirements-aligner/SKILL.md` — sibling skill (same SoT-alignment family); see for the symmetric shape (Stage 1 + Stage 3 hooks; advisory-then-blocking enforcement).
264
+ - Sibling skill (forthcoming): `risk-register-keeper` (DevAudit-Installer#121).
265
+ - Meta-reviewer (META-COMPLY): `framework-registry-auditor` reviews the `architecture_decision` evidence type's clause mappings before the META-COMPLY sub-PR opens. Per the [#119 sequencing](https://github.com/metasession-dev/DevAudit-Installer/issues/119#issuecomment-4631840651).
266
+ - Existing ADRs in the framework itself: `DevAudit-Installer/docs/ADR/ADR-001-polyglot-sdlc-architecture.md`, `docs/devaudit-cli/ADR-001-language-and-distribution.md` — the pattern this skill maintains.
@@ -161,9 +161,10 @@ Reached only on the **tracked** route from Phase 0 (the issue is already fetched
161
161
 
162
162
  **Don't delete sections** — mark with `N/A — <reason>` if a clause genuinely doesn't apply (e.g. UI-only change with no personal-data scope). Empty stubs commit-then-upload as placeholder evidence and break the audit trail.
163
163
  6. **Invoke `requirements-aligner` to populate the SRS-ID column on the AC table.** The plan's "Acceptance criteria" table carries an SRS-ID column per AC; `requirements-aligner` fuzzy-matches each AC against `docs/SRS.md` and proposes new `REQ-AREA-NNN` stubs, flags stale items, or annotates `@srs-deferred`. Don't author the SRS-ID column inline — call via the standard Claude Code Skill mechanism (`Skill(name: "requirements-aligner", …)`). Block plan APPROVAL until every AC has a resolved SRS-ID per the skill's Phase 1 contract (configurable via `sdlc-config.json:requirements_aligner.block_on_stage_1`; ramp-up mode default-on for legacy projects).
164
- 7. **Update `compliance/RTM.md`** with the new entry: REQ-XXX, title, risk class, linked issue, linked test cases (placeholder).
165
- 8. **Post plan summary as an issue comment.** Format: TL;DR; Risk class + signals; Acceptance criteria (with SRS-IDs); Technical approach (one paragraph); Dependencies; Test scope.
166
- 9. **Checkpoint** pause for human approval **iff** risk class is HIGH or CRITICAL. LOW and MEDIUM pass through to Phase 2 automatically. The checkpoint can be forced on for all classes via the `--require-plan-approval` flag (or `DEVAUDIT_REQUIRE_PLAN_APPROVAL=1` env var) for orgs that want it always-on.
164
+ 7. **Invoke `adr-author` to decide ADR-worthiness + draft the ADR if needed.** The plan's "Architecture decisions" section is no longer authored inline as bullets — `adr-author` applies its decision tree (new third-party dependency / new database/cache/queue / new external service / pattern change spanning >3 files / HIGH-CRITICAL risk class / file-path signals from `sdlc-config.json:adr_author.file_paths_signal_architecture`), allocates the next `ADR-NNN`, drafts a Context/Decision/Consequences/Alternatives/Status stub at `docs/ADR/ADR-NNN-<slug>.md`, and injects either *"Produced ADR-NNN: <title>"* or *"No ADR needed — <rationale>"* into the plan's section. Call via the standard Claude Code Skill mechanism (`Skill(name: "adr-author", …)`). Configurable via `sdlc-config.json:adr_author.block_on_stage_1`; advisory by default in v1.
165
+ 8. **Update `compliance/RTM.md`** with the new entry: REQ-XXX, title, risk class, linked issue, linked test cases (placeholder).
166
+ 9. **Post plan summary as an issue comment.** Format: TL;DR; Risk class + signals; Acceptance criteria (with SRS-IDs); Architectural decisions (ADR-NNN reference or no-ADR rationale); Technical approach (one paragraph); Dependencies; Test scope.
167
+ 10. **Checkpoint** — pause for human approval **iff** risk class is HIGH or CRITICAL. LOW and MEDIUM pass through to Phase 2 automatically. The checkpoint can be forced on for all classes via the `--require-plan-approval` flag (or `DEVAUDIT_REQUIRE_PLAN_APPROVAL=1` env var) for orgs that want it always-on.
167
168
 
168
169
  ### Phase 2 — Implement and test (SDLC stage 2)
169
170
 
@@ -194,14 +195,16 @@ Reached only on the **tracked** route from Phase 0 (the issue is already fetched
194
195
 
195
196
  ### Phase 3 — Compile evidence (SDLC stage 3)
196
197
 
197
- 1. **Invoke `requirements-aligner` to drop the per-REQ SRS-alignment artefact.** The skill's Phase 2 produces `compliance/evidence/REQ-XXX/srs-alignment.md` — the per-REQ trace from each AC to its SRS item, with an operator sign-off block. The artefact uploads with `evidence_type=srs_alignment` and closes `ISO29119.3.4` + `SOC2.CC2.1` for the REQ. Call via the standard Skill mechanism; don't inline the alignment logic.
198
- 2. **Re-run the full test pack** with artefact capture:
198
+ 1. **Invoke `requirements-aligner` to drop the per-REQ SRS-alignment artefact.** The skill's Phase 2 produces `compliance/evidence/REQ-XXX/srs-alignment.md` — the per-REQ trace from each AC to its SRS item, with an operator sign-off block. The artefact uploads with `evidence_type=srs_alignment` (visible in Documents tab + audit-pack export; v1 orphan-by-design per META-COMPLY framework-registry-auditor). Call via the standard Skill mechanism; don't inline the alignment logic.
199
+ 2. **Invoke `adr-author` to drop the per-REQ architecture-decision artefact.** The skill's Phase 2 produces `compliance/evidence/REQ-XXX/architecture-decision.md` — either *"Produced ADR-NNN: <title>"* with the file pointer, or *"No ADR needed — <rationale>"*. Operator sign-off block at the bottom. The artefact uploads with `evidence_type=architecture_decision`; clause attribution per the META-COMPLY framework-registry-auditor review. Call via the standard Skill mechanism.
200
+ 3. **Re-run the full test pack** with artefact capture:
199
201
  - `npm run test:e2e -- --reporter=html` (produces `playwright-report/`)
200
202
  - `npx vitest run --coverage` (produces `coverage/`)
201
- 3. **Organise artefacts** under `compliance/evidence/REQ-XXX/` with date-prefixed naming:
203
+ 4. **Organise artefacts** under `compliance/evidence/REQ-XXX/` with date-prefixed naming:
202
204
  ```
203
205
  compliance/evidence/REQ-XXX/
204
206
  ├── srs-alignment.md ← produced in step 1 by requirements-aligner
207
+ ├── architecture-decision.md ← produced in step 2 by adr-author
205
208
  ├── YYYY-MM-DD_e2e-results.json
206
209
  ├── YYYY-MM-DD_playwright-report/
207
210
  ├── YYYY-MM-DD_traces/ ← per-test trace.zip + error-context.md
@@ -210,7 +213,7 @@ Reached only on the **tracked** route from Phase 0 (the issue is already fetched
210
213
  ```
211
214
 
212
215
  Copy Playwright's `test-results/` folder verbatim into `YYYY-MM-DD_traces/` so trace-by-test-name is available for audit without walking the HTML report's hash-name index. For HIGH/CRITICAL releases the traces are part of the audit trail — *"what state was the page in when test X failed and was overridden?"* answers in one `ls` instead of an HTML-report walk.
213
- 4. **Upload each artefact to the portal**:
216
+ 5. **Upload each artefact to the portal**:
214
217
  ```bash
215
218
  devaudit push <project-slug> REQ-XXX <evidence-type> <file> \
216
219
  --release "v$(date +%Y.%m.%d)" --create-release-if-missing \
@@ -218,9 +221,9 @@ Reached only on the **tracked** route from Phase 0 (the issue is already fetched
218
221
  --git-sha "$(git rev-parse HEAD)" \
219
222
  --branch "$(git rev-parse --abbrev-ref HEAD)"
220
223
  ```
221
- Evidence types: `screenshot`, `e2e_result`, `test_report`, `audit_log`, `compliance_document`, `manual_upload`, `srs_alignment` (from step 1).
222
- 5. **Verify uploads landed.** `gh api` or `curl` against `https://devaudit.metasession.co/projects/<slug>/requirements/REQ-XXX/evidence` should show every artefact.
223
- 6. **Update `compliance/RTM.md`** with portal links for each evidence row.
224
+ Evidence types: `screenshot`, `e2e_result`, `test_report`, `audit_log`, `compliance_document`, `manual_upload`, `srs_alignment` (from step 1), `architecture_decision` (from step 2).
225
+ 6. **Verify uploads landed.** `gh api` or `curl` against `https://devaudit.metasession.co/projects/<slug>/requirements/REQ-XXX/evidence` should show every artefact.
226
+ 7. **Update `compliance/RTM.md`** with portal links for each evidence row.
224
227
 
225
228
  ### Phase 4 — Submit for UAT review (SDLC stage 4)
226
229
 
@@ -34,6 +34,18 @@ jobs:
34
34
  upload-compliance-evidence:
35
35
  name: Upload Compliance Evidence
36
36
  runs-on: {{RUNNER}}
37
+ # Permissions are needed because the "Auto-generate housekeeping stubs"
38
+ # step pushes a new branch + opens a PR via `gh pr create` when the
39
+ # current push triggers a housekeeping release (vYYYY.MM.DD) that
40
+ # doesn't yet have its stub release-ticket on disk. Without these
41
+ # the github-actions[bot] token gets HTTP 403 on the push + on the PR
42
+ # create, and the auto-housekeeping path silently leaves a red badge
43
+ # on every docs-only / chore push. DEVAUDIT_USER_TOKEN remains optional
44
+ # for orgs with restricted Actions permissions — but is no longer
45
+ # required for the default-config flow. See DevAudit-Installer#122.
46
+ permissions:
47
+ contents: write # push the auto-PR branch
48
+ pull-requests: write # gh pr create
37
49
  env:
38
50
  DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
39
51
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
@@ -93,5 +93,18 @@
93
93
  "block_on_stage_3": true,
94
94
  "auto_file_followup_issue": false,
95
95
  "ramp_up_runs": 5
96
+ },
97
+
98
+ "_comment_adr_author": "adr-author skill toggles (DevAudit-Installer#120, v0.1.43+). The skill applies a decision tree at Stage 1 plan APPROVAL to judge ADR-worthiness, drafts docs/ADR/ADR-NNN-<slug>.md when warranted, and drops compliance/evidence/REQ-XXX/architecture-decision.md at Stage 3. block_on_stage_1=false (default) means advisory-with-strong-recommend in v1; flip to true once the project's calibrated on the heuristic. block_on_stage_3=true means the per-REQ architecture-decision.md artefact is the hard gate. file_paths_signal_architecture lists path prefixes that should trigger an ADR-worthy verdict when touched — defaults cover lib/services/, lib/repositories/, prisma/schema.prisma, infra/; add project-specific load-bearing paths.",
99
+ "adr_author": {
100
+ "enabled": true,
101
+ "block_on_stage_1": false,
102
+ "block_on_stage_3": true,
103
+ "file_paths_signal_architecture": [
104
+ "lib/services/",
105
+ "lib/repositories/",
106
+ "prisma/schema.prisma",
107
+ "infra/"
108
+ ]
96
109
  }
97
110
  }