apw-write-test — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited apw-write-test (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when the deliverable is new test code — whether you are writing tests first (TDD) or covering an already-written change (post-hoc). It exists to fight one specific failure: left alone, an agent writes tests that codify whatever the code currently does — assertions reverse-engineered from the implementation instead of derived from intended behavior. Those tests pass by construction, are never seen to fail, exercise only the happy path, and mock away the very logic under test. Green coverage that proves nothing. This is the testing-specific face of the model's bias toward confirming its own output.
The antidote is structural: derive the expected behavior from the requirement before reasoning from the code, and trust no test until it has been seen to fail. That same spine works in both modes — in post-hoc mode it makes you behave as if the tests came first. This is a different job from deciding what work to do (apw-plan), proving a finished implementation meets its requirements (apw-verify, which consumes tests rather than authoring them), or general adversarial review (apw-review, of which Step 6 here is a narrow, test-only echo). Follow the steps below strictly and in order.
Before writing anything, pin down what you are testing and against what:
requirements.md / design.md / plan.md artifact (see apw-work-with-work-item-artifacts for where these live), read it. If there is no written spec, the intended behavior must come from the user (Step 3), not from the code.Do not skip this step, even in post-hoc mode where the code already exists. The goal is a clear picture of intended behavior before the implementation's logic can anchor you to actual behavior.
This is the heart of the skill and the step the bias fights hardest. Before reasoning from the implementation's internals, write down what should happen, derived from the contract and the spec in Step 1 — not from reading the code's branches and restating them.
Enumerate the cases the behavior implies:
Weight by risk — spend cases where the unit is most likely to be wrong or most costly if it is, not uniformly. If a reference oracle, property, or invariant exists, prefer it: a test that restates an independent property is far harder to make tautological than one that restates the code.
In post-hoc mode, do this step before studying the implementation's logic. The deliverable of this step is a case list traceable to intended behavior — that is what makes a post-hoc suite structurally resemble TDD instead of a mirror of the code.
Before writing test code, state concisely:
Then ask: "Ready to proceed?"
Wait for the user to confirm or correct the plan before writing tests. This gate matters most when there is no written spec — here is where the intended behavior gets agreed, rather than silently invented from the code. For a small, obvious set of tests keep the plan to a few lines — but still confirm.
Write the agreed cases, one at a time. For each test:
A test never seen red is not yet trusted — it may be green by construction. Before trusting any test, see it fail for the right reason:
Kill tautological tests (assert true, assert a mock returned what you told it to) and over-mocked tests here — they survive this gate only by accident.
Switch from author to critic and attack the suite for test-specific smells. For each test ask:
Fix what these surface. Do not invent problems to look thorough — but a suite that clears every smell on the first pass deserves a second, harder look.
When done, report concisely:
Be honest. The point of this skill is a suite you can trust to fail when the code is wrong — reporting clean coverage while edge cases went untested or the failure gate was skipped is the exact bias this skill exists to defeat.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.