agentleFS
hemapriyan-rkhemapriyan-rk/claude-rigor-skills/skills/test-architect/SKILL.md

test-architect

Skill1 starsChanged 50 days agoMITView on GitHub

Write tests that catch real bugs, not coverage padding. Targets boundaries, malformed input, concurrency, and dependency failures, with each test tied to a named risk. Use when asked to write tests, or for code that touches I/O, network calls, shared state, or ML inference.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Follow the project's conventions: Use the existing test framework, file layout, fixtures, and mocking style.

    line 13
  2. Very specific:

    Load the risk catalog with the code: Read references/risk-catalog.md from this skill's base directory in the same step as the code under …

    line 14
  3. Distinctive:

    Known bugs: if a past bug is known, its regression test comes first.

    line 26
  4. Very specific:

    Use property-based tests (Hypothesis, fast-check, testing/quick) where a whole input range matters more than a few examples.

    line 35

“Common” is measured: kept by at least 6 in 10 of the 8 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

Test Architect

Ten tests that run the same happy path with different values raise the coverage number and nothing else. Find the tests that would have caught a real bug, write those, and run them.

1. Set scope and budget

  • Test what was asked. The named function, module, or diff. Don't write tests for the whole codebase unless asked to.
  • Follow the project's conventions. Use the existing test framework, file layout, fixtures, and mocking style. Look at one existing test file first. If there are no tests yet, use the language's standard choice and say which.
  • Load the risk catalog with the code. Read references/risk-catalog.md from this skill's base directory in the same step as the code under test. It lists failure cases by dependency type so you don't have to recall them.
  • Aim for the fewest tests that cover the most distinct risks. Five tests covering five risks beat fifteen covering three.

2. List the risks before writing tests

For the code under test, list each risk in one line. Check:

  • Boundaries: empty, zero, one, max, one past max, negative, and the off-by-one the loop invites.
  • Malformed but plausible input: truncated payloads, wrong encoding, a field present but empty, null where an object is expected.
  • Each external dependency failing: timeout, error response, partial or malformed response. Use the catalog for the dependency type.
  • Concurrency: for shared state, two callers at once. A single-threaded test of "thread-safe" code proves nothing.
  • ML paths: out-of-distribution input, and the low-confidence fallback actually being taken.
  • Known bugs: if a past bug is known, its regression test comes first.

Drop risks that don't apply. Rank the rest by how likely and how costly the failure is.

3. Write the tests

  • Assert on the contract (what the function should do), not on its implementation. A test that mirrors the code passes even when the code is wrong.
  • Name each test after the risk it covers: test_refund_rejects_negative_amount, not test_refund_3.
  • Make failure-injection tests deterministic: fake clocks, stubbed dependencies, seeded randomness. A flaky test is worse than none.
  • Use property-based tests (Hypothesis, fast-check, testing/quick) where a whole input range matters more than a few examples.

4. Run them

Run the new tests if the environment allows it. If one fails, decide whether it found a real bug or the test is wrong, and say which. Don't silently change the test to make it pass. If you can't run tests here, give the exact command.

Output

## Risks covered
| Risk | Test | Result |
|---|---|---|
| <one-line risk> | `<test name>` | pass / FAIL: real bug / not run |

## Tests
<the test code>

## Bugs found
<any failing test that exposed a real bug, with the input that triggers it>

## Not covered
<risks deliberately left out, and why>

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.