agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when deciding what to test and at which level. Covers the test pyramid, what belongs in unit versus integration versus end-to-end tests, coverage as a signal rather than a target, and eliminating flakiness. Trigger on "what should we test", "our test suite is slow and
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill test-strategy --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill test-strategy -a windsurf -y
name: test-strategy description: Use when deciding what to test and at which level. Covers the test pyramid, what belongs in unit versus integration versus end-to-end tests, coverage as a signal rather than a target, and eliminating flakiness. Trigger on "what should we test", "our test suite is slow and flaky", "unit or integration test", "what coverage target". Do not use for writing Playwright tests — see the e2e-playwright skill; for the TDD loop, see the test-driven-development skill. metadata: category: testing version: 1.0.0 tags: [testing, strategy, pyramid, coverage, flakiness]
Build a test suite that catches real defects, runs fast enough to be run, and does not need to be rewritten every time the code is refactored.
1. **Test behavior, not implementation** — A test that breaks when you rename a private method is a test that prevents refactoring rather than enabling it. 2. **Choose the level by what you are verifying** — Business logic: unit tests, fast and many. Integration with a real database or queue: integration tests, fewer. A complete user journey: end-to-end, a handful. 3. **Use real dependencies where practical** — A test against a real Postgres in a container catches the SQL error that a mocked repository never will. Mocks verify that you called a thing; they do not verify that it works. 4. **Write the test that would have caught the bug** — After every production defect. This is where the highest-value tests come from — a real bug is empirical evidence of an untested path. 5. **Treat a flake as a defect** — Quarantine it immediately, then fix it. A suite with a 2% flake rate teaches the team to re-run and eventually to ignore. 6. **Keep the fast loop fast** — Under five minutes for what runs on every change, or people will stop running it.
**A test that verifies behavior, and one that verifies implementation:**
# Bad: verifies the implementation. Breaks on any refactor; catches no bugs.
def test_refund_calls_gateway():
gateway = Mock()
RefundService(gateway).refund(order, 1000)
gateway.refund.assert_called_once_with(order.charge_id, 1000)
# This passes even if the refund is never recorded, the amount is wrong
# in the database, and the customer is charged again.
# Good: verifies the behavior that the user and the business care about.
def test_refund_reduces_balance_and_is_idempotent(db, fake_gateway):
order = place_order(db, total_cents=5_000)
service = RefundService(fake_gateway, db)
result = service.refund(order.id, amount_cents=2_000)
assert result.ok
assert db.orders.get(order.id).refunded_cents == 2_000
assert fake_gateway.total_refunded(order.charge_id) == 2_000
# The same request again must not refund twice.
service.refund(order.id, amount_cents=2_000, idempotency_key=result.key)
assert db.orders.get(order.id).refunded_cents == 2_000**The distribution that actually works:**
Unit ~70% milliseconds each business logic, edge cases, error paths Integration ~25% seconds each real DB, real queue, real HTTP layer End-to-end ~5% tens of seconds the three journeys that must never break The proportions matter less than the principle: put the volume where the tests are fast and the coverage is cheap, and reserve the slow, brittle level for the handful of paths whose failure would be catastrophic.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.