run-parallel-agents-feature-debug
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<EXTREMELY-IMPORTANT>
Before launching parallel debugging agents, you **ABSOLUTELY MUST**:
- Verify problems are truly independent (no shared root cause, no cascading failures)
- Match each problem to the correct specialized agent
- Create complete briefs with error details, affected files, and success criteria
- Launch ALL agents in a SINGLE message with multiple Agent tool calls
Launching debug agents without verification = wasted time, misdiagnosis, incomplete fixes
This is not optional. Parallel debugging requires independence verification.
</EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT>
在启动并行调试Agent之前,你**绝对必须**:
- 验证问题是否真的相互独立(无共同根本原因、无连锁故障)
- 为每个问题匹配正确的专业Agent
- 创建包含错误详情、受影响文件和成功标准的完整简报
- 在单条消息中通过多个Agent工具调用启动所有Agent
未经验证就启动调试Agent会导致时间浪费、误诊和修复不完整
这不是可选步骤。并行调试必须进行独立性验证。
</EXTREMELY-IMPORTANT>
Run Parallel Agents Feature Debug
并行Agent功能调试
MANDATORY FIRST RESPONSE PROTOCOL
强制初始响应协议
Before launching ANY parallel debugging agents, you MUST complete this checklist:
- ☐ Count problems — are there 3+ independent issues?
- ☐ Check for shared root cause — could one fix solve multiple issues?
- ☐ Check for cascading failures — did one failure cause others?
- ☐ Match agents — assign correct agent type per problem
- ☐ Prepare briefs — error details, affected files, reproduction steps, success criteria
- ☐ Announce to user — "Launching N debugging agents in parallel for [issues]"
Launching agents WITHOUT completing this checklist = misdiagnosis and incomplete fixes.
在启动任何并行调试Agent之前,你必须完成以下检查清单:
- ☐ 统计问题数量——是否存在3个及以上独立问题?
- ☐ 检查是否存在共同根本原因——修复一个问题是否能解决多个问题?
- ☐ 检查是否存在连锁故障——是否某个故障引发了其他故障?
- ☐ 匹配Agent——为每个问题分配正确的Agent类型
- ☐ 准备简报——包含错误详情、受影响文件、复现步骤和成功标准
- ☐ 告知用户——"将为[问题列表]启动N个并行调试Agent"
未完成此检查清单就启动Agent会导致误诊和修复不完整。
Overview
概述
Automatically detect opportunities for parallel debugging and orchestrate multiple specialized agents working concurrently to diagnose and fix independent problems, bugs, test failures, and issues across different subsystems. Match each problem to the appropriate domain expert and coordinate their troubleshooting work to deliver faster resolutions.
自动检测并行调试的机会,编排多个专业Agent并发工作,诊断并修复不同子系统中的独立问题、bug、测试失败和异常。将每个问题匹配到对应的领域专家,协调他们的故障排查工作以更快解决问题。
When to Use This Skill
何时使用此技能
Use this skill automatically when:
Problem Indicators:
- Encountering 3+ unrelated bugs or failures
- Multiple test failures in isolated subsystems (backend, frontend, different services)
- Independent issues that don't share a root cause
- Problems in different technology stacks that can be debugged separately
- Each issue can be understood and fixed without context from others
User Triggers:
- "Debug these issues in parallel"
- "Fix these bugs concurrently"
- "Split debugging across agents"
- "Use parallel agents to resolve these failures"
- "Speed up troubleshooting with multiple agents"
Common Scenarios:
- Fixing multiple failing tests in different subsystems (Laravel tests, Next.js tests, API tests)
- Debugging independent bugs across microservices
- Resolving linting/type errors in separate modules
- Investigating performance issues in isolated components
- Fixing compilation errors across different parts of the stack
- Addressing security vulnerabilities in independent dependencies
在以下情况自动使用此技能:
问题指标:
- 遇到3个及以上不相关的bug或故障
- 独立子系统中出现多个测试失败(后端、前端、不同服务)
- 无共同根本原因的独立问题
- 可在不同技术栈中单独调试的问题
- 每个问题无需其他问题的上下文即可理解和修复
用户触发词:
- "并行调试这些问题"
- "同时修复这些bug"
- "拆分任务到多个Agent进行调试"
- "使用并行Agent解决这些故障"
- "通过多个Agent加速故障排查"
常见场景:
- 修复不同子系统中的多个失败测试(Laravel测试、Next.js测试、API测试)
- 调试微服务中的独立bug
- 解决独立模块中的代码规范/类型错误
- 排查独立组件的性能问题
- 修复技术栈不同部分的编译错误
- 处理独立依赖中的安全漏洞
When NOT to Use This Skill
何时不使用此技能
Do NOT use parallel debugging when:
Related Failures:
- Failures are interconnected (fixing one might fix others)
- Issues share a common root cause
- Cascading failures where the first error causes subsequent ones
- Need to understand full system state to diagnose properly
Sequential Dependencies:
- Must fix issues in a specific order
- Later fixes depend on earlier fixes being completed
- Shared state or data corruption affecting multiple areas
Single Root Cause:
- All symptoms point to one underlying issue
- Database connection problem affecting entire app
- Configuration error propagating through the system
- Single dependency version causing multiple breakages
Coordination Required:
- Need careful debugging across layers
- Issues require stepping through interconnected code
- Must maintain consistent state during debugging
- Agents would interfere with each other's diagnostic work
在以下情况请勿使用并行调试:
关联故障:
- 故障相互关联(修复一个可能解决其他问题)
- 问题存在共同根本原因
- 连锁故障(第一个错误引发后续错误)
- 需要了解完整系统状态才能正确诊断
顺序依赖:
- 必须按特定顺序修复问题
- 后续修复依赖于前期修复的完成
- 共享状态或数据损坏影响多个区域
单一根本原因:
- 所有症状指向同一个潜在问题
- 数据库连接问题影响整个应用
- 配置错误在系统中传播
- 单个依赖版本导致多个故障
需要协调:
- 需要跨层仔细调试
- 问题需要逐步排查关联代码
- 调试期间必须保持一致状态
- Agent之间的诊断工作会相互干扰
Core Workflow
核心工作流
Step 1: Analyze and Cluster the Problems
步骤1:分析并聚类问题
Examine the failures, bugs, or issues to identify:
- Problem isolation - Are the issues truly independent?
- Root cause analysis - Do they share a common cause?
- Subsystem mapping - Which tech stack/module is each problem in?
- Dependency check - Does fixing one require fixing another first?
Clustering Strategy:
Group problems by:
- Technology stack (Laravel backend, Next.js frontend, NestJS API)
- Subsystem (authentication, payment, user profile)
- Failure type (test failures, runtime errors, type errors, build errors)
- Module (independent services, separate features)
Decision Point:
- If problems cluster into 3+ independent groups → Proceed to parallel debugging
- If problems are related or have shared root cause → Use sequential debugging instead
检查故障、bug或问题,确定:
- 问题隔离——问题是否真的独立?
- 根本原因分析——是否存在共同原因?
- 子系统映射——每个问题属于哪个技术栈/模块?
- 依赖检查——修复一个问题是否需要先修复另一个?
聚类策略:
按以下维度分组问题:
- 技术栈(Laravel后端、Next.js前端、NestJS API)
- 子系统(认证、支付、用户资料)
- 故障类型(测试失败、运行时错误、类型错误、构建错误)
- 模块(独立服务、单独功能)
决策点:
- 如果问题聚类为3个及以上独立组→进行并行调试
- 如果问题相关或存在共同根本原因→改用顺序调试
Step 2: Match Problems to Specialized Agents
步骤2:为问题匹配专业Agent
For each independent problem cluster, determine the best agent type:
Technology Stack Detection:
- Laravel backend issues →
laravel-senior-engineer - Next.js frontend issues →
nextjs-senior-engineer - React + Vite + Tailwind bugs →
react-vite-tailwind-engineer - Express.js API issues →
express-senior-engineer - Node.js CLI issues →
nodejs-cli-senior-engineer - Python backend issues →
python-senior-engineer - FastAPI issues →
fastapi-senior-engineer - Go backend issues →
go-senior-engineer - Go CLI issues →
go-cli-senior-engineer - iOS/macOS, Swift issues →
ios-macos-senior-engineer - Expo mobile bugs →
expo-react-native-engineer - AWS infrastructure issues →
devops-aws-senior-engineer - Docker/container issues →
devops-docker-senior-engineer - General/cross-cutting issues →
general-purpose
Error Pattern Analysis:
PHPUnit test failures → Laravel
Jest/Vitest frontend tests → Next.js or React/Vite/Tailwind
Express middleware/routing errors → Express
pytest/unittest failures → Python or FastAPI
go test failures → Go
Swift/Xcode build errors → iOS/macOS
TypeScript compilation errors → Match to framework
Runtime errors → Match to where error occurs
Performance issues → Match to affected component为每个独立问题集群确定最佳Agent类型:
技术栈检测:
- Laravel后端问题 →
laravel-senior-engineer - Next.js前端问题 →
nextjs-senior-engineer - React + Vite + Tailwind bug →
react-vite-tailwind-engineer - Express.js API问题 →
express-senior-engineer - Node.js CLI问题 →
nodejs-cli-senior-engineer - Python后端问题 →
python-senior-engineer - FastAPI问题 →
fastapi-senior-engineer - Go后端问题 →
go-senior-engineer - Go CLI问题 →
go-cli-senior-engineer - iOS/macOS、Swift问题 →
ios-macos-senior-engineer - Expo移动bug →
expo-react-native-engineer - AWS基础设施问题 →
devops-aws-senior-engineer - Docker/容器问题 →
devops-docker-senior-engineer - 通用/跨领域问题 →
general-purpose
错误模式分析:
PHPUnit测试失败 → Laravel
Jest/Vitest前端测试 → Next.js或React/Vite/Tailwind
Express中间件/路由错误 → Express
pytest/unittest失败 → Python或FastAPI
go test失败 → Go
Swift/Xcode构建错误 → iOS/macOS
TypeScript编译错误 → 匹配对应框架
运行时错误 → 匹配错误发生位置
性能问题 → 匹配受影响组件Step 3: Prepare Debugging Briefs
步骤3:准备调试简报
For each agent, create a comprehensive debugging brief:
Required Elements:
- Problem description - What's failing or broken
- Error messages/stack traces - Complete diagnostic info
- Reproduction steps - How to trigger the issue
- Affected files - Where to look first
- Expected vs actual behavior - What should happen vs what's happening
- Success criteria - How to verify the fix
Brief Template:
Debug and fix [issue description]:
Problem: [concise problem statement]
Error: [error message or stack trace]
Affected files: [file paths or patterns]
Subsystem: [which part of the app]
Steps to reproduce:
1. [step 1]
2. [step 2]
3. [observed failure]
Expected: [what should happen]
Actual: [what's happening]
Success criteria:
- [how to verify fix - tests passing, error gone, etc.]为每个Agent创建全面的调试简报:
必填元素:
- 问题描述——什么功能失效或出现故障
- 错误消息/堆栈跟踪——完整的诊断信息
- 复现步骤——如何触发问题
- 受影响文件——优先排查的文件
- 预期与实际行为——应该发生什么 vs 实际发生了什么
- 成功标准——如何验证修复生效
简报模板:
调试并修复[问题描述]:
问题:[简洁的问题陈述]
错误:[错误消息或堆栈跟踪]
受影响文件:[文件路径或模式]
子系统:[应用的哪个部分]
复现步骤:
1. [步骤1]
2. [步骤2]
3. [观察到的故障]
预期:[应该发生的情况]
实际:[实际发生的情况]
成功标准:
- [如何验证修复——测试通过、错误消失等]Step 4: Launch Debug Agents in Parallel
步骤4:并行启动调试Agent
Execute all agents simultaneously using a single message with multiple Agent tool calls:
Use the Agent tool with these parameters for each issue:
- prompt: Complete diagnostic brief (error, affected files, reproduction, success criteria)
- subagent_type: Matched agent from the Agent Table
- isolation: "worktree" (MANDATORY for parallel file modifications)
- run_in_background: true (for concurrent execution)
- model: "opus" for complex debugging, "sonnet" for straightforward fixesCritical Requirements:
- Send ALL Agent tool calls in ONE message (this is what makes them parallel)
- Use — without this, parallel fixes clobber each other
isolation: "worktree" - Use — without this, agents run sequentially
run_in_background: true - Each agent gets complete diagnostic information in the parameter
prompt - No placeholder values — all error details, stack traces, and file paths must be included
- Use in briefs to show agents what the broken file depends on
codemap deps <file>
使用包含多个Agent工具调用的单条消息同时启动所有Agent:
为每个问题使用Agent工具并传入以下参数:
- prompt:完整的诊断简报(错误、受影响文件、复现步骤、成功标准)
- subagent_type:从Agent表中匹配的Agent类型
- isolation: "worktree"(并行文件修改时为必填项)
- run_in_background: true(用于并发执行)
- model: 复杂调试使用"opus",简单修复使用"sonnet"关键要求:
- 所有Agent工具调用必须在单条消息中发送(这是实现并行的关键)
- 必须使用——没有此参数,并行修复会相互覆盖
isolation: "worktree" - 必须使用——没有此参数,Agent会顺序运行
run_in_background: true - 每个Agent的参数中必须包含完整的诊断信息
prompt - 不能使用占位符——必须包含所有错误详情、堆栈跟踪和文件路径
- 在简报中使用向Agent展示故障文件的依赖关系
codemap deps <file>
Step 5: Monitor, Validate, and Consolidate Fixes
步骤5:监控、验证并整合修复结果
After agents complete their debugging:
- Collect fix reports from each agent
- Verify fixes independently - Did each issue get resolved?
- Check for conflicts - Do fixes touch overlapping code?
- Re-run tests - Validate that problems are truly fixed
- Integration check - Ensure fixes work together
- Report consolidated results to user
Validation Checklist:
- Original error no longer occurs
- Tests pass (if test failures were the issue)
- No new errors introduced
- No conflicts with other concurrent fixes
- Changes are coherent and don't contradict each other
Consolidation Template:
Parallel debugging complete. Results:
**[Issue 1]** (via [agent-type])
- Status: ✅ Fixed / ⚠️ Partial / ❌ Blocked
- Root cause: [what was wrong]
- Solution: [what was changed]
- Files modified: [list]
- Verification: [tests passing, error resolved]
**[Issue 2]** (via [agent-type])
- Status: ✅ Fixed / ⚠️ Partial / ❌ Blocked
- Root cause: [what was wrong]
- Solution: [what was changed]
- Files modified: [list]
- Verification: [tests passing, error resolved]
**Overall:** [X/Y issues resolved, any remaining work, next steps]
**Integration status:** [No conflicts / Conflicts resolved / Needs review]Agent完成调试后:
- 收集修复报告——从每个Agent处获取结果
- 独立验证修复——每个问题是否已解决?
- 检查冲突——修复是否涉及重叠代码?
- 重新运行测试——验证问题是否真的修复
- 集成检查——确保修复可以协同工作
- 向用户报告整合后的结果
验证检查清单:
- 原始错误不再出现
- 测试通过(如果问题是测试失败)
- 未引入新错误
- 与其他并发修复无冲突
- 修改内容连贯,无相互矛盾
整合结果模板:
并行调试完成。结果:
**[问题1]**(由[agent-type]处理)
- 状态:✅ 已修复 / ⚠️ 部分修复 / ❌ 受阻
- 根本原因:[问题所在]
- 解决方案:[修改内容]
- 修改文件:[列表]
- 验证:[测试通过、错误已解决]
**[问题2]**(由[agent-type]处理)
- 状态:✅ 已修复 / ⚠️ 部分修复 / ❌ 受阻
- 根本原因:[问题所在]
- 解决方案:[修改内容]
- 修改文件:[列表]
- 验证:[测试通过、错误已解决]
**总体情况:** [X/Y个问题已解决,剩余工作,下一步计划]
**集成状态:** [无冲突 / 冲突已解决 / 需要评审]Example Scenarios
示例场景
Example A: Multiple Test Failures Across Subsystems
示例A:跨子系统的多个测试失败
User Says:
"Run parallel agents to debug these failing tests."
Error Context:
- 5 Laravel PHPUnit tests failing (authentication module)
- 3 Next.js Jest tests failing (product listing page)
- 2 Express API tests failing (payment service)
Execution:
-
Cluster failures by subsystem:
- Laravel backend tests (authentication)
- Next.js frontend tests (product listing)
- Express API tests (payment)
-
Match agents:
- for Laravel test failures
laravel-senior-engineer - for Next.js test failures
nextjs-senior-engineer - for Express test failures
express-senior-engineer
-
Launch in parallel with debugging briefs containing:
- Full test output/error messages
- Affected test files
- Related source code files
-
Each agent independently:
- Analyzes test failures
- Identifies root causes
- Implements fixes
- Re-runs tests to verify
-
Consolidate results:
Parallel debugging complete: - Laravel auth tests: ✅ Fixed (5/5 passing) - Missing user factory trait - Next.js product tests: ✅ Fixed (3/3 passing) - Incorrect mock data - Express payment tests: ✅ Fixed (2/2 passing) - Async timing issue All 10 tests now passing. No conflicts detected.
用户请求:
"使用并行Agent调试这些失败的测试。"
错误上下文:
- 5个Laravel PHPUnit测试失败(认证模块)
- 3个Next.js Jest测试失败(产品列表页)
- 2个Express API测试失败(支付服务)
执行流程:
-
按子系统聚类故障:
- Laravel后端测试(认证)
- Next.js前端测试(产品列表)
- Express API测试(支付)
-
匹配Agent:
- 处理Laravel测试失败
laravel-senior-engineer - 处理Next.js测试失败
nextjs-senior-engineer - 处理Express测试失败
express-senior-engineer
-
并行启动——为每个Agent提供包含以下内容的调试简报:
- 完整的测试输出/错误消息
- 受影响的测试文件
- 相关的源代码文件
-
每个Agent独立工作:
- 分析测试失败原因
- 确定根本原因
- 实施修复
- 重新运行测试验证
-
整合结果:
并行调试完成: - Laravel认证测试:✅ 已修复(5/5通过)——缺少用户工厂trait - Next.js产品测试:✅ 已修复(3/3通过)——模拟数据不匹配 - Express支付测试:✅ 已修复(2/2通过)——异步时序问题 所有10个测试现在均通过。未检测到冲突。
Example B: Cross-Stack Bug Fixes
示例B:跨技术栈的Bug修复
User Says:
"Fix these three bugs in parallel: cart total calculation error, user profile image upload failure, and webhook timeout issue."
Execution:
-
Analyze bugs:
- Cart total calculation (Laravel backend logic)
- Image upload (Next.js frontend + storage)
- Webhook timeout (Express microservice)
-
Verify independence:
- ✅ Different subsystems
- ✅ Different tech stacks
- ✅ No shared state
- ✅ Can be fixed independently
-
Launch agents:
- : Debug cart calculation
laravel-senior-engineer - : Fix image upload
nextjs-senior-engineer - : Resolve webhook timeout
express-senior-engineer
-
Aggregate fixes:
3 bugs resolved in parallel: - Cart calculation: Fixed rounding error in Tax service - Image upload: Added missing CORS headers and size validation - Webhook timeout: Increased timeout + added retry logic All fixes tested and verified independently.
用户请求:
"并行修复这三个bug:购物车总额计算错误、用户头像上传失败、Webhook超时问题。"
执行流程:
-
分析bug:
- 购物车总额计算(Laravel后端逻辑)
- 头像上传(Next.js前端 + 存储)
- Webhook超时(Express微服务)
-
验证独立性:
- ✅ 不同子系统
- ✅ 不同技术栈
- ✅ 无共享状态
- ✅ 可独立修复
-
启动Agent:
- :调试购物车计算问题
laravel-senior-engineer - :修复头像上传问题
nextjs-senior-engineer - :解决Webhook超时问题
express-senior-engineer
-
整合修复结果:
3个bug已并行修复: - 购物车计算:修复了Tax服务中的舍入错误 - 头像上传:添加了缺失的CORS头和大小验证 - Webhook超时:增加超时时间 + 添加重试逻辑 所有修复均已独立测试并验证。
Example C: Build/Compilation Errors
示例C:构建/编译错误
User Says:
"I have TypeScript errors in multiple unrelated modules. Fix them in parallel."
Error Context:
- 15 type errors in Next.js dashboard components
- 8 type errors in Python FastAPI user service
- 12 type errors in Express API middleware
Execution:
-
Group by module/framework:
- Next.js errors (dashboard module)
- FastAPI errors (user service)
- Express errors (API middleware)
-
Spawn agents:
- for Next.js type errors
nextjs-senior-engineer - for FastAPI type errors
fastapi-senior-engineer - for Express type errors
express-senior-engineer
-
Each agent:
- Analyzes errors in their module
- Fixes type definitions, imports, and interfaces
- Verifies compilation/validation succeeds
-
Result:
Compilation now clean: - Next.js dashboard: 15 type errors fixed (component props, hooks) - FastAPI user service: 8 errors fixed (Pydantic models, type hints) - Express middleware: 12 type errors fixed (request/response types) Full build successful.
用户请求:
"我在多个不相关的模块中遇到了TypeScript错误。并行修复它们。"
错误上下文:
- Next.js仪表板组件中有15个类型错误
- Python FastAPI用户服务中有8个类型错误
- Express API中间件中有12个类型错误
执行流程:
-
按模块/框架分组:
- Next.js错误(仪表板模块)
- FastAPI错误(用户服务)
- Express错误(API中间件)
-
启动对应Agent:
- 处理Next.js类型错误
nextjs-senior-engineer - 处理FastAPI类型错误
fastapi-senior-engineer - 处理Express类型错误
express-senior-engineer
-
每个Agent工作:
- 分析所属模块中的错误
- 修复类型定义、导入和接口
- 验证编译/校验通过
-
结果:
编译已通过: - Next.js仪表板:15个类型错误已修复(组件props、hooks) - FastAPI用户服务:8个错误已修复(Pydantic模型、类型提示) - Express中间件:12个类型错误已修复(请求/响应类型) 完整构建成功。
Example D: Performance Issue Investigation
示例D:性能问题排查
User Says:
"Investigate these performance problems: slow product search (backend), laggy dashboard UI (frontend), and delayed webhook processing (microservice)."
Execution:
-
Cluster by component:
- Product search performance (Laravel)
- Dashboard UI lag (Next.js)
- Webhook delay (Express service)
-
Parallel investigation:
- : Profile search queries, identify N+1 problems
laravel-senior-engineer - : Analyze render performance, identify re-render issues
nextjs-senior-engineer - : Trace webhook processing, identify bottlenecks
express-senior-engineer
-
Each agent delivers:
- Performance analysis
- Root cause identification
- Optimization implementation
- Before/after metrics
-
Consolidated report:
Performance optimizations complete: - Product search: 3.2s → 180ms (eager loading, index added) - Dashboard UI: 850ms → 120ms render (memoization, virtual scrolling) - Webhook processing: 5s → 800ms (async processing, connection pooling) All improvements verified with benchmarks.
用户请求:
"排查这些性能问题:产品搜索缓慢(后端)、仪表板UI卡顿(前端)、Webhook处理延迟(微服务)。"
执行流程:
-
按组件聚类:
- 产品搜索性能(Laravel)
- 仪表板UI卡顿(Next.js)
- Webhook处理延迟(Express服务)
-
并行排查:
- :分析搜索查询性能,找出N+1问题
laravel-senior-engineer - :分析渲染性能,找出重渲染问题
nextjs-senior-engineer - :跟踪Webhook处理流程,找出瓶颈
express-senior-engineer
-
每个Agent交付:
- 性能分析报告
- 根本原因定位
- 优化方案实施
- 优化前后的指标对比
-
整合报告:
性能优化完成: - 产品搜索:3.2秒 → 180毫秒(预加载、添加索引) - 仪表板UI:850毫秒 → 120毫秒渲染( memoization、虚拟滚动) - Webhook处理:5秒 → 800毫秒(异步处理、连接池) 所有优化均已通过基准测试验证。
Agent Type Reference
Agent类型参考
Quick reference for matching debugging tasks to agents:
| Agent Type | Best For Debugging | Key Error Patterns |
|---|---|---|
| PHPUnit failures, Eloquent errors, API bugs | Laravel exceptions, DB query errors, validation failures |
| Jest/Vitest failures, React errors, hydration issues | Component errors, RSC issues, build failures |
| React + Vite + Tailwind component/build issues | Vite build errors, Tailwind class issues, React hooks bugs |
| Middleware failures, routing bugs, API errors | Express errors, middleware stack issues, request handling |
| CLI tool failures, argument parsing bugs | Commander errors, prompt failures, output formatting |
| pytest failures, Django errors, pipeline bugs | Python exceptions, import errors, async issues |
| FastAPI endpoint failures, async DB issues | Pydantic validation, dependency injection, ASGI errors |
| Go test failures, service bugs, API errors | Go panics, goroutine leaks, interface mismatches |
| Go CLI tool failures, flag parsing bugs | Cobra errors, flag conflicts, output formatting |
| Swift/Xcode build failures, SwiftUI bugs | Swift compiler errors, runtime crashes, UI layout issues |
| Mobile crashes, navigation bugs, native module errors | React Native errors, Expo module issues, platform-specific bugs |
| Infrastructure failures, deployment issues | CDK synth errors, CloudFormation failures, IAM issues |
| Container build/run failures, compose issues | Dockerfile errors, network issues, volume mount failures |
| Cross-cutting issues, config errors, tooling problems | Build tool errors, linting issues, general debugging |
See for detailed error pattern matching and debugging strategies.
See for detailed matching rules and edge cases.
references/debug_patterns.mdreferences/agent_matching_logic.md调试任务与Agent匹配速查表:
| Agent Type | 最适合调试的场景 | 关键错误模式 |
|---|---|---|
| PHPUnit失败、Eloquent错误、API bug | Laravel异常、数据库查询错误、验证失败 |
| Jest/Vitest失败、React错误、 hydration问题 | 组件错误、RSC问题、构建失败 |
| React + Vite + Tailwind组件/构建问题 | Vite构建错误、Tailwind类问题、React Hooks bug |
| 中间件失败、路由bug、API错误 | Express错误、中间件栈问题、请求处理异常 |
| CLI工具失败、参数解析bug | Commander错误、提示失败、输出格式问题 |
| pytest失败、Django错误、流水线bug | Python异常、导入错误、异步问题 |
| FastAPI端点失败、异步数据库问题 | Pydantic验证错误、依赖注入问题、ASGI错误 |
| Go测试失败、服务bug、API错误 | Go panic、goroutine泄漏、接口不匹配 |
| Go CLI工具失败、标志解析bug | Cobra错误、标志冲突、输出格式问题 |
| Swift/Xcode构建失败、SwiftUI bug | Swift编译器错误、运行时崩溃、UI布局问题 |
| 移动端崩溃、导航bug、原生模块错误 | React Native错误、Expo模块问题、平台特定bug |
| 基础设施失败、部署问题 | CDK合成错误、CloudFormation失败、IAM问题 |
| 容器构建/运行失败、compose问题 | Dockerfile错误、网络问题、卷挂载失败 |
| 跨领域问题、配置错误、工具问题 | 构建工具错误、代码规范问题、通用调试 |
查看获取详细的错误模式匹配和调试策略。查看获取详细的匹配规则和边缘情况处理。
references/debug_patterns.mdreferences/agent_matching_logic.mdBest Practices
最佳实践
Effective Problem Decomposition
有效的问题分解
Good Independent Problems:
- "Laravel auth tests failing (session handling)" + "Next.js checkout tests failing (form validation)" + "NestJS payment tests failing (timeout)"
- Each in different subsystem, different root causes, can be fixed separately
Poor Decomposition:
- "All tests failing after dependency update" (likely single root cause - the dependency)
- "Database connection errors throughout the app" (single root cause - DB config/connection)
- "Everything broken after deploy" (need to understand what changed first)
优质的独立问题示例:
- "Laravel认证测试失败(会话处理)" + "Next.js结账测试失败(表单验证)" + "NestJS支付测试失败(超时)"
- 每个问题属于不同子系统,有不同根本原因,可单独修复
糟糕的分解示例:
- "依赖更新后所有测试失败"(可能存在单一根本原因——依赖包)
- "整个应用出现数据库连接错误"(单一根本原因——数据库配置/连接)
- "部署后所有功能失效"(需要先了解变更内容)
Root Cause Analysis Before Parallelization
并行化前的根本原因分析
Always do initial triage:
- Look for common patterns - Do all errors mention the same dependency?
- Check timing - Did all failures start at the same time?
- Examine stack traces - Do they share common code paths?
- Review recent changes - Is there a single commit/deploy that broke everything?
If yes to any of these → Single root cause, don't parallelize yet.
始终先进行初步分类:
- 寻找共同模式——所有错误是否都提及同一个依赖包?
- 检查时间线——所有故障是否同时发生?
- 分析堆栈跟踪——是否共享共同的代码路径?
- 查看最近变更——是否有单次提交/部署导致所有故障?
如果以上任何一个问题答案为是→存在单一根本原因,请勿并行调试。
Communication Pattern
沟通模式
Before launching parallel debugging:
I've identified 3 independent issues that can be debugged in parallel:
1. Laravel authentication tests (5 failures) - using laravel-senior-engineer
Root cause appears to be: Session handling
2. Next.js product listing tests (3 failures) - using nextjs-senior-engineer
Root cause appears to be: Mock data mismatch
3. Express payment service tests (2 failures) - using express-senior-engineer
Root cause appears to be: Async timing
Launching debugging agents now...启动并行调试前:
我已识别出3个可并行调试的独立问题:
1. Laravel认证测试(5个失败)——使用laravel-senior-engineer
初步根本原因:会话处理问题
2. Next.js产品列表测试(3个失败)——使用nextjs-senior-engineer
初步根本原因:模拟数据不匹配
3. Express支付服务测试(2个失败)——使用express-senior-engineer
初步根本原因:异步时序问题
现在启动调试Agent...Post-Fix Validation
修复后验证
After parallel fixes are complete:
- Run full test suite - Not just the fixed tests
- Check for regressions - Did fixing one thing break another?
- Integration testing - Do all fixes work together?
- Code review - Are fixes consistent with codebase patterns?
并行修复完成后:
- 运行完整测试套件——不只是修复的测试用例
- 检查回归问题——修复一个问题是否导致其他问题失效?
- 集成测试——所有修复能否协同工作?
- 代码评审——修复是否符合代码库的模式?
Handling Partial Success
处理部分成功的情况
If some agents succeed and others get blocked:
Parallel debugging results (2/3 completed):
✅ Laravel auth tests: Fixed (5/5 passing)
✅ Next.js product tests: Fixed (3/3 passing)
⚠️ NestJS payment tests: Blocked - requires external payment gateway access
Next steps:
- 2 issues resolved and verified
- Payment test issue needs: [specific requirements]
- Recommend: [suggested approach]如果部分Agent成功,部分Agent受阻:
并行调试结果(2/3完成):
✅ Laravel认证测试:已修复(5/5通过)
✅ Next.js产品测试:已修复(3/3通过)
⚠️ NestJS支付测试:受阻——需要外部支付网关访问权限
下一步计划:
- 2个问题已解决并验证
- 支付测试问题需要:[具体要求]
- 建议:[推荐方案]Conflict Resolution
冲突解决
If fixes overlap or conflict:
- Identify the conflict - Same file, same function, contradictory changes
- Review both solutions - Which approach is better?
- Merge intelligently - Combine best aspects or choose one
- Re-test thoroughly - Ensure merged fix resolves both issues
- Document the decision - Why this approach was chosen
如果修复出现重叠或冲突:
- 识别冲突——同一文件、同一函数、相互矛盾的修改
- 评估两种解决方案——哪种方案更优?
- 智能合并——结合两种方案的优点或选择更合适的一种
- 彻底重新测试——确保合并后的修复能解决两个问题
- 记录决策——说明选择此方案的原因
Resources
资源
references/
references/
- debug_patterns.md - Comprehensive error pattern recognition guide, debugging strategies for each framework, and root cause analysis techniques
This skill does not require scripts or assets - it orchestrates existing Claude Code agent debugging capabilities.
- debug_patterns.md——全面的错误模式识别指南、各框架的调试策略和根本原因分析技术
此技能无需脚本或资源——它编排现有的Claude Code Agent调试能力。
Step 6: Verification (MANDATORY)
步骤6:验证(必填)
After aggregating results, verify the parallel debugging was successful:
整合结果后,验证并行调试是否成功:
Check 1: All Agents Completed
检查1:所有Agent已完成
- Every launched agent returned a result
- No agents timed out or crashed
- 每个启动的Agent都返回了结果
- 没有Agent超时或崩溃
Check 2: No Fix Conflicts
检查2:无修复冲突
- No two agents modified the same file with conflicting changes
- If conflicts exist, they are identified and resolved
- 没有两个Agent修改同一文件并产生冲突变更
- 如果存在冲突,已识别并解决
Check 3: Fixes Match Problem Descriptions
检查3:修复匹配问题描述
- Each agent addressed the assigned problem
- Root causes were correctly identified
- Solutions match the problem scope
- 每个Agent都处理了分配的问题
- 根本原因识别正确
- 解决方案符合问题范围
Check 4: Verification Tests Pass
检查4:验证测试通过
- Original errors no longer occur
- Tests pass (if test failures were the issue)
- No new errors introduced
- 原始错误不再出现
- 测试通过(如果问题是测试失败)
- 未引入新错误
Check 5: User Informed
检查5:已告知用户
- Completion announced with summary
- Any blocked or partial fixes documented
- Next steps provided if issues remain
Gate: Do NOT mark debugging complete until all 5 checks pass.
- 已发布包含摘要的完成通知
- 已记录所有受阻或部分修复的情况
- 如果存在未解决问题,已提供下一步计划
关卡: 必须通过所有5项检查才能标记调试完成。
Quality Checklist (Must Score 8/10)
质量检查清单(必须达到8/10分)
Score yourself honestly before marking parallel debugging complete:
在标记并行调试完成前,诚实地为自己评分:
Problem Decomposition (0-2 points)
问题分解(0-2分)
- 0 points: Launched without checking for shared root cause
- 1 point: Some root cause analysis done
- 2 points: Full independence verification (no shared root cause, no cascading failures)
- 0分: 未检查共享根本原因就启动Agent
- 1分: 进行了部分根本原因分析
- 2分: 完成全面的独立性验证(无共享根本原因、无连锁故障)
Agent Matching (0-2 points)
Agent匹配(0-2分)
- 0 points: Wrong agents for problems
- 1 point: Agents assigned without technology justification
- 2 points: Each problem matched to correct agent with error pattern indicators
- 0分: 为问题分配了错误的Agent
- 1分: 分配了Agent但未说明技术依据
- 2分: 每个问题都匹配到正确的Agent,并提供了错误模式依据
Brief Quality (0-2 points)
简报质量(0-2分)
- 0 points: No briefs or generic briefs
- 1 point: Partial briefs (missing error details or reproduction steps)
- 2 points: Complete briefs with error, affected files, reproduction, success criteria
- 0分: 无简报或使用通用简报
- 1分: 简报不完整(缺少错误详情或复现步骤)
- 2分: 包含错误、受影响文件、复现步骤和成功标准的完整简报
Execution Correctness (0-2 points)
执行正确性(0-2分)
- 0 points: Agents launched sequentially
- 1 point: Parallel launch but incomplete briefs
- 2 points: Single message with all Agent tool calls, complete briefs
- 0分: 顺序启动Agent
- 1分: 并行启动但简报不完整
- 2分: 单条消息包含所有Agent工具调用,且简报完整
Result Aggregation (0-2 points)
结果整合(0-2分)
- 0 points: No summary provided
- 1 point: Partial summary
- 2 points: Complete summary with status, root cause, fix, verification per issue
Minimum passing score: 8/10
- 0分: 未提供摘要
- 1分: 提供了部分摘要
- 2分: 提供了包含每个问题的状态、根本原因、修复方案和验证结果的完整摘要
最低及格分数:8/10
Common Rationalizations (All Wrong)
常见错误借口(全是错的)
These are excuses. Don't fall for them:
- "These failures look independent" → STILL check for shared root cause
- "I know the right agents" → STILL document the matching rationale
- "Briefs are obvious from error messages" → STILL write complete scope, files, reproduction, success criteria
- "Sequential is safer for debugging" → If problems are independent, parallel is FASTER with same quality
- "I'll merge conflict fixes later" → Check for conflicts BEFORE marking complete
- "One message is too long" → ALL Agent tool calls MUST be in one message
- "The user just wants it fixed" → Correct execution = faster resolution
- "Two bugs don't need parallel agents" → Correct, need 3+ independent problems
这些都是借口,请勿采纳:
- "这些故障看起来是独立的" → 仍需检查共享根本原因
- "我知道应该用哪个Agent" → 仍需记录匹配依据
- "错误消息中已包含足够的简报信息" → 仍需编写完整的范围、文件、复现步骤和成功标准
- "顺序调试更安全" → 如果问题独立,并行调试速度更快且质量相同
- "我稍后再合并冲突修复" → 标记完成前必须检查冲突
- "单条消息太长" → 所有Agent工具调用必须在单条消息中
- "用户只想要修复结果" → 正确执行才能更快解决问题
- "两个bug不需要并行Agent" → 正确,需要3个及以上独立问题才使用
Failure Modes
失败模式
Failure Mode 1: Debugging Related Failures Separately
失败模式1:单独调试关联故障
Symptom: Two agents fix the same underlying issue differently, or one fix breaks the other's solution
Fix: Do root cause analysis first. If failures started at the same time or share code paths, treat as single issue.
症状: 两个Agent以不同方式修复同一根本原因,或一个修复破坏了另一个的解决方案
修复: 先进行根本原因分析。如果故障同时发生或共享代码路径,将其视为单一问题处理。
Failure Mode 2: Wrong Agent Assignment
失败模式2:Agent分配错误
Symptom: Laravel debugging done by , poor diagnosis
Fix: Use error pattern analysis. Match PHPUnit failures → Laravel agent, Jest failures → Next.js agent.
nextjs-senior-engineer症状: Laravel调试由处理,诊断结果不佳
修复: 使用错误模式分析。PHPUnit失败→Laravel Agent,Jest失败→Next.js Agent。
nextjs-senior-engineerFailure Mode 3: Sequential Launch Instead of Parallel
失败模式3:顺序启动而非并行
Symptom: Sent multiple messages with Agent tool calls, agents ran one at a time
Fix: ALL Agent tool calls in a SINGLE message. This is critical for parallel debugging.
症状: 发送多条包含Agent工具调用的消息,Agent依次运行
修复: 所有Agent工具调用必须在单条消息中。这是并行调试的关键。
Failure Mode 4: Incomplete Debugging Briefs
失败模式4:调试简报不完整
Symptom: Agents ask clarifying questions or diagnose wrong issues
Fix: Every brief must have Error, Affected files, Reproduction steps, Success criteria. No placeholders.
症状: Agent询问澄清问题或诊断错误问题
修复: 每个简报必须包含错误、受影响文件、复现步骤和成功标准。禁止使用占位符。
Failure Mode 5: No Verification After Fixes
失败模式5:修复后未验证
Symptom: "Fixes applied" but no confirmation that original errors are gone
Fix: After aggregation, verify each fix: re-run failed tests, check error no longer occurs.
症状: "已应用修复"但未确认原始错误是否消失
修复: 整合结果后,验证每个修复:重新运行失败的测试,检查错误是否消失。
Quick Workflow Summary
工作流快速摘要
STEP 1: ANALYZE & CLUSTER
├── Count problems (need 3+)
├── Check for shared root cause
├── Check for cascading failures
└── Gate: Problems are independent
STEP 2: MATCH AGENTS
├── Identify error patterns per problem
├── Assign correct agent type
└── Document matching rationale
STEP 3: PREPARE BRIEFS
├── Error details, Affected files, Reproduction, Success criteria
└── No placeholders allowed
STEP 4: LAUNCH PARALLEL
├── Single message with ALL Agent tool calls
├── Do NOT wait between launches
└── Gate: All agents launched
STEP 5: AGGREGATE RESULTS
├── Collect fix reports
├── Check for conflicts
└── Merge into summary
STEP 6: VERIFICATION
├── All agents completed
├── No fix conflicts
├── Fixes match problems
├── Verification tests pass
└── Gate: All 5 checks pass步骤1:分析与聚类
├── 统计问题数量(需要3个及以上)
├── 检查共享根本原因
├── 检查连锁故障
└── 关卡:问题独立
步骤2:匹配Agent
├── 识别每个问题的错误模式
├── 分配正确的Agent类型
└── 记录匹配依据
步骤3:准备简报
├── 错误详情、受影响文件、复现步骤、成功标准
└── 禁止使用占位符
步骤4:并行启动
├── 单条消息包含所有Agent工具调用
├── 启动期间无需等待
└── 关卡:所有Agent已启动
步骤5:整合结果
├── 收集修复报告
├── 检查冲突
└── 合并为摘要
步骤6:验证
├── 所有Agent已完成
├── 无修复冲突
├── 修复匹配问题
├── 验证测试通过
└── 关卡:所有5项检查通过Completion Announcement
完成通知
When parallel debugging is complete, announce:
Parallel debugging complete.
**Quality Score: X/10**
- Problem Decomposition: X/2
- Agent Matching: X/2
- Brief Quality: X/2
- Execution Correctness: X/2
- Result Aggregation: X/2
**Results:**
- Issues resolved: X/Y
- Agents used: [list]
- Conflicts: [none/resolved/pending]
**Issue Summary:**
1. [Issue 1] — `agent-type`
- Status: ✅ Fixed / ⚠️ Partial / ❌ Blocked
- Root cause: [what was wrong]
- Fix: [what was changed]
- Verification: [how verified]
2. [Issue 2] — `agent-type`
- Status: ✅ Fixed / ⚠️ Partial / ❌ Blocked
- Root cause: [what was wrong]
- Fix: [what was changed]
- Verification: [how verified]
**Next steps:**
[Any remaining work or follow-up needed]并行调试完成后,发布以下通知:
并行调试完成。
**质量评分:X/10**
- 问题分解:X/2
- Agent匹配:X/2
- 简报质量:X/2
- 执行正确性:X/2
- 结果整合:X/2
**结果:**
- 已解决问题:X/Y
- 使用的Agent:[列表]
- 冲突:[无/已解决/待处理]
**问题摘要:**
1. [问题1] — `agent-type`
- 状态:✅ 已修复 / ⚠️ 部分修复 / ❌ 受阻
- 根本原因:[问题所在]
- 修复方案:[修改内容]
- 验证:[验证方式]
2. [问题2] — `agent-type`
- 状态:✅ 已修复 / ⚠️ 部分修复 / ❌ 受阻
- 根本原因:[问题所在]
- 修复方案:[修改内容]
- 验证:[验证方式]
**下一步计划:**
[任何剩余工作或后续需要执行的任务]Integration with Other Skills
与其他技能的集成
The skill integrates with:
run-parallel-agents-feature-debug- — Use
startfirst to identify if this skill is neededstart - — If debugging requires a plan, use
plan-to-task-list-with-dagto structure itplan-to-task-list-with-dag - — For building features; use this skill for debugging
run-parallel-agents-feature-build - — Use
codemapandcodemap deps <file>in diagnostic briefs so agents understand impact radiuscodemap dependents <file> - — For parallel UI debugging, use
browseto isolate each agent's browser statebrowse --session <agent-name>
Workflow: → (optionally) →
startplan-to-task-list-with-dagrun-parallel-agents-feature-debugrun-parallel-agents-feature-debug- — 先使用
start确定是否需要此技能start - — 如果调试需要计划,使用
plan-to-task-list-with-dag构建任务结构plan-to-task-list-with-dag - — 用于构建功能;使用此技能进行调试
run-parallel-agents-feature-build - — 在诊断简报中使用
codemap和codemap deps <file>,帮助Agent理解影响范围codemap dependents <file> - — 并行UI调试时,使用
browse隔离每个Agent的浏览器状态browse --session <agent-name>
工作流: →(可选) →
startplan-to-task-list-with-dagrun-parallel-agents-feature-debug