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.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill specification-driven-generation
Generate implementation code and validation tests from written specifications through a systematic specification-to-code workflow.
Read and extract requirements from the specification:
Plan the code structure before writing:
Write clean, well-documented code that satisfies the specification:
Code Structure:
Common Patterns:
Create comprehensive tests that validate the implementation against the specification:
Test Coverage:
Test Structure:
# 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)
Run tests to ensure implementation matches specification:
Python:
pytest test_<module>.py -v
Java:
mvn test
If tests fail, debug and fix implementation to match specification.
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:
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:
For OpenAPI/Swagger specs, extract:
# From spec: "requirement text"Specification → Implementation:
Specification → Implementation:
Specification → Implementation:
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
Step 2: Design
Step 3: Generate Implementation
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
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
pytest test_stack.py -v
All tests pass → Implementation satisfies specification.
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
Comprehensive project architecture blueprint generator that analyzes codebases to create detailed architectural documentation. Automatically detects technology stacks and architectural patterns, generates visual diagrams, documents implementation patterns, and provides extensible blueprints for maintaining architectural consistency and guiding new development.
Securely inspect and automate microscopy data workflows against OMERO.server with omero-py, BlitzGateway, OMERO CLI, tables, annotations, ROIs, rendering, and documented OMERO.web APIs. Use for scoped OMERO inventory, metadata export, import/export planning, or reviewed write workflows.
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals.
Creates comprehensive API changelogs documenting breaking changes, deprecations, and migration strategies for API consumers. Use when managing API versions, communicating breaking changes, or creating upgrade guides.
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Analyze fundamental data primitives, type systems, and state management patterns in a codebase. Use when (1) evaluating typing strategies (Pydantic vs TypedDict vs loose dicts), (2) assessing immutability and mutation patterns, (3) understanding serialization approaches, (4) documenting state shape and lifecycle, or (5) comparing data modeling approaches across frameworks.
Take arabelatso/specification-driven-generation from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.