test driven development

    1

    Enforce Red-Green-Refactor and Prove-It bug fixing workflows to ensure every code change is verified by tests.

    Free

    5 uses5.0 (2 reviews)

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    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. | ```typescript // 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** 1. Run the full suite using `npm test` to ensure no regressions in the task lifecycle. 2. Review the `Task` type definition to ensure `completedAt` is no longer marked as optional. 3. 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 `./gradlew` or `pytest`. - **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 1. **Discover** the repository's specific testing commands, file conventions, and existing patterns. 2. **RED** step involves writing a test that demonstrates the desired behavior or reproduces a reported bug. 3. **GREEN** step implements the minimum code necessary to satisfy the failing test. 4. **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.

    Excludes pure configuration or documentation changes. E2E tests are restricted to critical paths. Requires existing test infrastructure or a supported build tool to be present.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    5.0
    2 reviews
    5
    2
    4
    0
    3
    0
    2
    0
    1
    0

    This skill has been used 5 times.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    • Free with an Agensi account

    Permissions

    Browser
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill forces the AI agent to follow a strict Red-Green-Refactor cycle, preventing it from writing implementation code until a failing test exists. This ensures 100% test coverage for new features and prevents 'phantom fixes' where a bug appears solved but persists in edge cases.

    The skill is designed for any agent capable of file system access and terminal execution. It works across all major languages and frameworks, including Node.js, Python, Java, Go, and Rust, by automatically discovering your specific build tools and test runners.

    Upon purchase, you receive the specialized skill logic, configuration templates for various environments, and documentation on how to integrate the TDD workflow into your agent's task lifecycle.

    No manual configuration is required; the skill performs 'Project Stack Discovery' to identify your existing test frameworks (like Jest or pytest) and local wrappers (like ./gradlew) to ensure it uses your project's specific conventions.

    The skill focuses on behavioral logic and code reliability; it is not intended for pure documentation updates, static content changes, or UI/UX styling that doesn't involve functional logic.

    By prioritizing the 'Test Pyramid,' the skill favors fast-executing unit tests over slow integration or E2E tests. This ensures that while your code is fully verified, your CI/CD pipeline and local test suite remain performant and responsive.

    New in Testing & Debugging