ankyr-testing

Enforces test-authoring rules for behavior-driven tests, fakes over mocks, and regression coverage.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-testing-guyerreich
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ankyr-testing
Source: https://github.com/GuyErreich/AI_Agents/tree/main/plugins/ankyr/skills/ankyr-testing
Command: npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-testing-guyerreich

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often write brittle tests that mock internal implementation details, duplicate setup across files, or silently pass when the code under test is broken. This Skill provides language-agnostic test-authoring discipline so tests assert real behavior and fail loudly in CI. ## Core Features & Use Cases - Behavior-at-seams testing: Assert observable outcomes (return values, files written, HTTP status) instead of private internals. - Mocking discipline: Mock only true I/O (network, clock, subprocess, VCS) and prefer fakes, real temp files, and shared data files over mocking your own modules. - Shared setup and table-driven cases: Extract factories and helpers, and use named {name, input, expected} rows instead of copy-pasted tests. - Use Case: When fixing a bug in a Python or Node.js service, apply these rules to write one regression test that fails if the fix is reverted, drive edge cases through the public API, and ensure the suite exits non-zero on failure. ## Quick Start Review my new test file and rewrite it to test behavior at seams, replace internal mocks with fakes, and add a regression test for the bug I just fixed.

Frequently Asked Questions about ankyr-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write tests that mock only true I/O?▼

Mock only external boundaries like network calls, clocks, subprocesses, and version control operations. Never mock the code under test or its private helpers; instead drive those paths through the public API or extract a seam you own and fake that.

What is the difference between a fake and a mock in testing?▼

A fake is an in-process stand-in with the same interface, such as an in-memory store or temp clock. A mock records calls and returns scripted values. Fakes catch more contract drift, so prefer them for file, YAML, or JSON collaborators.

When should I use a mock instead of a fake?▼

Use a mock when the collaborator is a remote API or git process, when you only need to confirm a call happened, or when constructing the real type requires network access. Otherwise prefer fakes or real temp files.

How many regression tests should I write per bug fix?▼

Write exactly one regression test per bug fix. The test must fail if the fix is reverted, proving it actually covers the bug rather than passing regardless of the code under test.

Why does my failing test not fail the CI build?▼

A failing test must exit with a non-zero status code or the build system cannot detect it. Runner-less suites must call process.exit(1) or sys.exit(1) explicitly; a script that prints FAIL and exits 0 is invisible to CI.

Does this testing guidance work for both Python and Node.js?▼

Yes, the core rules are language-agnostic and apply to any test suite. Runner and library specifics live in the matching language skill's references/testing.md file for Python or Node.js.