Skip to content
Skillpedia
Testing81k · #1701

tdd-workflow

What it does

This skill guides a test-driven development cycle using the London school style, where dependencies are mocked first. It is for developers who want to build features step by step with tests leading the way.

When to use it

  • ✓When you want to build a feature test-first, from the outside in.
  • ✓When you want a clear red, green, refactor routine for a new behaviour.
  • ✓When you want the final test results checked before a task is called done.

Skill link

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Build the discount calculation test-first, starting with a failing test for the mocked pricing service.”

5 new skills a week. 1 minute to read.

How it works

The skill writes a failing test with mocked dependencies, runs it to see it fail for the right reason, writes the simplest code to pass, then refactors. Before reporting success, it runs the target and regression tests and records the actual results.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Follow the TDD London School (mock-first) approach:

  1. Write the failing test first -- define expected behavior with mocked dependencies
  2. Run the test -- confirm it fails for the right reason
  3. Implement minimal code -- make the test pass with the simplest solution
  4. Refactor -- clean up while keeping tests green
  5. Repeat -- add the next behavior

Before starting: mcp__plugin_ruflo-core_ruflo__hooks_pre-task({ description: "TDD: FEATURE_NAME" }) Before reporting the outcome, run the final target tests and the regression suite after the last edit. Record the actual commands, exit codes, whether tests ran, and failing test names. The initial red test is expected during TDD; only the final validation determines success.

Call mcp__plugin_ruflo-core_ruflo__hooks_post-task with the observed result, including when the task is abandoned or validation is interrupted. Set completed, targetTestsRan, and regressionTestsRan to true only when observed; use null for missing exit codes. Skipped or unrun validation is not success. Never substitute an expected result for an observed one.

The following example maps those observations to the hook input (tool-call notation):

const success = completed && targetTestsRan && regressionTestsRan
  && targetExitCode === 0 && regressionExitCode === 0;
mcp__plugin_ruflo-core_ruflo__hooks_post-task({
  taskId: "tdd-FEATURE",
  success,
  storeResults: true,
  task: JSON.stringify({
    feature: "FEATURE",
    targetCommand, targetExitCode, targetTestsRan,
    regressionCommand, regressionExitCode, regressionTestsRan,
    failingTestNames,
    failureReason: success ? null : failureReason
  })
});

On failure, report success: false and the failing test names in task. If the runner failed before identifying tests, or the task was abandoned, state that reason instead of inventing test names.

Principles:

  • Mock external dependencies at boundaries
  • Test behavior, not implementation
  • One assertion per test when possible
  • Descriptive names: should [behavior] when [condition]
FAQ

Is an initial failing test a problem?

No. The source says the first red test is expected during this method. Only the final validation decides success.

What counts as success?

Both the target tests and the regression suite must actually run and pass. Skipped tests are not success.

Does it record results?

Yes. It reports the task outcome to the memory hooks with the observed results.

Details

Original description by the author

TDD London School workflow -- mock-first, outside-in test development

repo: ruvnet/ruflo

Popularity

GitHub stars
81k
Ranking position
#1701
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills