agentleFS
hamakyohamakyo/okf-skills/skills/add-test/SKILL.md

add-test

Skill2 starsChanged 3 months agoMITView on GitHub

Use when adding or improving tests for existing behavior, regressions, edge cases, or coverage gaps. Follow existing test style and cover normal, error, and boundary cases where relevant. Do not use when behavior is undefined or implementation must change first.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 15

    Distinctive

    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:

    Use this Skill when:

    line 10
  2. Distinctive:

    Do not use this Skill when:

    line 17
  3. Distinctive:

    Before editing tests, read:

    line 32
  4. Distinctive:

    Test helpers, fixtures, factories, and naming conventions.

    line 35
  5. Distinctive:

    Add focused tests for useful cases:

    line 44
  6. Distinctive:

    Prefer stable assertions over brittle implementation details.

    line 48
  7. Distinctive:

    Run the new test directly.

    line 49
  8. Distinctive:

    Run related test files or suites when risk warrants it.

    line 50
  9. Distinctive:

    If tests expose a defect, stop and report it unless the user asked to fix it.

    line 51
  10. Distinctive:

    Do not change production behavior unless explicitly asked.

    line 55
  11. Distinctive:

    Do not rewrite the test framework or large fixtures for a narrow test request.

    line 56
  12. Distinctive:

    Do not add tests that only assert mocks were called unless that is the meaningful contract.

    line 57
  13. Distinctive:

    Do not hide flaky tests by weakening assertions without explanation.

    line 58
  14. Distinctive:

    Do not add secrets, credentials, private URLs, or personal data to fixtures.

    line 59
  15. Distinctive:

    Test commands run and results.

    line 75

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

Add Test

When to use

Use this Skill when:

  • Existing behavior needs test coverage.
  • A regression needs a failing test.
  • Edge cases or error paths need explicit coverage.
  • A refactor needs safety tests before code changes.

Do not use this Skill when:

  • The expected behavior is unclear.
  • The requested work requires implementation before tests can be meaningful.
  • The task is primarily documentation or OKF maintenance.

Inputs

  • Target behavior, file, bug, or coverage gap.
  • Expected behavior.
  • Existing test command or framework, if known.
  • Related OKF documents when behavior is domain-specific.

Required context

Before editing tests, read:

  • Existing tests near the target area.
  • Test helpers, fixtures, factories, and naming conventions.
  • Relevant implementation only enough to understand test boundaries.
  • Relevant OKF documents when they define expected behavior.

Workflow

  1. Identify the expected behavior and source of truth.
  2. Inspect nearby tests to match style, structure, naming, and helpers.
  3. Choose the right test level: unit, integration, end-to-end, or snapshot.
  4. Add focused tests for useful cases:
    • Normal path.
    • Error or invalid input path.
    • Boundary values or edge cases.
  5. Prefer stable assertions over brittle implementation details.
  6. Run the new test directly.
  7. Run related test files or suites when risk warrants it.
  8. If tests expose a defect, stop and report it unless the user asked to fix it.

Guardrails

  • Do not change production behavior unless explicitly asked.
  • Do not rewrite the test framework or large fixtures for a narrow test request.
  • Do not add tests that only assert mocks were called unless that is the meaningful contract.
  • Do not hide flaky tests by weakening assertions without explanation.
  • Do not add secrets, credentials, private URLs, or personal data to fixtures.

Completion checklist

  • Existing test style was followed.
  • Test scope matches the behavior.
  • Normal, error, and boundary cases were considered.
  • New tests were run directly where possible.
  • Any failing behavior is clearly reported.

Expected final response

Report:

  • What behavior is now covered.
  • Test files changed.
  • Test commands run and results.
  • Any uncovered cases or blockers.

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.