/teamwork-kit:test-the-testfrom teamwork-kit
Enforces behavioral, failure-path, and durable-seam evidence for tests. Use when writing tests, reviewing coverage, or assessing test quality.
Ships in teamwork-kit. 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.
Read when SKILL.md points to them.
Use this skill to write, evaluate, and verify tests that prove behavior rather than implementation details.
Tests prove behavior through public seams, not implementation internals.
A test that breaks when you rename an internal variable without changing behavior is testing the wrong thing. A test that passes when the behavior is broken is worse than no test at all.
Write one test. Implement to pass it. Repeat.
For every behavior change with testable logic, write the smallest targeted test and observe it fail for the missing behavior before changing the implementation. Do not write a broad suite for imagined internals before learning from one vertical slice.
WRONG (horizontal):
RED: write all tests
GREEN: write all implementation
RIGHT (vertical):
RED → GREEN: one test → its implementation → repeat
For a behavior change in existing code:
diagnose → write targeted behavior test → observe RED → implement narrow behavior → observe GREEN
For an extraction or refactor intended to preserve current behavior:
diagnose current behavior → add focused characterization test → observe PASS
→ move logic without changing behavior → observe PASS
A characterization test is not speculative: it pins behavior already present at a durable seam before logic moves. If the slice also changes behavior, characterize the current behavior first, then use a separate observed RED for the behavior change.
Before accepting a test as complete:
[ ] Test describes behavior, not implementation details
[ ] Test uses a public seam: route, server action, query helper, or pure helper interface
[ ] Test would survive an internal refactor without changing
[ ] Code written is the minimum to pass the current test
[ ] No broad test suite speculates about unverified internal structure
[ ] Test covers at least one failure/rejection case, not just the happy path
[ ] For high-risk seams: failure path, wrong input, unauthorized access are covered
| Seam type | Minimum test coverage |
|---|---|
| Pure helper / validation | valid input, invalid input, unsafe/malformed input, edge cases |
| Parser | correct parse, rejection, precedence between command types |
| Dispatcher / readback builder | safe input → expected output, authority markers, unsafe input fails closed |
| Server action | authorized path, wrong project/role → denial, invalid input → failure, idempotency where relevant |
| Route boundary | method validation, body validation, auth/authority, fail-closed response shape |
| DB query helper | correct project-scoped read, wrong-project exclusion, missing record handling |
| Presentational component | renders given props correctly; does not fetch/store/dispatch |
| Hook | hydration/effect behavior, pure helper tests where possible |
| Natural-language matcher / routing seam | generated class matrix across frames and objects, including guard/veto vocabulary in object position; directive-veto cases; mention/question negatives; verbatim failing deployed inputs |
| Rendered answer / readback surface | whole-answer pins for each state branch plus structural assertions banning stale or forbidden wording |
The natural-language matcher or routing seam row is load-bearing: test the direction class, not only the first known phrase. Include adversarial object-position vocabulary so a veto or guard does not accidentally reject the operator's intended noun phrase.
If correctness depends on fields or environment values supplied by the actual caller, fixture-only proof is not enough.
Examples:
process.envWhen the live caller matters, the test or captured evidence must exercise the real call path. Hand-shaped fixtures may supplement that proof, but they do not replace it.
For state-changing record-family seams, include tests for:
If the repository claims exactly-once behavior through a DB transaction or unique constraint, tests must prove that property at the durable record seam, not just through an in-memory guard.
Every new or changed governed crossing — a server action or route that records a decision, transitions a status, consumes a grant, or creates lineage — requires an explicit sad-path matrix in the builder return. A crossing whose changed behavior has only happy-path tests is an incomplete return, not a reviewable one.
The matrix has one row per failure condition, with these columns:
| Failure condition | Expected refusal or result | Mutation-boundary guarantee (what did NOT happen) | Operator-visible readback | Test file proving it |
|---|
The mutation-boundary column states, per row, which effects were prevented: no execution, no application, no repo change, no canonical-truth change, no duplicate transition — as applicable to the crossing.
Baseline row set (the starting matrix for any governed crossing):
A row may be marked not-applicable with one line of reasoning (e.g. "no external service on this crossing"). An unexplained empty row is a gap, not a pass. This gate applies to new and changed crossings from adoption forward; it is not a retroactive audit of existing code.
Classify the matrix in the Builder return:
COMPLETE — every applicable row has named evidence and every excluded row
has a specific not-applicable reason.NOT_APPLICABLE — the slice changes no governed crossing, with the crossing
boundary named.SAD_PATH_PARTIAL — one or more required cases lack evidence or a valid
not-applicable reason; name each missing case. Partial is never silently
presented as complete.Source-string tests check whether a string, import, or pattern appears in source code. They are guardrails, not behavioral proof.
Use source-string tests for:
fetch, insert, or a route directlyDo not use source-string tests alone for:
When source-string tests are the only coverage for complex behavior, flag the gap in the builder return and the reviewer should request behavioral tests.
For persistence seams, asserting durable database state is the correct proof.
Prefer testing through public seams — routes, server actions, query helpers — rather than querying DB internals directly.
When persistence is the behavior being proven, assert the durable record exists with the correct fields through the same query layer the app uses.
VERIFIED, NOT VERIFIED, or INCONCLUSIVE. Inconclusive is
not a pass, and a negative is never hidden.An evaluator-side change alters what declares pass: a test, fixture, threshold, expected value, sample set, judge prompt, validation route, or evidence path. An implementation-side change alters the behavior being measured.
Evaluator-side and implementation-side changes must stay separately inspectable, so review can determine which one produced the green result. This is a separability requirement on the record, not a limit on diff width; scope rules govern how wide a change may be, not whether the two halves can be told apart. Separate commits, separate sections of the return, or an explicit before-and-after statement of the evaluator all satisfy it. A single undifferentiated change that moves both halves at once does not.
Classify every evaluator-side change:
| Class | Meaning | Routing |
|---|---|---|
EVALUATOR_REPAIR | the evaluator was wrong about the objective | fix it; state the objective or invariant it contradicted |
REQUIREMENT_CHANGE | the definition of success itself changed | route through reconvergence, not through a quiet edit |
TESTABILITY_SUPPORT | the seam was made testable without changing behavior | state the extraction (for example, a pure helper) and show behavior is unchanged |
COVERAGE_CHANGE | which cases are measured or discovered changed | state what stopped being measured |
OBSERVABILITY_CHANGE | logs, telemetry, reporting, or what reviewers see changed | state what became less visible |
UNRESOLVED | the conflict was not settled | flag it in the return; the reviewing seat classifies the gap |
When the evaluator appears wrong: preserve the original failure and the evaluator's identity, cite the objective or invariant it contradicts, classify the change, route a changed success definition through reconvergence, compare old and new evaluator behavior on positive and negative controls, and rerun the original case plus one non-equivalent check. A positive control must still pass and a negative control must still fail under the new evaluator; an evaluator change that silences the negative control is a defect, not a repair.
Where the visible signal is controlled by the same change that is being accepted, at least one check must be non-equivalent to that signal. Re-running a second command over the same manipulated signal is not independent evidence.
Already owned elsewhere and referenced here rather than restated: re-running the original failure, real-caller-path evidence (Fixture-vs-Deployed Divergence above), a clean-baseline rerun, negative and denied-path proof for high-risk seams, independent review, and owner verification on the real surface.
Options for the non-equivalent check:
Model-graded evaluators. Where an LLM judge or model-scored rubric is load-bearing and the executor can influence its input through text, the rubric must be assembled or sanitized independently of executor-controlled text. Candidate-supplied text must not reach the rubric, the grading instructions, or the judge's notion of success unfiltered.
When a test, metric, rubric, benchmark, judge, or other proxy is load-bearing for accepting a change, record three lines in the return before claiming success:
TRUE OBJECTIVE:
STRONGEST APPARENT-SUCCESS SHORTCUT:
DISCRIMINATING CHECK:
Passing a proxy is evidence about the objective, not proof the objective was achieved. Name the strongest route by which the change could pass while leaving the objective unmet, and the check that would catch it.
Stop at Level A when the discriminating check is already mandatory, independent of this change, and capable of failing the strongest shortcut named above.
Materiality gate. Technical editability alone never escalates routine work. Being able to edit an in-tree test is not by itself a reason to escalate, or every implementation would escalate. Repeated failure or budget pressure raises scrutiny only when paired with a load-bearing evaluator this change can modify. Pressure is a risk signal, never a diagnosis, and never a claim about intent.
Escalate beyond Level A only when the Level A check is inadequate and a material condition holds:
When escalation applies, load reference/objective-integrity.md for the
Level B decision model, escalation handling, and non-claim boundary. Do not
reconstruct those rules here.
Include in the unified return block when this skill fires:
Test the Test:
- Seam type tested:
- Behavioral tests added: yes/no / list
- Failure/rejection path covered: yes/no
- Source-string tests used: yes/no — guardrails only / for complex behavior (flag)
- Test gaps remaining:
A changed seam also reports its resource behavior, because a passing functional test says nothing about cost:
Performance / resource boundaries:
- N+1 queries or repeated remote calls introduced: Yes / No
- Unbounded list/search/read/loop introduced: Yes / No
- Blocking work added to a latency-sensitive path: Yes / No
- Unbounded client work or repeated rendering introduced: Yes / No
- Evidence: <measurement, named test/inspection, or specific not-applicable basis>
Treat a performance concern as blocking only when the change creates a credible correctness, availability, cost, or operator-usability risk. Speculative micro-optimization is not a gate.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ezra144israel/agent-teamwork-kit --plugin teamwork-kit6 skills in this plugin
/better-codingEvaluate minimum-sufficient implementation routes and enforce the selected route for a fixed, authorized outcome. Use after outcome, scope, authority, and acceptance evidence are fixed. Do not choose outcomes, set acceptance, adjudicate governance, grade finished work, design tests alone, conduct security audits, or perform unrelated cleanup./plansUse for planning, roadmaps, design, architecture, sequencing, or before consequential work when no current FINAL plan plus GO covers it. Fire before changes to data or schemas, credentials or auth, production or releases, repository or source-home boundaries, irreversible work, or materially costly mistakes. Re-enter when that scope appears mid-task or when restoring prior plan state. Skip factual answers, trivial reversible one-step work, and authorized Builder or Reviewer execution under a current FINAL blueprint plus GO unless a reopen condition fires./ship-or-fixOracle-frozen Builder and independent-Judge convergence cycle. Load ONLY when the operator explicitly sets Governance Dial G2 for the task, or explicitly names this skill or an active work unit already running it. Never auto-activate on task class, such as security, auth, or payments. If a task seems to warrant G2 and the operator has not said so, ask first. Not for ordinary governed implementation, analysis, review-only, or documentation work./teamworkFull governance constitution for work that touches shared state, requires independent review, spans seats, or involves planning, architecture, code, reviews, dispatches, status reports, or canonical records. Not needed for quick factual questions or trivial one-off answers./thinkingThe working method for every nontrivial task: frame the objective, ground load-bearing facts, converge on a route, execute without drift, and verify before delivery. Use for analysis, planning, implementation, debugging, document work, reviews, and multi-stage tasks.Other plugins' skills for the same job