You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(agents): inline MCP tool usage into workflow steps
Remove the weak "MCP Tools — Conserve Context" preamble sections from
all agents. These advisory blocks were being ignored — agents fell into
Read/Grep habits. Instead, MCP tool calls are now embedded directly in
the workflow steps where the agent makes decisions.
Pattern: "Run dev_refs on the changed functions" (imperative, in-step)
instead of "Before you Grep, ask if an MCP tool can help" (advisory,
separate section).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/agents/bug-investigator.md
+5-16Lines changed: 5 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,31 +10,20 @@ color: orange
10
10
11
11
Systematically traces issues through the dev-agent monorepo. Reproduces, traces, fixes, and prevents regression.
12
12
13
-
## MCP Tools — Conserve Context
14
-
15
-
This agent runs in a long session with a finite context window. Every Grep → Read cycle burns ~5,000 tokens on irrelevant matches. MCP tools return only what you need.
16
-
17
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**
18
-
19
-
-**`dev_search`** — Conceptual queries ("where does rate limiting happen"). Returns ranked snippets, not 200 grep matches.
20
-
-**`dev_refs`** — Callers/callees of a function. Use `dependsOn` to trace dependency chains. Returns the call graph directly.
21
-
-**`dev_map`** — Codebase structure with hot paths and subsystems. One call replaces dozens of ls/glob/read operations.
22
-
23
-
Only use Grep for exact string matches where you know the literal text. Only Read files when you need the full implementation.
24
-
25
13
## Investigation Framework
26
14
27
15
### Phase 1: Understand the Bug
28
16
29
17
1. What is the expected behavior?
30
18
2. What is the actual behavior?
31
19
3. What are the reproduction steps?
32
-
4. When did it start happening? (check recent commits + `dev_map` for churn)
33
-
5. Is it consistent or intermittent?
20
+
4. Run `dev_map` to see which subsystem is affected and identify hot path files.
21
+
5. Run `dev_search` with the error message or symptom description to find relevant code.
22
+
6. When did it start happening? (check recent commits)
34
23
35
24
### Phase 2: Trace the Data Flow
36
25
37
-
Use`dev_refs` to trace caller/callee chains along these paths:
26
+
Run`dev_refs`on the functions identified in Phase 1. Use `dependsOn`to trace the full dependency chain. Follow these paths:
38
27
39
28
**MCP path:**
40
29
```
@@ -55,7 +44,7 @@ dev index → Indexer → Scanner (ts-morph/tree-sitter) → Antfly (embed + sto
55
44
56
45
### Phase 3: Identify Root Cause
57
46
58
-
Use`dev_search`to find code related to each symptom area:
47
+
Run`dev_search`for each symptom area to find related code:
Copy file name to clipboardExpand all lines: .claude/agents/logic-reviewer.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,13 +65,17 @@ Every finding MUST include confidence: **HIGH** (verified from code), **MEDIUM**
65
65
66
66
### Cross-Package Data Flow (Deep+ Effort)
67
67
68
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**`dev_refs` returns the call graph directly, `dev_search` finds related code by concept, `dev_patterns` compares error handling across files — each saves ~3,000-5,000 tokens vs manual file reading.
69
-
70
-
-[ ] Core exports consumed correctly by CLI, MCP server, and subagents — verify with `dev_refs`
71
-
-[ ] Dependency chains make sense — use `dev_refs` with `dependsOn` to trace file-to-file paths
68
+
Start by running these MCP tools on the changed functions:
69
+
1.`dev_refs` on each modified function — trace callers and callees across packages.
70
+
2.`dev_refs` with `dependsOn` on the changed files — trace file-to-file dependency paths.
71
+
3.`dev_patterns` on changed files — compare error handling patterns against similar files.
72
+
73
+
Then verify:
74
+
-[ ] Core exports consumed correctly by CLI, MCP server, and subagents (from `dev_refs` results)
75
+
-[ ] Dependency chains make sense (from `dependsOn` results)
72
76
-[ ] Type boundaries between packages match (no `any` casting to bridge mismatches)
73
77
-[ ] Logger (@prosdevlab/kero) configuration consistent across consumers
74
-
-[ ] Error handling patterns are consistent with existing code (verify with `dev_patterns`)
Copy file name to clipboardExpand all lines: .claude/agents/plan-reviewer.md
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,28 +12,22 @@ Two-pass review of execution plans in `.claude/da-plans/`. Validates completenes
12
12
13
13
This agent **NEVER modifies plans**. It reports issues for the author to fix.
14
14
15
-
## MCP Tools — Conserve Context
16
-
17
-
This agent runs in a long session with a finite context window. Every Grep → Read cycle burns ~5,000 tokens on irrelevant matches. MCP tools return only what you need.
18
-
19
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**
20
-
21
-
-**`dev_map`** — Verify structure claims in the plan against actual codebase layout.
22
-
-**`dev_refs`** — Confirm dependency assertions. Use `dependsOn` to trace dependency chains between files.
23
-
-**`dev_patterns`** — Check if proposed patterns match existing conventions.
24
-
25
15
## Two-Pass Review
26
16
27
17
### Pass 1: Engineer Review
28
18
29
-
Read the plan as a senior engineer. Use `dev_map` to verify structure claims, `dev_refs` to confirm dependency assertions, and `dev_patterns` to check if proposed patterns match existing conventions.
30
-
31
-
1.**Context** — Does it accurately describe what exists today? (Verify with `dev_map` and reading actual code)
32
-
2.**Architecture** — Does the proposed design fit the existing monorepo structure?
33
-
3.**Parts breakdown** — Are parts sized correctly? (Each should be 1-2 commits)
34
-
4.**Dependencies** — Are cross-package dependencies identified? (Verify with `dev_refs`. Use `dependsOn` to trace dependency chains between files.)
35
-
5.**Build order** — Does the implementation order respect the build dependency chain?
36
-
6.**Breaking changes** — Are they identified and migration paths described?
19
+
Read the plan as a senior engineer. Start by gathering context with MCP tools before evaluating.
20
+
21
+
1. Run `dev_map` to see the current codebase structure. Compare against the plan's architecture claims.
22
+
2. Run `dev_refs` on the key functions the plan modifies. Use `dependsOn` to trace dependency chains between files the plan touches.
23
+
3. Run `dev_patterns` on files the plan proposes to change. Check if the proposed code follows existing conventions.
24
+
4. Now evaluate with the context you gathered:
25
+
-**Context** — Does the plan accurately describe what exists today?
26
+
-**Architecture** — Does the proposed design fit the actual structure you saw in `dev_map`?
27
+
-**Parts breakdown** — Are parts sized correctly? (Each should be 1-2 commits)
28
+
-**Dependencies** — Do the `dev_refs` results confirm the plan's dependency claims?
29
+
-**Build order** — Does the implementation order respect the dependency chain?
30
+
-**Breaking changes** — Are they identified and migration paths described?
Copy file name to clipboardExpand all lines: .claude/agents/quality-reviewer.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,9 +48,9 @@ Maximum **5 SUGGESTION items** per review. If more found, pick the top 5 and not
48
48
49
49
### Readability & Simplification
50
50
51
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**`dev_patterns`compares patterns across similar files (~500 tokens vs ~3,000 for manual reads). `dev_search`checks if a utility exists by meaning, not just name.
51
+
Run `dev_patterns`on changed files to find similar code and detect duplication. Run `dev_search`to check if a utility already exists before flagging missing abstractions.
52
52
53
-
-[ ] No code duplicating existing utilities — verify with `dev_patterns` and `dev_search`
53
+
-[ ] No code duplicating existing utilities (from `dev_patterns` and `dev_search` results)
54
54
-[ ] Functions reasonably sized (consider splitting if >50 lines)
55
55
-[ ] Complex logic has comments explaining "why", not "what"
56
56
-[ ] No premature abstractions for one-time operations
Copy file name to clipboardExpand all lines: .claude/agents/quick-scout.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,6 @@ color: blue
10
10
11
11
Lightweight explorer optimized for speed and cost. Finds code, traces flows, maps dependencies.
12
12
13
-
## MCP Tools — Conserve Context
14
-
15
-
This agent runs in a long session with a finite context window. Every Grep → Read cycle burns ~5,000 tokens on irrelevant matches. MCP tools return only what you need.
16
-
17
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**
Copy file name to clipboardExpand all lines: .claude/agents/security-reviewer.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,11 @@ Security-focused review for a TypeScript monorepo that processes repository data
12
12
13
13
This agent **NEVER modifies code**. It reports issues for the developer to fix.
14
14
15
-
## MCP Tools — Conserve Context
15
+
## Before the Checklist
16
16
17
-
This agent runs in a long session with a finite context window. Every Grep → Read cycle burns ~5,000 tokens on irrelevant matches. MCP tools return only what you need.
18
-
19
-
**Before you Grep or Read, ask: can an MCP tool answer this without reading files?**
0 commit comments