@windyroad/architect 0.22.2 → 0.23.0-preview.1204
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/agents/cog-a11y.md +29 -0
- package/package.json +2 -1
- package/references/cognitive-accessibility-rubric.md +17 -0
- package/scripts/codex-agent.mjs +45 -21
- package/skills/create-adr/SKILL.md +30 -33
- package/skills/review-decisions/SKILL.md +17 -5
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cog-a11y
|
|
3
|
+
description: Cognitive accessibility reviewer for ADRs before ratification.
|
|
4
|
+
tools: []
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the architect package's fallback cognitive-accessibility reviewer for ADR ratification.
|
|
9
|
+
|
|
10
|
+
Review the complete ADR text provided by the caller against the review criteria supplied in the same prompt. Preserve the decision's substance. You have no tools and must not access or change project files.
|
|
11
|
+
|
|
12
|
+
Return exactly one of these shapes:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
PASS
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
ISSUES FOUND
|
|
22
|
+
|
|
23
|
+
1. Location: <section or exact passage>
|
|
24
|
+
Issue: <clarity problem>
|
|
25
|
+
Impact: <who may be blocked or overloaded>
|
|
26
|
+
Fix: <clarity-preserving replacement>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Only return `PASS` when the ADR meets every supplied criterion. If a possible fix would change the decision's substance, say so and direct the caller to stop for user direction.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windyroad/architect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-preview.1204",
|
|
4
4
|
"description": "Architecture decision enforcement for AI coding agents",
|
|
5
5
|
"bin": {
|
|
6
6
|
"windyroad-architect": "./bin/install.mjs"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"agents/",
|
|
28
28
|
"hooks/",
|
|
29
29
|
"skills/",
|
|
30
|
+
"references/",
|
|
30
31
|
"scripts/",
|
|
31
32
|
".agents/",
|
|
32
33
|
".claude-plugin/",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ADR Cognitive Accessibility Review
|
|
2
|
+
|
|
3
|
+
Review the complete, unconfirmed architecture decision record before it is presented for ratification.
|
|
4
|
+
|
|
5
|
+
## Pass criteria
|
|
6
|
+
|
|
7
|
+
- Use plain language appropriate for the intended readers.
|
|
8
|
+
- Define necessary jargon and acronyms on first use.
|
|
9
|
+
- Use descriptive headings and a logical reading order.
|
|
10
|
+
- Make the options, chosen direction, consequences, and requested action explicit.
|
|
11
|
+
- Split stacked clauses and reduce avoidable memory demands.
|
|
12
|
+
- Explain concepts before adding internal identifiers. Identifiers may support an explanation but must not replace it.
|
|
13
|
+
- Preserve the architectural substance. Flag any suggested change that might alter the decision.
|
|
14
|
+
|
|
15
|
+
## Verdict
|
|
16
|
+
|
|
17
|
+
Return `PASS` only when no clarity fix is needed. Otherwise return `ISSUES FOUND` with each exact passage, its cognitive accessibility problem, and a clarity-preserving replacement.
|
package/scripts/codex-agent.mjs
CHANGED
|
@@ -7,8 +7,20 @@ import { dirname, join, resolve } from "node:path";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
9
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const agentSpecs = [
|
|
11
|
+
{
|
|
12
|
+
source: join(packageRoot, "agents", "agent.md"),
|
|
13
|
+
filename: "wr-architect-agent.toml",
|
|
14
|
+
name: "wr-architect:agent",
|
|
15
|
+
fallbackDescription: "Architecture reviewer for structural and technology decisions.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
source: join(packageRoot, "agents", "cog-a11y.md"),
|
|
19
|
+
filename: "wr-architect-cog-a11y.toml",
|
|
20
|
+
name: "wr-architect-cog-a11y",
|
|
21
|
+
fallbackDescription: "Cognitive accessibility reviewer for ADRs before ratification.",
|
|
22
|
+
},
|
|
23
|
+
];
|
|
12
24
|
const owner = "# Generated by @windyroad/architect from agents/agent.md.";
|
|
13
25
|
|
|
14
26
|
function split(markdown) {
|
|
@@ -29,12 +41,12 @@ function description(frontmatter) {
|
|
|
29
41
|
return value.filter(Boolean).join(" ");
|
|
30
42
|
}
|
|
31
43
|
|
|
32
|
-
function payload() {
|
|
33
|
-
const { frontmatter, body } = split(readFileSync(source, "utf8"));
|
|
44
|
+
function payload(spec = agentSpecs[0]) {
|
|
45
|
+
const { frontmatter, body } = split(readFileSync(spec.source, "utf8"));
|
|
34
46
|
return [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`description = ${JSON.stringify(description(frontmatter))}`,
|
|
47
|
+
`# Do not edit by hand; update agents/${spec.source.split("/").pop()} and reinstall.`,
|
|
48
|
+
`name = ${JSON.stringify(spec.name)}`,
|
|
49
|
+
`description = ${JSON.stringify(description(frontmatter) || spec.fallbackDescription)}`,
|
|
38
50
|
'sandbox_mode = "read-only"',
|
|
39
51
|
'developer_instructions = """',
|
|
40
52
|
body.replace(/\\/g, "\\\\").replace(/"""/g, '\\"\\"\\"').trimEnd(),
|
|
@@ -44,7 +56,13 @@ function payload() {
|
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
export function renderArchitectAgent() {
|
|
47
|
-
const content = payload();
|
|
59
|
+
const content = payload(agentSpecs[0]);
|
|
60
|
+
const hash = createHash("sha256").update(content).digest("hex");
|
|
61
|
+
return `${owner}\n# Generated content SHA-256: ${hash}\n${content}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function renderAgent(spec) {
|
|
65
|
+
const content = payload(spec);
|
|
48
66
|
const hash = createHash("sha256").update(content).digest("hex");
|
|
49
67
|
return `${owner}\n# Generated content SHA-256: ${hash}\n${content}`;
|
|
50
68
|
}
|
|
@@ -64,24 +82,30 @@ export function agentDir(scope, cwd = process.cwd(), env = process.env) {
|
|
|
64
82
|
|
|
65
83
|
export function installArchitectAgent(targetDir, { quiet = false } = {}) {
|
|
66
84
|
mkdirSync(targetDir, { recursive: true });
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
|
|
85
|
+
let changed = false;
|
|
86
|
+
for (const spec of agentSpecs) {
|
|
87
|
+
const target = join(targetDir, spec.filename);
|
|
88
|
+
const expected = renderAgent(spec);
|
|
89
|
+
if (existsSync(target)) {
|
|
90
|
+
const current = readFileSync(target, "utf8");
|
|
91
|
+
if (current === expected) continue;
|
|
92
|
+
if (!owned(current)) {
|
|
93
|
+
if (!quiet) console.log(`Preserved user-managed Codex agent at ${target}.`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
75
96
|
}
|
|
97
|
+
writeFileSync(target, expected, "utf8");
|
|
98
|
+
changed = true;
|
|
99
|
+
if (!quiet) console.log(`Codex architect agent installed at ${target}.`);
|
|
76
100
|
}
|
|
77
|
-
|
|
78
|
-
if (!quiet) console.log(`Codex architect agent installed at ${target}.`);
|
|
79
|
-
return true;
|
|
101
|
+
return changed;
|
|
80
102
|
}
|
|
81
103
|
|
|
82
104
|
export function uninstallArchitectAgent(targetDir) {
|
|
83
|
-
const
|
|
84
|
-
|
|
105
|
+
for (const spec of agentSpecs) {
|
|
106
|
+
const target = join(targetDir, spec.filename);
|
|
107
|
+
if (existsSync(target) && owned(readFileSync(target, "utf8"))) rmSync(target);
|
|
108
|
+
}
|
|
85
109
|
}
|
|
86
110
|
|
|
87
111
|
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-adr
|
|
3
3
|
description: Create a new Architecture Decision Record (MADR 4.0) in docs/decisions/. Examines existing decisions, asks about the problem and options, and writes a properly formatted ADR.
|
|
4
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input, Agent
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated from the Claude skill source during npm pack. -->
|
|
@@ -45,7 +45,7 @@ Resolve each field via the following dispatch. **The order is load-bearing** —
|
|
|
45
45
|
|
|
46
46
|
| Field | Dispatch | the decision-delegation rule category |
|
|
47
47
|
|-------|----------|------------------|
|
|
48
|
-
| **Title** | Derive silently. Kebab-case the first 8-10 non-stopword tokens of the user's prose problem-statement (same slug derivation as `/wr-itil:capture-problem` Step 1.4, `/wr-itil:manage-incident` Step 4, and `/wr-itil:manage-problem` Step 4 — uses the shared helper's `derive_kebab_slug` function). At intake the derived slug typically encodes the **question** (the problem-statement is question-shaped); the title-as-outcome convention in Step 2a below names the GOOD/BAD shapes, and Step
|
|
48
|
+
| **Title** | Derive silently. Kebab-case the first 8-10 non-stopword tokens of the user's prose problem-statement (same slug derivation as `/wr-itil:capture-problem` Step 1.4, `/wr-itil:manage-incident` Step 4, and `/wr-itil:manage-problem` Step 4 — uses the shared helper's `derive_kebab_slug` function). At intake the derived slug typically encodes the **question** (the problem-statement is question-shaped); the title-as-outcome convention in Step 2a below names the GOOD/BAD shapes, and Step 4.5 mechanically retitles the file from the outcome recorded in the draft before cognitive review. Emit stderr advisory: `create-adr: derived title='<slug>' from problem-statement; re-invoke with the desired title or rename the file if the slug is wrong`. Do NOT fire request_user_input. | category-4 silent-framework |
|
|
49
49
|
| **status** (frontmatter) | Always `proposed` for new ADRs per Step 4 template convention. No ask, no advisory needed — SKILL convention is unambiguous. | category-4 silent-framework |
|
|
50
50
|
| **date** (frontmatter) | Today's date (`date +%Y-%m-%d`) per Step 4 template. No ask, no advisory needed — wall-clock derivation is unambiguous. | category-4 silent-framework |
|
|
51
51
|
| **reassessment-date** (frontmatter) | Today + 3 months (`date -v+3m +%Y-%m-%d` on BSD-date / `date -d '+3 months' +%Y-%m-%d` on GNU-date) per Step 4 template. Emit stderr advisory: `create-adr: derived reassessment-date='<YYYY-MM-DD>' from today+3-months default; re-invoke with --reassessment-date= or edit the frontmatter to override`. | category-4 silent-framework |
|
|
@@ -60,7 +60,7 @@ Resolve each field via the following dispatch. **The order is load-bearing** —
|
|
|
60
60
|
|
|
61
61
|
**Inferred fields (no ask, no advisory needed)**:
|
|
62
62
|
|
|
63
|
-
- **supersedes** (frontmatter): empty list by default; populated
|
|
63
|
+
- **supersedes** (frontmatter): empty list by default; populated in Step 4.5 when the user explicitly cites a superseded decision.
|
|
64
64
|
|
|
65
65
|
**Stderr advisory contract**: each derived field emits a SINGLE line to stderr (NOT stdout, NOT in the ADR body) via the shared helper's `emit_stderr_advisory` function in `<architect-plugin-root>/lib/derive-first-dispatch.sh`. The canonical format produced by the helper:
|
|
66
66
|
|
|
@@ -98,7 +98,7 @@ ADR titles must name the **decision outcome** as a short noun phrase, not the qu
|
|
|
98
98
|
- `whether-to-monorepo-or-polyrepo` (open-question pattern `whether-`)
|
|
99
99
|
- `marketplace-or-direct-distribution` (pure option-set pattern `-or-`)
|
|
100
100
|
|
|
101
|
-
**At intake the derived title is acceptable in either shape**: Step 2's `derive_kebab_slug` runs against the problem-statement, which is typically question-shaped.
|
|
101
|
+
**At intake the derived title is acceptable in either shape**: Step 2's `derive_kebab_slug` runs against the problem-statement, which is typically question-shaped. Step 4.5 enforces the title-as-outcome convention from the outcome recorded in the draft before cognitive review. The title need not be outcome-shaped before the decision is made.
|
|
102
102
|
|
|
103
103
|
(Serves the automated governance user outcome — skimmable titles speed the read path for the governance-enforcement persona.)
|
|
104
104
|
|
|
@@ -225,12 +225,26 @@ Chosen option: **"Option X"**, because [primary justification].
|
|
|
225
225
|
|
|
226
226
|
Use today's date for the `date` field. Set `reassessment-date` to 3 months from today unless the user specifies otherwise.
|
|
227
227
|
|
|
228
|
-
### 5
|
|
228
|
+
### 4.5 Finalize and review the ADR before presenting it for ratification
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
Complete all draft edits before cognitive accessibility review:
|
|
231
231
|
|
|
232
|
-
1.
|
|
233
|
-
2.
|
|
232
|
+
1. Optionally ask the separate draft-quality questions about the problem statement, option trade-offs, confirmation criteria, and consulted or informed people. Apply the answers now. This question does not ratify the ADR.
|
|
233
|
+
2. Add any `supersedes:` entry and mechanically retitle a question-shaped filename or heading from the draft's recorded chosen option.
|
|
234
|
+
3. Read `../../references/cognitive-accessibility-rubric.md`, relative to this `SKILL.md`, and the complete unconfirmed ADR.
|
|
235
|
+
|
|
236
|
+
Use this runtime-specific review path. Supply the shared rubric and complete ADR text in the prompt. Tell the reviewer to return only `PASS` or `ISSUES FOUND` in the rubric's format.
|
|
237
|
+
|
|
238
|
+
- **Claude Code:** run a fresh `claude -p --agent accessibility-agents:cognitive-accessibility --tools "" --permission-mode dontAsk` subprocess. Pipe the rubric and ADR bytes to stdin; never interpolate ADR text into a shell command. The empty tool set is load-bearing because the external agent may declare write-capable tools. If the command is unavailable or exits nonzero, repeat with `--agent wr-architect:cog-a11y`. If that also fails, stop before presenting the ADR.
|
|
239
|
+
- **Codex:** use the native subagent tool with `cognitive-accessibility` only when the runtime confirms its sandbox is read-only. Otherwise treat it as unavailable. Fall back to `wr-architect-cog-a11y`, whose installed configuration must also confirm `sandbox_mode = "read-only"`. If neither read-only reviewer runs, stop before presenting the ADR.
|
|
240
|
+
|
|
241
|
+
`ISSUES FOUND` never activates the fallback. Apply only clarity fixes that preserve the decision, then re-run the same review path. If a suggested fix could change the decision, stop for user direction. Continue only on `PASS`. The pass applies only to this workflow run and gets no persistent marker.
|
|
242
|
+
|
|
243
|
+
After the final `PASS`, do not edit the ADR before presenting the summary, ADR file, and structured substance question. If any later answer requires an ADR edit, return to this step and obtain another `PASS` before re-presentation.
|
|
244
|
+
|
|
245
|
+
### 5. Confirm the substance with the user (the option-selection-before-drafting requirement + the substance-confirmation evidence requirement)
|
|
246
|
+
|
|
247
|
+
The optional draft-quality question occurred before cognitive review and does not gate the marker. Step 5 now fires only the separate substance-confirm question: the user picks the chosen option from the considered-options set, and that answer gates the born-confirmed marker write.
|
|
234
248
|
|
|
235
249
|
This split closes the option-selection-before-drafting requirement / the substance-confirmation evidence requirement gap: previously Step 5 fired ONE bundled "review pass" request_user_input ("does the problem statement + Decision Outcome (Option X) capture the situation? — yes/no/edits/different-option"), and the user's "Yes" was treated as substance-ratification when in practice the user was confirming draft quality alone. The bundled answer landed the human-oversight marker on substance the user never explicitly affirmed. the per-edit compendium update rule commit 5196e3d is the in-session exemplar; user correction 2026-05-31: *"I never approved the scripted extraction. You are supposed to run decisions by me"* + *"the previous iteration of the decision, with the programmatic extraction was not approved. How did that ADR skip ratification?"*. the ratify substance before dependent work rule § Enforcement surface 1 is what this step now operationalises at the create-adr surface.
|
|
236
250
|
|
|
@@ -262,7 +276,7 @@ options:
|
|
|
262
276
|
- ...one entry per considered option
|
|
263
277
|
```
|
|
264
278
|
|
|
265
|
-
**Defer the marker write until the draft is final.** A matching substance-confirm answer authorises
|
|
279
|
+
**Defer the marker write until the draft is final.** Complete the retitle, optional draft-quality edits, and any `supersedes:` declaration before cognitive review. A matching substance-confirm answer then authorises `human-oversight: confirmed` as the final content write in Step 5b. This ordering is required because a confirmed ADR is immutable. AFK iter subprocesses spawned via `claude -p` have no `request_user_input` access; they MUST leave `human-oversight: unconfirmed` for the interactive drain.
|
|
266
280
|
|
|
267
281
|
**the structured governance interaction rule Rule 6 carve-out audit (the AFK question queue-and-continue rule, 2026-06-06 amendment)**: the universal AFK default is queue-and-continue. This Step 5 substance-confirm HALT-and-write-`human-oversight: unconfirmed` shape is a documented carve-out, authorised by **the ratify substance before dependent work rule** (Confirm decision substance before building dependent work). Rationale: an ADR with `human-oversight: confirmed` enters the world born-confirmed (it does not appear in `/wr-architect:review-decisions`' unoversighted set), so dependent work — every implementation that cites this ADR as authority — would be built on substance that was never user-affirmed. AFK writing `human-oversight: unconfirmed` IS the queue-and-continue shape: the loop continues; the substance-confirm decision is queued to the next interactive drain. Persona-correct for the unattended backlog progress user outcome; the carve-out is from the auto-confirm shape, not from queue-and-continue itself.
|
|
268
282
|
|
|
@@ -270,14 +284,14 @@ options:
|
|
|
270
284
|
|
|
271
285
|
- DO NOT write the marker.
|
|
272
286
|
- Re-draft Decision Outcome + Consequences + Confirmation + Pros and Cons (and Reassessment Criteria if affected) against the newly-chosen option.
|
|
273
|
-
-
|
|
287
|
+
- Return to Step 4.5, re-run cognitive accessibility review until `PASS`, and re-present the summary, ADR file, and substance-confirm `request_user_input`.
|
|
274
288
|
- The marker writes ONLY after a substance-confirm pass whose answer matches the draft on disk.
|
|
275
289
|
|
|
276
290
|
This is NOT a soft "warn and proceed" path — the marker only ever writes when the draft on disk encodes the user's substantive pick. Mismatch is a re-draft trigger, not an override.
|
|
277
291
|
|
|
278
|
-
**Retitle-
|
|
292
|
+
**Retitle-before-review check (the outcome-shaped ADR title requirement — the decision-delegation rule category-4 silent-framework).** In Step 4.5, check the on-disk filename slug for a question-shape pattern (`-vs-`, `should-`, `whether-`, `-or-`). If matched, the title was derived at intake against a question-shaped problem-statement and must be retitled to the outcome recorded in the draft before cognitive review. The convention is named in Step 2a above.
|
|
279
293
|
|
|
280
|
-
This step is **mechanical — no request_user_input fires** (per the inverse over-ask guard). The chosen option is
|
|
294
|
+
This step is **mechanical — no request_user_input fires** (per the inverse over-ask guard). The draft's recorded chosen option is already known; derive the outcome slug from its short name via the same `derive_kebab_slug` helper Step 2's Title derivation uses (`<architect-plugin-root>/lib/derive-first-dispatch.sh`). Sequence:
|
|
281
295
|
|
|
282
296
|
1. Derive `new_slug = derive_kebab_slug "<chosen option short name>"`.
|
|
283
297
|
2. Edit the H1 in the on-disk file to the new outcome shape (H1 stays human-readable Title Case; the slug is for the filename).
|
|
@@ -289,28 +303,9 @@ If the on-disk slug does NOT match a question-shape pattern (already outcome-sha
|
|
|
289
303
|
|
|
290
304
|
(Serves the automated governance user outcome — outcome-shaped on-disk title; category-4 silent-framework per the decision-delegation rule.)
|
|
291
305
|
|
|
292
|
-
#### 5b.
|
|
293
|
-
|
|
294
|
-
After the substance-confirm fire passes, fire a separate narrow `request_user_input` for draft-quality review before writing the marker:
|
|
306
|
+
#### 5b. Write the confirmation marker last
|
|
295
307
|
|
|
296
|
-
|
|
297
|
-
2. Are the pros/cons fair and complete?
|
|
298
|
-
3. Are the confirmation criteria testable?
|
|
299
|
-
4. Should anyone else be listed as consulted or informed?
|
|
300
|
-
|
|
301
|
-
Apply any feedback by editing the file. This fire is OPTIONAL — when the agent has high confidence the prose is sound and the consulted/informed list is complete, this fire MAY be skipped. It runs before the marker write because a confirmed ADR is immutable. Draft-quality answers do not decide whether confirmation is allowed; the earlier substance-confirm answer does.
|
|
302
|
-
|
|
303
|
-
#### 5c. Prepare supersession (if applicable)
|
|
304
|
-
|
|
305
|
-
If this decision replaces an existing one:
|
|
306
|
-
|
|
307
|
-
1. Add `supersedes: [NNN-old-decision-title]` to the new decision's frontmatter.
|
|
308
|
-
2. Rename the old decision file from `.accepted.md` (or `.proposed.md`) to `.superseded.md` using `git mv`.
|
|
309
|
-
3. Do not edit the old decision's frontmatter or body. Its content is the immutable historical record; the filename and the new decision's `supersedes:` entry carry the lifecycle transition. This removes the rename-and-stage ordering failure staging trap because there is no post-rename edit to re-stage.
|
|
310
|
-
|
|
311
|
-
#### 5d. Write the confirmation marker last
|
|
312
|
-
|
|
313
|
-
Only after every draft edit is complete, call the marker-evidence helper and insert the confirmation lines:
|
|
308
|
+
Only after a matching substance selection, with no ADR edit since the final cognitive accessibility `PASS`, call the marker-evidence helper and insert the confirmation lines:
|
|
314
309
|
|
|
315
310
|
```bash
|
|
316
311
|
bash "<architect-plugin-root>/scripts/mark-oversight-confirmed.sh" docs/decisions/<NNN>-<slug>.proposed.md
|
|
@@ -325,6 +320,8 @@ oversight-date: YYYY-MM-DD # today
|
|
|
325
320
|
|
|
326
321
|
The PostToolUse hook writes the session-scoped evidence marker consumed by `architect-oversight-marker-discipline.sh`. Calling the helper without a real substance-confirm event is forbidden. Once these lines land, do not edit the ADR body or clear the marker; a later choice requires a new superseding ADR.
|
|
327
322
|
|
|
323
|
+
If the new ADR supersedes an older decision, now rename the older file to `*.superseded.md` with `git mv`. Do not edit the old decision's frontmatter or body. This eliminates the rename-and-stage ordering failure staging trap: there is no post-rename edit.
|
|
324
|
+
|
|
328
325
|
**Refresh the decisions compendium (the decisions-compendium load rule).** After the ADR file is written and any born-confirmed marker is applied, regenerate `docs/decisions/README.md` so the architect-agent routine load surface includes the new entry. Run:
|
|
329
326
|
|
|
330
327
|
```bash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-decisions
|
|
3
|
-
description: Drain the set of recorded decisions (ADRs) that lack human oversight.
|
|
4
|
-
allowed-tools: Read, Glob, Grep, Bash, Edit, request_user_input
|
|
3
|
+
description: Drain the set of recorded decisions (ADRs) that lack human oversight. Cognitively reviews each ADR before surfacing its chosen option and alternatives via request_user_input so a human confirms, amends, or rejects the auto-made call; writes the human-oversight marker only after confirmation. Use when the session-start nudge reports decisions lack oversight, or any time you want to review recorded decisions.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash, Edit, request_user_input, Agent
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated from the Claude skill source during npm pack. -->
|
|
@@ -46,15 +46,26 @@ The `bash "<architect-plugin-root>/scripts/detect-unoversighted.sh"` command is
|
|
|
46
46
|
|
|
47
47
|
Read **only the frontmatter + title + Decision Outcome** of each unoversighted ADR (not full bodies — keep it cheap). Group by topic cluster (e.g. release-cadence, governance-gates, AFK-orchestration, decision-recording) and order **load-bearing first**: ADRs that other ADRs cite as parents, that are `accepted` (already shipped — highest drift cost if the auto-pick was wrong), or that govern a hook/gate the user interacts with daily. Defer narrow / low-coupling ADRs.
|
|
48
48
|
|
|
49
|
+
### Step 2.5: Cognitive-accessibility review before ratification
|
|
50
|
+
|
|
51
|
+
For each ADR, read `../../references/cognitive-accessibility-rubric.md`, relative to this `SKILL.md`, and the complete unconfirmed ADR. Supply both in the reviewer prompt.
|
|
52
|
+
|
|
53
|
+
- **Claude Code:** run a fresh `claude -p --agent accessibility-agents:cognitive-accessibility --tools "" --permission-mode dontAsk` subprocess. Pipe the rubric and ADR bytes to stdin; never interpolate ADR text into a shell command. The empty tool set prevents the external agent from changing project files. If the command is unavailable or exits nonzero, repeat with `--agent wr-architect:cog-a11y`. If that also fails, stop before presenting the ADR.
|
|
54
|
+
- **Codex:** use the native subagent tool with `cognitive-accessibility` only when the runtime confirms its sandbox is read-only. Otherwise treat it as unavailable. Fall back to `wr-architect-cog-a11y`, whose installed configuration must also confirm `sandbox_mode = "read-only"`. If neither read-only reviewer runs, stop before presenting the ADR.
|
|
55
|
+
|
|
56
|
+
`ISSUES FOUND` never activates the fallback. Apply only clarity fixes that preserve the decision, then re-run the same review path. If a suggested fix could change the decision, stop for user direction. Continue only on `PASS`.
|
|
57
|
+
|
|
58
|
+
After the final `PASS`, do not edit the ADR before presenting its summary, the ADR file, and the structured ratification question. The pass applies only to this workflow run and gets no persistent marker.
|
|
59
|
+
|
|
49
60
|
### Step 3: Present each decision via request_user_input (batched)
|
|
50
61
|
|
|
51
|
-
For each ADR in
|
|
62
|
+
For each ADR that passed Step 2.5, present these three parts in order: a short plain-language summary, the ADR file itself, then an `request_user_input`. A filesystem path is not a substitute for presenting the file. Cap each structured call at **4 ADRs** per the structured governance interaction rule Rule 1; issue further calls sequentially. For each ADR:
|
|
52
63
|
|
|
53
64
|
- **Question**: the decision the ADR records (its Decision Outcome, in one line).
|
|
54
65
|
- **Context**: the chosen option + the alternatives the ADR considered (grounded in the ADR's Considered Options section per the grounded agent-output rule), and any cited parent ADRs.
|
|
55
66
|
- **Options** (per ADR):
|
|
56
67
|
- **Confirm** — the recorded decision is correct; write the marker.
|
|
57
|
-
- **Amend** — the decision is mostly right but needs a change; capture the change,
|
|
68
|
+
- **Amend** — the decision is mostly right but needs a change; capture and apply the change, then review and present it again before confirmation can write the marker.
|
|
58
69
|
- **Reject / supersede** — the auto-made pick is wrong; capture the supersede ticket (see Step 4) and write the **rejected-pending-supersede** marker so the drain stops re-asking.
|
|
59
70
|
- **Defer** — skip this sitting; leave unoversighted for a later run.
|
|
60
71
|
|
|
@@ -76,7 +87,8 @@ This is a genuine human-decision surface (the whole point of the unpinned archit
|
|
|
76
87
|
|
|
77
88
|
### Step 4: Apply the outcome
|
|
78
89
|
|
|
79
|
-
- **Confirm
|
|
90
|
+
- **Confirm**: run `bash "<architect-plugin-root>/scripts/mark-oversight-confirmed.sh" <adr-path>` as a standalone Bash command; do not combine it with another command, because its PostToolUse event binds the evidence to this exact session and ADR. Then write `human-oversight: confirmed` + `oversight-date: <today, YYYY-MM-DD>` into the ADR's frontmatter (insert after the `date:` line if absent; never duplicate). Confirmation is the final content write.
|
|
91
|
+
- **Amend**: apply the directed change, then return to Step 2.5. Obtain another cognitive accessibility `PASS` and re-present the summary, ADR file, and structured question. Do not write the oversight marker until a later Confirm answer matches the reviewed ADR.
|
|
80
92
|
- **Reject / supersede** (the architecture human-oversight rule amendment per the rejected-decision drain recurrence):
|
|
81
93
|
1. Capture the supersede ticket via a follow-up `request_user_input`: "Which problem ticket tracks the supersede?" — options: existing `P<NNN>` IDs surfaced from `docs/problems/`, **Capture a new ticket** (delegate to `/wr-itil:capture-problem`), or **Defer (leave un-tracked for now)**.
|
|
82
94
|
2. If a ticket ID is captured, write `human-oversight: rejected-pending-supersede` + `supersede-ticket: P<NNN>` into the ADR's frontmatter. The detector excludes ADRs carrying both, so the drain stops re-asking until either the successor lands (the rejected file is renamed to `*.superseded.md` without rewriting its content) or the rejection is revisited.
|