Claude
Skills
Sign in
Back

research-driven-planning

Included with Lifetime
$97 forever

Loop 1 of the Three-Loop Integrated Development System. Research-driven requirements analysis with iterative risk mitigation through 5x pre-mortem cycles using multi-agent consensus. Feeds validated, risk-mitigated plans to parallel-swarm-implementation. Use when starting new features or projects requiring comprehensive planning with <3% failure confidence and evidence-based technology selection.

AI Agents

What this skill does


# Research-Driven Planning (Loop 1)

## Purpose

Comprehensive planning with research-backed solutions and iterative risk mitigation that prevents 85-95% of problems before coding begins.

## Specialist Agent Coordination

I coordinate multi-agent research and planning swarms using **explicit agent SOPs** from Claude-Flow's 86-agent ecosystem.

**Methodology** (SOP: Specification → Research → Planning → Execution → Knowledge):
1. **Specification Phase**: Requirements capture with structured SPEC.md
2. **Research Phase**: 6-agent parallel research with self-consistency validation
3. **Planning Phase**: MECE task decomposition with research integration
4. **Execution Phase**: 8-agent Byzantine consensus pre-mortem (5 iterations)
5. **Knowledge Phase**: Planning package generation for Loop 2 integration

**Integration**: Loop 1 of 3. Feeds → `parallel-swarm-implementation` (Loop 2), Receives ← `cicd-intelligent-recovery` (Loop 3) failure patterns.

---

## When to Use This Skill

Activate this skill when:
- Starting a new feature or project requiring comprehensive planning
- Need to prevent problems before coding begins (85-95% failure prevention)
- Want research-backed solutions instead of assumptions (30-60% time savings)
- Require risk analysis with <3% failure confidence
- Building something complex with multiple failure modes
- Need evidence-based planning that feeds into implementation

**DO NOT** use this skill for:
- Quick fixes or trivial changes (use direct implementation)
- Well-understood repetitive tasks (use existing patterns)
- Emergency hotfixes (skip to Loop 2)

---

## Input Contract

```yaml
input:
  project_description: string (required)
    # High-level description of what needs to be built

  requirements:
    functional: array[string] (required)
      # Core features and capabilities
    non_functional: object (optional)
      performance: string
      security: string
      scalability: string

  constraints:
    technical: array[string] (stack, framework, dependencies)
    timeline: string (deadlines, milestones)
    resources: object (team, budget, infrastructure)

  options:
    research_depth: enum[quick, standard, comprehensive] (default: standard)
    premortem_iterations: number (default: 5, range: 3-10)
    failure_threshold: number (default: 3, target: <3%)
```

## Output Contract

```yaml
output:
  specification:
    spec_file: path  # SPEC.md location
    requirements_complete: boolean
    success_criteria: array[string]

  research:
    evidence_sources: number  # Total research sources
    recommendations: array[object]
      solution: string
      confidence: number (0-100)
      evidence: array[url]
    risk_landscape: array[object]
      risk: string
      severity: enum[low, medium, high, critical]
      mitigation: string

  planning:
    enhanced_plan: path  # plan-enhanced.json location
    total_tasks: number
    task_dependencies: object
    estimated_complexity: string

  risk_analysis:
    premortem_iterations: number
    final_failure_confidence: number  # Target: <3%
    critical_risks_mitigated: number
    defense_strategies: array[string]

  integration:
    planning_package: path  # loop1-planning-package.json
    memory_namespace: string  # integration/loop1-to-loop2
    ready_for_loop2: boolean
```

---

## SOP Phase 1: Specification

**Objective**: Define initial requirements with clarity and structure.

### Create SPEC.md

Generate a comprehensive specification document in the project root:

```markdown
# Project Specification

## Overview
[High-level description of what needs to be built]

## Requirements
### Functional Requirements
1. [Core feature 1]
2. [Core feature 2]
...

### Non-Functional Requirements
- Performance: [metrics]
- Security: [requirements]
- Scalability: [targets]
- Compliance: [standards]

## Constraints
- Technical: [language, framework, dependencies]
- Timeline: [deadlines, milestones]
- Resources: [team size, budget, infrastructure]

## Success Criteria
1. [Measurable outcome 1]
2. [Measurable outcome 2]
...

## Out of Scope
- [Explicitly excluded features]
```

### Store Initial Context

```bash
npx claude-flow@alpha memory store \
  "project_spec" \
  "$(cat SPEC.md)" \
  --namespace "loop1/specification"
```

**Output**: Structured SPEC.md file and memory-stored specification

---

## SOP Phase 2: Research (Multi-Agent Evidence Collection)

**Objective**: Comprehensive solution discovery using evidence-based research with **self-consistency validation**.

### Execute 6-Agent Parallel Research SOP

**Agent Coordination Pattern** (Claude Code Task tool - Single Message):

```javascript
// RESEARCH PHASE: 6-Agent Parallel Evidence Collection
// Self-Consistency: Multiple research perspectives + cross-validation

[Single Message - All 6 Research Agents]:
  // Web Research Agents (3 perspectives for self-consistency)
  Task("Web Research Specialist 1",
    "Research [primary_technology] best practices 2024. Focus on: security patterns, industry standards, implementation approaches. Provide evidence with source URLs. Store findings in .claude/.artifacts/web-research-1.json. Use hooks: npx claude-flow@alpha hooks pre-task --description 'web research 1' && npx claude-flow@alpha hooks post-task --task-id 'web-research-1'",
    "researcher")

  Task("Web Research Specialist 2",
    "Research [technology] libraries comparison. Focus on: developer experience, community support, production reliability, security track record. Cross-validate findings from Specialist 1. Store in .claude/.artifacts/web-research-2.json. Use hooks for coordination.",
    "researcher")

  Task("Academic Research Agent",
    "Research [domain] security research papers and compliance requirements. Focus on: recent vulnerabilities, mitigation strategies, industry standards, regulatory requirements. Store in .claude/.artifacts/academic-research.json.",
    "researcher")

  // GitHub Analysis Agents (code quality perspective)
  Task("GitHub Quality Analyst",
    "Analyze top [technology] libraries on GitHub. Focus on: code quality metrics (test coverage, cyclomatic complexity), issue resolution time, commit frequency, maintainer responsiveness. Generate quality rankings. Store in .claude/.artifacts/github-quality.json.",
    "code-analyzer")

  Task("GitHub Security Auditor",
    "Audit [technology] library security. Focus on: vulnerability history, security advisories, patch response time, dependency security. Flag high-risk libraries. Store in .claude/.artifacts/github-security.json.",
    "security-review")

  // Synthesis Coordinator (Plan-and-Solve pattern)
  Task("Research Synthesis Coordinator",
    "Wait for all 5 research agents to complete. Synthesize findings using self-consistency validation: 1) Aggregate all evidence, 2) Cross-validate conflicting recommendations, 3) Calculate confidence scores based on source agreement, 4) Flag any contradictory evidence, 5) Generate ranked recommendations with evidence. Use Byzantine consensus for critical technology decisions (require 3/5 agent agreement). Store final synthesis in .claude/.artifacts/research-synthesis.json. Memory store: npx claude-flow@alpha memory store 'research_findings' \"$(cat .claude/.artifacts/research-synthesis.json)\" --namespace 'loop1/research'",
    "analyst")
```

**Evidence-Based Techniques Applied**:
- **Self-Consistency**: 3 web research agents + cross-validation
- **Plan-and-Solve**: Synthesis coordinator waits, then validates systematically
- **Program-of-Thought**: Explicit step-by-step synthesis workflow
- **Byzantine Consensus**: 3/5 agreement required for critical decisions

### Research Output

This produces:
- **Solution Rankings**: Best approaches with evidence and confidence scores
- **Pattern Library**: Proven implementation patterns from real codebases
- **Risk Identification**: Known pitfalls from real implementations
- **Technology Recommendations**: Evidence-based stack selection with justifications

**Validati

Related in AI Agents