agentleFS
bsafronovbsafronov/prosto-skills/skills/.experimental/implement-test-first/SKILL.md

implement-test-first

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Implement requested behavior through a failing behavioral test, a minimal change, and verified passing tests. Use when the user asks for test-first development, TDD, or red-green-refactor. Do not use for ordinary implementation without that sequencing request, adding tests for existing behavior alone, or verification-only work.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run that test before changing production behavior.

    line 25
  2. Distinctive:

    Test-first sequencing composes with diagnosis, feature work, and review when those outcomes are needed, without making another Skill a …

    line 41
  3. Distinctive:

    Stop when the requested behaviors pass, each new implementation slice has an observed relevant failure followed by success, and affected …

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Implement Test First

Make each requested behavior observable before implementing it, then close that red–green cycle before starting another.

  1. Ground one small behavior in the request and an observable interface. Reuse the repository's test conventions and existing public boundary. Existing user decisions and clear code evidence are sufficient to choose the test boundary; ask only when an unresolved product or interface choice changes what correctness means. A test-first request does not settle an unknown bug's cause or expected behavior.
  2. Establish the relevant baseline, then add one behavioral test. Derive its expected result from a requirement or independently worked example, not from the implementation's algorithm. Prefer real internal behavior; control time, randomness, and external systems at their boundaries. An interaction assertion is appropriate when the interaction itself is the observable contract.
  3. Run that test before changing production behavior. Confirm that it fails for the intended missing behavior. A broken runner, missing dependency, syntax error, or unrelated failure is not that proof: repair or isolate the obstacle and rerun. If the test already passes, inspect whether the behavior exists or the test misses it; do not manufacture a failure or rewrite working code to perform a ceremonial cycle.
  4. Make the smallest production change that satisfies the demonstrated behavior, and run the test again. Keep the assertion tied to the requirement instead of weakening it to obtain green. Run relevant existing tests before declaring the slice complete. Add another test only for the next required behavior after this slice is green; avoid a speculative batch of tests or implementation.
  5. Refactor only from green when it materially clarifies the changed code, with the behavioral tests passing again afterward. Keep broader redesign separate. Refactoring needs no mandatory review Skill or extra approval for routine, authorized changes.

Test-first sequencing composes with diagnosis, feature work, and review when those outcomes are needed, without making another Skill a prerequisite.

Stop when the requested behaviors pass, each new implementation slice has an observed relevant failure followed by success, and affected existing checks pass. Report tests that could not run and pre-existing failures precisely; passing final tests alone does not establish that the work was test-first.

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.