agentleFS
magia187magia187/premium-agent-skills/skills/test-plan-first/SKILL.md

test-plan-first

Skill0 starsChanged 2 months agoMITView on GitHub

Use when starting implementation of a feature or bugfix. Write a concrete test plan and at least one failing automated test (or explicit manual cases) before changing production behavior.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Do not delete golden files, snapshots, or fixtures wholesale without confirmation.

    line 27
  2. Distinctive:

    Write a short test plan (happy path, edge cases, failure modes).

    line 33
  3. Distinctive:

    Add or sketch the failing automated test(s).

    line 34
  4. Distinctive:

    Update the plan checkboxes with actual commands and results.

    line 36

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

Test Plan First

When to use

  • Implementing a feature, bug fix, or behavior change with testable outcomes.
  • The user asks for "TDD", "tests first", or "how will we verify this?".
  • You are about to edit production code without a verification story.

When not to use

  • Pure docs, comments, or markdown-only changes.
  • Exploratory spikes explicitly marked throwaway with no merge intent.
  • Environments where no test harness exists and the user waived automated tests (still write a manual plan).

Assumptions

  • Project has a known test command (e.g. npm test, pytest, go test) or you can document manual steps.
  • Shell access to run tests and capture pass/fail output.
  • Do not delete golden files, snapshots, or fixtures wholesale without confirmation.
  • Flaky suites: stabilize or quarantine per flaky-test-triage rather than ignoring failures.

Workflow

  1. Restate behavior under test as inputs → expected outputs / side effects.
  2. Write a short test plan (happy path, edge cases, failure modes).
  3. Add or sketch the failing automated test(s); run to confirm red.
  4. Implement until green; resist expanding scope beyond the plan.
  5. Update the plan checkboxes with actual commands and results.

Steps

  1. Behavior table — List cases: normal, boundary, invalid input, and one regression risk.
  2. Choose level — Prefer the lowest reliable layer (unit > integration > e2e) that would catch the bug.
  3. Write the red test — Assert the new contract. Name it after the behavior, not the implementation.
  4. Run and capture — Record the failing output once so the failure reason is clear.
  5. Implement minimally — Only what the tests require (pair with yagni-slice).
  6. Green + nearest suite — Re-run the new tests and the closest existing file/package suite.

Success criteria

  • A written test plan lists concrete cases before production edits.
  • At least one automated test failed for the right reason before the fix (or manual cases are explicit and reproducible).
  • Tests pass after implementation with recorded commands.
  • Edge and failure cases from the plan are covered or consciously deferred with rationale.
  • No snapshot/fixture mass-deletes without confirmation.

Out of scope

  • Full coverage campaigns unrelated to the current change.
  • Load/performance benchmarking (use perf-measure-first).
  • Authoring a new test framework or CI system from scratch.

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.