agentleFS
evgenii-studitskikhevgenii-studitskikh/Claude-Code-SaaS-Studio/.claude/skills/write-tests/SKILL.md

write-tests

Skill1 starsChanged 6 months agoMITView on GitHub

Author tests for one PRD user story: unit, integration, and e2e cases plus any RLS policy or Stripe webhook fixture tests required. Run after test-setup is complete. Produces passing test files.

  • Reads credentials

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use audit-choices, close-spec and 10 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.
  • dzhngSkill

    audit-choices

    Audit the choices an implementing agent made, not its diff — a pure decision audit that traces the session's history into a choices ledger, changes no code, and never blocks an unsupervised run. Working code still embeds architecture the user never chose; surface it because future work inherits it. Use when the user wants to review the decisions the AI made on their behalf, before merging or committing AI-implemented work, when integrating a delegated subagent's pass, or when a fix "works" but might be a point fix.

    Also in 3 projects that use this

  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 3 projects that use this

  • LucasMatuszewskiSkill

    audit-agents

    Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.

    Also in 3 projects that use this

  • Halcyon666Skill

    write-skills

    Creates high-quality Agent Skills (SKILL.md files) that follow the open Agent Skills specification. Use when asked to create a skill, write a SKILL.md, package agent instructions, build a reusable capability, or turn a workflow into a shareable skill. Produces spec-compliant, concise, well-structured skills optimized for agent discovery and execution.

    Also in 3 projects that use this

  • isLinXuSkill

    eval-skills

    AI Agent Skill unit testing framework. A framework-agnostic toolkit for discovering, scaffolding, selecting, evaluating, and reporting on AI skills. Use this skill to assess skill quality before production, compare candidate skills on the same benchmark, enforce quality gates in CI/CD, and generate human-readable evaluation reports.

    Also in 3 projects that use this

  • TrecekSkill

    audit-tests

    Audit the test suite for useless tests, consolidation opportunities, over-mocking, weak assertions, and other test quality issues. Use when user says "audit tests", "audit test suite", "review tests", or "test quality check". Generates an improvement plan in temp/ with explanations for each proposed change.

    Also in 3 projects that use this

  • +6 more from dzhng

The file

Files
SKILL.md

Author a complete, passing test suite for one user story, covering every layer the QA plan prescribes for that story's risk profile. Non-autonomous: identify the target, propose cases, get approval, write, then prove green. Never use real secrets or live network calls in tests.

Phases

  1. Load context — read docs/specs/qa-plan.md to understand the pyramid and conventions; read docs/specs/prd.md to list available stories. Ask the user which story or feature to target. If qa-plan.md is missing, stop and direct to /qa-plan; if the test scaffold is absent (no vitest.config.ts), stop and direct to /test-setup.
  2. Propose cases — for the chosen story, enumerate the specific test cases at each layer: (a) unit tests for pure functions/helpers; (b) integration tests for server actions, route handlers, and API routes (using mocked DB/Stripe calls); (c) e2e tests for the critical user path in Playwright; (d) RLS policy tests asserting that other-tenant rows are inaccessible; (e) Stripe webhook tests using stripe.webhooks.generateTestHeaderString (or the Stripe CLI stripe trigger) with a signed test payload — never real keys. Present the list with a note on what each case catches. Under full, confirm each layer separately; under lean, one confirmation for the full list; under solo, proceed and summarize. Get explicit approval before writing any test code.
  3. Write — on approval, author the test files in the locations prescribed by the QA plan (e.g. src/__tests__/, e2e/). Follow conventions from docs/specs/qa-plan.md and, if present, the .claude/rules/tests.md rule. Reference secrets by env-var name only (e.g. process.env.STRIPE_WEBHOOK_SECRET) — never embed literal secret-shaped strings. Use seeded or in-memory test data, not production data.
  4. Run green — execute npm test (or vitest run) for unit/integration tests and npm run test:e2e for Playwright tests; show the output. If any test fails, diagnose the root cause, fix the test or the fixture, and re-run. Repeat until the full suite for this story is green; if the suite cannot be made green within the session, surface the remaining failures for the user to resolve and still point to /code-review. Under full, show each failure and proposed fix before applying; under lean or solo, fix and re-run, then show the final result.
  5. Next step — once the suite is green, point to /code-review to review the new tests alongside the feature code.

Output

Passing test files (unit, integration, e2e, and fixture tests as applicable) for one user story. No application code is modified beyond test utilities.

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.