/agentic:agentic-code-testingfrom agentic
Testing rules (layers, test doubles, flakiness, naming, coverage). Use when writing or reviewing tests, or fixing a flaky one.
Ships in agentic. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Writing tests → also Call the Skill tool with "tdd" and follow it: the red → green loop, seams, good vs bad tests, mocking at system boundaries and the anti-patterns live there. This skill adds only what tdd doesn't say: layer choice, doubles, flakiness, setup, naming, coverage, and the review checklist.
Examples pair TypeScript (Jest, Testing Library) and Python (pytest); write the same shape in the project's language and framework.
Tests are FIRST: Fast, Isolated, Repeatable (time, randomness and environment pinned), Self-validating, Timely.
One behaviour per test: arrange, act once, assert. A second act gets its own test.
test('calculates order total with tax', () => {
const order = new Order();
order.addItem({ price: 100 });
const total = order.calculateTotal({ taxRate: 0.1 });
expect(total).toBe(110);
});
def test_calculates_order_total_with_tax():
order = Order()
order.add_item(price=100)
total = order.calculate_total(tax_rate=0.1)
assert total == 110
Default for apps (integrations, UI, services): the testing trophy, most tests at integration, fewer units, E2E on critical paths, static checks (types, lint) at the base. Libraries, algorithms and stable interfaces: the pyramid, mostly units.
| Situation | Layer |
|---|---|
Pure function, algorithm, edge cases (format_currency(1234.5) → '$1,234.50') | Unit |
| Components together, API endpoint, DB operations (cart computes totals) | Integration |
| Critical user journey (signup → purchase → confirmation) | E2E |
| API compatibility between services | Contract |
| Double | Purpose | Verifies |
|---|---|---|
| Dummy | Fills a parameter, never used | Nothing |
| Fake | Working shortcut (in-memory DB) | State |
| Stub | Canned responses | State |
| Spy | Records calls, plus stub | State or calls |
| Mock | Expects specific calls | Calls |
Deltas on tdd's mocking rules:
const service = new OrderService(createTestDatabase(), stubPayments({ charge: 'ok' }));
service = OrderService(create_test_database(), stub_payments(charge="ok"))
Each test builds the values it asserts on, in its own body (factory call with overrides). Per-test setup (beforeEach, a function-scoped pytest fixture) holds mechanics only: fresh database, reset clock, cleared mocks. Anything shared across tests (beforeAll, module-level objects, session-scoped fixtures) is read-only.
DAMP over DRY: tests have no tests, so each must be obviously correct on reading. DRY the mechanics (factories, setup); keep the values that matter written in the test.
const createTestUser = (overrides = {}) => ({ id: 1, name: 'Test User', ...overrides });
test('loyal customers receive 20% discount', () => {
const customer = createTestUser({ loyaltyYears: 5 });
expect(calculateDiscount(customer)).toBe(0.2);
});
def make_user(**overrides):
return {"id": 1, "name": "Test User", **overrides}
def test_loyal_customers_receive_20_percent_discount():
customer = make_user(loyalty_years=5)
assert calculate_discount(customer) == 0.2
Causes, most common first: async handled with fixed delays, race conditions, state shared between tests.
await screen.findByText('Loaded'), await waitFor(() => expect(result).toBe(expected)); in Python, poll the condition with a timeout (wait_until(lambda: job.done, timeout=2)).jest --randomize, pytest-randomly) to expose hidden dependencies.Names read like specifications of behaviour: 'calculates total price including tax', test_prevents_adding_out_of_stock_items_to_cart, 'returns empty array when input is null'. Not 'test1' or testCalculateTotal_ReturnsCorrectValue.
A gap finder, not a target: 70–85% as a sanity check, never a strict gate. High coverage with bugs slipping through → check the assertions, try mutation testing.
Reviewing tests: check every item, cite each hit.
expect(wrapper).toBeTruthy(), assert result): break the code; the test must go red.sleep), order dependence.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub johannwilfridcalixte/agent-skills --plugin agentic40 skills in this plugin
/agentic-babysit-prGet a work item's PR merge-ready and watch it until it merges: push, open or reuse the PR, fix CI and comments in a loop. Use to open a PR, get it green, handle feedback, or watch it to merge./agentic-change-featureChange an existing feature's behaviour, from request to merged PR; `light` for a small change./agentic-clean-architectureUse when writing or modifying backend code that has business logic — services, domain models, use cases, APIs with validation/calculations/state transitions. Default for any non-trivial backend work.