@crown-dev-studios/review-council 0.1.0 → 0.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.
- package/README.md +48 -80
- package/SKILL.md +95 -209
- package/dist/cli.js +0 -0
- package/dist/orchestrate-review-council.js +88 -156
- package/dist/render-review-html.js +90 -7
- package/dist/review-session.js +4 -51
- package/package.json +25 -17
- package/references/cli-integration.md +38 -95
- package/references/output-contract.md +36 -46
- package/schemas/judge-verdict.schema.json +33 -9
- package/schemas/review-findings.schema.json +0 -8
- package/templates/judge.md +50 -10
- package/templates/report.html +47 -27
- package/templates/reviewer-export.md +2 -8
- package/dist/schemas.js +0 -67
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# Review Council
|
|
2
2
|
|
|
3
|
-
Review Council is a
|
|
3
|
+
Review Council is a standalone skill repo for model-parallel code review. It runs Claude and Codex in parallel with selected skill references (architecture-review, testing-philosophy, plan-compliance) passed into reviewer prompts as additional review lenses, then synthesizes all findings through an LLM judge with semantic deduplication, contradiction detection, and dependency ordering.
|
|
4
4
|
|
|
5
5
|
Use it when you want:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- a static HTML report plus machine-readable JSON output
|
|
7
|
+
- model-parallel review where Claude and Codex each independently apply specialized review skills
|
|
8
|
+
- a judge that deduplicates across both models, detects contradictions, and orders findings by dependency
|
|
9
|
+
- automated self-review integrated into agentic workflows
|
|
11
10
|
|
|
12
11
|
## Status
|
|
13
12
|
|
|
@@ -15,7 +14,6 @@ The orchestrator handles the happy path and common failure modes:
|
|
|
15
14
|
|
|
16
15
|
- Stage timeouts with two-phase kill (SIGTERM then SIGKILL) prevent hung runs
|
|
17
16
|
- Automatic retry with exponential backoff handles transient failures
|
|
18
|
-
- Schema validation catches malformed reviewer and judge output
|
|
19
17
|
- Interactive prompts from reviewer CLIs are detected and relayed to the user
|
|
20
18
|
- Partial reviewer failure still allows the judge to run on available data
|
|
21
19
|
- Failed stages surface stderr excerpts and validation errors in the HTML report
|
|
@@ -23,24 +21,14 @@ The orchestrator handles the happy path and common failure modes:
|
|
|
23
21
|
## Requirements
|
|
24
22
|
|
|
25
23
|
- Node.js 20+
|
|
24
|
+
- `pnpm` 10.30.3+
|
|
26
25
|
- `claude` and/or `codex` on `PATH`
|
|
27
26
|
- a Git working tree to review
|
|
28
|
-
- reviewer CLIs authenticated and able to run non-interactively when possible
|
|
29
27
|
|
|
30
28
|
## Install
|
|
31
29
|
|
|
32
|
-
Run it directly:
|
|
33
|
-
|
|
34
30
|
```bash
|
|
35
|
-
npx @crown-dev-studios/review-council --
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Other package install paths:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
pnpm dlx @crown-dev-studios/review-council --help
|
|
42
|
-
npm install -g @crown-dev-studios/review-council
|
|
43
|
-
review-council --help
|
|
31
|
+
npx @crown-dev-studios/review-council --target "staged changes" --open-html
|
|
44
32
|
```
|
|
45
33
|
|
|
46
34
|
## Quick Start
|
|
@@ -50,62 +38,48 @@ From the project root you want to review:
|
|
|
50
38
|
```bash
|
|
51
39
|
npx @crown-dev-studios/review-council \
|
|
52
40
|
--target "staged changes" \
|
|
53
|
-
--
|
|
54
|
-
--claude-command 'claude -p --disable-slash-commands --permission-mode acceptEdits "$(cat "$CLAUDE_DIR/claude-review-export.md")" < /dev/null' \
|
|
55
|
-
--codex-command 'codex exec --sandbox workspace-write -o "$CODEX_DIR/last-message.txt" "$(cat "$CODEX_DIR/codex-review-export.md")"' \
|
|
56
|
-
--judge-command 'codex exec --sandbox workspace-write -o "$JUDGE_DIR/last-message.txt" "$(cat "$JUDGE_DIR/judge.md")"'
|
|
41
|
+
--open-html
|
|
57
42
|
```
|
|
58
43
|
|
|
59
|
-
That
|
|
44
|
+
That's it. Claude + Codex review in parallel, Codex judge, HTML report opens in your browser. Output goes to `docs/reviews/<run-id>/`.
|
|
60
45
|
|
|
61
46
|
Main outputs:
|
|
62
47
|
|
|
63
48
|
- `judge/summary.md`
|
|
64
49
|
- `judge/verdict.json`
|
|
50
|
+
- `follow-ups.md`
|
|
65
51
|
- `bundle.json`
|
|
66
52
|
- `index.html`
|
|
67
53
|
|
|
68
|
-
## Skill Install
|
|
69
|
-
|
|
70
|
-
Optional: install it as a slash-invocable skill by copying or symlinking this directory:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
cp -R ~/src/review-council ~/.claude/skills/review-council
|
|
74
|
-
cp -R ~/src/review-council ~/.codex/skills/review-council
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The skill docs and the published package describe the same runtime: invoke `npx @crown-dev-studios/review-council ...` from the repo you want to review so outputs stay rooted in that caller repo.
|
|
78
|
-
|
|
79
54
|
## CLI Options
|
|
80
55
|
|
|
81
56
|
```
|
|
82
57
|
--target <target> Review target label (required)
|
|
83
|
-
--review-id <id> Stable review identifier
|
|
84
58
|
--run-dir <dir> Output directory for this run
|
|
85
|
-
--
|
|
86
|
-
--
|
|
87
|
-
--claude-prompt-template <path> Override Claude reviewer prompt template
|
|
88
|
-
--codex-prompt-template <path> Override Codex reviewer prompt template
|
|
89
|
-
--judge-prompt-template <path> Override judge prompt template
|
|
90
|
-
--claude-command <command> Shell command for the Claude reviewer
|
|
91
|
-
--codex-command <command> Shell command for the Codex reviewer
|
|
92
|
-
--judge-command <command> Shell command for the judge stage
|
|
93
|
-
--allow-missing-sentinel Treat exit code 0 as success without done.json
|
|
59
|
+
--no-claude Skip Claude reviewer
|
|
60
|
+
--no-codex Skip Codex reviewer
|
|
94
61
|
--skip-judge Skip the judge stage
|
|
95
|
-
--
|
|
62
|
+
--skill-paths <paths> Comma-separated paths to skill directories
|
|
96
63
|
--open-html Open index.html after rendering (macOS)
|
|
64
|
+
--skip-html Skip HTML rendering
|
|
97
65
|
--timeout <ms> Stage timeout in ms (default: 300000)
|
|
98
66
|
--retries <n> Max retries per stage on failure (default: 2)
|
|
99
67
|
```
|
|
100
68
|
|
|
101
|
-
|
|
69
|
+
### Overrides (optional)
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
--claude-command <command> Override default Claude reviewer command
|
|
73
|
+
--codex-command <command> Override default Codex reviewer command
|
|
74
|
+
--judge-command <command> Override default judge command
|
|
75
|
+
--allow-missing-sentinel Treat exit code 0 as success without done.json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Operational Rules
|
|
102
79
|
|
|
103
80
|
- Use non-interactive reviewer commands when possible. Interactive prompts are detected and relayed to the user, but explicit non-interactive mode is more reliable.
|
|
104
|
-
- Use `claude -p --disable-slash-commands --permission-mode acceptEdits ... < /dev/null` for Claude reviewer runs. This keeps the run in headless mode, disables skills, allows artifact writes into the stage directory without interactive approval prompts, and prevents Claude from waiting on stdin during fully non-interactive runs.
|
|
105
|
-
- Codex reviewer and judge commands must run with a writable sandbox, for example `codex exec --sandbox workspace-write ...`, because they need to write review artifacts into the run directory.
|
|
106
|
-
- `--skip-judge` disables judge prompt rendering, judge command validation, and judge execution.
|
|
107
81
|
- Keep reviewer artifacts inside the run directory.
|
|
108
|
-
-
|
|
82
|
+
- Selected skills are passed into reviewer prompts as additional review lenses for the run; the orchestrator does not inline local `SKILL.md` contents.
|
|
109
83
|
- Do not create authoritative files in `todos/` during raw review.
|
|
110
84
|
- If you reuse `workflows-review`, run each reviewer in a separate worktree.
|
|
111
85
|
|
|
@@ -118,53 +92,47 @@ If a run fails or stalls, inspect:
|
|
|
118
92
|
- `<run>/judge/status.json`
|
|
119
93
|
- each stage's `stdout.log` and `stderr.log`
|
|
120
94
|
|
|
121
|
-
The `status.json` for each stage includes `
|
|
95
|
+
The `status.json` for each stage includes `exit_code`, `timed_out`, `attempts`, `retried`, and `validation_errors` fields. The HTML report surfaces stderr excerpts and validation errors for failed stages in a diagnostics section.
|
|
122
96
|
|
|
123
97
|
If a stage exits `0` but does not write `done.json`, the stage is incomplete and the run should be treated as failed.
|
|
124
98
|
|
|
125
|
-
##
|
|
99
|
+
## Publishing (maintainers)
|
|
126
100
|
|
|
127
|
-
|
|
101
|
+
Canonical release version lives in the [`VERSION`](VERSION) file and must match `version` in [`package.json`](package.json).
|
|
128
102
|
|
|
129
|
-
|
|
130
|
-
cd ~/src/review-council
|
|
131
|
-
pnpm install
|
|
132
|
-
pnpm typecheck
|
|
133
|
-
pnpm test
|
|
134
|
-
```
|
|
103
|
+
**Prerequisites**
|
|
135
104
|
|
|
136
|
-
|
|
105
|
+
- [`npm login`](https://docs.npmjs.com/cli/v11/commands/npm-login) (or another auth method `pnpm publish` can use for the public registry)
|
|
106
|
+
- A **clean** git working tree in this repository
|
|
107
|
+
- Git tag `vX.Y.Z` present locally before deploy (created by the bump script or manually)
|
|
108
|
+
- Permission to publish `@crown-dev-studios/review-council` on npm
|
|
137
109
|
|
|
138
|
-
|
|
139
|
-
pnpm verify:package
|
|
140
|
-
```
|
|
110
|
+
**Scripts (same idea as `simple-auth`)**
|
|
141
111
|
|
|
142
|
-
|
|
112
|
+
| Step | Command |
|
|
113
|
+
|------|---------|
|
|
114
|
+
| Preflight only (build, test, pack dry-run) | `pnpm run release:preflight` or `./scripts/prepare-release.sh` |
|
|
115
|
+
| Confirm `VERSION` ↔ `package.json` | `pnpm run release:check-version` or `./scripts/check-version.sh` |
|
|
116
|
+
| Require local tag exists | `./scripts/check-version.sh --require-tag` |
|
|
117
|
+
| Bump version, refresh lockfile, commit + tag (+ push) | `pnpm run release:bump -- patch` (or `major` / `minor` / `1.2.3`) |
|
|
118
|
+
| Publish to npm | `pnpm run release:deploy` or `./scripts/deploy.sh` |
|
|
143
119
|
|
|
144
|
-
|
|
145
|
-
- inspects `npm pack --dry-run` output with a repo-local npm cache
|
|
146
|
-
- installs the local tarball into a temporary caller repo
|
|
147
|
-
- verifies `review-council --help` and a minimal end-to-end run
|
|
120
|
+
**Typical release**
|
|
148
121
|
|
|
149
|
-
|
|
122
|
+
1. `./scripts/bump-version.sh patch` — updates `VERSION`, `package.json`, `pnpm-lock.yaml`, commits, tags `v…`, pushes (omit `--no-push` / `--no-tag` as needed).
|
|
123
|
+
2. `./scripts/check-version.sh --require-tag`
|
|
124
|
+
3. `./scripts/deploy.sh --dry-run` (optional)
|
|
125
|
+
4. `./scripts/deploy.sh` — pushes branch + tag (unless `--skip-git`), runs install/build/test/verify, then `pnpm publish --access public`.
|
|
150
126
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
npx @crown-dev-studios/review-council --help
|
|
155
|
-
```
|
|
127
|
+
Options: `./scripts/deploy.sh --dry-run` (no push/publish), `./scripts/deploy.sh --skip-git` (publish only; you already pushed).
|
|
128
|
+
|
|
129
|
+
Update [`package.json`](package.json) `repository` / `homepage` / `bugs` if the GitHub repo URL differs from `@crown-dev-studios/review-council` on GitHub.
|
|
156
130
|
|
|
157
131
|
## Files
|
|
158
132
|
|
|
159
133
|
- [SKILL.md](SKILL.md)
|
|
160
134
|
- [references/cli-integration.md](references/cli-integration.md)
|
|
161
135
|
- [references/output-contract.md](references/output-contract.md)
|
|
162
|
-
- [src/cli.ts](src/cli.ts)
|
|
163
136
|
- [src/orchestrate-review-council.ts](src/orchestrate-review-council.ts)
|
|
164
137
|
- [src/render-review-html.ts](src/render-review-html.ts)
|
|
165
138
|
- [src/interaction-queue.ts](src/interaction-queue.ts)
|
|
166
|
-
- [src/review-session.ts](src/review-session.ts)
|
|
167
|
-
- [src/schemas.ts](src/schemas.ts)
|
|
168
|
-
- [src/types.ts](src/types.ts)
|
|
169
|
-
- [test/package-smoke.test.mjs](test/package-smoke.test.mjs)
|
|
170
|
-
- [test/validate-schema.test.ts](test/validate-schema.test.ts)
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-council
|
|
3
|
-
description: Orchestrate
|
|
3
|
+
description: Orchestrate model-parallel code review with selected skill references. Runs Claude and Codex in parallel with those skill references listed in reviewer prompts as additional review lenses, then synthesizes all findings through an LLM judge with semantic deduplication, contradiction detection, and dependency ordering.
|
|
4
4
|
argument-hint: [staged|branch main..HEAD|pr 123|commit abc123]
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
---
|
|
@@ -9,254 +9,140 @@ disable-model-invocation: true
|
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
`/review-council`
|
|
12
|
+
`/review-council` orchestrates multi-source code review:
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- **Model reviewers** (Claude + Codex) provide general-purpose parallel review via CLI processes
|
|
15
|
+
- **Selected review skills** (architecture-review, testing-philosophy, plan-compliance) are listed in each model reviewer's prompt for that run
|
|
16
|
+
- **Judge** synthesizes all findings with semantic dedup, contradiction detection, and dependency ordering
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- `workflows-review` is optimized for single-agent review and immediate todo creation
|
|
19
|
-
- `review-council` is optimized for parallel raw review, adjudication, and artifact rendering
|
|
20
|
-
|
|
21
|
-
Use this when you want:
|
|
22
|
-
|
|
23
|
-
- a Claude review and a Codex review on the same target
|
|
24
|
-
- isolated worktrees or isolated CLI runs per reviewer
|
|
25
|
-
- raw reviewer artifacts stored outside `todos/`
|
|
26
|
-
- a judge step that decides which findings are valid
|
|
27
|
-
- a static HTML page next to the final markdown judge summary
|
|
18
|
+
All reviewers run in parallel. The judge adjudicates the combined results. A static HTML report is rendered for human review.
|
|
28
19
|
|
|
29
20
|
## Prerequisites
|
|
30
21
|
|
|
31
|
-
- Node.js
|
|
32
|
-
- `claude` and/or `codex` on `PATH` for
|
|
22
|
+
- Node.js and pnpm (for the TS orchestrator)
|
|
23
|
+
- `claude` and/or `codex` on `PATH` for model reviewers
|
|
33
24
|
- A Git working tree to review
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
## Quick Start
|
|
25
|
+
- Skill directories available for `--skill-paths` (e.g., `~/.agents/skills/architecture-review`)
|
|
37
26
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
2. Optional: install it as a slash-invocable skill by copying or symlinking this directory to one or both skill locations:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
cp -R ~/src/review-council ~/.claude/skills/review-council
|
|
44
|
-
cp -R ~/src/review-council ~/.codex/skills/review-council
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
3. Review or customize the command templates in [cli-integration.md](references/cli-integration.md).
|
|
48
|
-
|
|
49
|
-
No external `/review-export` command is required. The orchestrator renders self-contained prompt files into each stage directory before launching reviewer CLIs.
|
|
50
|
-
|
|
51
|
-
4. From the project root you want to review, run the published CLI. By default it writes each run under `docs/reviews/<review-id>/runs/<run-id>/` in the current project:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npx @crown-dev-studios/review-council \
|
|
55
|
-
--target "staged changes" \
|
|
56
|
-
--review-id staged-changes-review \
|
|
57
|
-
--claude-command 'claude -p --disable-slash-commands --permission-mode acceptEdits "$(cat "$CLAUDE_DIR/claude-review-export.md")" < /dev/null' \
|
|
58
|
-
--codex-command 'codex exec --sandbox workspace-write -o "$CODEX_DIR/last-message.txt" "$(cat "$CODEX_DIR/codex-review-export.md")"' \
|
|
59
|
-
--judge-command 'codex exec --sandbox workspace-write -o "$JUDGE_DIR/last-message.txt" "$(cat "$JUDGE_DIR/judge.md")"' \
|
|
60
|
-
--timeout 300000 \
|
|
61
|
-
--retries 2
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
- `--timeout <ms>`: per-stage timeout (default 300000 — 5 minutes). On timeout the process receives SIGTERM, then SIGKILL after a 5-second grace period.
|
|
65
|
-
- `--retries <n>`: max retries per stage on non-timeout failure (default 2). Uses exponential backoff starting at 2 seconds.
|
|
66
|
-
- For Claude reviewer runs, use `claude -p --disable-slash-commands --permission-mode acceptEdits ... < /dev/null`. This keeps the run headless, disables skills, allows artifact writes into the stage directory without interactive approval prompts, and avoids stdin wait warnings.
|
|
67
|
-
- When using Codex for reviewer or judge stages, include `--sandbox workspace-write` so it can write artifacts into the run directory.
|
|
68
|
-
- `--skip-judge` disables judge prompt rendering, judge command validation, and judge execution.
|
|
69
|
-
- Pass `--review-id` explicitly when you want the same review to be easy to correlate across reruns.
|
|
70
|
-
|
|
71
|
-
If the package is already installed globally, `review-council --target ...` is equivalent.
|
|
27
|
+
## Workflow
|
|
72
28
|
|
|
73
|
-
###
|
|
29
|
+
### Step 1: Scope Detection
|
|
74
30
|
|
|
75
|
-
|
|
31
|
+
Normalize the argument into one of these forms:
|
|
76
32
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
pnpm test
|
|
82
|
-
pnpm verify:package
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
This produces:
|
|
86
|
-
|
|
87
|
-
- `docs/reviews/<review-id>/runs/<run-id>/judge/summary.md`
|
|
88
|
-
- `docs/reviews/<review-id>/runs/<run-id>/judge/verdict.json`
|
|
89
|
-
- `docs/reviews/<review-id>/runs/<run-id>/bundle.json`
|
|
90
|
-
- `docs/reviews/<review-id>/runs/<run-id>/index.html`
|
|
91
|
-
|
|
92
|
-
### Example findings.json
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
{
|
|
96
|
-
"review_id": "staged-changes-review",
|
|
97
|
-
"run_id": "20260318-143000123-abc12345",
|
|
98
|
-
"reviewer": "claude",
|
|
99
|
-
"target": "staged changes",
|
|
100
|
-
"generated_at": "2026-03-07T18:30:00Z",
|
|
101
|
-
"summary": "Found two issues: one SQL injection and one missing index.",
|
|
102
|
-
"findings": [
|
|
103
|
-
{
|
|
104
|
-
"id": "F001",
|
|
105
|
-
"title": "SQL injection in search endpoint",
|
|
106
|
-
"severity": "p1",
|
|
107
|
-
"confidence": "high",
|
|
108
|
-
"category": "security",
|
|
109
|
-
"description": "Unsanitized user input passed directly to raw SQL query.",
|
|
110
|
-
"evidence": "db.query(`SELECT * FROM users WHERE name = '${input}'`)",
|
|
111
|
-
"recommended_fix": "Use parameterized queries instead of string interpolation.",
|
|
112
|
-
"files": [
|
|
113
|
-
{ "path": "src/routes/search.ts", "line": 42 }
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"id": "F002",
|
|
118
|
-
"title": "Missing index on users.email",
|
|
119
|
-
"severity": "p3",
|
|
120
|
-
"confidence": "medium",
|
|
121
|
-
"category": "performance",
|
|
122
|
-
"description": "The users.email column is queried frequently but has no index.",
|
|
123
|
-
"evidence": "Query plan shows sequential scan on users table.",
|
|
124
|
-
"recommended_fix": "Add a B-tree index on users.email.",
|
|
125
|
-
"files": [
|
|
126
|
-
{ "path": "db/migrations/001_create_users.sql" }
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
```
|
|
33
|
+
- `staged changes` — review staged (cached) changes
|
|
34
|
+
- `branch main..feature-branch` — review branch diff
|
|
35
|
+
- `pr 123` — review a pull request
|
|
36
|
+
- `commit abc123` — review a specific commit
|
|
132
37
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"run_id": "20260318-143000123-abc12345",
|
|
139
|
-
"target": "staged changes",
|
|
140
|
-
"generated_at": "2026-03-07T14:30:00Z",
|
|
141
|
-
"overall_verdict": "needs-fixes",
|
|
142
|
-
"summary_markdown": "Two confirmed issues require attention before merge.",
|
|
143
|
-
"confirmed_findings": [
|
|
144
|
-
{
|
|
145
|
-
"title": "SQL injection in search endpoint",
|
|
146
|
-
"status": "confirmed",
|
|
147
|
-
"reason": "Both reviewers flagged unsanitized user input passed to raw query.",
|
|
148
|
-
"final_priority": "p1",
|
|
149
|
-
"reviewer_ids": ["claude", "codex"]
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
"contested_findings": [
|
|
153
|
-
{
|
|
154
|
-
"title": "Missing index on users.email",
|
|
155
|
-
"status": "contested",
|
|
156
|
-
"reason": "Claude flagged as p2 but Codex noted the table has <1k rows.",
|
|
157
|
-
"final_priority": "p3",
|
|
158
|
-
"reviewer_ids": ["claude"]
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"rejected_findings": [
|
|
162
|
-
{
|
|
163
|
-
"title": "Unused import in helpers.ts",
|
|
164
|
-
"status": "rejected",
|
|
165
|
-
"reason": "Import is used in a type-only context; no runtime impact."
|
|
166
|
-
}
|
|
167
|
-
],
|
|
168
|
-
"todo_recommendations": [
|
|
169
|
-
{
|
|
170
|
-
"title": "Parameterize search query to prevent SQL injection",
|
|
171
|
-
"priority": "p1",
|
|
172
|
-
"reason": "Confirmed by both reviewers as a security vulnerability."
|
|
173
|
-
}
|
|
174
|
-
]
|
|
175
|
-
}
|
|
176
|
-
```
|
|
38
|
+
Generate the diff for analysis:
|
|
39
|
+
- Staged: `git diff --cached`
|
|
40
|
+
- Branch: `git diff main..HEAD`
|
|
41
|
+
- PR: `gh pr diff 123`
|
|
42
|
+
- Commit: `git show abc123`
|
|
177
43
|
|
|
178
|
-
|
|
44
|
+
### Step 2: Intent Discovery
|
|
179
45
|
|
|
180
|
-
|
|
46
|
+
Analyze the diff to understand what changed and guide reviewer selection:
|
|
181
47
|
|
|
182
|
-
|
|
48
|
+
1. **Categorize changed files:** source code, tests, config, docs, migrations, schemas.
|
|
49
|
+
2. **Identify modules/services touched:** which packages, directories, or service boundaries are affected.
|
|
50
|
+
3. **Classify change nature:** new feature, bug fix, refactor, test addition, config change.
|
|
51
|
+
4. **Gather stated intent:**
|
|
52
|
+
- PR mode: read the PR description and linked issues.
|
|
53
|
+
- Branch mode: read commit messages.
|
|
54
|
+
5. **Check for a plan:** look in `docs/plans/active/` and `docs/plans/` for a plan that references the changed files.
|
|
183
55
|
|
|
184
|
-
|
|
185
|
-
- `branch main..feature-branch`
|
|
186
|
-
- `pr 123`
|
|
187
|
-
- `commit abc123`
|
|
56
|
+
Output a brief intent summary that will be included in all reviewer prompts.
|
|
188
57
|
|
|
189
|
-
### Step
|
|
58
|
+
### Step 3: Select Review Skills
|
|
190
59
|
|
|
191
|
-
|
|
60
|
+
Based on intent discovery, select which review skills to include:
|
|
192
61
|
|
|
193
|
-
|
|
62
|
+
| Signal | Skill |
|
|
63
|
+
|--------|-------|
|
|
64
|
+
| Service boundary, data model, or migration files changed | `architecture-review` |
|
|
65
|
+
| Test files or test-adjacent source code changed | `testing-philosophy` |
|
|
66
|
+
| Plan exists in `docs/plans/` or ticket has a linked plan | `plan-compliance` |
|
|
194
67
|
|
|
195
|
-
|
|
196
|
-
2. Spawn reviewer CLIs with explicit commands
|
|
197
|
-
3. Wait for both reviewers to finish
|
|
198
|
-
4. Confirm each reviewer wrote `done.json`
|
|
199
|
-
5. Run the judge step
|
|
200
|
-
6. Render HTML
|
|
68
|
+
If the diff is trivial (<20 lines, single file, obvious fix), skip additional review skills.
|
|
201
69
|
|
|
202
|
-
|
|
70
|
+
### Step 4: Run Review
|
|
203
71
|
|
|
204
|
-
|
|
72
|
+
Run the orchestrator with `--skill-paths` pointing at the selected skill directories:
|
|
205
73
|
|
|
206
|
-
|
|
74
|
+
```bash
|
|
75
|
+
npx @crown-dev-studios/review-council \
|
|
76
|
+
--target "<target>" \
|
|
77
|
+
--skill-paths "/path/to/architecture-review,/path/to/plan-compliance" \
|
|
78
|
+
--open-html
|
|
79
|
+
```
|
|
207
80
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
81
|
+
This single invocation:
|
|
82
|
+
1. Lists the selected review skills in both Claude and Codex reviewer prompts
|
|
83
|
+
2. Runs Claude + Codex in parallel — each applies the selected skills independently
|
|
84
|
+
3. Runs the judge to merge, deduplicate, and resolve contradictions across both outputs
|
|
85
|
+
4. Renders the HTML report
|
|
211
86
|
|
|
212
|
-
|
|
87
|
+
Use `--no-claude` or `--no-codex` to skip one model reviewer.
|
|
213
88
|
|
|
214
|
-
|
|
89
|
+
The judge performs:
|
|
90
|
+
- **Semantic deduplication** — merges equivalent findings across Claude and Codex
|
|
91
|
+
- **Contradiction detection** — flags disagreements between reviewers
|
|
92
|
+
- **Dependency ordering** — orders findings so foundational issues come first
|
|
93
|
+
- **Confidence from corroboration** — findings flagged by both reviewers carry higher confidence
|
|
215
94
|
|
|
216
|
-
### Step
|
|
95
|
+
### Step 5: Present Findings
|
|
217
96
|
|
|
218
|
-
|
|
97
|
+
Present findings to the user in this order:
|
|
98
|
+
1. **Contradictions** — need human resolution
|
|
99
|
+
2. **Confirmed P1 findings** — in dependency order
|
|
100
|
+
3. **Confirmed P2 findings** — in dependency order
|
|
101
|
+
4. **Contested findings** — plausible but unverified
|
|
102
|
+
5. **Summary of rejected/low-confidence findings** — counts only
|
|
219
103
|
|
|
220
|
-
|
|
221
|
-
- which findings are contested
|
|
222
|
-
- which findings are rejected
|
|
223
|
-
- which findings are worth turning into final todos
|
|
104
|
+
## Mode Parameter
|
|
224
105
|
|
|
225
|
-
The
|
|
106
|
+
The skill supports a mode argument (design for all, only interactive is implemented):
|
|
226
107
|
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
108
|
+
- **Default (interactive):** present findings, user responds
|
|
109
|
+
- **`mode:autofix`** (future): apply safe fixes automatically
|
|
110
|
+
- **`mode:report-only`** (future): generate artifacts without interaction
|
|
230
111
|
|
|
231
|
-
|
|
112
|
+
## Output
|
|
232
113
|
|
|
233
|
-
|
|
114
|
+
All artifacts are written to `docs/reviews/<run-id>/`:
|
|
234
115
|
|
|
235
|
-
|
|
116
|
+
```
|
|
117
|
+
docs/reviews/<run-id>/
|
|
118
|
+
run.json # Run metadata
|
|
119
|
+
bundle.json # Consolidated data for HTML
|
|
120
|
+
follow-ups.md # Human-readable next-step list from the judge verdict
|
|
121
|
+
index.html # Static review report
|
|
122
|
+
claude/ # Claude model reviewer
|
|
123
|
+
report.md, findings.json, done.json, status.json
|
|
124
|
+
codex/ # Codex model reviewer
|
|
125
|
+
report.md, findings.json, done.json, status.json
|
|
126
|
+
judge/ # Judge adjudication
|
|
127
|
+
summary.md, verdict.json, done.json, status.json
|
|
128
|
+
```
|
|
236
129
|
|
|
237
|
-
|
|
238
|
-
- candidate findings from each reviewer
|
|
239
|
-
- confirmed versus contested verdicts
|
|
240
|
-
- raw markdown reports from Claude and Codex
|
|
130
|
+
Add `docs/reviews/` to `.gitignore` to keep review artifacts out of version control.
|
|
241
131
|
|
|
242
|
-
##
|
|
132
|
+
## Constraints
|
|
243
133
|
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
134
|
+
- The parent agent is the orchestrator. It should not do the review itself.
|
|
135
|
+
- Do not create files in `todos/` — the judge recommends todos and Review Council derives `follow-ups.md`, but neither creates authoritative todo files.
|
|
136
|
+
- Skills are passed to each model reviewer as additional review lenses for the run, not inlined prompt bodies.
|
|
137
|
+
- Model reviewers (Claude, Codex) run as CLI processes via the TS orchestrator.
|
|
138
|
+
- Interactive prompts from reviewer CLIs are detected and relayed; prefer explicit non-interactive mode (`claude --dangerously-skip-permissions -p`, `codex exec --full-auto`) for reliability.
|
|
248
139
|
|
|
249
140
|
## Supporting Files
|
|
250
141
|
|
|
251
142
|
- Output contract: [output-contract.md](references/output-contract.md)
|
|
252
143
|
- CLI examples: [cli-integration.md](references/cli-integration.md)
|
|
253
|
-
- Review schema: [review-findings.schema.json](schemas/review-findings.schema.json)
|
|
254
|
-
- Judge schema: [judge-verdict.schema.json](schemas/judge-verdict.schema.json)
|
|
255
|
-
-
|
|
144
|
+
- Review findings schema: [review-findings.schema.json](schemas/review-findings.schema.json)
|
|
145
|
+
- Judge verdict schema: [judge-verdict.schema.json](schemas/judge-verdict.schema.json)
|
|
146
|
+
- Model reviewer template: [reviewer-export.md](templates/reviewer-export.md)
|
|
256
147
|
- Judge template: [judge.md](templates/judge.md)
|
|
257
148
|
- HTML template: [report.html](templates/report.html)
|
|
258
|
-
- CLI entrypoint: [src/cli.ts](src/cli.ts)
|
|
259
|
-
- Orchestrator runtime: [src/orchestrate-review-council.ts](src/orchestrate-review-council.ts)
|
|
260
|
-
- Renderer: [src/render-review-html.ts](src/render-review-html.ts)
|
|
261
|
-
- TypeScript package: [package.json](package.json)
|
|
262
|
-
- TypeScript config: [tsconfig.json](tsconfig.json)
|
package/dist/cli.js
CHANGED
|
File without changes
|