agentleFS
riz007riz007/architect-os/skills/aos-tdd/SKILL.md

aos-tdd

Skill1 starsChanged 7 months agoMITView on GitHub

Test-driven workflow for adding or changing behavior — write a failing test first, make it pass, then refactor. Use proactively when implementing new business logic, a service method, a bug fix that needs a regression test, or any change where correctness matters. Also use when the user asks to "add tests", improve coverage, or write tests for existing code.

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
  1. Distinctive:

    Run it; confirm it fails for the right reason.

    line 13
  2. Distinctive:

    If you reach for an e2e test to cover logic a unit test could catch, push it down.

    line 33
  3. Distinctive:

    Write the failing regression test *first* (it reproduces the bug), then fix.

    line 37

≈ “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

Test-driven development

This is a model-invoked discipline. When the change is behavioral, drive it with tests.

The loop: red → green → refactor

  1. Red — write one failing test that describes the next small increment of behavior. Run it; confirm it fails for the right reason.
  2. Green — write the minimum code to make it pass. Don't gold-plate.
  3. Refactor — clean up names, duplication, and structure with the test as your net. Re-run; stay green.

Repeat in small steps. Each step is one behavior, not one whole feature.

Test quality rules (ArchitectOS)

  • Name tests by behavior: should throw ConflictError when email is already registered — not test1, not testCreate.
  • Mock only at boundaries — HTTP, DB, external APIs. Don't mock the unit under test.
  • Cover error paths and edges, not just the happy path. Every throw deserves a test.
  • Keep tests isolated — no shared mutable state, no order dependence, no real network.
  • Arrange-Act-Assert structure; one logical assertion per test.
  • Test the contract, not the implementation — avoid asserting on private internals.

The test pyramid

Favor many fast unit tests, fewer integration tests, very few end-to-end tests. If you reach for an e2e test to cover logic a unit test could catch, push it down.

When fixing a bug

Write the failing regression test first (it reproduces the bug), then fix. See aos-debugging for the full diagnosis loop.

On-demand suite audit

For a full review of an existing test suite's balance, naming, isolation, and coverage, use /aos-qa.

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.