Research Orchestration Patterns

VerifiedSafe

Orchestrates structured research workflows for codebase exploration, technical investigation, dependency analysis, and documentation research. Uses parallel fan-out and reduce phases to efficiently trace features, analyze impacts, and diagnose performance issues.

Sby Skills Guide Bot
DevelopmentIntermediate
1006/2/2026
Claude CodeCursor
#research-orchestration#codebase-exploration#technical-investigation#dependency-analysis

Recommended for

Our review

A structured approach to conducting multi-phase research and investigation within a codebase, using parallel exploration and synthesis to answer complex questions.

Strengths

  • Provides clear, repeatable patterns for common investigation scenarios
  • Leverages parallel exploration for efficient breadth-first discovery
  • Includes synthesis phases to consolidate findings
  • Covers codebase exploration, debugging, and dependency analysis

Limitations

  • Assumes access to multiple agent instances or parallel execution
  • May not scale well for very large codebases without proper scoping
  • Patterns are high-level and require customization to specific contexts
When to use it

Use when you need to understand unfamiliar code, trace features, analyze impacts, or investigate bugs in a structured manner.

When not to use it

Avoid for simple, single-file questions where direct querying suffices.

Security analysis

Safe
Quality score92/100

The skill describes research orchestration patterns and examples of task management using shell commands; it does not instruct any destructive, exfiltrating, or unsafe actions. No actual execution is triggered.

No concerns found

Examples

Codebase understanding
Help me understand this codebase. Start with the project structure, key files, and then dive into the main modules.
Feature tracing
How does user authentication work? Trace the flow from the login page to the database.
Impact analysis
What would break if I change the UserService class? Find all files that depend on it and assess the risk.

Research Orchestration Patterns

┌─────────────────────────────────────────────────────────────┐
│                                                             │
│   Discovery is where great work begins.                     │
│   Explore broadly, synthesize clearly, answer confidently.  │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Load when: Codebase exploration, technical investigation, dependency analysis, documentation research Common patterns: Breadth-First Discovery, Feature Tracing, Root Cause Analysis

Table of Contents

  1. Codebase Exploration
  2. Technical Investigation
  3. Dependency Analysis
  4. Documentation Research

Codebase Exploration

Pattern: Breadth-First Discovery

User Request: "Help me understand this codebase"

Phase 1: FAN-OUT (Parallel surface scan)
├─ Explore agent: Project structure, entry points
├─ Explore agent: Package.json/requirements/build files
├─ Explore agent: README, docs folder
└─ Explore agent: Test structure and patterns

Phase 2: REDUCE
└─ General-purpose agent: Synthesize codebase overview

Phase 3: FAN-OUT (Deep dive areas of interest)
├─ Explore agent: Deep dive area 1
├─ Explore agent: Deep dive area 2
└─ Explore agent: Deep dive area 3

Pattern: Feature Tracing

User Request: "How does user authentication work?"

Phase 1: EXPLORE
└─ Explore agent: Find auth-related files (grep patterns)

Phase 2: PIPELINE (Follow the flow)
├─ Explore agent: Entry point (login route/component)
├─ Explore agent: Middleware/validation layer
├─ Explore agent: Session/token handling
└─ Explore agent: Database/storage layer

Phase 3: REDUCE
└─ General-purpose agent: Document complete auth flow

Pattern: Impact Analysis

User Request: "What would break if I change UserService?"

Phase 1: EXPLORE
└─ Explore agent: Find UserService definition and interface

Phase 2: FAN-OUT
├─ Explore agent: Find all imports of UserService
├─ Explore agent: Find all usages of each method
└─ Explore agent: Find tests depending on UserService

Phase 3: REDUCE
└─ General-purpose agent: Impact report with risk assessment

Technical Investigation

Pattern: Root Cause Analysis

User Request: "Why is the API slow?"

Phase 1: FAN-OUT (Parallel hypothesis generation)
├─ Explore agent: Check database query patterns
├─ Explore agent: Check API middleware chain
├─ Explore agent: Check external service calls
└─ Explore agent: Check caching implementation

Phase 2: REDUCE
└─ General-purpose agent: Ranked hypotheses with evidence

Phase 3: PIPELINE (Validate top hypothesis)
└─ General-purpose agent: Instrument/test to confirm

Pattern: Technology Evaluation

User Request: "Should we use Redis or Memcached?"

Phase 1: FAN-OUT (Parallel research)
├─ Agent A (WebSearch): Redis features, use cases, benchmarks
├─ Agent B (WebSearch): Memcached features, use cases, benchmarks
└─ Explore agent: Current caching patterns in codebase

Phase 2: REDUCE
└─ Plan agent: Comparison matrix, recommendation with rationale

Dependency Analysis

Pattern: Dependency Graph

User Request: "Map all dependencies for the auth module"

Phase 1: EXPLORE
└─ Explore agent: Find auth module entry points

Phase 2: FAN-OUT (Parallel tracing)
├─ Explore agent: Trace internal dependencies
├─ Explore agent: Trace external package dependencies
└─ Explore agent: Trace database/service dependencies

Phase 3: REDUCE
└─ General-purpose agent: Dependency graph visualization

Pattern: Dead Code Detection

Phase 1: EXPLORE
└─ Explore agent: Build export/import graph

Phase 2: FAN-OUT
├─ Explore agent: Find unreferenced exports
├─ Explore agent: Find unused internal functions
└─ Explore agent: Find commented/disabled code

Phase 3: REDUCE
└─ General-purpose agent: Dead code report with safe removal list

Documentation Research

Pattern: API Discovery

User Request: "Document all API endpoints"

Phase 1: EXPLORE
└─ Explore agent: Find route definitions (express routes, decorators, etc.)

Phase 2: MAP (Per endpoint)
├─ Agent A: Document endpoint group 1 (params, responses)
├─ Agent B: Document endpoint group 2
└─ Agent C: Document endpoint group 3

Phase 3: REDUCE
└─ General-purpose agent: Unified API documentation

Research Output Formats

Investigation Report Template

## Question

[Original question/request]

## Summary

[1-2 sentence answer]

## Evidence

1. [Finding 1 with file:line references]
2. [Finding 2 with file:line references]

## Analysis

[Interpretation of evidence]

## Recommendations

1. [Actionable recommendation]

## Open Questions

- [What wasn't answered]

Task Management for Research

For research tasks, structure as exploration followed by synthesis:

# Create research tasks
npx cc-mirror tasks create --subject "Define research scope" --description "Clarify questions, identify sources..."
npx cc-mirror tasks create --subject "Explore area 1" --description "Search for patterns in auth module..."
npx cc-mirror tasks create --subject "Explore area 2" --description "Search for patterns in API layer..."
npx cc-mirror tasks create --subject "Explore area 3" --description "Search for patterns in database..."
npx cc-mirror tasks create --subject "Synthesize findings" --description "Aggregate discoveries, form conclusions..."

# Exploration can run in parallel, synthesis waits
npx cc-mirror tasks update 2 --add-blocked-by 1
npx cc-mirror tasks update 3 --add-blocked-by 1
npx cc-mirror tasks update 4 --add-blocked-by 1
npx cc-mirror tasks update 5 --add-blocked-by 2,3,4
# Spawn Explore agents in parallel (haiku swarm for fast exploration)
Task(subagent_type="Explore", prompt="Task 2: Find auth patterns...",
     model="haiku", run_in_background=True)
Task(subagent_type="Explore", prompt="Task 3: Find API patterns...",
     model="haiku", run_in_background=True)
Task(subagent_type="Explore", prompt="Task 4: Find database patterns...",
     model="haiku", run_in_background=True)

Agent Selection for Research

| Research Type | Primary Agent | Secondary Agents | | ------------------ | ------------------ | ------------------------------- | | Codebase questions | Explore | General-purpose for synthesis | | External research | WebSearch-enabled | Explore for local context | | Architecture | Plan | Explore for discovery | | Impact analysis | Explore (parallel) | General-purpose for aggregation |


─── ◈ Research ──────────────────────────
Related skills