agentleFS
Ecoa-PUC-RioEcoa-PUC-Rio/GAIDE/.claude/skills/test-generator/SKILL.md

test-generator

Skill8 starsChanged 3 months agoMITView on GitHub

Generates automated tests from an existing SDD spec. Maps each acceptance criterion to one or more test cases. Use after a spec is approved and before implementing the code it describes.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactor-advisor, log-analyzer and 2 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.
  • aidankaokaoSkill

    refactor-advisor

    分析程式碼的重構機會,給出有優先順序的建議,但不直接改寫程式碼。當使用者說「這段程式碼怎麼改比較好」、「幫我分析重構方向」、「這樣寫有什麼問題」、「refactor」、「技術債」時觸發。

    Also in 3 projects that use this

  • nek1987Skill

    log-analyzer

    Parse and analyze application logs to identify errors, patterns, and insights.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check AGENTS.md or package.json / pyproject.toml to identify the test framework in use.

    line 28
  2. Distinctive:

    Before finishing, produce a traceability table:

    line 54
  3. Distinctive:

    If a criterion has no matching test → report the gap to the user.

    line 61
  4. Distinctive:

    Each test proves one criterion: Don't bundle multiple criteria in one test.

    line 65
  5. Distinctive:

    Readable names: Test names become executable documentation.

    line 66

“Common” is measured: kept by at least 6 in 10 of the 14 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
<!-- GENERATED from agents/skills/test-generator.md by scripts/sync-adapters.sh — edit the source and re-run; do not edit this file. -->

Skill: test-generator

When to activate

  • An approved spec exists at specs/<feature>/spec.md
  • Implementation hasn't started (or is just starting)
  • The user explicitly asks for tests generated from a spec

Why run this before implementation

The skill is designed for tests-first: tests derived from the spec represent the external contract the implementation must honor. Implementing first blurs the criterion.

Playbook

1. Load the spec

Read specs/<feature>/spec.md, especially:

  • The "Use cases" section
  • The "Acceptance criteria" section
  • The "Out of scope" section (to generate negative tests where applicable)
  • The "Security considerations" section (abuse cases → tests proving the abuse fails)

2. Load the test stack

Check AGENTS.md or package.json / pyproject.toml to identify the test framework in use. Do not introduce a new framework.

3. Map criterion → test

For each acceptance criterion, generate one or more tests:

  • Happy path test (the scenario described in the main use case)
  • Alternative path test (variations mentioned in the spec)
  • Error test (violated preconditions, invalid inputs)
  • Edge case test (numeric limits, empty strings, empty lists)
  • Abuse case test (from Security considerations: the test performs the abuse — wrong user, tampered ID, expired token — and asserts it is denied; these prove what must NOT happen)

4. Test file structure

# Suggested layout (adapt to the framework):

describe/feature("<Feature name>")
  describe/context("Criterion 1: <criterion text>")
    test/it("given X when Y then Z")
    test/it("edge: ...")
  describe/context("Criterion 2: ...")
    ...

5. Confirm coverage

Before finishing, produce a traceability table:

Acceptance criterionGenerated test(s)
Criterion 1test_criterion_1_happy, test_criterion_1_edge
Criterion 2test_criterion_2_happy, test_criterion_2_error

If a criterion has no matching test → report the gap to the user.

Principles

  • Each test proves one criterion. Don't bundle multiple criteria in one test.
  • Readable names. Test names become executable documentation.
  • No production code. This skill produces tests that will fail until the implementation happens (red-green-refactor).
  • No excessive mocks. Mock only what is outside the scope of the test; code under test should actually run.

Expected output

One or more test files in the project's conventional location (tests/, __tests__/, etc.) + a traceability report.

Expected status of the tests at the end: red (failing) — because the implementation doesn't exist yet. That's the point.

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.