Tdd loop
Agent-native workflow orchestration platform that separates intelligence (agents) from infrastructure (state, logging, caching, retries)
npx -y skills add mpuig/raw --skill tdd-loopAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Test-driven development loop for workflows - write tests first, then implementation
SKILL.md
3.3 KB, as published. Nobody here has run it
TDD Loop Skill
Use this skill to follow test-driven development practices for workflow implementation.
TDD Cycle
- Write Test First: Define expected behavior in test.py
- Run Test (Red): Verify test fails with clear error
- Write Implementation: Add minimal code to make test pass
- Run Test (Green): Verify test passes
- Refactor: Clean up code while keeping tests green
- Repeat: Move to next test case
Workflow Testing Pattern
test.py Structure
#!/usr/bin/env python3
"""Tests for workflow."""
from pathlib import Path
from workflow_name import WorkflowClass, WorkflowParams
def test_workflow_basic():
"""Test basic workflow execution."""
params = WorkflowParams()
workflow = WorkflowClass(params, workflow_dir=Path(__file__).parent)
result = workflow.run()
assert result == 0 # Success
# Add more assertions
def test_workflow_with_params():
"""Test workflow with specific parameters."""
params = WorkflowParams(param1="value")
workflow = WorkflowClass(params, workflow_dir=Path(__file__).parent)
result = workflow.run()
assert result == 0
# Verify outputs, side effects, etc.
def test_workflow_error_handling():
"""Test workflow handles errors gracefully."""
params = WorkflowParams(invalid="value")
workflow = WorkflowClass(params, workflow_dir=Path(__file__).parent)
# Should handle error, not crash
result = workflow.run()
assert result != 0 # Non-zero exit code for errors
dry_run.py Testing
The dry run is a form of integration testing with mocks:
#!/usr/bin/env python3
"""Dry run with mock data."""
from raw_runtime import DryRunContext
def mock_external_api(ctx: DryRunContext):
"""Mock API call that would normally fetch real data."""
return {
"data": "mock_value",
"status": "success"
}
def mock_file_write(ctx: DryRunContext):
"""Mock file writing - don't actually write."""
ctx.log("Would write to file: results/output.json")
return True
TDD Benefits
- Clear Requirements: Tests document expected behavior
- Regression Prevention: Existing tests catch breaking changes
- Refactoring Safety: Change internals without breaking API
- Design Feedback: Hard-to-test code signals design issues
When to Use
- Adding new workflow functionality
- Fixing bugs (write failing test, then fix)
- Refactoring existing code
- Integrating new tools
Red-Green-Refactor Example
# 1. RED: Write failing test
def test_fetch_stock_data():
result = fetch_stock_data("AAPL")
assert result["symbol"] == "AAPL"
assert "price" in result
# Run: pytest test.py -k test_fetch (FAILS - function doesn't exist)
# 2. GREEN: Minimal implementation
def fetch_stock_data(symbol: str) -> dict:
return {"symbol": symbol, "price": 150.0} # Hardcoded for now
# Run: pytest test.py -k test_fetch (PASSES)
# 3. REFACTOR: Real implementation
def fetch_stock_data(symbol: str) -> dict:
from tools.yahoo_finance import get_quote
data = get_quote(symbol)
return {"symbol": data.symbol, "price": data.current_price}
# Run: pytest test.py -k test_fetch (PASSES)
Gives 4 of the 12 instructions most tdd skills give
Counted across 439 of the 443 authors here whose files we hold, read 2026-08-06
- write minimal code to pass the testhere, and in 302 of 439, across 218 files
- write a failing test firstin 176 of 439, across 112 files
- refactor code only after tests passin 171 of 439, across 101 files
- watch the test fail before writing codehere, and in 142 of 439, across 93 files
- test one behavior per testin 106 of 439, across 44 files
- refactor code while keeping tests greenhere, and in 99 of 439, across 86 files
- delete code written before testsin 98 of 439, across 54 files
- run tests after each refactor stepin 85 of 439, across 54 files
- Use real code instead of mocks unless unavoidablein 64 of 439, across 21 files
- confirm the test fails for the right reasonin 64 of 439, across 60 files
- reproduce bugs with a test before fixingin 53 of 439, across 36 files
- write tests before implementationhere, and in 48 of 439, across 39 files
Said here and by no other author read
- move to next test case
- test basic workflow execution
- test workflow with specific parameters
- test workflow error handling
- mock external calls in dry runs
- mock file writing in dry runs
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.