ensodynamics/enso-method/test-hardening

Claude Code and agent skill by ensodynamics/enso-method

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Final pre-commit pass that strengthens the tests for the work just implemented — verify every acceptance criterion has credible test evidence, upgrade weak or mock-reliant tests to prove real behavior, add what's missing, and leave the full suite green. Bounded strictly by the acceptance criteria of the work being hardened — it never grows tests for behavior outside them. Runs after deliverable-review as the third step of the implement → review → harden chain. An action skill, not an audit — it…

Install

npx vskill@latest install ensodynamics/enso-method/test-hardening

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as ensodynamics/enso-method/test-hardening.

Test Hardening

The third step of the standard implementation chain: implement (implement-from-requirements or implement-from-discovery) → deliverable-review → `test-hardening`.

Deliverable review re-checks the work that was produced. This skill turns to the tests themselves and asks a different question: if this suite passes, do we actually have credible evidence that the acceptance criteria hold? Then it closes whatever gap it finds.

This is an action skill, not an audit. It does not produce a coverage report or a graded findings document as its deliverable — the assessment happens internally, and the output is a stronger test suite. Meaningful improvement beats exhaustive analysis: a session that converts two mock-reliant tests to real integration tests and adds one missing acceptance-criterion test has succeeded, even if it didn't touch everything.


When to Use

  • Automatically, as the final step of implement-from-requirements or implement-from-discovery (after deliverable review completes)
  • Manually, after any implementation session, when the user says "harden the tests," "are the tests good?", or "button this up for commit"
  • Standalone against a recently implemented feature or phase whose tests were never hardened

Do NOT use this skill for:

  • A whole-repo test audit divorced from a specific piece of implemented work — this skill anchors on the requirements of the work just done, not on generic coverage metrics
  • An independent audit of a finished phase's or PRD's test evidence, with a written grade for every criterion — that is test-audit
  • A substitute for running tests during implementation — the implement skills own that; this is a second, deliberate pass after review

Invocation Context: The Same Chat, Not a Fresh One

The expected path is the same chat that just did the implementation. The implement skills auto-run this pass right after deliverable review, and there is no reason to start over. The fresh-eyes requirement is already satisfied without a new chat: Step 2 delegates the assessment to a sub-agent that reads the requirements, code, and tests from disk with no conversation history. A fresh chat buys nothing the sub-agent doesn't already provide.

It also costs something real. The main agent's accumulated context is what carries the scope boundary — which acceptance criteria were in scope for this phase rather than the whole PRD, what deliverable review already changed, and what was already dismissed as immaterial. A fresh chat has to reconstruct all of that, and reconstructing it wrong is precisely the scope-creep failure this skill exists to prevent.

If the pass does start in a fresh chat, it needs two inputs before any hardening begins — and they carry different bars:

  1. The requirements — provided by the user, never inferred. This is a hard gate. The phase doc or PRD whose acceptance criteria bound the pass (for discovery-driven work, a one-line statement of what the fix was meant to do). If the user hasn't pointed at it, stop and ask — do not start the assessment without it, and never reconstruct acceptance criteria from the diff. Deriving "what the tests should prove" from "what the code does" is circular: it blesses whatever was built, and it dissolves the scope boundary this skill depends on.
  2. The changeset — resolved from any reasonable pointer. If the work is uncommitted (the usual case), git status / git diff finds it exactly as it would in-session, no pointer needed. If it was committed, an explicit SHA or range is ideal but not required: "the last commit," "what I committed this morning," "the phase-3 commit" are all enough — resolve the pointer with git log, then confirm the resolved commit's files and message actually match the described work before proceeding. Ask only when resolution genuinely fails: several candidate commits fit, or the one found doesn't look like the work described. Being pointed in the right direction is enough; guessing without a pointer, or proceeding unsure you found the right commit, is not.

A workable fresh-chat invocation: "Run test-hardening on `<path to the phase doc or PRD>` — the implementation is in the last commit."

One caveat grows with distance from the implementation. Step 4's triage of a failing test into "regression this work caused" versus "pre-existing debt" assumes the suite's starting state is known. Hardening a commit from days ago, with unrelated work landed in between, makes that call unreliable. Establish the baseline explicitly in that situation — run the suite before changing anything, or check the parent commit — rather than assuming a failure is pre-existing.


The Scope Boundary: Acceptance Criteria Are the Whole Test Universe

This is the rule that keeps the skill from going off the rails, so it comes before everything else.

Every test this pass adds or strengthens must trace to an in-scope acceptance criterion of the phase/PRD being hardened (or, for discovery-driven work, the stated intent of the fix). The acceptance criteria define what "good tests" means here — nothing else does.

The failure mode this prevents is specific and expensive. Hardening looks closely at code, and looking closely surfaces discoveries: adjacent behavior with no tests, pre-existing oddities, edge cases nobody asked about. Writing a test for any of these is scope creep twice over — the test itself is unrequested work, and when it fails it demands fixes to code this session never touched. That chain (found a thing → wrote a test for it → now fixing the thing to make the test pass → which surfaces more things) is the off-the-rails loop this boundary exists to prevent.

How the boundary applies in practice:

  • The assessment may look broadly; the action may not. The sub-agent examines all tests covering this session's work, but every fix the main agent makes must trace to an in-scope criterion. A discovery that doesn't is an observation, and the default disposition for an observation is dismiss — silently, no wrap-up mention (this is the Materiality Gate; implementation-lifecycle has the full treatment, but the rule stands on its own here).
  • "Edge case" means an edge case *of a criterion*. Boundary conditions and error paths of required behavior are in scope. An edge case of behavior no criterion requires is a new requirement being invented mid-hardening — out.
  • Full-suite failures get triaged by cause, not adopted wholesale. A test your change broke is a regression — material, fix it. A test that was already failing before this session's work is pre-existing debt — out of scope; mention it in one line so the user knows the suite wasn't fully green when you arrived, and move on. Never "fix" it here, and never write new tests around it.
  • One exception, and only one. A genuinely critical finding, as implementation-lifecycle defines it ("The Critical Exception": real money moving wrongly, production data lost, production down, a live secret or customer data exposed), is surfaced regardless of scope, as that section says. The boundary is for the immaterial; it is never a reason to unsee something dangerous.

What "Hardening" Means (and What It Doesn't)

Hardening raises the quality of evidence, never the test count for its own sake. The philosophy, stated in full so this skill stands alone:

  • Prove risks, not test counts. The goal is the smallest test portfolio that gives credible evidence the acceptance criteria hold — not one test per criterion, not a test per function, not a coverage number. One well-chosen integration or workflow test may prove several criteria at once; a high-risk criterion may need tests at more than one level.
  • An acceptance criterion with no verifying test is a gap. Add the smallest test that credibly proves it.
  • A test that passes without proving anything is weak. Asserting "didn't crash" or "not null" when the requirement specifies concrete behavior is the most common form. Weak tests get strengthened to assert the actual expected values.
  • Mocks are lies that make tests pass. A mock proves your code handles the response you wrote, not the response the real system returns — auth, field names, response shape, all unverified. If the risk under test is the external interaction (the API contract, the query, the serialization), a mock there proves nothing: convert it to the real resource in a sandbox/dev environment, within the environment rules below.
  • Mocks keep a narrow, legitimate place: destructive operations you can't safely perform, expensive or rate-limited third-party APIs where every run costs money, and simulated failure conditions (timeouts, 500s) you can't reliably trigger for real. Even then, keep the mock at the smallest boundary needed and never treat mock-only coverage as proof an integration works — note the limitation in the test.
  • Integration tests carry more weight than unit tests here. Unit tests earn their place for isolated deterministic logic — calculations, transformations, parsing. The hardening pass leans toward tests that exercise real systems, because that's where unearned confidence hides.
  • Never add a ceremonial test. Before adding any test, name the failure it would catch, the criterion it traces to, and why no existing test already catches it. If you can't do all three, don't add it.
  • Never weaken an assertion to get green. If hardening surfaces a failure, that's the skill working — root-cause it (see Step 4).

Process

Step 1: Establish the Requirements Baseline

Anchor the pass on what the session was supposed to deliver:

  1. Identify the governing requirements — the phase doc's acceptance criteria, the PRD's acceptance criteria, or (for discovery-driven work) the stated intent of the fix. This list is the scope boundary for everything that follows. Leave out any criterion with a Superseded by: line; one with Superseded in part by: is in scope for the part still in force (prd-writing-standards, "When Later Work Changes an Earlier Criterion").
  2. Run git diff --stat / git status to see what code changed this session.
  3. Identify the test suite, how it runs, and which tests relate to the changed code.

If invoked standalone and the user has not pointed at the requirements, stop and ask (the hard gate under "Invocation Context: The Same Chat, Not a Fresh One") — a one-line answer is enough.

Step 2: Fresh-Eyes Test Assessment (sub-agent)

The implementing agent already judged its own tests adequate once — during implementation. That's the bias this step breaks, the same way deliverable-review uses fresh eyes on the deliverable.

Launch a single general-purpose sub-agent with:

  • The acceptance criteria (or stated intent) from Step 1
  • The list of changed files and the relevant test files
  • Instruction to read this skill's SKILL.md — pass the absolute path of the file this skill was loaded from — and follow the Assessment Checklist section
  • Instruction to re-read the requirements, changed code, and tests from disk — not from conversation memory
  • Report findings as a structured list; do NOT fix anything — the main agent hardens after collecting results
Step 3: Prioritized Hardening (main agent)

Present the assessment in one short list ("Assessment: AC-3 has no test evidence, the payments client is mocked in the two checkout tests, four assertions are not-null-only. Hardening now."), then fix in priority order:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
5
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ensodynamics/enso-method/test-hardening/badge)](https://verified-skill.com/skills/ensodynamics/enso-method/test-hardening)

Something wrong with this skill or its page? Tell us.