agentleFS
jsuvicjsuvic/agent-profile/.agents/skills/tdd-change/SKILL.md

tdd-change

Skill3 starsChanged 3 months agoApache-2.0View on GitHub

Use when changing behavior where a focused failing test or golden fixture must prove RED before implementation and GREEN after the minimal fix.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 17 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add or update one focused failing test or golden fixture before changing behavior code.

    line 13
  2. Distinctive:

    Run the narrowest relevant test command and confirm RED: the test fails for the expected reason, not because of a typo, setup error, or …

    line 14
  3. Distinctive:

    Run the same focused test command and confirm GREEN: the test passes without new warnings or unrelated failures.

    line 16
  4. Distinctive:

    Do not update golden files only to hide an unexplained behavior change.

    line 18
  5. Distinctive:

    Do not write a tautological test: expected values must come from an independent source, never recomputed the way the code under test …

    line 22
  6. Distinctive:

    Do not assert on mock elements or mock call counts when a real behavior assertion is possible.

    line 23
  7. Distinctive:

    Do not add production methods, flags, or exports that exist only for tests.

    line 24
  8. Distinctive:

    Do not mock a dependency until you understand the side effects the test needs.

    line 25
  9. Distinctive:

    Keep test doubles structurally complete enough to match the real data shape consumed by the code.

    line 26
  10. Distinctive:

    If mock setup is larger than the behavior under test, consider a narrower integration test or a simpler production boundary.

    line 27
  11. Distinctive:

    Prefer a fake over a stub, and a stub over a mock or spy.

    line 32
  12. Distinctive:

    Use a spy only where outbound communication is itself the tested contract.

    line 33
  13. Distinctive:

    Never introduce an abstraction that exists only for a test.

    line 34
  14. Very specific:

    Read CONTEXT.md when it exists.

    line 38
  15. Distinctive:

    Test only at the seam declared in the issue brief.

    line 39
  16. Very specific:

    If implementation shows the declared seam is wrong, stop and report BLOCKED with the reason.

    line 40
  17. Distinctive:

    Do not install dependencies automatically.

    line 48
  18. Distinctive:

    Do not run broad or destructive commands without explicit approval.

    line 49
  19. Distinctive:

    Do not include secrets, environment variable values, or production endpoints in tests or fixtures.

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
<!-- Generated by Agent Profile Compiler. Do not edit by hand. -->

TDD Change

Instructions

  1. Identify the smallest observable behavior covered by the approved spec.
  2. Add or update one focused failing test or golden fixture before changing behavior code.
  3. Run the narrowest relevant test command and confirm RED: the test fails for the expected reason, not because of a typo, setup error, or unrelated failure.
  4. Implement the smallest change that satisfies the failing test and the spec.
  5. Run the same focused test command and confirm GREEN: the test passes without new warnings or unrelated failures.
  6. Refactor only after GREEN, then rerun the focused test command.
  7. Do not update golden files only to hide an unexplained behavior change.

Testing Anti-Patterns

  • Do not write a tautological test: expected values must come from an independent source, never recomputed the way the code under test computes them.
  • Do not assert on mock elements or mock call counts when a real behavior assertion is possible.
  • Do not add production methods, flags, or exports that exist only for tests.
  • Do not mock a dependency until you understand the side effects the test needs.
  • Keep test doubles structurally complete enough to match the real data shape consumed by the code.
  • If mock setup is larger than the behavior under test, consider a narrower integration test or a simpler production boundary.

Mock Boundary

  • Mock only unmanaged external dependencies, such as network, clock, or filesystem you do not own.
  • Prefer a fake over a stub, and a stub over a mock or spy.
  • Use a spy only where outbound communication is itself the tested contract.
  • Never introduce an abstraction that exists only for a test.

Seam Discipline

  • Read CONTEXT.md when it exists; test names and interface names must match its glossary terms.
  • Test only at the seam declared in the issue brief; do not re-decide the seam inside the loop.
  • If implementation shows the declared seam is wrong, stop and report BLOCKED with the reason. Never silently move or redesign the seam.

Output

Report the RED command and expected failure, the GREEN command and passing result, any refactor rerun, and any TDD exception that required human approval.

Safety

  • Do not install dependencies automatically.
  • Do not run broad or destructive commands without explicit approval.
  • Do not include secrets, environment variable values, or production endpoints in tests or fixtures.

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.