Test Driven Coding Agent Workflow

    by Ritesh Nipane

    1

    Make focused code changes, run the relevant tests or checks, repair failures with bounded retries, and report verified results clearly.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    Test Driven Coding Agent Workflow

    Example session with this skill installed

    Fix the zero-division error in the calculate_ratio function in utils.py and verify it with the existing pytest suite.

    • Read your context and instructions
    • Compiled the test driven coding

    Illustrative example only; this is not a report of a task run for this listing.

    Scope and assumption

    The request specifies that a zero denominator must be handled but does not define the expected behavior. In this example, the user has clarified that the function should raise ValueError.

    Proposed focused change

    Keep the existing behavior for non-zero denominators and add an explicit guard:

    def calculate_ratio(numerator, denominator):
        if denominator == 0:
            raise ValueError("denominator must not be zero")
        return numerator / denominator
    

    Add a focused test that asserts the exception:

    import pytest
    
    def test_calculate_ratio_rejects_zero_denominator():
        with pytest.raises(ValueError, match="denominator must not be zero"):
            calculate_ratio(10, 0)
    

    Verification report

    A real run should first check the relevant test's baseline, apply the smallest patch, then run the project's scoped test command. It must include the exact command and observed result here. No test result is claimed in this illustrative example.

    If the repository already defines a different zero-denominator contract, follow that contract instead of this example.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    This skill gives coding agents a repeatable way to make focused changes and verify them before reporting completion.

    Workflow

    1. Classify the request. Answer questions and run read-only checks directly; do not invent edits for them.
    2. Inspect repository instructions, working-tree changes, relevant source files, tests, and documented commands. Preserve unrelated user edits.
    3. Reproduce the issue or identify the expected behavior. Run a baseline check when practical to spot pre-existing failures.
    4. Choose a narrow implementation path. Use a local model for focused changes when available; use cloud reasoning for architectural or cross-module work when configured.
    5. Apply a small diff and check syntax or patch validity before writing.
    6. Run the most relevant test, linter, type check, or build. Record the command and actual result.
    7. For a failure, give the worker the exact diagnostic and allow up to two focused repair attempts. If still failing, escalate once to a cloud model when available, then stop and report any unresolved failure.
    8. Review the final diff and report changed files, checks that passed or failed, and checks that were skipped.

    Who it is for

    Use it for bug fixes, small features, and code changes where tests or static checks can verify the result. It works with different languages and repository toolchains; the agent uses the commands already documented by the project.

    Requirements and limits

    The agent needs repository read/write access and a terminal to run checks. Local and cloud model routing depends on the agent and providers already configured; this skill does not supply models, API access, or test infrastructure. If no suitable check exists, the agent must say verification was skipped.

    Limited to two repair attempts before stopping. Requires a project with existing test commands or a documented verification workflow. Skip verification if no tests exist.

    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 buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    • Free with an Agensi account

    Requires

    Nothing to install.

    Permissions

    Read Files
    Write Files
    Listed6 days ago

    What's inside

    Frequently Asked Questions

    This skill implements a strict 'Inspect-Edit-Verify' loop that forces the agent to run actual terminal commands and verify test results before it can report a task as complete, preventing the common issue of agents hallucinating that code works when it actually fails.

    The workflow is framework-agnostic and works with any tool that provides terminal output, including pytest, jest, npm, ruff, and tsc, provided your repository has these tools configured.

    The agent performs a 'Baseline Verification' check before making any edits to identify pre-existing failures, ensuring it doesn't spend your tokens trying to fix unrelated legacy bugs unless specifically instructed to.

    To prevent token wastage and infinite loops, the skill is capped at two automated repair attempts per task; if it cannot resolve the error within these cycles, it will report the exact traceback and stop for human intervention.

    The skill is designed to work with both local models for routine patches and high-reasoning cloud models for complex architectural repairs, making it compatible with most agentic execution environments that support file and terminal access.

    New in Testing & Debugging

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.

    Free