/flagrare:testing-philosophyfrom Flagrare
Defines what makes a good test: behavior over implementation details, using the Testing Trophy model. Generalized to any language and layer (frontend, backend, CLI, library).
Ships in Flagrare. 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.
This is the shared definition of "good test" that every flagrare skill which proposes or reviews tests leans on. It distils Kent Dodds' testing writing and generalizes it past his JS/React context to any language and any layer. (Grounded in docs/research/2026-06-11-kent-dodds-testing-philosophy.md.)
The more your tests resemble the way your software is used, the more confidence they can give you. (Kent C. Dodds)
Every rule below is a corollary. The principle is already language- and layer-agnostic; "the way your software is used" just resolves to a different surface in each context. When a testing decision is unclear, return to this sentence.
An implementation detail is anything "users of your code will not typically use, see, or even know about." A test bound to one fails in both directions at once:
Dodds' framing: a test that drives your code differently from how real users drive it becomes a third user you never wanted, now you have to keep the end user, the calling developer, and the test happy.
"User" generalizes by layer. Assert only on what that user can observe; drive the code only through the surface that user touches:
| Layer | The user | Assert on (observable) | Do NOT touch (implementation) |
|---|---|---|---|
| Library / module | the calling developer | return values, thrown errors, public types, emitted events | private fields/methods, internal helpers, internal data-structure choices |
| Backend / API | the HTTP/RPC client | status codes, response bodies, headers, state visible through the API, domain events | ORM internals, service method names, query shapes, internal DTOs |
| Frontend / UI | the person clicking | rendered text, roles, what appears/disappears after an interaction | component state vars, hook internals, CSS class names, child-component names |
| CLI | the person at the prompt | stdout/stderr, exit code, files written | internal flag parsing, function call order |
Concrete tells of an implementation-detail test (stack-independent, flag any of these):
calls setIndex with 0) instead of a behavior (shows the first slide on load).The acid test: "If I refactor the internals but keep the public contract identical, does this test break?" If yes, it tests the wrong thing. Pair it with: "Does this assert what a real user observes?" If no, same problem.
Four layers, bottom to top. Height is confidence; height is also cost/time. Testing is "return on investment where return is confidence and investment is time."
| Layer | What it is | Mock how much |
|---|---|---|
| Static | types + lint, correctness for free | n/a |
| Unit | one piece in isolation | dependencies mocked |
| Integration | several units working together, the default tier | mock only external boundaries |
| E2E | the whole assembled system | "as little as possible" |
"Write tests. Not too many. Mostly integration" puts most effort in the middle, because that's the best confidence-per-effort and most regressions live between units, not inside them.
The correction that matters: "mostly integration" is not "skip e2e." There are two opposite violations, and most reviews only catch the first:
The e2e necessity rule: every user-facing feature needs at least one end-to-end (or highest-practical) test that exercises its critical happy path through the real, assembled system, one or two paths, not one per scenario. The e2e tier proves the wiring; integration proves the behavior; unit proves the tricky pure logic; static proves the shapes. A plan or a diff that has unit + integration coverage but no wiring proof for a user-facing feature has a gap.
E2e does not require a browser: it generalizes:
| Surface | What "e2e" means |
|---|---|
| Frontend app | browser-driven test of the critical journey: load → act → see the result |
| Backend service | hit the running service over HTTP against a real (test) DB; assert response + persisted state |
| CLI | invoke the built binary as a subprocess; assert stdout / exit code / files written |
| Library | consume the published public API exactly as a downstream user would, nothing internal stubbed |
When proposing tests (planning, ATDD): write tests behavior-first against the public surface; default to integration; reserve unit tests for pure functions with tricky logic; and include at least one e2e/full-stack happy-path test for any user-facing feature. Never aim at a coverage number, coverage is a side effect of testing the right behaviors.
When reviewing tests: run both acid-test questions on every test; flag the implementation-detail tells above; and check both e2e directions, overuse and the missing-critical-path gap.
calls X) rather than the outcome the user observes.Kent C. Dodds: Testing Implementation Details, The Testing Trophy and Testing Classifications, Write tests. Not too many. Mostly integration.. Generalization and per-layer mapping captured in docs/research/2026-06-11-kent-dodds-testing-philosophy.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub flagrare/agent-skills --plugin flagrare43 skills in this plugin
/atdd-planProduce an ATDD-first implementation plan in Claude Code's native plan mode, with named design patterns called out where they earn their keep. The skill enters plan mode automatically (via the EnterPlanMode tool), runs /flagrare:codebase-explore to ground the plan in the actual codebase, then produces a plan-mode plan that MUST include both: (1) 3-5 acceptance tests in plain English defining 'done' before any implementation, written behavior-first against the public API only; and (2) any non-trivial structural decisions named as design patterns with a one-line rationale. Plan mode's native approve/edit/reject button UI is the close, ExitPlanMode is how the skill ends. Use whenever the user wants to plan a feature, fix, or refactor, 'how should we implement X', 'plan this', 'let's design X', 'where do we start on Y'. Tests follow Kent Dodds Testing Trophy: behavior over implementation, integration-heavy, public-API-only, refactor-proof. The skill stops at the plan; it does not write implementation code./brag-docGenerate a comprehensive, impact-framed brag-doc entry for a chosen time window (day, week, biweek, month, or custom). Pulls authored PRs, reviews given, commits, deploys, and linked tickets across GitHub, local git, and configured MCPs, then synthesises a themed narrative, leading with outcomes, quantifying impact, owning the work in first-person past tense, separating IC contributions from amplification, and naming the judgment exercised. Output is designed to drop straight into a developer journal, a personal bragging sheet, or a performance-review packet. Accepts a mode argument, `/flagrare:brag-doc resumancer` renders the output as ready-to-paste Resumancer CLI commands (`resumancer impact "..." --branch ...`) instead of markdown. Use whenever the user says "brag doc", "brag sheet", "what did I do this week", "weekly recap", "monthly recap", "performance review prep", "what should I tell my manager", "summarise my impact", "career log entry", "give me my wins", "biweekly recap", or any variant about looking back over a longer window than a single day's standup. Also trigger near review season ("self-review", "perf packet", "evaluation prep"), and on phrases like "log my wins to resumancer" or "make resumancer entries for this week" (which should pass the `resumancer` mode). For windows longer than about a month, a tenure retrospective, a departure record, or "everything I did at this company", hand off to `/flagrare:impact-timeline` instead; this skill's window tops out at a month.Other plugins' skills for the same job