Guide · Agent skill
How to use the TDD workflow agent skill: steps, install and tips
Updated · written with AI from the project's own documentation and checked against our catalogue data
The tdd-workflow skill is an instruction file (SKILL.md) that tells an AI coding agent to build features, fix bugs and refactor code using test-driven development (TDD). It is for developers and teams whose projects already use JavaScript or TypeScript tests. After this guide you will know what the skill changes in the agent's behaviour, how to install it, how to trigger it and what it needs to run.
Quick start
- 1Download the skill ZIP. Download the ZIP file for tdd-workflow from this page and unzip it so you have a folder containing SKILL.md.
- 2Place the folder. Move the folder into ~/.claude/skills/ for personal use, or into the project's .claude/skills/ folder for one project.
- 3Or upload it in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the skill.
- 4Check your test setup. Confirm that npm test and npm run test:coverage run in your project, with Jest, Vitest or Playwright configured.
- 5Make a natural request. Ask for a feature, bug fix or refactor in plain language and name the test tools you use.
- 6Review red, green and refactor steps. Check that the new test failed for the expected reason before the production code changed, then that it passed after the fix.
- 7Confirm coverage. Run npm run test:coverage and verify you reached 80% or more.
What an agent skill is and what this one makes the agent do
An agent skill is a folder with a SKILL.md file that gives an AI agent extra instructions for a specific kind of task. This skill is triggered when you write new features, fix bugs or refactor code, and it asks the agent to apply TDD with at least 80% coverage across unit, integration and end-to-end tests.
In practice the agent first writes tests that describe the expected behaviour, runs them and checks that they fail, then writes the minimum code needed to make them pass, and finally refactors while keeping the tests green.
- Writes tests before production code
- Requires unit, integration and E2E (Playwright) tests
- Targets at least 80% coverage (unit + integration + E2E)
- If the project is a Git repository, creates checkpoint commits after each TDD stage
How to install the tdd-workflow skill
Download the ZIP file for this skill from this page and unzip it. The skill is delivered as a folder containing SKILL.md.
Put the folder in one of these locations: ~/.claude/skills/ to make it available to your user account, or a .claude/skills/ folder inside a specific project to make it available only there.
You can also upload the skill in the Claude apps under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload
How to trigger the skill with natural requests
You do not need a special command. The skill describes when it applies, so ask for the kind of work it covers in plain language. Mention the feature, bug or refactor you want, and the agent can match the request to the skill.
Good requests name the behaviour you want, for example a search function, an API endpoint or a fixed bug. Adding the test tools you use (Jest, Vitest or Playwright) helps the agent follow the workflow in your project.
- "Add a search endpoint for markets using TDD, with 80% coverage."
- "Fix the bug where the cart total ignores discounts. Write a failing test first."
- "Refactor the date helpers and keep the tests green."
What the skill needs before you start
The examples in the skill use npm commands, so the project should have Node.js and npm, and a test setup. The skill names Jest or Vitest for unit tests, Playwright for end-to-end tests and Testing Library for React component tests. A Git repository is optional and only needed for checkpoint commits.
Without a configured test setup, the skill is a poor fit, because it assumes commands such as npm test and npm run test:coverage already work.
- Node.js and npm
- Jest or Vitest for unit tests
- Playwright for E2E tests
- Testing Library for React component tests
- A Git repository (optional, for checkpoint commits)
npm test
npm run test:coverageExample: running the TDD cycle on a bug fix
Suppose you ask the agent to fix a bug. Following the skill, it first writes a test that reproduces the bug and runs npm test. The test must fail for the bug's reason, not because of a syntax error or broken configuration. Only then does the agent change production code.
Once the minimal fix makes the test pass, the agent runs the same test target again, refactors, and checks coverage with npm run test:coverage.
- Red: add a reproducer test and confirm it fails for the expected reason (commit message pattern: test: add reproducer for <feature or bug>)
- Green: apply the minimal fix and re-run the test (commit: fix: <feature or bug>)
- Refactor: clean up while tests stay green (commit: refactor: clean up after <feature or bug> implementation)
- Check coverage: npm run test:coverage, aiming for 80% or more
npm test
# The tests must fail first
npm run test:coverage
# Verify 80%+ coverageSafety notes: scripts and network
According to the listing, this skill runs scripts and does not use the network. Its instructions are about running your project's own test commands, so the scripts that actually execute are the ones in your project (for example npm test). Review your project's package.json scripts before letting an agent run them.
If your repository is under Git, the skill asks the agent to create commits. Check that commits land on the branch you expect and that you do not want squashing done until the workflow is finished, as the skill itself instructs.
- Runs scripts: yes (your project's test commands)
- Uses network: no
- Review package.json scripts before running agent-driven tests
- Checkpoint commits are only counted on the current active branch
Tips for getting good results
Give the agent the test tools your project uses, so it does not guess. Keep the requests small, one feature or bug at a time, because each one goes through the full red-green-refactor cycle.
Expect the skill to be slow for small changes. The skill itself is aimed at code work, and the test cycle adds time to quick edits.
- Name your test framework (Jest, Vitest or Playwright) in the request
- Use one feature or bug per request
- Check coverage output yourself rather than trusting the summary
- Skip the skill for throwaway scripts where the test cycle adds time without benefit
What people use it for
- Adding a new API endpoint with integration tests written first
- Fixing a bug by writing a reproducer test that fails before the fix
- Refactoring helper functions while keeping the test suite green
- Building a React component with unit tests using Testing Library
- Adding a critical user flow covered by a Playwright E2E test
Frequently asked questions
How do I install the tdd-workflow skill?
Download the ZIP from this page and unzip it. Place the folder in ~/.claude/skills/ for your user account or in a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings → Capabilities → Skills.
What do I need to use the tdd-workflow skill?
You need Node.js and npm, plus a test setup. The skill names Jest or Vitest for unit tests, Playwright for E2E tests and Testing Library for React components. A Git repository is optional, for checkpoint commits.
Is the tdd-workflow skill free?
The skill is listed under the MIT licence. Check the licence file in the source repository for the full terms.
Does the tdd-workflow skill work without Jest or Playwright?
The source names Jest, Vitest and Playwright as the tools it assumes. Projects without configured tests are not a good fit, because the skill expects commands like npm test and npm run test:coverage to work.
Does the skill use the internet?
The listing says it does not use the network. It does run scripts, which means your project's test commands, so review those before running them.
Why does the skill ask the agent to create commits?
If the project is a Git repository, the skill asks for a checkpoint commit after the red, green and refactor stages, so each stage is recorded. These commits should not be squashed until the workflow is finished.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers and teams with JavaScript or TypeScript projects that already run Jest, Vitest or Playwright and want an agent to work test-first with at least 80% coverage. It is a poor choice for quick prototypes, one-off scripts, projects without a test setup, or people who only want a general explanation of TDD.
Download the skill