Skip to content

Commit 8033f20

Browse files
nhortonclaude
andauthored
fix: namespace reviewer agent as deepwork:reviewer (#375)
* fix: namespace reviewer agent as deepwork:reviewer Use the fully-qualified plugin agent name "deepwork:reviewer" instead of bare "reviewer" so the agent is correctly resolved from the plugin. The /review skill now checks for agent availability and tells users to run /reload-plugins if the agent is missing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: update specs and docs for deepwork:reviewer rename - Update REVIEW-REQ-006.3.3c to reference "deepwork:reviewer" default - Add REVIEW-REQ-007.1.10 for agent availability pre-flight check - Update README_REVIEWS.md example output and contributor setup section - Add plugins/**/agents/**/*.md to prompt_best_practices review rule - Add changelog entries for the reviewer rename Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: tighten requirements_traceability instructions and add shell_code_review output format - Condensed requirements_traceability inline instructions (~94 → ~45 lines) while preserving all review criteria - Added explicit Output Format section to shell_code_review rule Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7c9191c commit 8033f20

9 files changed

Lines changed: 61 additions & 95 deletions

File tree

.deepreview

Lines changed: 37 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ prompt_best_practices:
1111
- "plugins/**/skills/**/*.md"
1212
- "learning_agents/skills/**/*.md" # learning_agents plugin skills are prompt-heavy
1313
- "learning_agents/agents/**/*.md" # agent persona definitions
14+
- "plugins/**/agents/**/*.md" # plugin agent definitions are prompt-heavy
1415
- "platform/**/*.md"
1516
- "src/deepwork/standard_jobs/**/*.md"
1617
- "library/jobs/**/*.md" # library job step instructions are prompt-heavy files
@@ -118,96 +119,47 @@ requirements_traceability:
118119
instructions: |
119120
Review the changed files for requirements traceability.
120121

121-
This project keeps formal requirements in `doc/specs/` organized by domain.
122-
Each file follows the naming pattern `{PREFIX}-REQ-NNN-<topic>.md` where
123-
PREFIX is one of: DW-REQ, JOBS-REQ, REVIEW-REQ, LA-REQ, PLUG-REQ.
124-
Requirements are individually numbered (e.g. JOBS-REQ-004.1). Requirements
125-
must be validated by either automated tests OR DeepWork review rules.
122+
Requirements live in `doc/specs/` as `{PREFIX}-REQ-NNN-<topic>.md`
123+
(prefixes: DW-REQ, JOBS-REQ, REVIEW-REQ, LA-REQ, PLUG-REQ), with
124+
individually numbered items (e.g. JOBS-REQ-004.1). Each requirement
125+
must be validated by automated tests, DeepSchemas, or `.deepreview` rules.
126126

127127
## Choosing the right validation mechanism
128128

129-
Choosing the right mechanism is critical. The wrong choice creates
130-
false confidence (a passing test that doesn't actually verify anything)
131-
or wastes reviewer judgment on something a machine can check exactly.
132-
133-
**Use anonymous DeepSchemas** (`.deepschema.<filename>.yml`) when
134-
requirements target a specific file — whether structural or semantic:
135-
- "This config file MUST include a timeout field" — structural check
136-
for one file (use `json_schema_path` or `verification_bash_command`
137-
for exact verification)
138-
- "The learn workflow MUST accept X and Y step arguments" — the
139-
requirement governs a specific YAML file's content
140-
- "Skill MUST instruct the agent to do X" — judgment-based check
141-
of prose in one specific file
142-
- "The error message MUST include a suggestion for how to fix the
143-
problem" — governs a specific source file's behavior
144-
145-
Anonymous DeepSchemas provide both write-time validation and review-time
146-
checks, and they keep the requirement co-located with the file it governs.
147-
**Prefer them over both tests and `.deepreview` rules whenever the
148-
requirement targets a specific file** rather than a class of files.
149-
DeepSchemas can enforce structural requirements via `json_schema_path`
150-
or `verification_bash_command` just as precisely as a test, while also
151-
supporting judgment-based requirements in the same schema.
152-
153-
**Use automated tests** (`tests/`) when the requirement specifies a
154-
concrete, machine-verifiable fact that spans multiple files or is not
155-
tied to a single file's content:
156-
- File A is byte-identical to file B
157-
- A Python function returns the correct value for given inputs
158-
- A CLI command produces expected output
159-
- A data structure assembled from multiple sources has a required shape
160-
161-
Tests reference requirement IDs via docstrings and traceability comments.
162-
163-
**Use `.deepreview` rules** when evaluating the requirement requires
164-
judgment AND applies broadly across many files of a type:
165-
- "All prompts MUST use the terms X, Y, and Z" — a general standard
166-
that applies to every file matching a glob pattern
167-
- "Code MUST follow pattern Y" — does the implementation match the
168-
spirit of the pattern across multiple files?
169-
- "Documentation MUST stay in sync with code" — are the descriptions
170-
still accurate after changes?
171-
172-
Both `.deepreview` rules and DeepSchemas reference requirement IDs in
173-
their `description`, `instructions`, or `requirements` fields.
129+
Pick the mechanism that matches the requirement type. The wrong choice
130+
creates false confidence or wastes reviewer judgment.
131+
132+
**Anonymous DeepSchemas** (`.deepschema.<filename>.yml`): when the
133+
requirement targets a specific file (structural or semantic). Use
134+
`json_schema_path` / `verification_bash_command` for exact checks,
135+
or judgment-based criteria for prose. Prefer DeepSchemas over tests
136+
and `.deepreview` rules for single-file requirements.
137+
138+
**Automated tests** (`tests/`): for concrete, machine-verifiable facts
139+
spanning multiple files (function return values, CLI output, cross-file
140+
structure). Tests reference requirement IDs via docstrings/comments.
141+
142+
**`.deepreview` rules**: when evaluation requires judgment AND applies
143+
broadly across many files of a type (coding standards, documentation
144+
accuracy, prompt conventions). Rules and DeepSchemas reference
145+
requirement IDs in `description`, `instructions`, or `requirements`.
174146

175147
## Anti-patterns to flag
176148

177-
**Fragile keyword tests for judgment-based requirements.** A test that
178-
checks `"reuse" in content.lower()` to validate "MUST instruct the
179-
agent to reuse existing rules" is not deterministic verification — it
180-
is a keyword search pretending to be one. The word "reuse" could appear
181-
in an unrelated sentence, be negated ("do NOT reuse"), or be absent
182-
while the instruction clearly conveys reuse through other wording.
183-
These requirements need a review rule that can read and evaluate the
184-
instruction's meaning. Other examples of this anti-pattern:
185-
- `"parallel" in content` for "MUST launch tasks in parallel"
186-
- `"again" in content or "repeat" in content` for "MUST re-run after changes"
187-
- `"without asking" in content` for "MUST automatically apply obvious fixes"
188-
189-
**Review rules for machine-verifiable requirements.** A review rule
190-
that asks a reviewer "check whether the config file contains
191-
`--platform claude`" is wasting reviewer judgment on something
192-
`assert "--platform" in args` can verify exactly. If the requirement
193-
specifies a concrete value, path, or structure, use a test.
194-
195-
See doc/specs/validating_requirements_with_rules.md for more information.
149+
- **Fragile keyword tests for judgment requirements**: e.g.
150+
`"parallel" in content` for "MUST launch tasks in parallel" — use
151+
a review rule instead. See doc/specs/validating_requirements_with_rules.md.
152+
- **Review rules for machine-verifiable requirements**: e.g. asking a
153+
reviewer to check for a specific flag — use a test instead.
196154

197155
## Review checklist
198156

199-
1. Check that any new or changed end-user functionality has a
200-
corresponding requirement in `doc/specs/`.
201-
2. Check that every requirement touched by this change has at least
202-
one automated test OR at least one `.deepreview` rule validating
203-
it. **Verify the mechanism matches the requirement type** — flag
204-
keyword-search tests used for judgment requirements, and flag
205-
review rules used for machine-verifiable requirements.
206-
3. Flag any test modifications where the underlying requirement did
207-
not also change.
208-
4. For rule-validated requirements, verify the `.deepreview` rule's
209-
description or instructions reference the requirement ID and that
210-
the rule's scope covers the requirement's intent.
157+
1. New/changed end-user functionality has a requirement in `doc/specs/`.
158+
2. Every touched requirement has a test, DeepSchema, or `.deepreview`
159+
rule. Verify the mechanism matches the requirement type.
160+
3. Flag test modifications where the underlying requirement didn't change.
161+
4. For rule-validated requirements, verify the rule references the
162+
requirement ID and its scope covers the requirement's intent.
211163

212164
Produce a structured review with Coverage Gaps, Test Stability
213165
Violations, and a Summary with PASS/FAIL verdicts.
@@ -369,6 +321,10 @@ shell_code_review:
369321
section markers) still accurate after the changes? Flag any comments
370322
that describe behavior that no longer matches the code.
371323

324+
Output Format:
325+
- PASS: No issues found.
326+
- FAIL: List each issue with file, line, severity (high/medium/low), and a concise description.
327+
372328
agents_md_claude_md_symlink:
373329
description: "Ensure every AGENTS.md file has a sibling CLAUDE.md symlink pointing to it, because Claude Code reads CLAUDE.md but ignores AGENTS.md."
374330
match:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
- Renamed default reviewer agent from `reviewer` to `deepwork:reviewer` (plugin-namespaced) in review instructions output
15+
- `/review` skill now checks for `deepwork:reviewer` agent availability before proceeding and directs users to `/reload-plugins` if missing
16+
1417
### Fixed
1518

1619
### Removed

README_REVIEWS.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,18 @@ This:
305305
### What the output looks like
306306

307307
```
308-
Invoke the following list of Tasks in parallel.
308+
Invoke the following list of Agents in parallel.
309+
IMPORTANT: Do NOT read the prompt files yourself. Pass the prompt field directly to each agent — the @file references are expanded automatically.
309310

310-
name: "python_review review of src/app.py"
311-
description: Review python_review
312-
subagent_type: reviewer
311+
description: Review python_review
312+
subagent_type: deepwork:reviewer
313313
prompt: "@.deepwork/tmp/review_instructions/7142141.md"
314314

315-
name: "python_review review of src/lib.py"
316-
description: Review python_review
317-
subagent_type: reviewer
315+
description: Review python_review
316+
subagent_type: deepwork:reviewer
318317
prompt: "@.deepwork/tmp/review_instructions/6316224.md"
319318

320-
name: "db_migration_safety review of 2 files"
321-
description: Review db_migration_safety
319+
description: Review db_migration_safety
322320
subagent_type: db-expert
323321
prompt: "@.deepwork/tmp/review_instructions/3847291.md"
324322
```
@@ -535,6 +533,6 @@ Patterns follow standard glob syntax, evaluated relative to the `.deepreview` fi
535533

536534
## Contributor setup
537535

538-
By default, `/review` dispatches each review task to the `reviewer` subagent shipped with the DeepWork Claude plugin (`plugins/claude/agents/reviewer.md`). If you are developing against this repo with only the dev MCP server (`uv run deepwork serve`) and no plugin installed, Claude Code cannot resolve `subagent_type: reviewer` and review dispatch will fail.
536+
By default, `/review` dispatches each review task to the `deepwork:reviewer` subagent shipped with the DeepWork Claude plugin (`plugins/claude/agents/reviewer.md`). If you are developing against this repo with only the dev MCP server (`uv run deepwork serve`) and no plugin installed, Claude Code cannot resolve `subagent_type: deepwork:reviewer` and review dispatch will fail.
539537

540538
To run reviews as a contributor, install the plugin alongside the dev server: `claude plugin marketplace add Unsupervisedcom/deepwork && claude plugin install deepwork@deepwork-plugins`. The plugin ships the reviewer agent file, and either MCP server prefix (`mcp__deepwork-dev__*` or `mcp__plugin_deepwork_deepwork__*`) will resolve the reviewer's tools.

doc/specs/deepwork/review/REVIEW-REQ-006-cli-review-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The `deepwork review` CLI command orchestrates the full DeepWork Reviews pipelin
3232
3. For each review task, the output MUST include fields matching the Claude Code `Agent` tool parameters:
3333
a. ~~DEPRECATED~~ ~~A `name` field formatted as `"{scope_prefix}{rule_name} review of {file_or_scope}"`.~~
3434
b. A `description` field with a short (3-5 word) summary for the task (e.g., `"Review {rule_name}"`). When the rule comes from a `.deepreview` in a subdirectory, the description MUST include the scope (e.g., `"Review my_job/{rule_name}"`).
35-
c. A `subagent_type` field set to the agent persona name (from the rule's `agent.claude` value) or `"reviewer"` if no persona is specified. `"reviewer"` refers to the default reviewer subagent shipped by the DeepWork Claude plugin (`plugins/claude/agents/reviewer.md`).
35+
c. A `subagent_type` field set to the agent persona name (from the rule's `agent.claude` value) or `"deepwork:reviewer"` if no persona is specified. `"deepwork:reviewer"` refers to the default reviewer subagent shipped by the DeepWork Claude plugin (`plugins/claude/agents/reviewer.md`), using the plugin-namespaced agent name.
3636
d. A `prompt` field referencing the instruction file path relative to the project root, prefixed with `@` (e.g., `@.deepwork/tmp/review_instructions/7142141.md`).
3737
4. The instruction file paths MUST be relative to the project root.
3838
5. When running inside a git worktree, the formatter MUST resolve `@file` paths relative to the main working tree root (not the worktree root), because Claude Code expands `@file` references relative to the main repo root. The main repo root MUST be detected via `git rev-parse --path-format=absolute --git-common-dir`. If git is unavailable or the directory is not a worktree, the formatter MUST fall back to using the project root.

doc/specs/deepwork/review/REVIEW-REQ-007-plugin-skills.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ DeepWork Reviews is delivered to users via the Claude Code plugin. The plugin sh
1717
7. The skill MUST instruct the agent to use AskUserQuestion for findings that involve trade-offs or subjective judgment.
1818
8. The skill MUST instruct the agent to re-run the review after making changes, repeating until no further actionable findings remain.
1919
9. The skill MUST route configuration requests (creating or modifying `.deepreview` files) to the `configure_reviews` skill.
20+
10. The skill MUST verify that the `deepwork:reviewer` agent is available before running reviews. If the agent is not available, the skill MUST stop and instruct the user to run `/reload-plugins` to pick up the latest plugin updates.
2021

2122
### REVIEW-REQ-007.2: Configure Reviews Skill
2223

plugins/claude/agents/reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: reviewer
2+
name: deepwork:reviewer
33
description: Minimal review subagent for DeepWork review tasks. Reads a supplied instruction file, performs the review against the criteria in that file, and reports results via the DeepWork MCP mark_review_as_passed tool. Use when dispatching parallel review tasks from .deepreview rules or workflow quality gates.
44
model: sonnet
55
color: cyan

plugins/claude/skills/review/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Run automated code reviews on the current branch based on `.deepreview` config f
1616

1717
Only proceed past this section if the user wants to **run** reviews.
1818

19+
## Pre-flight — Verify Agent Availability
20+
21+
Before running reviews, check that the `deepwork:reviewer` agent is available. If it does not appear in the agents list (i.e., the Agent tool does not list `deepwork:reviewer` as a valid `subagent_type`), **STOP** and tell the user:
22+
23+
> The `deepwork:reviewer` agent is not available. Please run `/reload-plugins` to pick up the latest plugin updates, then try again.
24+
25+
Do not proceed with reviews until the agent is available.
26+
1927
## How to Run
2028

2129
1. Call the `mcp__deepwork__get_review_instructions` tool directly:

src/deepwork/review/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def format_for_claude(
105105
rel_path = file_path
106106

107107
description = _task_description(task)
108-
subagent_type = task.agent_name or "reviewer"
108+
subagent_type = task.agent_name or "deepwork:reviewer"
109109

110110
lines.append(f"description: {description}")
111111
lines.append(f"\tsubagent_type: {subagent_type}")

tests/unit/review/test_formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_default_subagent_type_when_no_agent(self, tmp_path: Path) -> None:
4646
task = _make_task(agent_name=None)
4747
file_path = tmp_path / "instructions.md"
4848
result = format_for_claude([(task, file_path)], tmp_path)
49-
assert "subagent_type: reviewer" in result
49+
assert "subagent_type: deepwork:reviewer" in result
5050

5151
# THIS TEST VALIDATES A HARD REQUIREMENT (REVIEW-REQ-006.3.3c).
5252
# YOU MUST NOT MODIFY THIS TEST UNLESS THE REQUIREMENT CHANGES

0 commit comments

Comments
 (0)