# Using the SPARC Development Methodology in roocode ## Prerequisites [.roomodes file for SPARC](https://gist.githubusercontent.com/bitnom/03205e96005525f6ba55dc78cbf62b62/raw/a9c1352d36fd28fc24ef9fd093feaf0d8876983e/.roomodes.json) [roocode boomerang mode docs](https://docs.roocode.com/features/boomerang-tasks/) ## What is SPARC? SPARC is a methodology for structuring complex software development projects. It breaks down the development lifecycle into distinct, manageable stages, each handled by a specialized "mode" or agent. This approach promotes clarity, modularity, collaboration, and adherence to best practices, similar to an assembly line for software. ## The SPARC Modes: Your Specialized Team Each mode acts as an expert focused on a specific development phase: * **`ask` (โAsk):** Clarifies vague tasks into actionable prompts and identifies the correct mode for delegation. Uses **Prompt Decomposition Thinking**. * **`sparc` (โก๏ธ SPARC Orchestrator):** The project manager. Breaks down high-level goals into subtasks and delegates them using `new_task`. Uses **SPARC Orchestration Thinking**. * **`spec-pseudocode` (๐ Specification Writer):** Defines *what* the software should do (requirements, edge cases, constraints) via detailed pseudocode. * **`architect` (๐๏ธ Architect):** Designs *how* the system is built (high-level structure, scalability, security, component interactions). Uses **Architectural Systems Thinking** and often visualization tools like Mermaid. * **`code` (๐ง Auto-Coder):** Writes clean, efficient, modular implementation code based on specs and architecture. * **`tdd` (๐งช Tester (TDD)):** Writes tests *before* implementation using Test-Driven Development principles to ensure quality. * **`security-review` (๐ก๏ธ Security Reviewer):** Audits code and infrastructure for security vulnerabilities. * **`docs-writer` (๐ Documentation Writer):** Creates clear user and developer documentation. * **`integration` (๐ System Integrator):** Merges outputs from different modes into a cohesive, working system. * **`devops` (๐ DevOps):** Manages deployment, infrastructure automation, and CI/CD. * **Other Modes:** Specialized modes exist for debugging (`debug`), optimization (`refinement-optimization-mode`), monitoring (`post-deployment-monitoring-mode`), etc. ## The SPARC Workflow & Key Commands 1. **Define & Decompose:** Start with a high-level task. Use `ask` or `sparc` to refine and break it down. 2. **Delegate (`new_task`):** The orchestrator assigns subtasks to appropriate modes. * *Example:* ```xml <new_task> <mode>spec-pseudocode</mode> <message>Define functional requirements and pseudocode for the password reset flow.