Patterns d'orchestration de recherche

VérifiéSûr

Orchestre des workflows de recherche structurés pour l'exploration de codebase, l'investigation technique, l'analyse de dépendances et la recherche documentaire. Utilise des phases parallèles de déploiement et de synthèse pour tracer efficacement les fonctionnalités, analyser les impacts et diagnostiquer les problèmes de performance.

Spar Skills Guide Bot
DeveloppementIntermédiaire
9002/06/2026
Claude CodeCursor
#research-orchestration#codebase-exploration#technical-investigation#dependency-analysis

Recommandé pour

Notre avis

Une approche structurée pour mener des recherches et investigations en plusieurs phases dans un codebase, utilisant l'exploration parallèle et la synthèse pour répondre à des questions complexes.

Points forts

  • Fournit des modèles clairs et reproductibles pour les scénarios d'investigation courants
  • Exploite l'exploration parallèle pour une découverte efficace en largeur
  • Inclut des phases de synthèse pour consolider les résultats
  • Couvre l'exploration du codebase, le débogage et l'analyse des dépendances

Limites

  • Suppose un accès à plusieurs instances d'agents ou une exécution parallèle
  • Peut ne pas bien passer à l'échelle pour de très grands codebases sans cadrage approprié
  • Les modèles sont de haut niveau et nécessitent une personnalisation selon le contexte
Quand l'utiliser

Utilisez-le lorsque vous devez comprendre un code inconnu, tracer des fonctionnalités, analyser des impacts ou enquêter sur des bugs de manière structurée.

Quand l'éviter

Évitez pour des questions simples sur un seul fichier où une requête directe suffit.

Analyse de sécurité

Sûr
Score qualité92/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.

Aucun point d'attention détecté

Exemples

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 ──────────────────────────
Skills similaires