Skip to content
Back to skills

Tdd Workflow

ASecurity

Test-driven development loop (red, green, refactor). Use when adding behaviour or fixing a bug so the change is pinned by a test that failed first.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentstestingrefactoring

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill tdd-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tdd Workflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-tdd-workflow/badge)](https://www.skillsdirectory.com/skills/karthikrshet-tdd-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tdd-workflow
description: Test-driven development loop (red, green, refactor). Use when adding behaviour or fixing a bug so the change is pinned by a test that failed first.
tags: [core, testing]
---

# Tdd Workflow

## When to use

- New functions, endpoints or components
- Bug fixes (write the reproducing test first)
- Refactoring code without tests (add characterisation tests first)

## Procedure

1. Write the smallest failing test for the next behaviour
2. Run it and read the failure; it must fail for the right reason
3. Write the minimum code to pass
4. Run the related suite
5. Refactor names and structure while green
6. Commit; repeat

## Example

```ts
it('rejects refunds larger than the captured amount', async () => {
  await expect(refund(payment({ captured: 500 }), 600)).rejects.toThrow(RefundExceedsCapture);
});
```

## Checklist

- [ ] Test failed before the fix
- [ ] Test names describe behaviour
- [ ] No .only or skipped tests left
- [ ] Edge cases covered: empty, null, boundary, error

## Anti-patterns

- Writing tests after the code and calling it TDD
- Asserting on private internals
- Mocking the thing under test
- Huge tests with many reasons to fail

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.