Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

sparc-implement — Claude Code skill: design and implementation

A skill that runs SPARC design phases: writes algorithm pseudocode, defines module boundaries and API contracts, then generates working code. Use it if you're developing with SPARC methodology and want to automate the architecture stage.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill sparc-implement -a claude-code
Open on GitHub

What sparc-implement does

sparc-implement covers phases 2 and 3 of the SPARC methodology. In phase 2, the agent writes language-agnostic pseudocode for each acceptance criterion, defines data structures with type annotations, and maps control flow — happy path, error handling, concurrent access. It calculates time and space complexity for critical paths.

Phase 3 designs the architecture: establishes bounded contexts and aggregate roots using DDD, writes TypeScript interfaces for requests and responses, specifies error codes, defines directory structure and dependency rules. It outlines persistence, caching, and messaging strategies.

The skill stores artifacts in ruflo memory, updates phase state, records trajectory steps, and can start implementation immediately — creates files along module boundaries, writes tests, and verifies acceptance criteria. Runs after the specification phase is complete.

What it helps with

  • write pseudocode with control flow and error handling
  • design architecture with module boundaries and API contracts
  • define data structures and calculate algorithm complexity
  • generate code from specification and architecture
  • track design phase status in ruflo memory

Example prompts for the agent

  • Design phases 2 and 3 for authentication: get pseudocode and architecture
  • Write pseudocode with edge cases and time/space complexity for a search algorithm
  • Define bounded contexts and API contracts for a payment module

How to install sparc-implement

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill sparc-implement -a claude-code

2Manually: put the files in place

~/.claude/skills/sparc-implement/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/sparc-implement/

From the same set104

The whole set →
ruflo ruvnet This skill adds multi-agent orchestration, memory, routing, and MCP tools to a project. Use it for swarm tasks and multi-step workflows. Claude Code CX Codex Cursor +1 4,000installs Swarm Orchestration ruvnet Skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. Claude Code CX Codex Cursor +1 2,100installs github-project-management ruvnet Turns issue triage and board upkeep into gh and ruv-swarm calls: labels, subtasks, duplicate lookup. Useful when the tracker holds more tickets than order. Claude Code CX Codex Cursor +1 1,400installs github-workflow-automation ruvnet Automates GitHub Actions with AI agent coordination. Generates optimised pipelines, manages pull requests, analyzes failed runs, and deploys updates with risk assessment. Claude Code CX Codex Cursor +1 1,300installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs flow-nexus-swarm ruvnet Deploy cloud-based AI agent swarms and define event-driven workflows with message queues. Use it to coordinate tasks, inspect runs, and scale a swarm. Claude Code CX Codex Cursor +1 1,200installs performance-analysis ruvnet Detects bottlenecks in Claude Flow swarms, profiles agent operations, and generates reports with actionable optimization recommendations. Claude Code CX Codex Cursor +1 1,200installs

Similar

Questions about sparc-implement

How do I install sparc-implement in Claude Code?

Run npx skills add ruvnet/ruflo --skill sparc-implement -a claude-code, then open ~/.claude/skills/sparc-implement/SKILL.md.

What does sparc-implement do?

It runs SPARC phases 2 and 3: the agent writes algorithm pseudocode, designs architecture with module boundaries and API contracts, then generates working code and tests.

When should I use sparc-implement?

After the specification phase is complete and its gate has been passed. The skill requires ruflo with memory and task support.

Source text

SKILL.md · MIT
---
name: sparc-implement
description: Run the SPARC Pseudocode and Architecture phases (2 and 3) — write algorithm pseudocode, design module boundaries and API contracts, then implement
argument-hint: ""
allowed-tools: mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__task_create mcp__plugin_ruflo-core_ruflo__task_update mcp__plugin_ruflo-core_ruflo__task_complete mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step mcp__plugin_ruflo-core_ruflo__neural_predict mcp__plugin_ruflo-core_ruflo__workflow_create Bash Read Write Edit
---

# SPARC Architecture + Implementation

Run Phases 2 and 3 of the SPARC methodology: design algorithms with pseudocode, then establish architecture with module boundaries and API contracts.

## When to use

After the Specification phase is complete and its gate has been passed. This skill covers both the Pseudocode and Architecture phases as they are tightly coupled — algorithm design informs module boundaries and vice versa.

## Steps

1. **Retrieve specification** — call `mcp__plugin_ruflo-core_ruflo__memory_search` with namespace `sparc-phases` and query for the feature's spec. Extract requirements, acceptance criteria, constraints, and edge cases.

2. **Retrieve phase state** — call `mcp__plugin_ruflo-core_ruflo__memory_retrieve` with namespace `sparc-state` and exact key `current-phase-{feature-slug}` to confirm we are in Phase 2 or 3.

3. **Search for architectural patterns** — call `mcp__plugin_ruflo-core_ruflo__neural_predict` with the feature description to find relevant architectural decisions from past projects

4. **Phase 2 — Pseudocode Design**:
   a. For each acceptance criterion, write language-agnostic pseudocode that satisfies it
   b. Define core data structures with type annotations
   c. Map control flow including:
      - Happy path
      - Error/exception paths for each edge case
      - Concurrent access handling if applicable
   d. Annotate algorithmic complexity (time and space) for critical paths
   e. Store pseudocode artifact:
      - Call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `sparc-phases`, key `pseudo-{feature-slug}`
      - Value: `{ status: "complete", algorithms: [...], dataStructures: [...], controlFlow: [...], complexity: {...} }`

5. **Phase 3 — Architecture Design**:
   a. Define bounded contexts and aggregate roots following DDD patterns:
      - Identify entity boundaries and value objects
      - Define aggregate invariants
      - Map domain events
   b. Design API contracts:
      - Request/response schemas with TypeScript interfaces
      - Error response codes and formats
      - Versioning strategy if applicable
   c. Plan module boundaries:
      - Directory structure
      - Dependency direction rules (no circular dependencies)
      - Public vs internal interfaces
   d. Specify infrastructure concerns:
      - Persistence strategy (database, cache, file)
      - Messaging patterns (sync, async, event-driven)
      - Configuration and environment requirements
   e. Store architecture artifact:
      - Call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `sparc-phases`, key `arch-{feature-slug}`
      - Value: `{ status: "complete", boundedContexts: [...], apiContracts: [...], moduleBoundaries: {...}, infrastructure: {...} }`

6. **Update phase state** — call `mcp__plugin_ruflo-core_ruflo__memory_store` with namespace `sparc-state`, exact key `current-phase-{feature-slug}`; preserve existing state fields, update current phase to 3 (Architecture) with both artifacts recorded, and set `updatedAt` to the current ISO timestamp

7. **Record trajectory step** — call `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step` with architecture summary

8. **Begin implementation** — if the user confirms, proceed to write production code:
   a. Create files following the defined module boundaries
   b. Implement interfaces and types first
   c. Implement core logic following the pseudocode
   d. Write unit tests alongside implementation (TDD when possible)
   e. Run tests to verify acceptance criteria

9. **Present architecture** — display the architecture decision record and suggest running `/ruflo-sparc:ruflo-sparc advance` to pass the Phase 3 gate

## Output format

```
# Pseudocode: {Feature Name}

## Core Algorithms
### Algorithm 1: {name}
```pseudocode
FUNCTION processRequest(input):
    VALIDATE input against schema
    IF invalid THEN THROW ValidationError
    result <- TRANSFORM input
    STORE result
    RETURN result
```
Complexity: O(n) time, O(1) space

## Data Structures
- {StructName}: { field1: type, field2: type }

---

# Architecture: {Feature Name}

## Bounded Contexts
- {ContextName}: {description}
  - Aggregates: {list}
  - Events: {list}

## API Contracts
### POST /api/{resource}
- Request: { field1: string, field2: number }
- Response: { id: string, ...fields }
- Errors: 400 (validation), 409 (conflict), 500 (internal)

## Module Structure
```
src/{feature}/
  {feature}.types.ts      # Interfaces and types
  {feature}.service.ts     # Business logic
  {feature}.controller.ts  # HTTP handling
  {feature}.repository.ts  # Data access
  {feature}.test.ts        # Tests
```

## Infrastructure
- Persistence: {strategy}
- Caching: {strategy}
- Events: {strategy}

---
Phases 2-3 complete. Run `/ruflo-sparc:ruflo-sparc advance` to pass the gate check.
```

© ruvnet · MIT · ruvnet/ruflo

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor