SPARC Specification Phase
Run Phase 1 of the SPARC methodology: define what must be built and how success is measured.
When to use
When starting a new feature or project that needs structured requirements gathering before any code is written. This phase produces the foundational specification that all subsequent phases (Pseudocode, Architecture, Refinement, Completion) build upon.
Steps
Initialize phase tracking — call mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-start with metadata { "phase": "specification", "feature": "$ARGUMENTS" }
Check for prior work — call mcp__plugin_ruflo-core_ruflo__memory_search with namespace sparc-state and query for the feature to see if a SPARC workflow already exists. If it does, retrieve existing artifacts. If not, initialize state with phase 1.
Search for similar patterns — call mcp__plugin_ruflo-core_ruflo__neural_predict with the feature description to find relevant past specifications and learned patterns
Gather requirements — analyze the feature description and the codebase to identify:
- Functional requirements: what the feature must do (user-facing behaviors)
- Non-functional requirements: performance targets, security constraints, scalability needs
- Integration points: what existing systems or APIs are affected
- Data requirements: what data is created, read, updated, or deleted
Define acceptance criteria — write at least 3 concrete, testable acceptance criteria in Given/When/Then format:
AC-1: Given [precondition], when [action], then [expected result]
AC-2: Given [precondition], when [action], then [expected result]
AC-3: Given [precondition], when [action], then [expected result]
Identify constraints — document:
- Performance constraints (latency, throughput, resource limits)
- Security constraints (authentication, authorization, data sensitivity)
- Compatibility constraints (browser support, API versions, backward compatibility)
- Infrastructure constraints (deployment environment, dependencies)
Map edge cases — list at least 3 edge cases or failure scenarios:
- What happens with invalid input?
- What happens under concurrent access?
- What happens when external dependencies fail?
Store specification — call mcp__plugin_ruflo-core_ruflo__memory_store with:
- Namespace:
sparc-phases
- Key:
spec-{feature-slug}
- Value: JSON with
{ status: "complete", requirements, acceptanceCriteria, constraints, edgeCases, integrationPoints }
Update phase state — call mcp__plugin_ruflo-core_ruflo__memory_store with:
- Namespace:
sparc-state
- Key:
current-phase-{feature-slug}
- Value: updated state with artifacts list including the spec key
Record trajectory step — call mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step with the specification summary
Present specification — display the full specification document to the user with a summary table and suggest running /sparc advance to pass the gate and move to the Pseudocode phase
Output format
# Specification: {Feature Name}
## Requirements
### Functional
- FR-1: ...
- FR-2: ...
### Non-Functional
- NFR-1: ...
## Acceptance Criteria
- AC-1: Given ..., when ..., then ...
- AC-2: Given ..., when ..., then ...
- AC-3: Given ..., when ..., then ...
## Constraints
- Performance: ...
- Security: ...
- Compatibility: ...
## Edge Cases
- EC-1: ...
- EC-2: ...
- EC-3: ...
## Integration Points
- IP-1: ...
---
Phase 1 complete. Run `/sparc advance` to pass the gate check.
Source: ruvnet/ruflo → plugins/ruflo-sparc/skills/sparc-spec/SKILL.md
1---2name: sparc-spec3description: Run the SPARC Specification phase — gather requirements, define acceptance criteria, identify constraints, and store the spec in memory4---567# SPARC Specification Phase89Run Phase 1 of the SPARC methodology: define what must be built and how success is measured.1011## When to use1213When starting a new feature or project that needs structured requirements gathering before any code is written. This phase produces the foundational specification that all subsequent phases (Pseudocode, Architecture, Refinement, Completion) build upon.1415## Steps16171. **Initialize phase tracking** — call `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-start` with metadata `{ "phase": "specification", "feature": "$ARGUMENTS" }`18192. **Check for prior work** — call `mcp__plugin_ruflo-core_ruflo__memory_search` with namespace `sparc-state` and query for the feature to see if a SPARC workflow already exists. If it does, retrieve existing artifacts. If not, initialize state with phase 1.20213. **Search for similar patterns** — call `mcp__plugin_ruflo-core_ruflo__neural_predict` with the feature description to find relevant past specifications and learned patterns22234. **Gather requirements** — analyze the feature description and the codebase to identify:24 - **Functional requirements**: what the feature must do (user-facing behaviors)25 - **Non-functional requirements**: performance targets, security constraints, scalability needs26 - **Integration points**: what existing systems or APIs are affected27 - **Data requirements**: what data is created, read, updated, or deleted28295. **Define acceptance criteria** — write at least 3 concrete, testable acceptance criteria in Given/When/Then format:30 ```31 AC-1: Given [precondition], when [action], then [expected result]32 AC-2: Given [precondition], when [action], then [expected result]33 AC-3: Given [precondition], when [action], then [expected result]34 ```35366. **Identify constraints** — document:37 - Performance constraints (latency, throughput, resource limits)38 - Security constraints (authentication, authorization, data sensitivity)39 - Compatibility constraints (browser support, API versions, backward compatibility)40 - Infrastructure constraints (deployment environment, dependencies)41427. **Map edge cases** — list at least 3 edge cases or failure scenarios:43 - What happens with invalid input?44 - What happens under concurrent access?45 - What happens when external dependencies fail?46478. **Store specification** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with:48 - Namespace: `sparc-phases`49 - Key: `spec-{feature-slug}`50 - Value: JSON with `{ status: "complete", requirements, acceptanceCriteria, constraints, edgeCases, integrationPoints }`51529. **Update phase state** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with:53 - Namespace: `sparc-state`54 - Key: `current-phase-{feature-slug}`55 - Value: updated state with artifacts list including the spec key565710. **Record trajectory step** — call `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step` with the specification summary585911. **Present specification** — display the full specification document to the user with a summary table and suggest running `/sparc advance` to pass the gate and move to the Pseudocode phase6061## Output format6263```64# Specification: {Feature Name}6566## Requirements67### Functional68- FR-1: ...69- FR-2: ...7071### Non-Functional72- NFR-1: ...7374## Acceptance Criteria75- AC-1: Given ..., when ..., then ...76- AC-2: Given ..., when ..., then ...77- AC-3: Given ..., when ..., then ...7879## Constraints80- Performance: ...81- Security: ...82- Compatibility: ...8384## Edge Cases85- EC-1: ...86- EC-2: ...87- EC-3: ...8889## Integration Points90- IP-1: ...9192---93Phase 1 complete. Run `/sparc advance` to pass the gate check.94```9596---9798**Source:** [`ruvnet/ruflo`](https://github.com/ruvnet/ruflo) → `plugins/ruflo-sparc/skills/sparc-spec/SKILL.md`