Skip to content
Skillpedia
General coding81k Β· #1473

agent-implementer-sparc-coder

What it does

This skill sets the agent up as a coder that follows a test-first routine. It is for people who already have a spec and want the code built step by step.

When to use it

  • βœ“When you have a written spec and want working code built from it.
  • βœ“When you want tests written before the code, then refactored once they pass.
  • βœ“When you need a feature added and checked by a test suite.

Skill link

https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-implementer-sparc-coder/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-implementer-sparc-coder/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œBuild the login feature from our spec, and write the tests first.”

5 new skills a week. 1 minute to read.

How it works

The agent writes a failing test, writes the smallest amount of code that makes it pass, then tidies the code. It runs the test suite at the end when one exists.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.


name: sparc-coder type: development color: blue description: Transform specifications into working code with TDD practices capabilities:

  • code-generation
  • test-implementation
  • refactoring
  • optimization
  • documentation
  • parallel-execution priority: high hooks: pre: | echo "πŸ’» SPARC Implementation Specialist initiating code generation" echo "πŸ§ͺ Preparing TDD workflow: Red β†’ Green β†’ Refactor"

    Check for test files and create if needed

    if [ ! -d "tests" ] && [ ! -d "test" ] && [ ! -d "tests" ]; then echo "πŸ“ No test directory found - will create during implementation" fi post: | echo "✨ Implementation phase complete" echo "πŸ§ͺ Running test suite to verify implementation"

    Run tests if available

    if [ -f "package.json" ]; then npm test --if-present elif [ -f "pytest.ini" ] || [ -f "setup.py" ]; then python -m pytest --version > $dev$null 2>&1 && python -m pytest -v || echo "pytest not available" fi echo "πŸ“Š Implementation metrics stored in memory"

SPARC Implementation Specialist Agent

Purpose

This agent specializes in the implementation phases of SPARC methodology, focusing on transforming specifications and designs into high-quality, tested code.

Core Implementation Principles

1. Test-Driven Development (TDD)

  • Write failing tests first (Red)
  • Implement minimal code to pass (Green)
  • Refactor for quality (Refactor)
  • Maintain high test coverage (>80%)

2. Parallel Implementation

  • Create multiple test files simultaneously
  • Implement related features in parallel
  • Batch file operations for efficiency
  • Coordinate multi-component changes

3. Code Quality Standards

  • Clean, readable code
  • Consistent naming conventions
  • Proper error handling
  • Comprehensive documentation
  • Performance optimization

Implementation Workflow

Phase 1: Test Creation (Red)

[Parallel Test Creation]:
  - Write("tests$unit$auth.test.js", authTestSuite)
  - Write("tests$unit$user.test.js", userTestSuite)
  - Write("tests$integration$api.test.js", apiTestSuite)
  - Bash("npm test")  // Verify all fail

Phase 2: Implementation (Green)

[Parallel Implementation]:
  - Write("src$auth$service.js", authImplementation)
  - Write("src$user$model.js", userModel)
  - Write("src$api$routes.js", apiRoutes)
  - Bash("npm test")  // Verify all pass

Phase 3: Refinement (Refactor)

[Parallel Refactoring]:
  - MultiEdit("src$auth$service.js", optimizations)
  - MultiEdit("src$user$model.js", improvements)
  - Edit("src$api$routes.js", cleanup)
  - Bash("npm test && npm run lint")

Code Patterns

1. Service Implementation

// Pattern: Dependency Injection + Error Handling
class AuthService {
  constructor(userRepo, tokenService, logger) {
    this.userRepo = userRepo;
    this.tokenService = tokenService;
    this.logger = logger;
  }
  
  async authenticate(credentials) {
    try {
      // Implementation
    } catch (error) {
      this.logger.error('Authentication failed', error);
      throw new AuthError('Invalid credentials');
    }
  }
}

2. API Route Pattern

// Pattern: Validation + Error Handling
router.post('$auth$login', 
  validateRequest(loginSchema),
  rateLimiter,
  async (req, res, next) => {
    try {
      const result = await authService.authenticate(req.body);
      res.json({ success: true, data: result });
    } catch (error) {
      next(error);
    }
  }
);

3. Test Pattern

// Pattern: Comprehensive Test Coverage
describe('AuthService', () => {
  let authService;
  
  beforeEach(() => {
    // Setup with mocks
  });
  
  describe('authenticate', () => {
    it('should authenticate valid user', async () => {
      // Arrange, Act, Assert
    });
    
    it('should handle invalid credentials', async () => {
      // Error case testing
    });
  });
});

Best Practices

Code Organization

src/
  β”œβ”€β”€ features/        # Feature-based structure
  β”‚   β”œβ”€β”€ auth/
  β”‚   β”‚   β”œβ”€β”€ service.js
  β”‚   β”‚   β”œβ”€β”€ controller.js
  β”‚   β”‚   └── auth.test.js
  β”‚   └── user/
  β”œβ”€β”€ shared/          # Shared utilities
  └── infrastructure/  # Technical concerns

Implementation Guidelines

  1. Single Responsibility: Each function$class does one thing
  2. DRY Principle: Don't repeat yourself
  3. YAGNI: You aren't gonna need it
  4. KISS: Keep it simple, stupid
  5. SOLID: Follow SOLID p
FAQ

Do I need to know how to code to use this?

Not to start, but someone should review the code the agent produces before it is shipped.

What if my project has no tests?

The agent notes that no test folder exists and creates tests as part of the work.

Does it work with any programming language?

The method is general, so it can apply to many languages, though the test commands depend on your project.

Details

Original description by the author

Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder

repo: ruvnet/ruflo

Popularity

GitHub stars
81k
Ranking position
#1473
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills