# Test Driven Coding Agent Workflow

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

Test Driven Coding Agent Workflow is a free AI agent skill on Agensi by Ritesh Nipane, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Ritesh Nipane](https://www.agensi.io/creators/ritesh-nipane)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/test-driven-coding-agent-workflow
- Tags: coding, testing, debugging

## 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.

## Requires

Nothing beyond your AI agent.

## Known limitations

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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Test Driven Coding Agent Workflow skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this workflow prevent the agent from 'hallucinating' that a bug is fixed?

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.

### Does this skill only work with Python and Pytest?

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.

### What happens if my project already has failing tests before the agent starts?

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.

### Is there a limit to how many times the agent will try to fix a failing test?

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.

### Which AI models or agents are compatible with this workflow?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
