Skip to content

Commit 3d9acd0

Browse files
committed
Merge branch 'main' into feat/openclaw-support
2 parents f79cbdc + 21f23cf commit 3d9acd0

138 files changed

Lines changed: 2223 additions & 883 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"name": "deepwork",
1313
"description": "Framework for AI-powered multi-step workflows with quality gates",
14-
"version": "0.13.2",
14+
"version": "0.14.0",
1515
"source": "./plugins/claude",
1616
"author": {
1717
"name": "DeepWork"

.claude/agents/requirements_reviewer.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ You are a requirements traceability reviewer. Your job is to verify the three-wa
1616

1717
## Project Conventions
1818

19-
This project uses formal requirements documents with RFC 2119 keywords (MUST, SHALL, SHOULD, MAY, etc.) located in the `specs/` directory. Specs are organized into domain subdirectories:
19+
This project uses formal requirements documents with RFC 2119 keywords (MUST, SHALL, SHOULD, MAY, etc.) located in the `doc/specs/` directory. Specs are organized into domain subdirectories:
2020

21-
- `specs/deepwork/` — root DeepWork specs (DW-REQ-prefixed)
22-
- `specs/deepwork/jobs/` — job-related specs (JOBS-REQ-prefixed)
23-
- `specs/deepwork/review/` — review-related specs (REVIEW-REQ-prefixed)
24-
- `specs/deepwork/cli_plugins/` — CLI plugin specs (PLUG-REQ-prefixed)
25-
- `specs/learning-agents/` — learning agent specs (LA-REQ-prefixed)
21+
- `doc/specs/deepwork/` — root DeepWork specs (DW-REQ-prefixed)
22+
- `doc/specs/deepwork/jobs/` — job-related specs (JOBS-REQ-prefixed)
23+
- `doc/specs/deepwork/review/` — review-related specs (REVIEW-REQ-prefixed)
24+
- `doc/specs/deepwork/cli_plugins/` — CLI plugin specs (PLUG-REQ-prefixed)
25+
- `doc/specs/learning-agents/` — learning agent specs (LA-REQ-prefixed)
2626

2727
Each file follows the naming pattern `{PREFIX}-REQ-NNN-<topic>.md`, where the prefix identifies the domain:
2828

@@ -75,7 +75,7 @@ When asked to review, perform these checks:
7575
### 1. Requirements Coverage
7676
7777
For every piece of new or changed end-user functionality in the diff (end-user functionality means behavior observable through public APIs, CLI commands, MCP tools, or documented outputs — internal refactoring that doesn't change observable behavior does not require new requirements):
78-
- Verify there is a corresponding requirement in `specs/**/*-REQ-*.md`
78+
- Verify there is a corresponding requirement in `doc/specs/**/*-REQ-*.md`
7979
- If functionality is new, check that a new requirement was added
8080
- If functionality changed, check that the relevant requirement was updated
8181
- Flag any functional code changes that lack a matching requirement

.claude/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"Edit(./.deepwork/**)",
100100
"Write(./.deepwork/**)",
101101
"Bash(deepwork:*)",
102+
"Bash(make:*)",
102103
"Bash(gh pr edit:*)",
103104
"Bash(gh api:*)",
104105
"Bash(learning_agents/scripts/*:*)",
@@ -113,5 +114,7 @@
113114
"mcp__plugin_deepwork_deepwork__*"
114115
]
115116
},
116-
"enabledPlugins": {}
117+
"enabledPlugins": {
118+
"plugin-dev@claude-plugins-official": true
119+
}
117120
}

.deepreview

Lines changed: 83 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 `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 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 `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.
@@ -335,6 +287,52 @@ update_learning_agents_architecture:
335287
additional_context:
336288
unchanged_matching_files: true
337289

290+
agent_tools_fully_qualified:
291+
description: "Claude Code agent definition files must list every tool by fully-qualified name, never by wildcard."
292+
match:
293+
include:
294+
- "**/agents/*.md"
295+
review:
296+
strategy: individual
297+
instructions: |
298+
This file defines a Claude Code subagent (the YAML frontmatter at the
299+
top of the file configures the agent's name, description, model, and
300+
tool grants). Check the `tools:` frontmatter field.
301+
302+
Rule: every tool entry MUST be a fully-qualified tool name. Wildcard
303+
or glob patterns (any entry containing `*`, `?`, `[`, or ending in
304+
`__*`) are non-conforming.
305+
306+
Rationale: wildcard patterns in subagent `tools:` frontmatter do not
307+
reliably match deferred MCP tools at runtime. Observed failure mode:
308+
a frontmatter entry like `mcp__deepwork-dev__*` is accepted at parse
309+
time, but when the subagent tries to invoke
310+
`mcp__deepwork-dev__mark_review_as_passed` the runtime responds with
311+
`Error: No such tool available`. Enumerating each MCP tool by its
312+
full name (e.g., `mcp__deepwork-dev__mark_review_as_passed`) avoids
313+
this failure mode and also documents the exact tool surface the
314+
agent relies on. This caught us in the e2e merge-queue run that
315+
failed PR #390.
316+
317+
This rule does NOT apply to files that are not Claude Code agent
318+
definitions — if the file has no YAML frontmatter with name/tools
319+
fields (e.g., it is a context-injection document or a skill body
320+
that happens to live under an `agents/` path), this review passes
321+
vacuously.
322+
323+
Check for:
324+
- Any entry in `tools:` containing `*`, `?`, or `[...]` glob syntax.
325+
- Any entry ending in `__*` (the common MCP-wildcard form).
326+
- Any quoted glob pattern such as `"mcp__<server>__*"`.
327+
328+
Output Format:
329+
- PASS: `tools:` field is missing, empty, or every entry is a
330+
fully-qualified name.
331+
- FAIL: list each wildcard entry with its line number and the
332+
fully-qualified tool names it should be replaced with (if
333+
determinable from the agent's body; otherwise flag the need for
334+
enumeration).
335+
338336
shell_code_review:
339337
description: "Review shell scripts for correctness, safety, and project conventions."
340338
match:
@@ -369,6 +367,10 @@ shell_code_review:
369367
section markers) still accurate after the changes? Flag any comments
370368
that describe behavior that no longer matches the code.
371369

370+
Output Format:
371+
- PASS: No issues found.
372+
- FAIL: List each issue with file, line, severity (high/medium/low), and a concise description.
373+
372374
agents_md_claude_md_symlink:
373375
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."
374376
match:

.deepwork/jobs/test_job_flow/AGENTS.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ This folder and its subfolders are managed using `deepwork_jobs` workflows.
1313
```
1414
.
1515
├── AGENTS.md # This file - project context and guidance
16-
├── job.yml # Job specification (created by define step)
17-
├── steps/ # Step instruction files (created by implement step)
18-
│ └── *.md # One file per step
16+
├── job.yml # Job specification with inline step instructions
1917
├── hooks/ # Custom validation scripts and prompts
2018
│ └── *.md|*.sh # Hook files referenced in job.yml
2119
├── scripts/ # Reusable scripts and utilities created during job execution

.deepwork/jobs/test_job_flow/job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ workflows:
9090
completed on first try or required retries.
9191
9292
2. **Verify completion**: Confirm `.deepwork/jobs/detailed_test_review/job.yml`
93-
exists with expected structure (2 steps, correct outputs, reviews). Check
94-
step instruction files exist in `steps/`.
93+
exists with expected structure (2 steps, correct outputs, reviews, and
94+
inline step instructions).
9595
9696
3. **Identify friction points**: Look for errors, workarounds, retries, confusion,
9797
unnecessary steps, slow paths, and missing guidance in the transcript.

.deepwork/learning-agents/consistency-reviewer/core-knowledge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ There are exactly three types of jobs. Confusing them is one of the most common
3434
### Key File Patterns
3535

3636
- `job.yml` — Job definitions with steps, workflows, outputs, reviews, quality criteria
37-
- `steps/*.md` — Step instruction files (markdown with structured guidance)
37+
- Step instructions are inlined in `job.yml` (the `steps/` folder pattern is deprecated)
3838
- `hooks/` — Lifecycle hooks (after_agent, before_tool, etc.)
3939
- `.claude/agents/*.md` — Agent definitions with YAML frontmatter (name, description)
4040
- `AGENTS.md` — Bespoke learnings and context for a working directory

.deepwork/learning-agents/consistency-reviewer/topics/mcp-workflow-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ steps:
6868
When the server encounters a concurrent entry, it:
6969
1. Uses the first step ID as the "current" step
7070
2. Appends a `**CONCURRENT STEPS**` message to the instructions
71-
3. Expects the agent to use the Task tool to execute them in parallel
71+
3. Expects the agent to use the Agent tool to execute them in parallel
7272

7373
**Consistency check**: The `current_entry_index` tracks position in the `step_entries` list (which may contain concurrent groups), not the flat step list.
7474

.deepwork/requirements_traceability_info.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ REPO_ROOT="$(git rev-parse --show-toplevel)"
1313
cd "$REPO_ROOT"
1414

1515
# Configurable directories
16-
SPEC_DIR="specs"
16+
SPEC_DIR="doc/specs"
1717
TEST_DIR="tests"
1818

1919
TMPDIR_TRACE=$(mktemp -d)

.github/workflows/claude-code-test.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,11 @@ jobs:
219219
# The plugin (--plugin-dir) provides skills, hooks, and MCP server config.
220220
# Override the plugin's MCP config to use the bare `deepwork` command
221221
# (the plugin uses `uvx` which may not resolve the local venv install).
222+
# Server is named "deepwork-dev" to match the reviewer agent's tool
223+
# patterns (mcp__deepwork-dev__*) — see CLAUDE.md MCP tool naming.
222224
python3 -c "
223225
import json
224-
mcp = {'mcpServers': {'deepwork': {
226+
mcp = {'mcpServers': {'deepwork-dev': {
225227
'command': 'deepwork',
226228
'args': ['serve', '--path', '.', '--platform', 'claude']
227229
}}}
@@ -236,10 +238,10 @@ jobs:
236238
'permissions': {
237239
'allow': [
238240
'Bash(*)', 'Read(./**)', 'Edit(./**)', 'Write(./**)', 'Skill(*)',
239-
'mcp__deepwork__get_workflows', 'mcp__deepwork__start_workflow',
240-
'mcp__deepwork__finished_step', 'mcp__deepwork__abort_workflow',
241-
'mcp__deepwork__go_to_step',
242-
'mcp__deepwork__mark_review_as_passed'
241+
'mcp__deepwork-dev__get_workflows', 'mcp__deepwork-dev__start_workflow',
242+
'mcp__deepwork-dev__finished_step', 'mcp__deepwork-dev__abort_workflow',
243+
'mcp__deepwork-dev__go_to_step',
244+
'mcp__deepwork-dev__mark_review_as_passed'
243245
]
244246
}
245247
}
@@ -308,18 +310,12 @@ jobs:
308310
exit 1
309311
fi
310312
311-
# Verify step files were created
312-
echo "=== Checking step files were created ==="
313-
if [ -f ".deepwork/jobs/fruits/steps/identify.md" ] && [ -f ".deepwork/jobs/fruits/steps/classify.md" ]; then
314-
echo "SUCCESS: Step instruction files created"
315-
echo "--- identify.md ---"
316-
cat .deepwork/jobs/fruits/steps/identify.md
317-
echo ""
318-
echo "--- classify.md ---"
319-
cat .deepwork/jobs/fruits/steps/classify.md
313+
# Verify step instructions are inlined in job.yml
314+
echo "=== Checking step instructions are inlined ==="
315+
if grep -q 'instructions:' .deepwork/jobs/fruits/job.yml; then
316+
echo "SUCCESS: Step instructions are inlined in job.yml"
320317
else
321-
echo "ERROR: Step files were not created"
322-
ls -la .deepwork/jobs/fruits/steps/ || echo "No steps directory"
318+
echo "ERROR: No inline step instructions found in job.yml"
323319
exit 1
324320
fi
325321

0 commit comments

Comments
 (0)