agentleFS
xcaeserxcaeser/work-skill/skills/work-test/SKILL.md

work-test

Skill2 starsChanged 4 months agoMITView on GitHub

Inspect a codebase and write a small number of high-value tests for real, observable behavior using the repository's existing framework and conventions. Use when the user asks to add, improve, or write meaningful tests without optimizing for coverage.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    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:

    Write meaningful tests for behavior the product genuinely promises or currently depends on.

    line 8
  2. Distinctive:

    Read the applicable project instructions, repository status and diff, implementation, existing tests and helpers, public APIs, consumers, …

    line 14
  3. Distinctive:

    If the user did not name a target, choose the smallest coherent feature or current change that can be understood and tested safely.

    line 16
  4. Distinctive:

    Before editing, provide one entry per justified behavior in this exact format:

    line 20
  5. Distinctive:

    Keep the plan short. Prefer a small number of high-value tests in this order:

    line 27
  6. Distinctive:

    Test observable behavior, not internal implementation details.

    line 37
  7. Distinctive:

    Test negative behavior only when a real contract or regression needs protection.

    line 38
  8. Distinctive:

    Prefer integration tests for interactions between modules owned by the project.

    line 39
  9. Distinctive:

    Use realistic inputs and fixtures.

    line 41
  10. Distinctive:

    Keep each test focused on one behavior without splitting a simple workflow into redundant cases.

    line 43
  11. Distinctive:

    Do not test unrelated non-events, impossible states the code does not handle, speculative attack surfaces, framework or language behavior, …

    line 45
  12. Distinctive:

    Use the repository's existing test framework, conventions, helpers, fixtures, and directory structure.

    line 49
  13. Distinctive:

    Do not modify production code to satisfy an artificial test.

    line 51
  14. Distinctive:

    Run the narrowest relevant test command first, then the appropriate broader suite.

    line 57
  15. Distinctive:

    Do not optimize for coverage percentage.

    line 59
  16. Distinctive:

    Use this compact handoff:

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Work / 4. Test

Write meaningful tests for behavior the product genuinely promises or currently depends on. The testing rules below are binding.

Work directly in the parent conversation. Do not spawn agents or register a goal unless the user explicitly asks. Testing is implementation work: inspect first, show the plan, make the smallest justified edits, run the tests, and report the evidence.

Inspect before writing

Read the applicable project instructions, repository status and diff, implementation, existing tests and helpers, public APIs, consumers, and actual user flows. Identify the behavior users or current callers rely on. Do not invent requirements, hypothetical threats, or unrealistic edge cases.

If the user did not name a target, choose the smallest coherent feature or current change that can be understood and tested safely. State the scope. If no meaningful behavior is worth testing, stop and explain why; never add a test only to increase coverage.

Publish the test plan

Before editing, provide one entry per justified behavior in this exact format:

  1. Behavior being protected
  2. Why it matters
  3. Test level: unit, integration, or end-to-end
  4. Exact observable assertion

Keep the plan short. Prefer a small number of high-value tests in this order:

  1. Core happy paths.
  2. Realistic failure paths.
  3. Important boundaries.
  4. Previously broken behavior.
  5. Data persistence, permissions, billing, authentication, or destructive actions when relevant.

Select meaningful tests

  • Test observable behavior, not internal implementation details.
  • Test negative behavior only when a real contract or regression needs protection.
  • Prefer integration tests for interactions between modules owned by the project.
  • Mock external boundaries only when necessary: network APIs, time, randomness, queues, email, payment providers, or databases.
  • Use realistic inputs and fixtures. Keep tests deterministic and independent of execution order.
  • Assert the actual result, persisted state, returned error, emitted event, or externally visible side effect.
  • Keep each test focused on one behavior without splitting a simple workflow into redundant cases.

Do not test unrelated non-events, impossible states the code does not handle, speculative attack surfaces, framework or language behavior, trivial accessors, or library behavior. Do not reproduce the implementation inside the assertion. Do not mock the whole system and merely verify calls.

Implement

Use the repository's existing test framework, conventions, helpers, fixtures, and directory structure. Update obsolete tests when the current owned contract changed; do not retain compatibility tests for a superseded path.

Do not modify production code to satisfy an artificial test. If real behavior is difficult to test, explain the smallest justified production change before making it. Pause for user direction if that change alters public behavior or expands the requested scope.

When a justified test exposes a production bug, preserve and report the evidence. Fix it only when the request clearly includes the repair. Otherwise do not silently broaden test work into product changes or leave the repository with an unexplained failing test; report the exact regression test that should accompany the eventual fix.

Validate

Run the narrowest relevant test command first, then the appropriate broader suite. Re-run failures when useful and distinguish failures caused by this work from established or unrelated baseline failures. Do not claim the suite is green unless the command proves it.

Do not optimize for coverage percentage. Report coverage only when the user explicitly asks, and never use it as a substitute for confidence in real behavior.

Return

Use this compact handoff:

## Work / 4. Test

**Scope:** <implementation and behavior inspected>

### Test plan
| Behavior | Why it matters | Level | Observable assertion |
|---|---|---|---|
| ... | ... | ... | ... |

**Tests added:** <files and cases>
**Behaviors covered:** <real contracts protected>
**Tests deliberately not added:** <omissions and why>
**Actual bugs discovered:** <bugs or none>
**Validation:** <commands and exact results>
**Remaining gap:** <none or the precise unproved boundary>

Say complete, partial, or blocked plainly. Completion means every justified test was implemented and the reported validation ran. A no-change result may also be complete when inspection proves that no meaningful test is justified; say that explicitly instead of creating coverage work.

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.