claude-mpm 5.4.59__py3-none-any.whl → 5.4.64__py3-none-any.whl
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.
Potentially problematic release.
This version of claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +5 -0
- claude_mpm/cli/startup.py +14 -9
- claude_mpm/scripts/start_activity_logging.py +0 -0
- claude_mpm/services/agents/deployment/agent_template_builder.py +8 -0
- claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
- claude_mpm/skills/bundled/collaboration/git-worktrees.md +317 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
- claude_mpm/skills/bundled/collaboration/stacked-prs.md +251 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/INTEGRATION.md +611 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/README.md +596 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/SKILL.md +260 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/examples/nextjs-env-structure.md +315 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/frameworks.md +436 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/security.md +433 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/synchronization.md +452 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/troubleshooting.md +404 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/validation.md +420 -0
- claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
- claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
- claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
- claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
- claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
- claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
- claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
- claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
- claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
- claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
- claude_mpm/skills/bundled/pm/pm-delegation-patterns/SKILL.md +167 -0
- claude_mpm/skills/bundled/pm/pm-git-file-tracking/SKILL.md +113 -0
- claude_mpm/skills/bundled/pm/pm-pr-workflow/SKILL.md +124 -0
- claude_mpm/skills/bundled/pm/pm-ticketing-integration/SKILL.md +154 -0
- claude_mpm/skills/bundled/pm/pm-verification-protocols/SKILL.md +198 -0
- claude_mpm/skills/bundled/react/flexlayout-react.md +742 -0
- claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
- claude_mpm/skills/bundled/tauri/tauri-async-patterns.md +495 -0
- claude_mpm/skills/bundled/tauri/tauri-build-deploy.md +599 -0
- claude_mpm/skills/bundled/tauri/tauri-command-patterns.md +535 -0
- claude_mpm/skills/bundled/tauri/tauri-error-handling.md +613 -0
- claude_mpm/skills/bundled/tauri/tauri-event-system.md +648 -0
- claude_mpm/skills/bundled/tauri/tauri-file-system.md +673 -0
- claude_mpm/skills/bundled/tauri/tauri-frontend-integration.md +767 -0
- claude_mpm/skills/bundled/tauri/tauri-performance.md +669 -0
- claude_mpm/skills/bundled/tauri/tauri-state-management.md +573 -0
- claude_mpm/skills/bundled/tauri/tauri-testing.md +384 -0
- claude_mpm/skills/bundled/tauri/tauri-window-management.md +628 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
- claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/SKILL.md +458 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/examples/example-inspection-report.md +411 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/assertion-quality.md +317 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/inspection-checklist.md +270 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/red-flags.md +436 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
- claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
- claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
- claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
- claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
- claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
- claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/METADATA +1 -1
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/RECORD +128 -11
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/WHEEL +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/entry_points.txt +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.64.dist-info}/top_level.txt +0 -0
claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
# Agent Prompts
|
|
2
|
+
|
|
3
|
+
Complete guide to writing effective prompts for parallel agent dispatch.
|
|
4
|
+
|
|
5
|
+
## Prompt Structure
|
|
6
|
+
|
|
7
|
+
### The Four Essential Elements
|
|
8
|
+
|
|
9
|
+
Every agent prompt must include:
|
|
10
|
+
|
|
11
|
+
1. **Scope** - What domain/files the agent works on
|
|
12
|
+
2. **Goal** - What success looks like
|
|
13
|
+
3. **Constraints** - What the agent should NOT do
|
|
14
|
+
4. **Output** - What to return when complete
|
|
15
|
+
|
|
16
|
+
**Missing any element leads to:**
|
|
17
|
+
- Scope missing → Agent changes too much
|
|
18
|
+
- Goal missing → Agent doesn't know when done
|
|
19
|
+
- Constraints missing → Agent breaks other things
|
|
20
|
+
- Output missing → You can't verify what changed
|
|
21
|
+
|
|
22
|
+
### Template: Test File Fixing
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
Fix the [N] failing tests in [file path]:
|
|
26
|
+
|
|
27
|
+
[List each failing test name and error message]
|
|
28
|
+
|
|
29
|
+
Context:
|
|
30
|
+
[Why these tests are failing - recent changes, library updates, etc.]
|
|
31
|
+
|
|
32
|
+
Your task:
|
|
33
|
+
1. Read the test file and understand what each test verifies
|
|
34
|
+
2. Identify root cause - is it the test or the implementation?
|
|
35
|
+
3. Fix by:
|
|
36
|
+
[Specific guidance based on failure type]
|
|
37
|
+
|
|
38
|
+
Constraints:
|
|
39
|
+
- Only modify [allowed files]
|
|
40
|
+
- Do NOT change [protected files/APIs]
|
|
41
|
+
- [Other specific constraints]
|
|
42
|
+
|
|
43
|
+
Return:
|
|
44
|
+
- Summary of root cause
|
|
45
|
+
- List of files changed with brief explanation
|
|
46
|
+
- Confirmation all tests in scope now pass
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Template: Subsystem Investigation
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
Investigate and fix issues in [subsystem name]:
|
|
53
|
+
|
|
54
|
+
Symptoms:
|
|
55
|
+
[List observed failures, errors, unexpected behavior]
|
|
56
|
+
|
|
57
|
+
Your scope:
|
|
58
|
+
[List files/modules in this subsystem]
|
|
59
|
+
|
|
60
|
+
Your task:
|
|
61
|
+
1. Reproduce the issue locally
|
|
62
|
+
2. Identify root cause through debugging
|
|
63
|
+
3. Implement minimal fix
|
|
64
|
+
4. Verify fix resolves symptoms
|
|
65
|
+
|
|
66
|
+
Constraints:
|
|
67
|
+
- Stay within [subsystem] boundaries
|
|
68
|
+
- Coordinate with me before changing shared utilities
|
|
69
|
+
- Don't modify external dependencies
|
|
70
|
+
|
|
71
|
+
Return:
|
|
72
|
+
- Root cause explanation
|
|
73
|
+
- Your fix approach and rationale
|
|
74
|
+
- List of changed files
|
|
75
|
+
- Verification steps you performed
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Template: Feature Bug Fix
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
Fix bug in [feature name]:
|
|
82
|
+
|
|
83
|
+
Bug report:
|
|
84
|
+
[User-reported issue or test failure]
|
|
85
|
+
|
|
86
|
+
Expected behavior:
|
|
87
|
+
[What should happen]
|
|
88
|
+
|
|
89
|
+
Actual behavior:
|
|
90
|
+
[What currently happens]
|
|
91
|
+
|
|
92
|
+
Your task:
|
|
93
|
+
1. Locate where this behavior is implemented
|
|
94
|
+
2. Identify why actual ≠ expected
|
|
95
|
+
3. Fix the implementation or test expectations
|
|
96
|
+
4. Add test coverage if missing
|
|
97
|
+
|
|
98
|
+
Constraints:
|
|
99
|
+
- Maintain backward compatibility for [API/interface]
|
|
100
|
+
- Don't change [other features]
|
|
101
|
+
- Keep fix minimal and focused
|
|
102
|
+
|
|
103
|
+
Return:
|
|
104
|
+
- Root cause (why did this bug exist?)
|
|
105
|
+
- Your fix and why it's correct
|
|
106
|
+
- Test coverage added/modified
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Good vs Bad Prompts
|
|
110
|
+
|
|
111
|
+
### Example 1: Test Failures
|
|
112
|
+
|
|
113
|
+
**❌ Bad:**
|
|
114
|
+
```
|
|
115
|
+
Fix the tests that are failing.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Problems:**
|
|
119
|
+
- No scope (which tests?)
|
|
120
|
+
- No context (why failing?)
|
|
121
|
+
- No constraints (can change anything)
|
|
122
|
+
- No output format
|
|
123
|
+
|
|
124
|
+
**✅ Good:**
|
|
125
|
+
```
|
|
126
|
+
Fix the 3 failing tests in src/auth/login.test.ts:
|
|
127
|
+
|
|
128
|
+
1. "should handle expired sessions" - TypeError: Cannot read property 'refresh' of undefined
|
|
129
|
+
2. "should refresh tokens" - Expected token to be defined, got undefined
|
|
130
|
+
3. "should logout on invalid token" - Expected logout() to be called
|
|
131
|
+
|
|
132
|
+
Context: These started failing after auth library upgrade v2→v3
|
|
133
|
+
|
|
134
|
+
Your task:
|
|
135
|
+
1. Review auth library v3 migration guide
|
|
136
|
+
2. Update TokenService usage to v3 API
|
|
137
|
+
3. Verify all 3 tests pass
|
|
138
|
+
|
|
139
|
+
Constraints:
|
|
140
|
+
- Only modify login.service.ts and login.test.ts
|
|
141
|
+
- Don't change TokenService (external library)
|
|
142
|
+
|
|
143
|
+
Return:
|
|
144
|
+
- What changed in v3 API
|
|
145
|
+
- Your implementation changes
|
|
146
|
+
- Test status after fix
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Example 2: Subsystem Issues
|
|
150
|
+
|
|
151
|
+
**❌ Bad:**
|
|
152
|
+
```
|
|
153
|
+
The payment stuff is broken, please fix.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Problems:**
|
|
157
|
+
- "Payment stuff" too vague
|
|
158
|
+
- "Broken" undefined (what's the symptom?)
|
|
159
|
+
- No specific task
|
|
160
|
+
|
|
161
|
+
**✅ Good:**
|
|
162
|
+
```
|
|
163
|
+
Fix payment processing errors in checkout flow:
|
|
164
|
+
|
|
165
|
+
Errors observed:
|
|
166
|
+
- Stripe webhook receiving 500 responses
|
|
167
|
+
- Payment confirmations not saving to database
|
|
168
|
+
- Users not receiving email receipts
|
|
169
|
+
|
|
170
|
+
Your scope:
|
|
171
|
+
- src/payments/stripe-webhook.controller.ts
|
|
172
|
+
- src/payments/payment.service.ts
|
|
173
|
+
- src/payments/payment.model.ts
|
|
174
|
+
|
|
175
|
+
Your task:
|
|
176
|
+
1. Reproduce webhook failure with test events
|
|
177
|
+
2. Identify why confirmations aren't saving
|
|
178
|
+
3. Fix the payment processing pipeline
|
|
179
|
+
4. Verify webhooks return 200 and emails send
|
|
180
|
+
|
|
181
|
+
Constraints:
|
|
182
|
+
- Don't modify Stripe SDK usage (library is correct)
|
|
183
|
+
- Don't change payment.model.ts schema (requires migration)
|
|
184
|
+
- Keep email service calls async (don't block webhook)
|
|
185
|
+
|
|
186
|
+
Return:
|
|
187
|
+
- Root cause of each error
|
|
188
|
+
- Your fixes and verification
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Example 3: Investigation + Fix
|
|
192
|
+
|
|
193
|
+
**❌ Bad:**
|
|
194
|
+
```
|
|
195
|
+
Look into the performance problems.
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Problems:**
|
|
199
|
+
- What performance problems where?
|
|
200
|
+
- What's the success criteria?
|
|
201
|
+
- Should agent fix or just report?
|
|
202
|
+
|
|
203
|
+
**✅ Good:**
|
|
204
|
+
```
|
|
205
|
+
Investigate and fix slow response times in product search API:
|
|
206
|
+
|
|
207
|
+
Observed: /api/products/search takes 3-5 seconds (should be <500ms)
|
|
208
|
+
|
|
209
|
+
Your scope:
|
|
210
|
+
- src/products/search.service.ts
|
|
211
|
+
- src/products/search.controller.ts
|
|
212
|
+
- Database queries for product search
|
|
213
|
+
|
|
214
|
+
Your task:
|
|
215
|
+
1. Profile the search endpoint to identify bottleneck
|
|
216
|
+
2. Analyze database query performance
|
|
217
|
+
3. Optimize slow queries or add caching
|
|
218
|
+
4. Verify response time <500ms for typical searches
|
|
219
|
+
|
|
220
|
+
Constraints:
|
|
221
|
+
- Don't change API contract (request/response shape)
|
|
222
|
+
- Keep search results accurate (no false positives)
|
|
223
|
+
- If caching, implement proper invalidation
|
|
224
|
+
|
|
225
|
+
Return:
|
|
226
|
+
- Profiling results (what was slow)
|
|
227
|
+
- Your optimization approach
|
|
228
|
+
- Performance before/after measurements
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Context Provision
|
|
232
|
+
|
|
233
|
+
### What Context to Include
|
|
234
|
+
|
|
235
|
+
**Always include:**
|
|
236
|
+
- Exact error messages (copy-paste)
|
|
237
|
+
- Test names that are failing
|
|
238
|
+
- Recent changes that might be related
|
|
239
|
+
- Expected vs actual behavior
|
|
240
|
+
|
|
241
|
+
**Include when relevant:**
|
|
242
|
+
- Library/framework versions
|
|
243
|
+
- Environment differences (prod vs dev)
|
|
244
|
+
- User reports or bug tickets
|
|
245
|
+
- Related issues that were fixed
|
|
246
|
+
|
|
247
|
+
**Don't include:**
|
|
248
|
+
- Entire codebase (agent will search)
|
|
249
|
+
- Unrelated files
|
|
250
|
+
- Historical context beyond 1-2 changes back
|
|
251
|
+
- Speculation ("I think maybe...")
|
|
252
|
+
|
|
253
|
+
### Example: Rich Context
|
|
254
|
+
|
|
255
|
+
```markdown
|
|
256
|
+
Fix 3 failures in batch-completion-behavior.test.ts:
|
|
257
|
+
|
|
258
|
+
Test failures:
|
|
259
|
+
1. "should execute all tools in batch"
|
|
260
|
+
Error: Expected 3 tool executions, received 0
|
|
261
|
+
|
|
262
|
+
2. "should complete batch when all tools finish"
|
|
263
|
+
Error: Batch status is 'pending', expected 'completed'
|
|
264
|
+
|
|
265
|
+
3. "should handle partial batch completion"
|
|
266
|
+
Error: completedCount is 0, expected 2
|
|
267
|
+
|
|
268
|
+
Context:
|
|
269
|
+
- Started failing after refactoring event emission (commit abc123)
|
|
270
|
+
- Changed from direct method calls to event-based architecture
|
|
271
|
+
- Other tests pass, only batch execution affected
|
|
272
|
+
|
|
273
|
+
Relevant code:
|
|
274
|
+
- src/batch/batch-executor.ts (execution logic)
|
|
275
|
+
- src/batch/batch.service.ts (status tracking)
|
|
276
|
+
- Tests use mock tools that resolve after 100ms
|
|
277
|
+
|
|
278
|
+
Your task:
|
|
279
|
+
1. Review how events are emitted in new architecture
|
|
280
|
+
2. Check if batch executor is listening to correct events
|
|
281
|
+
3. Verify event payload structure matches expectations
|
|
282
|
+
4. Fix event wiring or update tests if behavior changed intentionally
|
|
283
|
+
|
|
284
|
+
Constraints:
|
|
285
|
+
- Keep event-based architecture (don't revert to direct calls)
|
|
286
|
+
- Don't modify mock tools in tests
|
|
287
|
+
- Ensure fix works for both sync and async tools
|
|
288
|
+
|
|
289
|
+
Return:
|
|
290
|
+
- What was wrong with event wiring
|
|
291
|
+
- Your fix
|
|
292
|
+
- Verification all 3 tests pass
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Common Mistakes
|
|
296
|
+
|
|
297
|
+
### Mistake 1: Too Broad
|
|
298
|
+
|
|
299
|
+
**❌ Bad:**
|
|
300
|
+
```
|
|
301
|
+
Fix all the auth issues and make sure everything works.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Why bad:**
|
|
305
|
+
- "All auth issues" could be 50 files
|
|
306
|
+
- "Everything works" has no definition
|
|
307
|
+
- Agent doesn't know where to start
|
|
308
|
+
|
|
309
|
+
**✅ Fix:**
|
|
310
|
+
```
|
|
311
|
+
Fix the 2 failing tests in auth/session.test.ts:
|
|
312
|
+
- Test 1: [specific test name and error]
|
|
313
|
+
- Test 2: [specific test name and error]
|
|
314
|
+
|
|
315
|
+
Success = both tests pass
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Mistake 2: No Context
|
|
319
|
+
|
|
320
|
+
**❌ Bad:**
|
|
321
|
+
```
|
|
322
|
+
Fix the race condition in agent-tool-abort.test.ts
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Why bad:**
|
|
326
|
+
- Which race condition?
|
|
327
|
+
- What's the symptom?
|
|
328
|
+
- What was changed recently?
|
|
329
|
+
|
|
330
|
+
**✅ Fix:**
|
|
331
|
+
```
|
|
332
|
+
Fix race condition in agent-tool-abort.test.ts:
|
|
333
|
+
|
|
334
|
+
Symptom: Test "should abort tool with partial output" is flaky
|
|
335
|
+
- Passes 70% of time, fails 30%
|
|
336
|
+
- When fails: expects 'interrupted at' in message, message is empty
|
|
337
|
+
|
|
338
|
+
Likely cause: Test doesn't wait for abort to complete before asserting
|
|
339
|
+
|
|
340
|
+
Your task: Replace arbitrary timeout with event-based waiting
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Mistake 3: Unclear Constraints
|
|
344
|
+
|
|
345
|
+
**❌ Bad:**
|
|
346
|
+
```
|
|
347
|
+
Fix the tests but don't break anything.
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Why bad:**
|
|
351
|
+
- "Don't break anything" is obvious but not actionable
|
|
352
|
+
- Doesn't specify what agent CAN change
|
|
353
|
+
|
|
354
|
+
**✅ Fix:**
|
|
355
|
+
```
|
|
356
|
+
Fix the tests in login.test.ts.
|
|
357
|
+
|
|
358
|
+
Allowed changes:
|
|
359
|
+
- login.service.ts (implementation)
|
|
360
|
+
- login.test.ts (test expectations)
|
|
361
|
+
|
|
362
|
+
NOT allowed:
|
|
363
|
+
- auth.controller.ts (API contract)
|
|
364
|
+
- user.model.ts (database schema)
|
|
365
|
+
- Shared utilities in /common
|
|
366
|
+
|
|
367
|
+
Coordinate with me before changing anything else.
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Mistake 4: No Output Specification
|
|
371
|
+
|
|
372
|
+
**❌ Bad:**
|
|
373
|
+
```
|
|
374
|
+
Fix the payment processing bugs.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Why bad:**
|
|
378
|
+
- Agent might fix and not tell you what changed
|
|
379
|
+
- You can't verify the fix without reading all the code
|
|
380
|
+
|
|
381
|
+
**✅ Fix:**
|
|
382
|
+
```
|
|
383
|
+
Fix payment processing bugs.
|
|
384
|
+
|
|
385
|
+
When complete, return:
|
|
386
|
+
1. Root cause analysis - why were payments failing?
|
|
387
|
+
2. List of files you changed with brief explanation each
|
|
388
|
+
3. How you verified the fix (tests? manual testing?)
|
|
389
|
+
4. Any risks or edge cases to watch for
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Advanced Patterns
|
|
393
|
+
|
|
394
|
+
### Pattern: Investigate Then Fix
|
|
395
|
+
|
|
396
|
+
**Use when:** Root cause unknown, agent needs to explore
|
|
397
|
+
|
|
398
|
+
```markdown
|
|
399
|
+
Investigate why user profile updates are failing:
|
|
400
|
+
|
|
401
|
+
Symptoms:
|
|
402
|
+
- PUT /api/users/:id returns 200 but changes don't persist
|
|
403
|
+
- Database shows old values after update
|
|
404
|
+
- No errors in logs
|
|
405
|
+
|
|
406
|
+
Your approach:
|
|
407
|
+
1. **Investigate** (15-20 min):
|
|
408
|
+
- Add debug logging to update flow
|
|
409
|
+
- Check if database transaction commits
|
|
410
|
+
- Verify request payload reaches database layer
|
|
411
|
+
|
|
412
|
+
2. **Report findings** to me:
|
|
413
|
+
- What you discovered
|
|
414
|
+
- Proposed fix approach
|
|
415
|
+
|
|
416
|
+
3. **Wait for confirmation** before implementing fix
|
|
417
|
+
|
|
418
|
+
4. **Implement** approved fix
|
|
419
|
+
|
|
420
|
+
This two-phase approach ensures we fix root cause, not symptoms.
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Pattern: Parallel Agents with Shared Learning
|
|
424
|
+
|
|
425
|
+
**Use when:** Multiple agents might discover related info
|
|
426
|
+
|
|
427
|
+
```markdown
|
|
428
|
+
[Agent 1 - Auth subsystem]
|
|
429
|
+
Fix auth issues, report any shared utility bugs you find.
|
|
430
|
+
|
|
431
|
+
[Agent 2 - Payment subsystem]
|
|
432
|
+
Fix payment issues, report any shared utility bugs you find.
|
|
433
|
+
|
|
434
|
+
[Agent 3 - Notification subsystem]
|
|
435
|
+
Fix notification issues, report any shared utility bugs you find.
|
|
436
|
+
|
|
437
|
+
If any agent finds a shared utility bug:
|
|
438
|
+
1. Report it immediately
|
|
439
|
+
2. Pause your other work
|
|
440
|
+
3. Wait for coordinator to decide if one agent should fix centrally
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### Pattern: Staged Dispatch
|
|
444
|
+
|
|
445
|
+
**Use when:** Some problems must be fixed before others
|
|
446
|
+
|
|
447
|
+
```markdown
|
|
448
|
+
[Agent 1 - Priority 1]
|
|
449
|
+
Fix database connection pool exhaustion.
|
|
450
|
+
This is blocking other work - highest priority.
|
|
451
|
+
|
|
452
|
+
Return ASAP: Is it fixed?
|
|
453
|
+
|
|
454
|
+
[Agent 2 & 3 - Will dispatch after Agent 1]
|
|
455
|
+
Waiting for database fix before investigating:
|
|
456
|
+
- Agent 2: Session timeout issues (might be due to DB)
|
|
457
|
+
- Agent 3: Query performance (definitely due to DB)
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
## Prompt Checklist
|
|
461
|
+
|
|
462
|
+
Before dispatching any agent:
|
|
463
|
+
|
|
464
|
+
```
|
|
465
|
+
□ Scope clearly defined (files, boundaries)
|
|
466
|
+
□ Goal is specific and measurable
|
|
467
|
+
□ Context includes error messages and recent changes
|
|
468
|
+
□ Constraints specify what NOT to change
|
|
469
|
+
□ Output format specified (summary, file list, verification)
|
|
470
|
+
□ Agent knows when to ask for help vs decide independently
|
|
471
|
+
□ Integration plan considered (how will this merge with other agent work?)
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## Template Library
|
|
475
|
+
|
|
476
|
+
### Quick Template: Single Test File
|
|
477
|
+
|
|
478
|
+
```markdown
|
|
479
|
+
Fix [N] failing tests in [file]:
|
|
480
|
+
|
|
481
|
+
Tests:
|
|
482
|
+
1. [test name] - [error]
|
|
483
|
+
2. [test name] - [error]
|
|
484
|
+
|
|
485
|
+
Task: [what to do]
|
|
486
|
+
Don't: [what not to change]
|
|
487
|
+
Return: Root cause + changes + verification
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Quick Template: Bug Investigation
|
|
491
|
+
|
|
492
|
+
```markdown
|
|
493
|
+
Investigate [symptom]:
|
|
494
|
+
|
|
495
|
+
Context: [when it happens, what changed]
|
|
496
|
+
Scope: [files to look at]
|
|
497
|
+
Task: Find root cause, propose fix, wait for approval
|
|
498
|
+
Return: Analysis + proposed solution + risks
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### Quick Template: Performance Issue
|
|
502
|
+
|
|
503
|
+
```markdown
|
|
504
|
+
Optimize [slow operation]:
|
|
505
|
+
|
|
506
|
+
Current: [performance measurement]
|
|
507
|
+
Target: [performance goal]
|
|
508
|
+
Scope: [what to optimize]
|
|
509
|
+
Constraints: [what must stay the same]
|
|
510
|
+
Return: Bottleneck analysis + optimization + before/after
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
## Real-World Examples
|
|
514
|
+
|
|
515
|
+
### Example: Actual Parallel Dispatch
|
|
516
|
+
|
|
517
|
+
From debugging session (2025-10-03):
|
|
518
|
+
|
|
519
|
+
**Agent 1 Prompt:**
|
|
520
|
+
```markdown
|
|
521
|
+
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
|
|
522
|
+
|
|
523
|
+
1. "should abort tool with partial output capture" - expects 'interrupted at' in message
|
|
524
|
+
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
|
|
525
|
+
3. "should properly track pendingToolCount" - expects 3 results but gets 0
|
|
526
|
+
|
|
527
|
+
These are timing/race condition issues. Your task:
|
|
528
|
+
|
|
529
|
+
1. Read the test file and understand what each test verifies
|
|
530
|
+
2. Identify root cause - timing issues or actual bugs?
|
|
531
|
+
3. Fix by:
|
|
532
|
+
- Replacing arbitrary timeouts with event-based waiting
|
|
533
|
+
- Fixing bugs in abort implementation if found
|
|
534
|
+
- Adjusting test expectations if testing changed behavior
|
|
535
|
+
|
|
536
|
+
Do NOT just increase timeouts - find the real issue.
|
|
537
|
+
|
|
538
|
+
Return: Summary of what you found and what you fixed.
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
**Agent 2 Prompt:**
|
|
542
|
+
```markdown
|
|
543
|
+
Fix the 2 failing tests in src/agents/batch-completion-behavior.test.ts:
|
|
544
|
+
|
|
545
|
+
1. "should execute all tools in batch" - expected 3 tool executions, received 0
|
|
546
|
+
2. "should complete batch when all tools finish" - batch status is 'pending', expected 'completed'
|
|
547
|
+
|
|
548
|
+
Context: These started failing after event refactoring.
|
|
549
|
+
|
|
550
|
+
Your task:
|
|
551
|
+
1. Verify event emission in batch executor
|
|
552
|
+
2. Check event listeners are set up correctly
|
|
553
|
+
3. Fix event wiring or update test expectations
|
|
554
|
+
|
|
555
|
+
Return: Summary of what you found and what you fixed.
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**Agent 3 Prompt:**
|
|
559
|
+
```markdown
|
|
560
|
+
Fix the 1 failing test in src/agents/tool-approval-race-conditions.test.ts:
|
|
561
|
+
|
|
562
|
+
1. "should handle rapid tool approvals" - execution count is 0, expected 3
|
|
563
|
+
|
|
564
|
+
Likely cause: Test doesn't wait for async execution to complete.
|
|
565
|
+
|
|
566
|
+
Your task:
|
|
567
|
+
1. Add proper waiting for tool execution completion
|
|
568
|
+
2. Verify race conditions are actually handled (not just test timing)
|
|
569
|
+
|
|
570
|
+
Return: Summary of what you found and what you fixed.
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
**Results:**
|
|
574
|
+
- All agents returned clear summaries
|
|
575
|
+
- No scope overlap, no conflicts
|
|
576
|
+
- All fixes integrated cleanly
|
|
577
|
+
- Full test suite passed
|