agentleFS
TheophilusChinomonaTheophilusChinomona/idev/skills/tdd-workflow/SKILL.md

tdd-workflow

Skill0 starsChanged 5 months agoMITView on GitHub

Test-driven development workflow: write failing test, implement to pass, refactor. Use when starting a new feature or bugfix that needs tests first.

128 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use brand-discovery, configure-ecc and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ysyecustSkill

    brand-discovery

    Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).

    Also in 6 projects that use this

  • royaluniondesign-sysSkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 12 projects that use this

  • junimnjwSkill

    ralphinho-rfc-pipeline

    RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.

    Also in 12 projects that use this

  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 10 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 16 projects that use this

  • RojiosSkill

    dart-flutter-patterns

    Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.

    Also in 7 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 13 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 117 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write a test that describes expected behavior

    line 20
  2. Distinctive:

    Run the test — it MUST fail

    line 21
  3. Distinctive:

    If it passes, the test is wrong — fix the test

    line 22
  4. Distinctive:

    Write the MINIMUM code to make the test pass

    line 25
  5. Distinctive:

    Run the test — it MUST pass

    line 26
  6. Distinctive:

    Do NOT write extra code yet

    line 27
  7. Distinctive:

    Run tests again — they MUST still pass

    line 31
  8. Distinctive:

    Use build-check after implementation

    line 54
  9. Distinctive:

    Use test-coverage to verify coverage

    line 55
  10. Distinctive:

    Do NOT skip the RED phase — verify the test fails first

    line 59
  11. Distinctive:

    Do NOT write more code than needed to pass the test

    line 60
  12. Distinctive:

    Do NOT refactor while tests are failing

    line 61
  13. Distinctive:

    Do NOT write tests after implementation (that's verification, not TDD)

    line 62

“Common” is measured: kept by at least 6 in 10 of the 117 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TDD Workflow Skill

Purpose

Enforce test-driven development: RED → GREEN → REFACTOR.

Activation

  • User says "let's do TDD" or "write tests first"
  • Starting a new feature
  • Fixing a bug (write test that reproduces it)

Workflow

RED — Write Failing Test

  1. Understand the requirement
  2. Write a test that describes expected behavior
  3. Run the test — it MUST fail
  4. If it passes, the test is wrong — fix the test

GREEN — Make It Pass

  1. Write the MINIMUM code to make the test pass
  2. Run the test — it MUST pass
  3. Do NOT write extra code yet

REFACTOR — Improve

  1. Clean up the code
  2. Run tests again — they MUST still pass
  3. Repeat until satisfied

Example

// RED: Write a failing test first
describe('UserService', () => {
  it('should hash passwords on create', async () => {
    const user = await createUser({ password: 'secret123' })
    expect(user.passwordHash).not.toBe('secret123')
    expect(user.passwordHash).toMatch(/^\$2[abyb]\$.{56}$/) // bcrypt
  })
})

// GREEN: Write minimal implementation
async function createUser(data: { password: string }) {
  const passwordHash = await bcrypt.hash(data.password, 12)
  return db.user.create({ ...data, passwordHash })
}

Integration

  • Use build-check after implementation
  • Use test-coverage to verify coverage
  • Log lessons if TDD revealed a gotcha

Anti-Patterns

  1. Do NOT skip the RED phase — verify the test fails first
  2. Do NOT write more code than needed to pass the test
  3. Do NOT refactor while tests are failing
  4. Do NOT write tests after implementation (that's verification, not TDD)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.