- Home
- Skills
- Testing & Debugging
- test driven development
test driven development
Enforce Red-Green-Refactor and Prove-It bug fixing workflows to ensure every code change is verified by tests.
Free
Works with the AI Agents you already use
test driven development
Example session with this skill installed
Fix the bug where completing a task doesn't update the timestamp, and make sure we have a test for it.
- Read your context and instructions
- Compiled the test driven development
I have identified the bug in TaskService. I will follow the Prove-It Pattern by writing a reproduction test first, verifying its failure, and then implementing the fix.
Bug Fix: Task Completion Timestamp
| Step | Action | Result |
|---|---|---|
| RED | Created tests/task.test.ts with a test asserting completedAt is a Date. | FAIL: expected undefined to be instance of Date |
| GREEN | Updated completeTask in src/services/task.ts to include completedAt: new Date(). | PASS: Test successfully verified the timestamp. |
| REFACTOR | Cleaned up the database update object for better readability. | PASS: Regression tests confirmed no side effects. |
// src/services/task.ts - Implementation Fix
export async function completeTask(id: string): Promise<Task> {
return db.tasks.update(id, {
status: 'completed',
completedAt: new Date(),
});
}
Next steps
- Run the full suite using
npm testto ensure no regressions in the task lifecycle. - Review the
Tasktype definition to ensurecompletedAtis no longer marked as optional. - Deploy the fix to the staging environment for final verification.
Connects securely to your tools. The creator never sees your data.
About this skill
Logic is brittle without verification. Manual testing fails to scale and provides no regression safety. This skill enforces a strict test-driven development workflow to ensure code behaves as expected before it is even written. It shifts the focus from writing code that seems to work to writing code that is proven to work.
What it does
- Red-Green-Refactor enforcement drives every code change through a cycle of failure, minimal implementation, and cleanup.
- Prove-It bug fixing requires a failing reproduction test before any fix is attempted, preventing phantom fixes.
- Project stack discovery automatically identifies build tools, test frameworks, and local wrappers like
./gradleworpytest. - Test pyramid alignment prioritizes fast unit tests over heavy integration and E2E flows to maintain suite performance.
- State-based assertion focuses on outcomes rather than internal method calls to keep tests resilient during refactoring.
How it works
- Discover the repository's specific testing commands, file conventions, and existing patterns.
- RED step involves writing a test that demonstrates the desired behavior or reproduces a reported bug.
- GREEN step implements the minimum code necessary to satisfy the failing test.
- REFACTOR step cleans up the implementation while using the new test as a safety net.
Frameworks & tools
The skill works with any language ecosystem including Node.js (Jest, Vitest), Python (pytest), Java (JUnit, Gradle), Go, and Rust. It integrates with Chrome DevTools MCP for runtime browser verification.
Why this beats prompting it yourself
Generic prompts often lead to tests written after the code, which only verify what the code already does rather than what it should do. This skill embeds the Red-Green-Refactor loop into the agent's core decision logic, ensuring that reproduction tests for bugs are never skipped.
Use cases
- Implementing new business logic with built-in documentation and safety.
- Fixing reported bugs by first proving they exist with a test case.
- Refactoring legacy codebases where existing behavior must be preserved.
- Verifying complex browser interactions using runtime DOM and console inspection.
Known limitations
This skill focuses on behavioral logic and excludes pure configuration, documentation, or static content changes. High-level E2E tests are limited to critical paths to avoid suite bloat.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 2 days ago
- Free to download with an account