Skip to content

Commit 6bb0e0a

Browse files
nhortonclaude
andauthored
fix: remove DeepPlan injection, rename Task tool to Agent tool (#365)
* fix: remove automatic DeepPlan injection from startup hook The startup_context hook was injecting an instruction forcing agents into the DeepPlan workflow whenever they entered plan mode. Remove the injection, deprecate the corresponding requirement (JOBS-REQ-014.5.1), and drop the test that enforced it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add agents/ directory to AGENTS.md project structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: rename Task tool references to Agent tool across codebase Claude Code renamed the Task tool to Agent tool. Update all references in source code, tests, specs, docs, skills, schemas, and hooks to use the new name. Also drop the `name` field from review formatter output since the Agent tool uses `description` as the primary identifier, and deprecate REVIEW-REQ-006.3.3a accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use REQUIREMENT REMOVED format and update changelog - JOBS-REQ-014.5.1: use "REQUIREMENT REMOVED" instead of strikethrough per requirement-id-stability convention - Update deepschema validation to exempt "REQUIREMENT REMOVED" lines - Add changelog entries for this PR Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address pre-existing review findings across codebase - wrapper.py: update stale docstring to list all 8 NormalizedEvent values - quality_gate.py: remove dead QualityGateError class, fix stale comment - tools.py: DRY — refactor _write_manifest to accept optional jobs param, add comment documenting deliberate lack of path-traversal check - LA-REQ-006.5: fix MAY/MUST contradiction (now both say MUST) - learning_agents_architecture.md: fix inaccurate sequential processing description to match actual parallel behavior in learn/SKILL.md - deepwork_jobs job.yml: fix "should" typo, add errata_summary output, fix MCP prefix to plugin form, fix RFC 2119 double-negative phrasing - formatter.py: fix ruff double blank line Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): rename MCP server to deepwork-dev in e2e test The reviewer agent's tool patterns (mcp__deepwork-dev__* and mcp__plugin_deepwork_deepwork__*) didn't match the CI server named "deepwork" (mcp__deepwork__*), so the reviewer couldn't call mark_review_as_passed. Aligns with CLAUDE.md guidance to always use the deepwork-dev prefix in this repo. 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 2d9b44b commit 6bb0e0a

37 files changed

Lines changed: 129 additions & 191 deletions

.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

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

Lines changed: 7 additions & 5 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
}

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ deepwork/
216216
│ ├── claude/ # Claude Code plugin
217217
│ │ ├── .claude-plugin/plugin.json
218218
│ │ ├── README_REVIEWS.md
219+
│ │ ├── agents/ # Subagent definitions (e.g., reviewer.md)
219220
│ │ ├── example_reviews/
220221
│ │ ├── skills/
221222
│ │ │ ├── configure_reviews/SKILL.md

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
- Post-commit review reminder hook now short-circuits when all applicable (non-catch-all) review rules for the committed files are already marked as passed, emitting "No re-review needed" instead of nagging
15+
- Renamed all "Task tool" references to "Agent tool" across codebase to match Claude Code's current tool naming
16+
- Review formatter now emits `description`, `subagent_type`, and `prompt` fields (dropped `name` field) to match Agent tool signature
17+
- Hook wrapper tool mappings updated: `Task`/`task``Agent`/`agent`
1518

1619
### Fixed
1720

1821
- Review instruction files now include a `## Project Root` directive stating the absolute project root so reviewer subagents read files from the correct working tree — fixes spurious findings in git-worktree setups where the subagent's cwd differed from the worktree the commits actually lived in (REVIEW-REQ-005.1.9)
1922

2023
### Removed
24+
25+
- Removed automatic DeepPlan workflow injection from startup_context.sh hook (no longer forces plan mode into DeepPlan)
26+
- Deprecated JOBS-REQ-014.5.1 (startup hook DeepPlan trigger) and REVIEW-REQ-006.3.3a (name field in review output)
2127
## [0.13.3] - 2026-04-10
2228

2329
### Added

doc/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ Lists all available workflows from `.deepwork/jobs/`.
872872
873873
**Parameters**: None
874874
875-
**Returns**: List of jobs with their workflows, steps, and summaries. Each `WorkflowInfo` includes a `how_to_invoke` field with invocation instructions: when the workflow's `agent` field is set in job.yml, it directs callers to delegate via the Task tool; otherwise, it directs callers to use the `start_workflow` MCP tool directly.
875+
**Returns**: List of jobs with their workflows, steps, and summaries. Each `WorkflowInfo` includes a `how_to_invoke` field with invocation instructions: when the workflow's `agent` field is set in job.yml, it directs callers to delegate via the Agent tool; otherwise, it directs callers to use the `start_workflow` MCP tool directly.
876876
877877
#### 2. `start_workflow`
878878
Begins a new workflow session.

doc/job_yml_guidance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ Changes how the workflow appears in `get_workflows`. Without `agent`, the respon
8282

8383
> Call `start_workflow` with job_name="X" and workflow_name="Y", then follow the step instructions it returns.
8484

85-
With `agent` set (e.g., `"general-purpose"`), the response tells the caller to spawn a **Task sub-agent** of that type:
85+
With `agent` set (e.g., `"general-purpose"`), the response tells the caller to spawn a sub-agent of that type:
8686

87-
> Invoke as a Task using subagent_type="general-purpose" with a prompt giving full context and instructions to call `start_workflow`...
87+
> Invoke as an Agent using subagent_type="general-purpose" with a prompt giving full context and instructions to call `start_workflow`...
8888

89-
If the agent does not have the Task tool available, the instructions fall back to direct invocation.
89+
If the agent does not have the Agent tool available, the instructions fall back to direct invocation.
9090

9191
Use `agent` for workflows that should execute autonomously without blocking the main conversation.
9292

doc/learning_agents_architecture.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ A sub-agent with a persistent knowledge base that improves over time. Defined in
1313

1414
### Learning Cycle
1515
The feedback loop that makes agents improve:
16-
1. **Use** — Agent is invoked via Task tool during normal work
17-
2. **Track** — Post-Task hook records the session for later review
16+
1. **Use** — Agent is invoked via Agent tool during normal work
17+
2. **Track** — Post-Agent hook records the session for later review
1818
3. **Identify** — Transcript is reviewed for issues/mistakes
1919
4. **Investigate** — Root causes are determined from transcript evidence
2020
5. **Incorporate** — Learnings are folded back into the agent's knowledge base
@@ -250,12 +250,12 @@ After the script runs, the skill prompts the user to describe what the agent is
250250
Fills in key files in the LearningAgent directory — initial topics and/or learnings if the user provides seed knowledge about the domain.
251251

252252
#### learn
253-
Runs the full learning cycle on all sessions needing it. The skill takes no arguments — any text after `learn` is ignored. Sessions are processed sequentially (not in parallel) to avoid conflicts when the same agent appears in multiple sessions. Workflow:
254-
1. Uses `!`find ...`` to inject a list of all paths containing a `needs_learning_as_of_timestamp` file into the prompt
255-
2. For each such folder, spawns a Task with the `LearningAgentExpert` agent using **Sonnet model** to run the `identify` skill
256-
3. After identification completes, spawns a Task with the `LearningAgentExpert` to run `investigate-issues` then `incorporate-learnings` in sequence
253+
Runs the full learning cycle on all sessions needing it. The skill takes no arguments. Workflow:
254+
1. Uses a script to inject a list of all paths containing a `needs_learning_as_of_timestamp` file into the prompt
255+
2. Spawns an Agent per session with the `LearningAgentExpert` agent using **Sonnet model** to run the `identify` skill**all run in parallel**
256+
3. After identification completes, skips sessions where zero issues were found; for remaining sessions, spawns an Agent per session to run `investigate-issues` then `incorporate-learnings` in sequence**sessions for different agents run in parallel; sessions for the same agent run serially**
257257

258-
If no pending sessions are found (or the `.deepwork/tmp/agent_sessions/` directory is missing), the skill informs the user and stops. If a sub-skill Task fails for a session, the skill logs the failure, skips that session, continues processing remaining sessions, and does NOT mark `needs_learning_as_of_timestamp` as resolved. On completion, the skill outputs a summary containing total sessions processed, total issues identified, list of agents updated, key learnings per agent, and any skipped sessions with reasons. The `learn` skill itself MUST NOT modify agent files directly — all knowledge base updates are delegated to the sub-skills.
258+
If no pending sessions are found (or the `.deepwork/tmp/agent_sessions/` directory is missing), the skill informs the user and stops. If a sub-skill Agent fails for a session, the skill logs the failure, skips that session, continues processing remaining sessions, and does NOT mark `needs_learning_as_of_timestamp` as resolved. On completion, the skill outputs a summary containing total sessions processed, total issues identified, list of agents updated, key learnings per agent, and any skipped sessions with reasons. The `learn` skill itself MUST NOT modify agent files directly — all knowledge base updates are delegated to the sub-skills.
259259

260260
#### setup
261261
Configures project permissions for the LearningAgents plugin. Adds required Bash and file access rules to `.claude/settings.json` so hooks and scripts can run without manual approval.
@@ -324,4 +324,4 @@ Issues are tied to specific transcripts for evidence. Storing them alongside ses
324324
The `learn` skill spawns identification tasks using the Sonnet model. Transcript review is high-volume, pattern-matching work that doesn't require the most capable model. This keeps learning cycles fast and cost-effective.
325325

326326
### Why Hidden Skills
327-
Skills like `identify`, `report-issue`, `investigate-issues`, and `incorporate-learnings` are implementation details of the learning cycle. They're invoked by the `learn` skill via Task delegation, not directly by users. Hiding them keeps the user-facing skill surface clean.
327+
Skills like `identify`, `report-issue`, `investigate-issues`, and `incorporate-learnings` are implementation details of the learning cycle. They're invoked by the `learn` skill via Agent delegation, not directly by users. Hiding them keeps the user-facing skill surface clean.

doc/mcp_interface.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Navigate back to a prior step in the current workflow. Clears all progress from
183183

184184
### 6. `get_review_instructions`
185185

186-
Run a review of changed files based on `.deepreview` configuration files and DeepSchema-generated synthetic review rules. Returns a list of review tasks to invoke in parallel. Each task has `name`, `description`, `subagent_type`, and `prompt` fields for the Task tool.
186+
Run a review of changed files based on `.deepreview` configuration files and DeepSchema-generated synthetic review rules. Returns a list of review tasks to invoke in parallel. Each task has `description`, `subagent_type`, and `prompt` fields for the Agent tool.
187187

188188
This tool operates outside the workflow lifecycle — it can be called independently at any time.
189189

@@ -402,7 +402,7 @@ The quality gate builds dynamic `ReviewRule` objects from step output review blo
402402
- **Job context**: The workflow's `common_job_info` (if any)
403403
- **Step inputs**: Input values from prior steps, with file_path inputs shown as `@path` references
404404

405-
These rules are then processed through the standard DeepWork Reviews pipeline (matched against output files, instruction files written, formatted for the agent platform). The review output directs the agent to launch parallel Task agents for each review.
405+
These rules are then processed through the standard DeepWork Reviews pipeline (matched against output files, instruction files written, formatted for the agent platform). The review output directs the agent to launch parallel review agents for each review.
406406

407407
### Review Types
408408

@@ -496,7 +496,7 @@ Add to your `.mcp.json`:
496496
| 2.1.0 | Added `important_note` field to `StartWorkflowResponse` — instructs agents to clarify ambiguous user requests via `AskUserQuestion` when available. |
497497
| 2.0.0 | **Breaking**: `session_id` is now a required `string` parameter on all mutation tools (`start_workflow`, `finished_step`, `abort_workflow`, `go_to_step`). Added `agent_id` optional parameter for sub-agent scoping — sub-agents get their own isolated workflow stacks. State persistence path changed to `.deepwork/tmp/sessions/<platform>/session-<id>/state.json` (with sub-agent state in `agent_<agent_id>.json`). |
498498
| 1.9.0 | Added `go_to_step` tool for navigating back to prior steps. Clears all step progress from the target step onward, forcing re-execution of subsequent steps. Supports `session_id` for concurrent workflow safety. |
499-
| 1.8.0 | Added `how_to_invoke` field to `WorkflowInfo` in `get_workflows` response. Always populated with invocation instructions: when a workflow's `agent` field is set, directs callers to delegate via the Task tool; otherwise, directs callers to use the `start_workflow` MCP tool directly. Also added optional `agent` field to workflow definitions in job.yml. |
499+
| 1.8.0 | Added `how_to_invoke` field to `WorkflowInfo` in `get_workflows` response. Always populated with invocation instructions: when a workflow's `agent` field is set, directs callers to delegate via the Agent tool; otherwise, directs callers to use the `start_workflow` MCP tool directly. Also added optional `agent` field to workflow definitions in job.yml. |
500500
| 1.7.0 | Added `mark_review_as_passed` tool for review pass caching. Instruction files now include an "After Review" section with the review ID. Reviews with a `.passed` marker are automatically skipped by `get_review_instructions`. |
501501
| 1.6.0 | Added `get_configured_reviews` tool for listing configured review rules without running the full pipeline. Supports optional file-based filtering. |
502502
| 1.5.0 | Added `get_review_instructions` tool (originally named `review`) for running `.deepreview`-based code reviews via MCP. Added `--platform` CLI option to `serve` command. |

learning_agents/agents/learning-agent-expert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You are the meta-expert that operates on LearningAgent files. You understand the
2121

2222
!`cat ${CLAUDE_PLUGIN_ROOT}/doc/learning_log_folder_structure.md`
2323

24-
### Post-Task Reminder
24+
### Post-Agent Reminder
2525

2626
!`cat ${CLAUDE_PLUGIN_ROOT}/doc/learning_agent_post_task_reminder.md`
2727

learning_agents/doc/learning_log_folder_structure.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Session-level agent interaction logs are stored in `.deepwork/tmp/agent_sessions
1919

2020
### conversation_transcript.jsonl
2121

22-
A symlink to the agent's Claude Code transcript, created automatically by the post-Task hook. Points to the subagent transcript at `~/.claude/projects/<project-hash>/<session_id>/subagents/agent-<agent_id>.jsonl`. This allows learning cycle skills to read the transcript directly from the session log folder without needing to search for it via Glob patterns.
22+
A symlink to the agent's Claude Code transcript, created automatically by the post-Agent hook. Points to the subagent transcript at `~/.claude/projects/<project-hash>/<session_id>/subagents/agent-<agent_id>.jsonl`. This allows learning cycle skills to read the transcript directly from the session log folder without needing to search for it via Glob patterns.
2323

24-
The symlink is only created if the transcript file exists at hook execution time (which it should, since the PostToolUse hook fires after the Task completes).
24+
The symlink is only created if the transcript file exists at hook execution time (which it should, since the PostToolUse hook fires after the Agent completes).
2525

2626
### needs_learning_as_of_timestamp
2727

28-
Created automatically by the post-Task hook whenever a LearningAgent is used. The file body contains a single ISO 8601 timestamp indicating when the agent was last invoked. This file serves as a flag: its presence means the session transcript has not yet been processed for learnings.
28+
Created automatically by the post-Agent hook whenever a LearningAgent is used. The file body contains a single ISO 8601 timestamp indicating when the agent was last invoked. This file serves as a flag: its presence means the session transcript has not yet been processed for learnings.
2929

3030
Deleted by `incorporate_learnings` after all issues in the folder have been processed.
3131

@@ -35,19 +35,19 @@ Updated by `incorporate_learnings` after processing issues in this conversation.
3535

3636
### agent_used
3737

38-
Created automatically by the post-Task hook. Contains the name of the LearningAgent that was used in this session (matching the folder name under `.deepwork/learning-agents/`). This links the session's agent_id back to the LearningAgent definition so learning skills can look up the agent's instructions and knowledge.
38+
Created automatically by the post-Agent hook. Contains the name of the LearningAgent that was used in this session (matching the folder name under `.deepwork/learning-agents/`). This links the session's agent_id back to the LearningAgent definition so learning skills can look up the agent's instructions and knowledge.
3939

4040
### *.issue.yml
4141

4242
Issue files created during the `identify` and `report_issue` skills. See `issue_yml_format.md` for the full schema. These files progress through statuses: `identified``investigated``learned`.
4343

4444
### conversation_transcript.jsonl
4545

46-
Symlink to the agent's Claude Code transcript, created automatically by the post-Task hook. **THIS IS THE FILE TO READ TO SEE THE CONVERSATION ALL THE OTHER FILES REFER TO.**
46+
Symlink to the agent's Claude Code transcript, created automatically by the post-Agent hook. **THIS IS THE FILE TO READ TO SEE THE CONVERSATION ALL THE OTHER FILES REFER TO.**
4747

4848
## Lifecycle
4949

50-
1. **Agent used**: Post-Task hook creates `needs_learning_as_of_timestamp`, `agent_used`, and `conversation_transcript.jsonl` symlink
50+
1. **Agent used**: Post-Agent hook creates `needs_learning_as_of_timestamp`, `agent_used`, and `conversation_transcript.jsonl` symlink
5151
2. **Session ends**: Stop hook detects `needs_learning_as_of_timestamp` files and suggests running a learning cycle
5252
3. **Learning cycle** (`/learning-agents learn`):
5353
a. `identify` reads transcripts and creates `*.issue.yml` files with status `identified`

0 commit comments

Comments
 (0)