testing-craft
Provides Google-derived testing strategy, test-writing craft, and test-suite health reference, distilled from Software Engineering at Google (the Flamingo book), the Google Testing Blog, and Google's published testing-infrastructure research. Canon's `reviewer` subagent reads the writing-craft and strategy references as review criteria. Invoke directly to design a test strategy, audit an existing suite's health, or triage a flaky or brittle test.
- License 许可
- BSD-3-Clause
- 所属仓库
- urban233/Canon
- 最近更新
- 2026-10-01
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- testing-craft
- description
- Provides Google-derived testing strategy, test-writing craft, and test-suite health reference, distilled from Software Engineering at Google (the Flamingo book), the Google Testing Blog, and Google's published testing-infrastructure research. Canon's `reviewer` subagent reads the writing-craft and strategy references as review criteria. Invoke directly to design a test strategy, audit an existing suite's health, or triage a flaky or brittle test.
02 资源文件 3
- 参考文档references/test-strategy.md5.9 KB
- 参考文档references/test-suite-health.md5.1 KB
- 参考文档references/writing-tests.md4.8 KB
03 SKILL.md 正文
Testing Craft
Reference for designing a test strategy, writing individual tests well, and keeping a test suite healthy over time -- distilled from Google's public testing methodology (Software Engineering at Google, the Google Testing Blog, and Google's peer-reviewed testing-infrastructure research). This skill has no template of its own; it sharpens test content another skill or agent is already producing.
Invocation boundary
Use this skill in two situations:
- As a prerequisite. Canon's
reviewersubagent readsreferences/writing-tests.mdandreferences/test-strategy.mdas its review criteria for a change's tests. That's a read, not a full invocation of this skill -- continue in the calling agent's own workflow. - Directly, when the developer asks to design a test strategy for a change, audit an existing test suite's health, triage a specific flaky or brittle test, or asks for this skill by name.
Apply the references
references/test-strategy.md-- size vs. scope, the target test-count pyramid and its antipatterns, when a larger test earns its cost, and the coverage-decision heuristic. Read before deciding what to test and at what level.references/writing-tests.md-- DAMP over DRY for test code, behavior- named tests, the test-doubles priority ladder, and the brittleness checklist. Read before writing or revising an individual test.references/test-suite-health.md-- hermetic tests, flaky-test triage, and coverage-as-diagnostic. Read before auditing or maintaining an existing suite.
Each reference ends in a self-check list; run it against the test content before treating that content as done.
When invoked directly
- Identify which of three cases applies: a new or revised test strategy, a health audit of an existing suite, or triage of one specific flaky or brittle test. Ask if the developer's request is ambiguous between them -- the three use different references and produce different output.
- New or revised strategy. Gather the change's actual risk and shape
(new component, size, blast radius, existing coverage) from the
developer's request and the repository itself. Apply
references/test-strategy.mdto produce a size/scope recommendation, a test-doubles approach, and a list of any larger tests that earn their cost -- with the reasoning, not just the list. Hand the result back into the calling skill's own artifact if one is open; otherwise present it directly. - Suite health audit. Inspect the existing suite's structure, runtime,
and recent CI or test-run history if available. Apply
references/test-suite-health.md's checklist (hermeticity, flake signal, pyramid shape) andreferences/writing-tests.md's brittleness signals. Report findings ranked by how much trust they erode, each with specific evidence (a flaky test's failure history, a brittle test's coupling to an internal method) -- do not silently rewrite tests as part of an audit; that is separate, explicitly-requested work once the developer accepts a finding. - Flaky or brittle triage. Apply
references/test-suite-health.md's triage decision tree to the specific test named. Recommend one of fix-now, quarantine-and-ticket, or delete, with the reasoning, not a default.
Handoff
This skill does not decide product scope, architecture, or which change to make -- it only sharpens test content already in scope. Return control to the calling skill or the developer once the relevant self-check passes, or once a direct invocation's findings are reported.
04 同仓库更多 Skills
ship
Decide whether a change is ready to hand to a human, and open the pull request when it is. Use once the work is done and verified, before opening a PR or telling the developer the change is ready.
review
Dispatch Canon's independent reviewer subagents for this branch and read their verdicts back from canon_review. Use once a change is built and verified, before shipping. This skill only dispatches and reads back -- the review itself runs inside the subagent, in a fresh context, and never in this session.
review-change
暂无简介
plan
Shape what plan mode drafts, so the plan Canon saves needs no follow-up. Use whenever drafting a plan for approval in plan mode, before writing it to .canon/plans/.
frame
Surface the open questions before planning a multi-branch feature, and shape the feature plan mode drafts. Use before entering plan mode for work that obviously won't fit in one branch and one pull request -- never for a change that already does.
decide
Draft and commit a decision record for a design or architecture choice made in this session, once it has survived implementation. Use at ship time, right before opening the pull request, when the branch made a decision worth recording.