Skip to content
Skills Library
Programming · Testing

test-hardening

/test-hardening

Strengthen tests — strengthen an area's existing tests unit by unit with mutation checks before and after, changing tests only, and recording any real bug found instead of fixing it. Use for /haechi:test-hardening, when the user asks to strengthen or harden the tests of a folder or feature.

Repository
haechi ↗
Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Strengthen tests — strengthen an area's existing tests unit by unit with mutation checks before and after, changing tests only, and recording any real bug found instead of fixing it. Use for /haechi:test-hardening, when the user asks to strengthen or harden the tests of a folder or feature.

Original author description

Strengthen tests — strengthen an area's existing tests unit by unit with mutation checks before and after, changing tests only, and recording any real bug found instead of fixing it. Use for /haechi:test-hardening, when the user asks to strengthen or harden the tests of a folder or feature.

How it works

  1. Task focus
  2. Steps
  3. Extra DONE evidence
  4. Delegation contracts
Original SKILL.md headings · 103 lines, 755 words
SKILL.md preview
---
name: test-hardening
description: Strengthen tests — strengthen an area's existing tests unit by unit with mutation checks before and after, changing tests only, and recording any real bug found instead of fixing it. Use for /haechi:test-hardening, when the user asks to strengthen or harden the tests of a folder or feature.
---

# Strengthen an area’s tests

Apply the [common work contract](../../principles/work-contract.md) within the authorized scope. It owns required implementation, verification, review and completion obligations; this skill supplies methods. Use /haechi:delegate for a bounded worker task when independent execution helps. Existing step names below are compatible delegation entry points, not an exclusive workflow state.

The main session runs these steps. Scope, delegation, authorization and completion requirements are in the session rules. Use /haechi:mutation-check for each unit and a worker with /haechi:attack-tests when separate context or independent challenge helps. Use /haechi:sweep for useful independent units. This file adds only what is specific to hardening an area. Principle files are two levels above this skill's folder (`<this skill's folder>/../../principles/<name>.md`): **behavior-tests** and **sibling-paths** apply.

## Task focus

Establish the area's mutation results, or say "not measured" if unknown. The easy mistake is scope: "harden the tests" with no folder can mean the whole repo. Example: "`src/invoices` not measured; `formatDate.ts` has no test file."

## Steps

1. **Clarify the task.** Establish the area's current mutation results and the intended improvement. Consider /haechi:spec using its description while establishing the scope and success criteria; preserve the tests-only boundary. Only tests change; source code stays unchanged. Show mutation results before and after per unit and passing tests. Fixed labels and tables are optional.
2. **Choose units.** Work directly for a tightly coupled area, or use /haechi:sweep when independent units benefit from separate context. A unit can be a source file plus its tests. Order:
   1. files identified as high risk by repository instructions;
   2. files with many recent bug fixes (`git log --oneline --grep=fix -- <file>`, or the repo's commit convention for fixes);
   3. files without tests;
   4. the rest.
   For the cost preview, estimate mutants per file (the mutation-check limit, default 20) times the unit's test run time.
3. **Harden each unit.** Work directly or give a worker with /haechi:attack-tests this brief when independent challenge is useful:
   - Run mutation-check before changing anything, with a per-file limit and `--lines 1-<last line of the file>`. Without `--lines` it mutates only lines changed against HEAD, which on a committed file is nothing.
   - Judge each surviving mutant: a real gap gets a stronger assertion or a new case; an equivalent mutant (behavior cannot change) gets a one-line reason and is excluded.
   - Touch existing tests in exactly two cases: a mutant survived, or a test is tied to internals and gets rewritten against observable results. Each new test catches a different mutant or path. A file with no tests gets new behavior-based tests.
   - A real bug found: do not fix the source. Record it the repo's way (AGENTS.md; otherwise a skipped test named `BUG: <expected behavior>`). The user decides what happens to it.
   - Run mutation-check again after, with the same `--lines` as before.
4. **Review each unit as it finishes.** Check:
   - tests assert behavior a caller observes, not internal calls;
   - no mocks of the unit's own internals, no render snapshots;
   - time and randomness are fixed;
   - fixtures are synthetic.
   Then commit the completed unit.
5. **Report.** Give the before/after results, equivalent mutants, test changes and bugs found for each unit. An optional table:

   | Unit | Survived before → after | Equivalent | Tests added / changed | Bugs found |
   |---|---|---|---|---|
   | `src/utils/formatDate.ts` | 4 → 1 | 1 | 2 / 1 | — |

## Extra DONE evidence

Mutation results before and after for every unit, the equivalent mutants with their reasons, and the test run passing. No source file in the diff.

## Delegation contracts

These compatible entries identify delegated methods, not an exclusive workflow or a mandatory agent sequence. Packet assembly also supplies the canonical common work contract. The main session fills the named context fields and task-specific acceptance criteria; detailed procedures and principle bodies stay in their referenced files. `read-only` means repository files remain unchanged; authorized temporary or report outputs must be named separately in `artifactPaths`.

```haechi-handoffs
{
  "attack": {
    "skills": [
      "attack-tests",
      "sibling-path-map",
      "mutation-check"
    ],
    "principles": [
      "sibling-paths",
      "behavior-tests"
    ],
    "checks": [],
    "writeScope": "scoped",
    "contextRequired": [
      "repository",
      "requirements",
      "changedFiles",
      "ownership"
    ],
    "completion": [
      "Demonstrate that tests detect the targeted defects without weakening expected behavior."
    ]
  },
  "review": {
    "skills": [
      "verify-work",
      "review-diff",
      "impact-map"
    ],
    "principles": [
      "evidence-levels",
      "behavior-tests"
    ],
    "checks": [
      "agent-defects",
      "sibling-paths",
      "dry",
      "yagni",
      "kiss"
    ],
    "writeScope": "read-only",
    "contextRequired": [
      "repository",
      "requirements",
      "base",
      "changedFiles",
      "priorEvidence"
    ],
    "completion": [
      "Report concrete defects with expected and observed behavior and affected consumers.",
      "Distinguish passing checks, failures, missing proof and unresolved expectations."
    ]
  }
}
```

Versions

The database has no other skills named test-hardening.

Database snapshot: 13.11.2026 · package version b640069e70f0 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95Hardening
    Hardens LifeOS tests via property-based testing with fast-check. USE WHEN harden, hardening, property test, property based testing, PBT, fast-check, strengthen tests, find bugs example tests miss, universal quantified claim, shrink counterexample, what bugs am I missing, test…
  • 95Hardening
    Hardens LifeOS tests via property/mutation testing. USE WHEN harden, hardening, property test, property based testing, PBT, fast-check, mutation test, mutation testing, Stryker, CRAP score, CRAP analysis, DRY scan, jscpd, acceptance test mutation, strengthen tests, sharpen ISCs,…
  • 100strengthen
    Evaluate how well a feature's tests defend its code — check report freshness first, hand the human the exact coverage and mutation commands when reports are stale or missing, then read the per-criterion oracle-strength heatmap and route every surviving mutant to a killing test…
  • 100test-unit
    Write unit and integration tests for a named module or change. Use when "write unit tests" or "add tests for this function". Coverage plan → plan-test-coverage. Mutation score → test-mutation. Browser check → test-playwright.
  • 91mutation-check
    Use when asked to strengthen tests or check their ability to detect defects, or when a specific concern suggests an incorrect implementation could still pass. Introduces small deliberate defects in relevant code and checks which ones the tests detect. Writing a test alone does…
  • 100unit-testing
    Writes and updates unit tests for new or changed code in the project's existing framework and style, covering happy, error and boundary paths, then runs them with coverage and fixes failures. Use when implementing a feature or bug fix that needs tests, when asked to add or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.