agentleFS
otncotnc/agent-skills/skills/maketest/SKILL.md

maketest

Skill2 starsChanged 50 days agoMITView on GitHub

Design and write software tests from requirements, agreed examples, or contracts. Use when asked to add tests, catch a bug with a regression test, pin legacy behavior before a refactor, plan test cases, or develop with TDD or BDD. Choose cases by risk and use the fastest layer that can observe the behavior. テストを追加・作成する、テストケースを設計する、回帰テストを書く、TDDで実装する。

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Known defect: Prefer the same test on a known bad baseline and on the candidate fix.

    line 45
  2. Distinctive:

    Before handoff, compare the finished tests against the requirements in scope.

    line 56

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

maketest

Choose tests that would detect plausible defects in behavior the project promises. Keep the feedback loop fast and leave evidence of what the tests exercise.

1. Establish the oracle and scope

Read the user request, relevant requirements, project instructions, nearby tests, and the runner or CI configuration. An oracle is the basis for deciding whether an outcome is correct: a requirement, agreed example, published contract, domain invariant, or independently justified property. Use code to find the public seam, fixtures, and affected paths. Decide expectations from the oracle, even if that exposes a bug in the code or an existing test.

Use the table to choose a workflow and combine rows where useful. For example, TDD controls the implementation sequence while a decision table supplies the test cases. In a short plan or working note, identify the oracle, the unit of behavior, and the stopping rule. Say which risks the chosen seam cannot observe. Keep this lightweight for a single test.

WorkflowOracleTest unitStop when
TDD for requested implementationRequirement or agreed exampleOne observable behavior per cycleThe behavior list for the requested scope is covered or gaps are explicit
BDD / ATDDAgreed acceptance rules and examplesOne scenario with a distinct user outcomeAgreed outcomes have evidence at a suitable layer
Specification-based designSpecification and input or state modelOne meaningful partition, boundary, rule, or transitionSelected technique items and material risks are covered or recorded as gaps
ContractPublished interface or actual consumer requirementsOne interaction or compatibility requirementUsed interactions and relevant error variants have verification evidence
Domain / DDDBusiness rules and invariantsOne rule across a domain operation or sequenceRelevant invariants and their important violation paths are exercised
Regression for a known defectIssue, agreed corrected outcome, or other independent oracleA minimal case that distinguishes buggy and correct behaviorThe defect is detected on a known bad version when available, and related cases add distinct value
Characterization before refactoringObserved public behavior, explicitly labeledOne existing behavior whose change would be costlyRisky behaviors in the refactor's scope are pinned; uncertain behavior stays explicit

Resolve contradictions that change an assertion. If intent is missing, ask a focused question and continue with the cases that have a source. Mark the unresolved case as a gap. Accept multiple outcomes only when the oracle permits them and the test can check the conditions for each. Do not silently promote a passing observation to intended behavior. Use characterization only when preserving behavior is part of the request; avoid pinning suspected defects as correct.

2. Choose cases and the cheapest useful layer

Start with the changed behavior and what would break for users or dependents. Map each relevant requirement to existing or proposed coverage. Consider valid and invalid inputs, meaningful boundaries, error handling, state changes, and side effects; keep a case when it guards a distinct outcome, risk, or plausible defect. For high impact behavior, explicitly account for missing coverage. Read test design techniques for branching rules, ordered inputs, state, or combinations. Read workflow examples for acceptance, contract, domain, or characterization work.

Reuse coverage that already catches the same defect. Prefer the smallest test that can see the actual failure: pure code for decision logic, integration for wiring or a storage guarantee, and end to end for critical journeys that depend on the deployed pieces working together. Combine equivalent setup with readable, named parameter rows. Each row still runs and must earn its cost. Avoid asserting framework behavior unless the project's configuration or wrapper changes its guarantees.

For a large test change or CI performance work, agree a useful runtime target and read suite cost and reliability. Use the test plan template when the user asks for a plan or there are several risks and layers to track.

3. Write an observable check and establish failure evidence

  • Test-first work: Run the focused test before implementing the behavior. Confirm the intended test ran and failed for the predicted behavioral reason. A compile error, missing fixture, or runner failure does not establish that the assertion can detect the defect. When implementation is in scope, make the smallest coherent change, rerun to green, then refactor and rerun the affected tests.
  • Known defect: Prefer the same test on a known bad baseline and on the candidate fix. Keep inputs and runner comparable. If a tests-only request exposes a bug, report the failing test and the requirement it contradicts; keep production fixes within the user's scope.
  • Already working behavior: A first-run pass is normal. Check discovery and assertions, then use prior defect evidence or a focused negative control where useful. For example, confirm that the test rejects a version with the relevant limit shifted by one. If this is unsafe or impractical, report exactly what evidence is missing. See failure checks for isolation, mutation, and evidence labels.

Assert meaningful observable results: the value, error, persisted state, event, or boundary effect the contract promises. Prefer real deterministic collaborators. Use a fake or stub when the real dependency is expensive, nondeterministic, or needed to inject a specific failure. Verify calls only when the interaction itself matters, such as emitting exactly one receipt for repeated submissions. Avoid asserting private calls, using the same production calculation for the expected result, accepting unreviewed snapshots, or weakening expected outcomes to get green.

4. Run and report

For each new behavior assertion, name a plausible incorrect outcome and check mentally that the assertion distinguishes it. Strengthen weak assertions or remove redundant cases. Make fixtures independent, control time or randomness when relevant, wait for observable conditions with a timeout, and avoid retrying away assertion failures.

Run the focused tests, then the relevant repository checks for the change. Confirm the intended cases ran as normal tests. Check for filters, skips, expected-failure markers, or caught errors that hide the outcome. Follow existing policy for intentional skips or expected failures and report them as gaps in passing coverage. Repeat or shuffle a scoped set when there is meaningful timing, concurrency, or shared-state risk and the runner supports it. Use existing CI requirements and performance budgets. Measure when claiming a speed improvement; use comparable before and after runs.

Before handoff, compare the finished tests against the requirements in scope. For each material requirement, find the assertion that would fail if it were broken, or record the gap. A test name, covered line, or successful interaction does not establish that the outcome was checked.

Report the covered behavior and oracle, the exact checks and results, how any failure was demonstrated, and any material gaps. Distinguish observed failure from a mental check, and a drafted test from a test that ran. If tests cannot run, name the blocker and give the command to verify them.

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.