Agent skill

Specification Driven Generation

by ArabelaTso in ArabelaTso/Skills-4-SE

Generate implementation code and tests from written specifications.

Apache-2.0Auto-check passedTesting & QA

Install Specification Driven Generation

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill specification-driven-generation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE specification-driven-generation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/specification-driven-generation .claude/skills/specification-driven-generation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
specification-driven-generation
GitHub stars
253
Token cost
~2.4k tokens
SKILL.md length
734 words
Files
1
Skills in repo
150
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate implementation code and tests from written specifications.

  • Works in 5 steps: Analyze Specification → Design Implementation → Generate Implementation → …
  • The user provides specifications (natural language descriptions
  • SKILL.md covers Workflow, Specification Analysis, Best Practices and Common Patterns, plus 2 more sections
  • Calls pytest and mvn

What it does

Specification Driven Generation is an agent skill from ArabelaTso/Skills-4-SE. Generate implementation code and tests from written specifications. Use when the user provides specifications (natural language descriptions, formal specs, requirements documents, API specs) and asks Claude to implement the described functionality. Supports data structures, algorithms, classes, functions, and includes automatic test generation to validate implementation against specification.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering OpenAPI specifications, Test generation and PRD writing. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • The user provides specifications (natural language descriptions
  • Requirements documents
  • API specs) and asks Claude to implement the described functionality

Example prompts

  • “/specification-driven-generation”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Analyze Specification
  2. Design Implementation
  3. Generate Implementation
  4. Generate Tests
  5. Verify Implementation

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • mvn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Specification Driven Generation loads about 2.4k tokens when it runs. Until then it costs about 107 tokens; SKILL.md has 734 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 734 words, ~2,368 tokens.

Download SKILL.mdSave it as .claude/skills/specification-driven-generation/SKILL.md (or your agent's skills folder).
name
specification-driven-generation
description
Generate implementation code and tests from written specifications. Use when the user provides specifications (natural language descriptions, formal specs, requirements documents, API specs) and asks Claude to implement the described functionality. Supports data structures, algorithms, classes, functions, and includes automatic test generation to validate implementation against specification.

Specification-Driven Generation

Generate implementation code and validation tests from written specifications through a systematic specification-to-code workflow.

Workflow

1. Analyze Specification

Read and extract requirements from the specification:

  • Identify functional requirements (what the code must do)
  • Extract input/output contracts (parameters, return types, constraints)
  • Note edge cases, error conditions, and validation rules
  • Understand performance requirements or complexity constraints
  • Identify data structures and algorithms needed
2. Design Implementation

Plan the code structure before writing:

  • Choose appropriate data structures
  • Select efficient algorithms
  • Plan class/function organization
  • Identify helper functions needed
  • Consider error handling approach
3. Generate Implementation

Write clean, well-documented code that satisfies the specification:

Code Structure:

  • Use clear, descriptive names that reflect the specification
  • Add docstrings/comments explaining the specification being implemented
  • Include type hints/annotations where applicable
  • Implement all required functionality
  • Handle edge cases and errors per specification

Common Patterns:

  • Data structures: Classes with proper encapsulation, initialization, and methods
  • Algorithms: Step-by-step implementation with complexity documentation
  • Validators: Input validation matching specification constraints
  • Utilities: Helper functions for complex operations
4. Generate Tests

Create comprehensive tests that validate the implementation against the specification:

Test Coverage:

  • Normal cases from specification examples
  • Edge cases mentioned in specification
  • Error cases and validation rules
  • Boundary conditions
  • Performance requirements (if specified)

Test Structure:

python
# Example: Testing a sorted list data structure
def test_basic_functionality():
    # From spec: "Insert elements in sorted order"
    sl = SortedList()
    sl.insert(5)
    sl.insert(2)
    sl.insert(8)
    assert sl.to_list() == [2, 5, 8]

def test_edge_case_duplicates():
    # From spec: "Allow duplicate elements"
    sl = SortedList()
    sl.insert(3)
    sl.insert(3)
    assert sl.to_list() == [3, 3]

def test_error_handling():
    # From spec: "Raise TypeError for non-comparable items"
    sl = SortedList()
    with pytest.raises(TypeError):
        sl.insert("string")
        sl.insert(5)
5. Verify Implementation

Run tests to ensure implementation matches specification:

Python:

bash
pytest test_<module>.py -v

Java:

bash
mvn test

If tests fail, debug and fix implementation to match specification.

Specification Analysis

Natural Language Specifications

Extract key information from prose descriptions:

Example specification:

"Implement a priority queue that supports insertion in O(log n) time and removal of the minimum element in O(log n) time. The queue should handle duplicate priorities and raise an error when attempting to remove from an empty queue."

Extracted requirements:

  • Data structure: Priority queue
  • Operations: insert, remove_min
  • Complexity: O(log n) for both operations
  • Edge cases: Duplicates allowed, error on empty removal
  • Implementation hint: Heap-based structure
Formal Specifications

Parse structured requirements:

Example (mathematical notation):

Function: binary_search(arr: sorted array, target: int) → int
Precondition: arr is sorted in ascending order
Postcondition: returns index i where arr[i] = target, or -1 if not found
Complexity: O(log n)

Extracted requirements:

  • Input: Sorted array and target value
  • Output: Index or -1
  • Algorithm: Binary search
  • Validation: Assumes sorted input
API Specifications

For OpenAPI/Swagger specs, extract:

  • Endpoints and HTTP methods
  • Request/response schemas
  • Validation rules
  • Error codes
  • Authentication requirements

Best Practices

Specification Clarity
  • Ask clarifying questions if specification is ambiguous
  • Verify assumptions about edge cases
  • Confirm expected behavior for unspecified scenarios
Implementation Quality
  • Write self-documenting code with clear variable names
  • Add comments linking code to specific specification requirements
  • Use appropriate design patterns
  • Follow language conventions and style guides
Test Quality
  • Map each test to a specific requirement in the specification
  • Use descriptive test names that reference the specification
  • Include comments like # From spec: "requirement text"
  • Test boundary conditions and edge cases thoroughly
Show full SKILL.md (305 more words)Show less
Validation
  • Ensure ALL specification requirements have corresponding tests
  • Check that implementation handles ALL specified error cases
  • Verify performance requirements if specified
  • Confirm output format matches specification exactly

Common Patterns

Data Structure Implementation

Specification → Implementation:

  1. Define the data structure class
  2. Implement initialization
  3. Add required operations
  4. Include helper methods for internal logic
  5. Add validation and error handling
Algorithm Implementation

Specification → Implementation:

  1. Understand input/output requirements
  2. Choose efficient algorithm approach
  3. Implement step-by-step with clear logic
  4. Add complexity analysis in comments
  5. Optimize if performance constraints specified
Class Design

Specification → Implementation:

  1. Identify attributes from specification
  2. Design initialization and validation
  3. Implement public methods per specification
  4. Add private helper methods as needed
  5. Include properties/getters as appropriate

Example Session

User provides specification:

"Implement a Stack data structure with push, pop, and peek operations. The stack should have a maximum capacity and raise an exception when pushing to a full stack or popping from an empty stack. Include a method to check if the stack is empty."

Step 1: Analyze

  • Operations: push, pop, peek, is_empty
  • Constraints: Maximum capacity
  • Errors: StackOverflowError (full), StackUnderflowError (empty)
  • Data structure: Array/list-based stack

Step 2: Design

  • Use list as internal storage
  • Track current size and max capacity
  • Custom exception classes

Step 3: Generate Implementation

python
class StackOverflowError(Exception):
    pass

class StackUnderflowError(Exception):
    pass

class Stack:
    def __init__(self, capacity):
        self.capacity = capacity
        self.items = []

    def push(self, item):
        if len(self.items) >= self.capacity:
            raise StackOverflowError("Stack is full")
        self.items.append(item)

    def pop(self):
        if self.is_empty():
            raise StackUnderflowError("Stack is empty")
        return self.items.pop()

    def peek(self):
        if self.is_empty():
            raise StackUnderflowError("Stack is empty")
        return self.items[-1]

    def is_empty(self):
        return len(self.items) == 0

Step 4: Generate Tests

python
import pytest

def test_push_and_peek():
    # From spec: "push and peek operations"
    stack = Stack(capacity=3)
    stack.push(1)
    stack.push(2)
    assert stack.peek() == 2

def test_pop():
    # From spec: "pop operation"
    stack = Stack(capacity=3)
    stack.push(1)
    stack.push(2)
    assert stack.pop() == 2
    assert stack.pop() == 1

def test_is_empty():
    # From spec: "check if stack is empty"
    stack = Stack(capacity=3)
    assert stack.is_empty() == True
    stack.push(1)
    assert stack.is_empty() == False

def test_overflow():
    # From spec: "raise exception when pushing to full stack"
    stack = Stack(capacity=2)
    stack.push(1)
    stack.push(2)
    with pytest.raises(StackOverflowError):
        stack.push(3)

def test_underflow_pop():
    # From spec: "raise exception when popping from empty stack"
    stack = Stack(capacity=2)
    with pytest.raises(StackUnderflowError):
        stack.pop()

def test_underflow_peek():
    # From spec: "raise exception when peeking empty stack"
    stack = Stack(capacity=2)
    with pytest.raises(StackUnderflowError):
        stack.peek()

Step 5: Verify

bash
pytest test_stack.py -v

All tests pass → Implementation satisfies specification.

Tips

Handling Ambiguity
  • If specification is unclear, identify multiple interpretations
  • Ask user which interpretation is correct
  • Document assumptions in code comments
Performance Specifications
  • Note Big-O requirements in docstrings
  • Choose appropriate algorithms/data structures
  • Add complexity analysis comments
Error Handling
  • Create custom exceptions for domain-specific errors
  • Match exception types to specification requirements
  • Include descriptive error messages
Incremental Implementation
  • Implement and test one requirement at a time
  • Start with core functionality, then edge cases
  • Verify each piece before moving to the next

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/specification-driven-generation of ArabelaTso/Skills-4-SE.

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Specification Driven Generation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Specification Driven Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Specification Driven Generation this skillArabelaTso/Skills-4-SE253—~2.4kAutomated safety check: PassApache-2.0
Codexqa Testdata Generatoropenqa-cn/codexqa152—~4.8kAutomated safety check: PassApache-2.0
Test Strategynurettincoban/ai-prd-workflow298—~1.4kAutomated safety check: PassMIT
Scenario DesignBlackBeltTechnology/pi-agent-dashboard315—~2.8kAutomated safety check: PassMIT
Test Strategy Docmohitagw15856/pm-claude-skills1.4k—~1.6kAutomated safety check: PassMIT
AI Test Generationpetrkindlmann/qa-skills165—~4.8kAutomated safety check: PassMIT

Similar skills

  • Constructs test data against real backends and writes it back into test cases as executable preconditions.

    152 GitHub stars~4.8k tokensUpdated 5 days ago
    Testing & QAAuto-check passed
  • Test Strategy

    nurettincoban/ai-prd-workflow

    Write TEST-STRATEGY.md, a test plan per RFC, before the tests are written.

    298 GitHub stars~1.4k tokensUpdated 6 days ago
    Testing & QAAuto-check passed
  • Scenario Design

    BlackBeltTechnology/pi-agent-dashboard

    Draft real-life test SCENARIOS (not smoke tests) from a change/feature spec.

    315 GitHub stars~2.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Strategy Doc

    mohitagw15856/pm-claude-skills

    Write a test strategy document from a feature spec, PRD, or system description.

    1.4k GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • AI Test Generation

    petrkindlmann/qa-skills

    Use AI to write NEW test code from specs, PRDs, user stories, code diffs, bug reports, or OpenAPI specs.

    165 GitHub stars~4.8k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Prd V07 Test Planning

    mattgierhart/PRD-driven-context-engineering

    Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution.

    180 GitHub stars~3.5k tokensUpdated 1 mo ago
    Testing & QAAuto-check: notes

More from ArabelaTso/Skills-4-SE

All 150 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Specification Driven Generation

What does Specification Driven Generation do?

Generate implementation code and tests from written specifications. Specification Driven Generation is an agent skill from ArabelaTso/Skills-4-SE. Generate implementation code and tests from written specifications.

When should I use Specification Driven Generation?

Specification Driven Generation fits situations like: the user provides specifications (natural language descriptions; requirements documents; API specs) and asks Claude to implement the described functionality.

How do I install Specification Driven Generation in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill specification-driven-generation -a claude-code`. Or copy the skill folder (skills/specification-driven-generation in ArabelaTso/Skills-4-SE) into .claude/skills/specification-driven-generation in your project. Claude Code loads it when a task matches its description.

How do I install Specification Driven Generation in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill specification-driven-generation -a codex`. Or copy the skill folder (skills/specification-driven-generation in ArabelaTso/Skills-4-SE) into .agents/skills/specification-driven-generation in your project. Codex loads it when a task matches its description.

Can I use Specification Driven Generation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill specification-driven-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/specification-driven-generation, .gemini/skills/specification-driven-generation, .github/skills/specification-driven-generation and .opencode/skills/specification-driven-generation in your project.

What does Specification Driven Generation need to run?

Going by SKILL.md and its folder, Specification Driven Generation needs the command-line tools its instructions call (pytest and mvn). Our summary lists: Python 3.

Does Specification Driven Generation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Specification Driven Generation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Specification Driven Generation use?

Specification Driven Generation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Specification Driven Generation use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Specification Driven Generation?

Skills that share tags, products or a category with Specification Driven Generation: Codexqa Testdata Generator (openqa-cn/codexqa, 152 stars), Test Strategy (nurettincoban/ai-prd-workflow, 298 stars), Scenario Design (BlackBeltTechnology/pi-agent-dashboard, 315 stars) and Test Strategy Doc (mohitagw15856/pm-claude-skills, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Specification Driven Generation?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.