agentleFS
darkroomengineeringdarkroomengineering/cc-settings/skills/test/SKILL.md

test

Skill47 starsChanged 2 months agoMITView on GitHub

Write or run tests, check coverage, or drive TDD. Triggers "write tests", "run tests", "coverage", "TDD", "red-green-refactor", or a pre-merge test pass.

98 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use develop, perf and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bamechoSkill

    develop

    开发实施阶段详细规则;进入开发实施时读取;包含执行流程、代码规范、一致性审计、方案包迁移

    Also in 6 projects that use this

  • MicrosoftSkill

    perf

    Speed and memory performance rules for Rust crates, the Node addon, webui-framework, and webui-router.

    Also in 6 projects that use this

  • nicolasestremSkill

    document

    Create focused documentation for specific components or features

    Also in 8 projects that use this

  • vltingSkill

    scope

    Interactive planning + orchestration. Approval-gated workflow covering saga→epic→task hierarchy via progressive scoping.

    Also in 5 projects that use this

  • bitwize-music-studioSkill

    tutorial

    Provides interactive guided album creation for new users. Use when the user is new to the plugin or asks for a walkthrough of the album creation process.

    Also in 3 projects that use this

  • kt057Skill

    check

    lint, typecheck, test を一括実行して結果をサマリーする

    Also in 8 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 80 edited versions we read keep these.

  • 10

    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. Very specific:

    Write: - Create test files colocated with source (e.g., button.test.tsx)

    line 15
  2. Distinctive:

    If you catch yourself thinking any of the following, STOP — you are skipping testing:

    line 28
  3. Distinctive:

    Mocking everything: If you mock the thing you're testing, you're testing the mock.

    line 43
  4. Very specific:

    Before exploring the codebase, follow ../context-doc/DOMAIN-AWARENESS.md.

    line 61
  5. Distinctive:

    Before writing any code:

    line 84
  6. Distinctive:

    Ask: *"What should the public interface look like?

    line 91
  7. Distinctive:

    Write one test confirming one thing about the system:

    line 95
  8. Distinctive:

    Only enough code to pass the current test

    line 121
  9. Distinctive:

    Don't anticipate future tests

    line 122
  10. Distinctive:

    Keep tests focused on observable behavior

    line 123
  11. Distinctive:

    After all tests pass, look for cleanup:

    line 127
  12. Distinctive:

    Run the full test suite after each refactor step

    line 132

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

Testing Workflow

Delegates to the Tester agent for test coverage and verification.

Workflow

  1. Identify - Determine what needs testing (component, hook, utility, integration)
  2. Write - Create test files colocated with source (e.g., button.test.tsx)
  3. Run - Execute tests and verify results
  4. Report - Summarize coverage and gaps

Testing Priorities

  1. Critical paths - Auth, payments, core features
  2. Edge cases - Error states, empty states, boundaries
  3. User interactions - Forms, buttons, navigation
  4. Integration points - API calls, external services

Rationalization Counters

If you catch yourself thinking any of the following, STOP — you are skipping testing:

RationalizationWhy It's Wrong
"This is too simple to test"Simple functions with edge cases are exactly what tests catch
"I'll add tests later"Later never comes; untested code ships and breaks
"The types guarantee correctness"Types check structure, not logic — add(a, b) returning a - b passes TypeScript
"It's just UI, tests don't help"Interaction tests catch regressions that visual review misses
"Manual testing is enough"Manual testing doesn't run in CI and doesn't prevent regressions
"Tests are passing immediately"Tests that pass on first run without failing first may not be testing what you think — verify the test actually exercises the code path

Red Flags

  • Tests pass immediately on first write: Suspicious. Verify the test would fail if the implementation were wrong.
  • No assertions: A test without assertions is not a test.
  • Mocking everything: If you mock the thing you're testing, you're testing the mock.
  • A batch of tests written before any has run: a batch against imagined behavior pins what you guessed — those tests fail on harmless changes and pass while the real path is broken. Write one, watch it go red, earn green, then write the next; each cycle tells you what the next test should actually assert.
  • Asserting internals: assert observable behavior through the outermost practical entry point (return values, exit codes, persisted rows, rendered output) — never which internal functions ran. A public-surface test survives a rewrite of everything underneath; an internals test breaks on every refactor and pins implementation, not behavior.

Output

Return a summary:

  • Tests written: New test files/cases
  • Tests passing: Status
  • Coverage: Key areas covered
  • Gaps: What still needs testing

Variant: TDD (test-first discipline)

A test-first discipline that produces tests which describe behavior through public interfaces, not implementation. Such tests survive refactors. Tests coupled to internals do not — they break the moment you rename a function and pass when behavior actually breaks.

Before exploring the codebase, follow ../context-doc/DOMAIN-AWARENESS.md. Test names and interface vocabulary should match the project's CONTEXT.md.

Anti-pattern: horizontal slices

Do not write all tests first, then all implementation. That produces tests describing imagined behavior. They test the shape of things (data structures, function signatures) instead of user-facing capability. They go insensitive to real changes — they pass when behavior breaks and fail when behavior is fine.

WRONG (horizontal):
  RED:   test1, test2, test3, test4, test5
  GREEN: impl1, impl2, impl3, impl4, impl5

RIGHT (vertical):
  RED→GREEN: test1 → impl1
  RED→GREEN: test2 → impl2
  ...

Each cycle responds to what you learned from the previous one. You can only write the right test for behavior N after implementing behavior N−1.

Workflow

1. Plan

Before writing any code:

  • Confirm with the user what interface changes are needed
  • Confirm which behaviors to test (prioritize — you can't test everything)
  • List the behaviors to test (not implementation steps)
  • Get user approval on the plan

Ask: "What should the public interface look like? Which behaviors are most important?"

2. Tracer bullet

Write one test confirming one thing about the system:

RED:   test for first behavior → fails
GREEN: minimal code to pass → passes

This proves the path works end-to-end. Don't move on until it passes.

3. Incremental loop

For each remaining behavior:

RED:   next test → fails
GREEN: minimal code to pass → passes

To run the red→green cycle autonomously across turns, set /goal every planned behavior has a passing test and the full suite exits 0. The evaluator reads the test output from the transcript after each turn — don't phrase the condition as something only the runtime can prove (file flags, etc.).

Rules:

  • One test at a time
  • Only enough code to pass the current test
  • Don't anticipate future tests
  • Keep tests focused on observable behavior

4. Refactor

After all tests pass, look for cleanup:

  • Extract duplication
  • Deepen modules — move complexity behind simple interfaces
  • Apply naming from CONTEXT.md
  • Run the full test suite after each refactor step

Never refactor while red. Get to green first.

Per-cycle checklist

  • Test describes behavior, not implementation
  • Test uses only the public interface
  • Test would survive an internal refactor
  • Code is minimal for this test
  • No speculative features added

When TDD is the wrong tool

  • One-shot scripts, prototypes, throwaway exploration
  • UI work where the "behavior" is visual and a snapshot/visual test is more useful
  • Code where the public interface is dictated by an external spec (just write the conformance test, then implement)

For these, use /build (scaffold-then-test) or /fix (existing-bug pipeline) instead.

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.