sparc-specification

SPARC Specification phase specialist for requirements analysis, constraint identification, use case definition, and acceptance criteria creation

16 stars

Best use case

sparc-specification is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

SPARC Specification phase specialist for requirements analysis, constraint identification, use case definition, and acceptance criteria creation

Teams using sparc-specification should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sparc-specification/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/sparc-specification/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sparc-specification/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sparc-specification Compares

Feature / Agentsparc-specificationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

SPARC Specification phase specialist for requirements analysis, constraint identification, use case definition, and acceptance criteria creation

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SPARC Specification Agent

> Requirements analysis specialist focused on creating comprehensive, clear, and testable specifications for the SPARC methodology.

## Quick Start

```bash
# Invoke SPARC Specification phase
npx claude-flow sparc run spec-pseudocode "Define authentication system requirements"

# Or directly in Claude Code
# "Use SPARC specification to define requirements for user authentication"
```

## When to Use

- Starting a new feature or project that needs clear requirements
- Translating stakeholder needs into technical specifications
- Creating acceptance criteria for user stories
- Documenting constraints (technical, business, regulatory)
- Defining use cases with preconditions and postconditions

## Prerequisites

- Clear understanding of project goals
- Access to stakeholders for requirements validation
- Knowledge of existing system constraints
- Understanding of compliance requirements (if applicable)

## Core Concepts

### SPARC Specification Phase

The Specification phase is the foundation of SPARC methodology:

1. **Define clear, measurable requirements** - Avoid ambiguity
2. **Identify constraints and boundaries** - Technical, business, regulatory
3. **Create acceptance criteria** - Testable pass/fail conditions
4. **Document edge cases and scenarios** - What happens when things go wrong
5. **Establish success metrics** - How to measure completion

### Requirement Types

| Type | Purpose | Example |
|------|---------|---------|
| Functional (FR) | What the system does | "System shall authenticate users via OAuth2" |
| Non-Functional (NFR) | Quality attributes | "API response time <200ms for 95% of requests" |
| Constraint | Limitations | "Must use existing PostgreSQL database" |

## Implementation Pattern

### Requirements Document Structure

```yaml
specification:
  functional_requirements:
    - id: "FR-001"
      description: "System shall authenticate users via OAuth2"
      priority: "high"
      acceptance_criteria:
        - "Users can login with Google/GitHub"
        - "Session persists for 24 hours"
        - "Refresh tokens auto-renew"

  non_functional_requirements:
    - id: "NFR-001"
      category: "performance"
      description: "API response time <200ms for 95% of requests"
      measurement: "p95 latency metric"

    - id: "NFR-002"
      category: "security"
      description: "All data encrypted in transit and at rest"
      validation: "Security audit checklist"
```

### Constraint Analysis

```yaml
constraints:
  technical:
    - "Must use existing PostgreSQL database"
    - "Compatible with Node.js 18+"
    - "Deploy to AWS infrastructure"

  business:
    - "Launch by Q2 2024"
    - "Budget: $50,000"
    - "Team size: 3 developers"

  regulatory:
    - "GDPR compliance required"
    - "SOC2 Type II certification"
    - "WCAG 2.1 AA accessibility"
```

### Use Case Definition

```yaml
use_cases:
  - id: "UC-001"
    title: "User Registration"
    actor: "New User"
    preconditions:
      - "User has valid email"
      - "User accepts terms"
    flow:
      1. "User clicks 'Sign Up'"
      2. "System displays registration form"
      3. "User enters email and password"
      4. "System validates inputs"
      5. "System creates account"
      6. "System sends confirmation email"
    postconditions:
      - "User account created"
      - "Confirmation email sent"
    exceptions:
      - "Invalid email: Show error"
      - "Weak password: Show requirements"
      - "Duplicate email: Suggest login"
```

### Acceptance Criteria (Gherkin)

```gherkin
Feature: User Authentication

  Scenario: Successful login
    Given I am on the login page
    And I have a valid account
    When I enter correct credentials
    And I click "Login"
    Then I should be redirected to dashboard
    And I should see my username
    And my session should be active

  Scenario: Failed login - wrong password
    Given I am on the login page
    When I enter valid email
    And I enter wrong password
    And I click "Login"
    Then I should see error "Invalid credentials"
    And I should remain on login page
    And login attempts should be logged
```

## Configuration

```yaml
# sparc-specification-config.yaml
specification_settings:
  output_format: "markdown"
  id_prefix: "FR-"
  priority_levels: ["critical", "high", "medium", "low"]

templates:
  requirements_doc: ".agent-os/specs/{spec-name}/spec.md"
  use_cases: ".agent-os/specs/{spec-name}/sub-specs/use-cases.md"

validation:
  require_acceptance_criteria: true
  require_priority: true
  require_testability: true
```

## Usage Examples

### Example 1: API Requirements

```markdown
# System Requirements Specification

## 1. Introduction
### 1.1 Purpose
This system provides user authentication and authorization...

### 1.2 Scope
- User registration and login
- Role-based access control
- Session management
- Security audit logging

### 1.3 Definitions
- **User**: Any person with system access
- **Role**: Set of permissions assigned to users
- **Session**: Active authentication state

## 2. Functional Requirements

### 2.1 Authentication
- FR-2.1.1: Support email/password login
- FR-2.1.2: Implement OAuth2 providers
- FR-2.1.3: Two-factor authentication

### 2.2 Authorization
- FR-2.2.1: Role-based permissions
- FR-2.2.2: Resource-level access control
- FR-2.2.3: API key management

## 3. Non-Functional Requirements

### 3.1 Performance
- NFR-3.1.1: 99.9% uptime SLA
- NFR-3.1.2: <200ms response time
- NFR-3.1.3: Support 10,000 concurrent users

### 3.2 Security
- NFR-3.2.1: OWASP Top 10 compliance
- NFR-3.2.2: Data encryption (AES-256)
- NFR-3.2.3: Security audit logging
```

### Example 2: Data Model Specification

```yaml
entities:
  User:
    attributes:
      - id: uuid (primary key)
      - email: string (unique, required)
      - passwordHash: string (required)
      - createdAt: timestamp
      - updatedAt: timestamp
    relationships:
      - has_many: Sessions
      - has_many: UserRoles

  Role:
    attributes:
      - id: uuid (primary key)
      - name: string (unique, required)
      - permissions: json
    relationships:
      - has_many: UserRoles

  Session:
    attributes:
      - id: uuid (primary key)
      - userId: uuid (foreign key)
      - token: string (unique)
      - expiresAt: timestamp
    relationships:
      - belongs_to: User
```

## Execution Checklist

- [ ] Gather requirements from stakeholders
- [ ] Define functional requirements with IDs
- [ ] Define non-functional requirements (performance, security)
- [ ] Document technical, business, regulatory constraints
- [ ] Create use cases with flows and exceptions
- [ ] Write acceptance criteria in Gherkin format
- [ ] Define data model entities and relationships
- [ ] Validate all requirements are testable
- [ ] Get stakeholder approval

## Best Practices

1. **Be Specific**: Avoid ambiguous terms like "fast" or "user-friendly"
2. **Make it Testable**: Each requirement should have clear pass/fail criteria
3. **Consider Edge Cases**: What happens when things go wrong?
4. **Think End-to-End**: Consider the full user journey
5. **Version Control**: Track specification changes
6. **Get Feedback**: Validate with stakeholders early

## Error Handling

| Issue | Resolution |
|-------|------------|
| Ambiguous requirements | Ask clarifying questions, use specific metrics |
| Missing acceptance criteria | Add testable pass/fail conditions |
| Conflicting requirements | Document and escalate to stakeholders |
| Scope creep | Reference original scope, create change request |

## Metrics & Success Criteria

- All requirements have unique IDs
- 100% of requirements have acceptance criteria
- All NFRs have measurable targets
- Stakeholder sign-off obtained
- Zero ambiguous requirements

## Integration Points

### MCP Tools

```javascript
// Store specification phase start
mcp__claude-flow__memory_usage {
  action: "store",
  key: "sparc/specification/status",
  namespace: "coordination",
  value: JSON.stringify({
    phase: "specification",
    status: "in_progress",
    timestamp: Date.now()
  })
}
```

### Hooks

```bash
# Pre-specification hook
npx claude-flow@alpha hooks pre-task --description "SPARC Specification phase"

# Post-specification hook
npx claude-flow@alpha hooks post-task --task-id "spec-complete"
```

### Related Skills

- [sparc-pseudocode](../sparc-pseudocode/SKILL.md) - Next phase: algorithm design
- [sparc-architecture](../sparc-architecture/SKILL.md) - System design phase
- [sparc-refinement](../sparc-refinement/SKILL.md) - TDD implementation phase

## References

- [SPARC Methodology](https://github.com/ruvnet/claude-flow)
- [Gherkin Syntax](https://cucumber.io/docs/gherkin/)
- [IEEE 830 SRS Standard](https://standards.ieee.org/)

## Version History

- **1.0.0** (2026-01-02): Initial release - converted from agent to skill format

Related Skills

sparc-methodology

16
from diegosouzapw/awesome-omni-skill

SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration

prd-v06-technical-specification

16
from diegosouzapw/awesome-omni-skill

Define implementation contracts (APIs and data models) that developers will build against during PRD v0.6 Architecture. Triggers on requests to define APIs, design database schema, create data models, or when user asks "define APIs", "data model", "database schema", "API contracts", "technical spec", "endpoint design", "schema design". Consumes ARC- (architecture), TECH- (Build items), UJ- (flows), SCR- (screens). Outputs API- entries for endpoints and DBT- entries for data models. Feeds v0.7 Build Execution.

api-specifications

16
from diegosouzapw/awesome-omni-skill

Guidance for Splits Network REST API design, implementation, and documentation

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

tdd-orchestrator

16
from diegosouzapw/awesome-omni-skill

Master TDD orchestrator specializing in red-green-refactor discipline, multi-agent workflow coordination, and comprehensive test-driven development practices.

tavily-web

16
from diegosouzapw/awesome-omni-skill

Web search, content extraction, crawling, and research capabilities using Tavily API

tauri2-react-rust

16
from diegosouzapw/awesome-omni-skill

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built frontend in browser, or when the user mentions Tauri, Tauri 2, Rust backend, React frontend, desktop app architecture, invoke/commands, cross-platform, 调研网站, 验证效果, agent-browser.

tauri-svelte-typescript-general

16
from diegosouzapw/awesome-omni-skill

General rules for developing desktop applications using Tauri with Svelte and TypeScript for the frontend.

tauri-development

16
from diegosouzapw/awesome-omni-skill

Tauri development guidelines for building cross-platform desktop applications with TypeScript, Rust, and modern web technologies

tasks-code-review

16
from diegosouzapw/awesome-omni-skill

Use for QUICK PR reviews with structured checklists (architecture, patterns, security, performance). Provides step-by-step review process, git diff commands, and review report templates. Best for pull request reviews and pre-commit checks. NOT for deep refactoring analysis (use code-review instead).

task-bg

16
from diegosouzapw/awesome-omni-skill

Launch and manage background tasks for parallel droid execution using background-manager.py. Factory Droid has no native run_in_background, so this uses manual Python-based background management.

tapform-automation

16
from diegosouzapw/awesome-omni-skill

Automate Tapform tasks via Rube MCP (Composio). Always search tools first for current schemas.