# Sparc Methodology

> SPARC — a systematic 5-phase development lifecycle (Specification, Pseudocode, Architecture, Refinement, Completion) run through Claude Flow multi-agent orchestration. Use when driving a feature from spec through review and deployment with coordinated agents, or when you want a structured spec→design→TDD→review→completion pipeline rather than ad-hoc edits.

- Skill: `dreamlab-ai/sparc-methodology` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add dreamlab-ai/sparc-methodology`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dreamlab-ai/sparc-methodology/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: dreamlab-ai (https://skillmd.com/u/dreamlab-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/dreamlab-ai/sparc-methodology

---


# SPARC Methodology

SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) is a
systematic development lifecycle wired into Claude Flow's multi-agent
orchestration. It offers 17 specialized modes covering research, architecture,
TDD, review, and deployment. This guide is the quick-path; the deep detail lives
in `references/`.

## When to use

Reach for SPARC when a task benefits from a structured, multi-phase lifecycle with
coordinated agents — e.g. building a feature from requirements through tested,
reviewed, deployed code, or running a spec→design→TDD→review pipeline.

## When not to use

- Full quality engineering with 34 agents, coverage gates, and defect prediction — use **build-with-quality**.
- GitHub-specific code-review swarms on PRs — use **github-code-review**.
- Queen-led hive-mind / Byzantine consensus without a full dev lifecycle — use **hive-mind-advanced**.
- PRD-to-documentation generation without the SPARC lifecycle — use **prd2build**.
- Raw swarm-coordination primitives (quick mesh/star/ring, load balancing) without methodology overhead — use **swarm-advanced**.
- Simple single-file changes that need no multi-phase orchestration — edit directly.

## Core philosophy

Specification before code · design before implementation · tests before features ·
review everything · document continuously. Emphasises TDD, parallel agent
execution, persistent Memory sharing across agents/sessions, and modular design.

## The five phases

| Phase | Goal | Key modes |
|-------|------|-----------|
| 1. Specification | Requirements, constraints, success criteria, pseudocode planning | `researcher`, `analyzer`, `memory-manager` |
| 2. Architecture | System structure, interfaces, schema, API contracts, infra | `architect`, `designer`, `orchestrator` |
| 3. Refinement (TDD) | Failing tests → minimum code → pass → refactor → iterate | `tdd`, `coder`, `tester` |
| 4. Review | Quality, security, performance, best-practice validation | `reviewer`, `optimizer`, `debugger` |
| 5. Completion | Integration, deployment, monitoring, docs, knowledge capture | `workflow-manager`, `documenter`, `memory-manager` |

The 17 modes span core orchestration (`orchestrator`, `swarm-coordinator`,
`workflow-manager`, `batch-executor`), development (`coder`, `architect`, `tdd`,
`reviewer`), analysis/research (`researcher`, `analyzer`, `optimizer`), and
creative/support (`designer`, `innovator`, `documenter`, `debugger`, `tester`,
`memory-manager`). Full per-mode capabilities, quality standards, and usage
snippets: **[references/modes.md](references/modes.md)**.

## Quick path

`mcp__claude-flow__sparc_mode` is the primary, verified path — run a single mode:

```javascript
mcp__claude-flow__sparc_mode { mode: "coder", task_description: "implement JWT auth" }
```

Claude Code only: the MCP tool above requires an MCP client. On Codex / GPT-6 Astra:
run the phase sequentially in one session using the mode's prompt from
[references/modes.md](references/modes.md) instead.

Historical (v2, not current): earlier docs showed a `claude-flow sparc modes|run|tdd|
pipeline|batch` CLI. The installed ruflo v3.38.21 binary has no `sparc` subcommand
(`claude-flow sparc --help` → "Unknown command: sparc") — that surface does not exist
in this image. Use the MCP tool above.

For complex work, initialize a swarm first, then spawn agents and monitor:

```javascript
mcp__claude-flow__swarm_init { topology: "hierarchical", strategy: "adaptive", maxAgents: 8 }
mcp__claude-flow__sparc_mode { mode: "orchestrator", task_description: "coordinate feature dev" }
mcp__claude-flow__swarm_status { swarmId: "current" }
```

## References

- **[references/modes.md](references/modes.md)** — the five phases in depth and all 17 modes (capabilities, quality standards, usage snippets).
- **[references/orchestration.md](references/orchestration.md)** — activation methods (MCP / NPX / local), the five swarm topologies, and the complete TDD + red-green-refactor workflows.
- **[references/cookbook.md](references/cookbook.md)** — best practices (Memory, batching, hooks, coverage, file layout), worked integration examples (full-stack, innovation, legacy refactor), common CLI workflows, advanced features (neural training, cross-session memory, GitHub, monitoring), and performance context.

## Working principles

- **Memory for coordination**: store architectural decisions and share across agents/sessions (`memory_store` / `memory_retrieve`).
- **Batch related operations** in a single message rather than one call per message.
- **Wire hooks** (`pre-task` / `post-edit` / `post-task`) for lifecycle coordination.
- **Target ~90% coverage** and document as you build.
See `references/cookbook.md` for the full detail on each.

