Skill v1.0.2
currentAutomated scan100/1003 files
name: tdd description: > Guide test-driven development workflow. Suggest when: "test first", "TDD", "write tests before", "red green refactor" mentioned, or when implementing features or bug fixes where a test-first approach is beneficial. Enforces Red-Green-Refactor cycle. allowed-tools: [Bash, Read, Write, Edit, Glob, Grep] metadata: version: "1.0.2"
TDD Workflow
Orchestrate test-driven development: Red → Green → Refactor.
Activation Triggers
- "TDD", "test-driven", "test first", "red green refactor"
- Bug fix where proving the bug first is valuable
- Feature with clear acceptance criteria
- "write the test before implementing"
The Cycle
| Phase | Action | Gate | |
|---|---|---|---|
| RED | Write failing test expressing desired behavior | Run it — MUST fail. If it passes, it tests nothing new. | |
| GREEN | Write minimum code to make the test pass | Run it — MUST pass. No over-engineering. | |
| REFACTOR | Clean up while staying green | Run ALL tests — MUST pass. Never refactor with failures. |
Run commands
# lionagi Pythonscripts/ci.sh test-python tests/test_feature.py::test_name # single testscripts/ci.sh test-python # full suitescripts/ci.sh test-python-cov # with coverage# Rustcargo test test_name -- --nocapture # single testcargo test --workspace # full workspace
Key Principles
- Test must fail first: A test that passes before implementation proves nothing
- Minimal implementation: Don't over-engineer in the GREEN phase
- Refactor only when green: Never refactor with failing tests
- Small cycles: Keep each cycle focused on one behavior
- One behavior per test: Each test verifies one specific behavior
- Use the project runner: Follow the repository's configured test and CI entry points
Coverage Gates
Meet the repository's configured coverage threshold. Do not substitute generic percentages for project policy.
For lionagi, check with scripts/ci.sh test-python-cov.
See methodology.md for detailed cycle steps, multi-cycle patterns, parallel agent TDD through the plugin's MCP server (fanout.submit), anti-patterns, and lint/quality commands.
Relevant Source Files
lionhub/src/lionhub/serve/mcp/server.py,lionhub/src/lionhub/serve/mcp/verbs.py—fanout.submit/agent.submit, the
MCP path for parallel and single-agent TDD sessions
lionagi/cli/orchestrate/fanout.py—li o fanout, the checkout-local equivalent for
parallel workers
lionagi/cli/agent.py—li agent, the checkout-local equivalent for a single-agent
implementation session
docs/internals/ci.md— documents the supported Python test, coverage, lint, and format entry pointpyproject.toml— project test and Pyright configuration