Run parallel agents feature debug

From ulpi-io/browse · View interactive version

Run parallel agents feature debug is an AI agent skill from the GitHub repository ulpi-io/browse. Orchestrate multiple specialized agents working in parallel to debug independent problems. Use when encountering 3+ unrelated bugs or test failures in isolated modules. Matches each problem to the right expert agent and launches them concurrently via the Agent tool with worktree isolation. Supports

How to use this skill

Skill file

<EXTREMELY-IMPORTANT>

Before launching parallel debugging agents, you ABSOLUTELY MUST:

  1. Verify problems are truly independent (no shared root cause, no cascading failures)
  2. Match each problem to the correct specialized agent
  3. Create complete briefs with error details, affected files, and success criteria
  4. 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>

Run Parallel Agents Feature Debug

MANDATORY FIRST RESPONSE PROTOCOL

Before launching ANY parallel debugging agents, you MUST complete this checklist:

  1. ☐ Count problems — are there 3+ independent issues?
  2. ☐ Check for shared root cause — could one fix solve multiple issues?
  3. ☐ Check for cascading failures — did one failure cause others?
  4. ☐ Match agents — assign correct agent type per problem
  5. ☐ Prepare briefs — error details, affected files, reproduction steps, success criteria
  6. ☐ Announce to user — "Launching N debugging agents in parallel for [issues]"

Launching agents WITHOUT completing this checklist = misdiagnosis and incomplete fixes.

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.

When to Use This Skill

Use this skill automatically when:

Problem Indicators:

User Triggers:

Common Scenarios:

When NOT to Use This Skill

Do NOT use parallel debugging when:

Related Failures:

Sequential Dependencies:

Single Root Cause:

Coordination Required:

Core Workflow

Step 1: Analyze and Cluster the Problems

Examine the failures, bugs, or issues to identify:

  1. Problem isolation - Are the issues truly independent?
  2. Root cause analysis - Do they share a common cause?
  3. Subsystem mapping - Which tech stack/module is each problem in?
  4. Dependency check - Does fixing one require fixing another first?

Clustering Strategy:

Group problems by:

Decision Point:

Step 2: Match Problems to Specialized Agents

For each independent problem cluster, determine the best agent type:

Technology Stack Detection:

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

Step 3: Prepare Debugging Briefs

For each agent, create a comprehensive debugging brief:

Required Elements:

  1. Problem description - What's failing or broken
  2. Error messages/stack traces - Complete diagnostic info
  3. Reproduction steps - How to trigger the issue
  4. Affected files - Where to look first
  5. Expected vs actual behavior - What should happen vs what's happening
  6. 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.]

Step 4: Launch Debug Agents in Parallel

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 fixes

Critical Requirements:

Step 5: Monitor, Validate, and Consolidate Fixes

After agents complete their debugging:

  1. Collect fix reports from each agent
  2. Verify fixes independently - Did each issue get resolved?
  3. Check for conflicts - Do fixes touch overlapping code?
  4. Re-run tests - Validate that problems are truly fixed
  5. Integration check - Ensure fixes work together
  6. Report consolidated results to user

Validation Checklist:

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]

Example Scenarios

Example A: Multiple Test Failures Across Subsystems

User Says:

"Run parallel agents to debug these failing tests."

Error Context:

Execution:

  1. Cluster failures by subsystem:
  1. Match agents:
  1. Launch in parallel with debugging briefs containing:
  1. Each agent independently:
  1. Consolidate results:

```

Parallel debugging complete:

All 10 tests now passing. No conflicts detected.

```

Example B: Cross-Stack Bug Fixes

User Says:

"Fix these three bugs in parallel: cart total calculation error, user profile image upload failure, and webhook timeout issue."

Execution:

  1. Analyze bugs:
  1. Verify independence:
  1. Launch agents:
  1. Aggregate fixes:

```

3 bugs resolved in parallel:

All fixes tested and verified independently.

```

Example C: Build/Compilation Errors

User Says:

"I have TypeScript errors in multiple unrelated modules. Fix them in parallel."

Error Context:

Execution:

  1. Group by module/framework:
  1. Spawn agents:
  1. Each agent:
  1. Result:

```

Compilation now clean:

Full build successful.

```

Example D: Performance Issue Investigation

User Says:

"Investigate these performance problems: slow product search (backend), laggy dashboard UI (frontend), and delayed webhook processing (microservice)."

Execution:

  1. Cluster by component:
  1. Parallel investigation:
  1. Each agent delivers:
  1. Consolidated report:

```

Performance optimizations complete:

All improvements verified with benchmarks.

```

Agent Type Reference

Quick reference for matching debugging tasks to agents:

| Agent Type | Best For Debugging | Key Error Patterns |

| ----------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------- |

| laravel-senior-engineer | PHPUnit failures, Eloquent errors, API bugs | Laravel exceptions, DB query errors, validation failures |

| nextjs-senior-engineer | Jest/Vitest failures, React errors, hydration issues | Component errors, RSC issues, build failures |

| react-vite-tailwind-engineer | React + Vite + Tailwind component/build issues | Vite build errors, Tailwind class issues, React hooks bugs |

| express-senior-engineer | Middleware failures, routing bugs, API errors | Express errors, middleware stack issues, request handling |

| nodejs-cli-senior-engineer | CLI tool failures, argument parsing bugs | Commander errors, prompt failures, output formatting |

| python-senior-engineer | pytest failures, Django errors, pipeline bugs | Python exceptions, import errors, async issues |

| fastapi-senior-engineer | FastAPI endpoint failures, async DB issues | Pydantic validation, dependency injection, ASGI errors |

| go-senior-engineer | Go test failures, service bugs, API errors | Go panics, goroutine leaks, interface mismatches |

| go-cli-senior-engineer | Go CLI tool failures, flag parsing bugs | Cobra errors, flag conflicts, output formatting |

| ios-macos-senior-engineer | Swift/Xcode build failures, SwiftUI bugs | Swift compiler errors, runtime crashes, UI layout issues |

| expo-react-native-engineer | Mobile crashes, navigation bugs, native module errors | React Native errors, Expo module issues, platform-specific bugs |

| devops-aws-senior-engineer | Infrastructure failures, deployment issues | CDK synth errors, CloudFormation failures, IAM issues |

| devops-docker-senior-engineer | Container build/run failures, compose issues | Dockerfile errors, network issues, volume mount failures |

| general-purpose | Cross-cutting issues, config errors, tooling problems | Build tool errors, linting issues, general debugging |

See references/debug_patterns.md for detailed error pattern matching and debugging strategies.

See references/agent_matching_logic.md for detailed matching rules and edge cases.

Best Practices

Effective Problem Decomposition

Good Independent Problems:

Poor Decomposition:

Root Cause Analysis Before Parallelization

Always do initial triage:

  1. Look for common patterns - Do all errors mention the same dependency?
  2. Check timing - Did all failures start at the same time?
  3. Examine stack traces - Do they share common code paths?
  4. 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...

Post-Fix Validation

After parallel fixes are complete:

  1. Run full test suite - Not just the fixed tests
  2. Check for regressions - Did fixing one thing break another?
  3. Integration testing - Do all fixes work together?
  4. 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]

Conflict Resolution

If fixes overlap or conflict:

  1. Identify the conflict - Same file, same function, contradictory changes
  2. Review both solutions - Which approach is better?
  3. Merge intelligently - Combine best aspects or choose one
  4. Re-test thoroughly - Ensure merged fix resolves both issues
  5. Document the decision - Why this approach was chosen

Resources

references/

This skill does not require scripts or assets - it orchestrates existing Claude Code agent debugging capabilities.


Step 6: Verification (MANDATORY)

After aggregating results, verify the parallel debugging was successful:

Check 1: All Agents Completed

Check 2: No Fix Conflicts

Check 3: Fixes Match Problem Descriptions

Check 4: Verification Tests Pass

Check 5: User Informed

Gate: Do NOT mark debugging complete until all 5 checks pass.


Quality Checklist (Must Score 8/10)

Score yourself honestly before marking parallel debugging complete:

Problem Decomposition (0-2 points)

Agent Matching (0-2 points)

Brief Quality (0-2 points)

Execution Correctness (0-2 points)

Result Aggregation (0-2 points)

Minimum passing score: 8/10


Common Rationalizations (All Wrong)

These are excuses. Don't fall for them:


Failure Modes

Failure Mode 1: Debugging Related Failures Separately

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.

Failure Mode 2: Wrong Agent Assignment

Symptom: Laravel debugging done by nextjs-senior-engineer, poor diagnosis

Fix: Use error pattern analysis. Match PHPUnit failures → Laravel agent, Jest failures → Next.js agent.

Failure Mode 3: Sequential Launch Instead of Parallel

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.

Failure Mode 4: Incomplete Debugging Briefs

Symptom: Agents ask clarifying questions or diagnose wrong issues

Fix: Every brief must have Error, Affected files, Reproduction steps, Success criteria. No placeholders.

Failure Mode 5: No Verification After Fixes

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

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]

Integration with Other Skills

The run-parallel-agents-feature-debug skill integrates with:

Workflow: start → (optionally) plan-to-task-list-with-dag → run-parallel-agents-feature-debug

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.