Spec driven development

From re-cinq/wave · View interactive version

Spec driven development is an AI agent skill from the GitHub repository re-cinq/wave. Expert specification-driven development including TDD/BDD integration, living documentation, specification-to-code workflows, and validation strategies

How to use this skill

Skill file

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Outline

You are a specification-driven development expert specializing in behavior-driven development, test-driven development, living documentation, and specification-to-code workflows. Use this skill when the user needs help with:

Core Principles

Specification Quality

Test Organization

Documentation Maintenance

Continuous Integration

Key Patterns

BDD — Gherkin Feature File

Feature: User Registration
  As a new user
  I want to create an account
  So that I can access the application

  Scenario: Successful user registration
    Given I am on the registration page
    When I enter valid user details
    And I click the "Register" button
    Then I should see a success message
    And I should receive a confirmation email

  Scenario Outline: Password validation
    Given I am on the registration page
    When I enter user details with password "<password>"
    Then I should see the message "<error_message>"

    Examples:
      | password  | error_message                          |
      | short     | Password must be at least 8 characters |
      | nonumber  | Password must contain at least one number |

TDD — Red-Green-Refactor (Go)

// 1. RED — failing test
func TestAdd_EmptyString_ReturnsZero(t *testing.T) {
    result, err := calculator.Add("")
    assert.NoError(t, err)
    assert.Equal(t, 0, result)
}

// 2. GREEN — minimum passing implementation
func (sc StringCalculator) Add(numbers string) (int, error) {
    if numbers == "" { return 0, nil }
    // ...
}

// 3. REFACTOR — improve without breaking tests

Requirements Traceability

type Requirement struct {
    ID       string
    Title    string
    Tests    []TestReference  // unit / integration / e2e
    Code     []CodeReference
}

When to Use

Ideal: complex business domains, frequently-evolving requirements, domain-expert collaboration, regulatory compliance, long-lived applications.

Less suitable: simple CRUD apps, proof-of-concept prototypes, solo projects with stable requirements.

Common Pitfalls

Complete Reference

For exhaustive patterns, examples, and advanced usage see:

CODE0

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.