Hardening

Strengthens existing tests and claims using property-based testing and mutation analysis.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/ruban-s/DevOS --skill hardening-ruban-s
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Hardening
Source: https://github.com/ruban-s/DevOS/tree/main/skills/Hardening
Command: npx skills add https://github.com/ruban-s/DevOS --skill hardening-ruban-s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? A green test suite only proves what the author thought to check; bugs survive in unsampled inputs and claims that constrain nothing. This Skill attacks existing tests and claims with property-based testing and planned mutation, complexity, and duplication analysis so weaknesses surface as minimal, reproducible counterexamples instead of production failures. ## Core Features & Use Cases - Property-Based Testing: Identifies pure functions, parsers, serializers, and transforms as candidates, names universal properties across ten categories (round-trip, idempotency, commutativity, and more), and implements them with fast-check. - Counterexample Shrinking: Captures fast-check's shrunk minimal failing inputs with pinned seeds and converts them into regression example tests. - Test Strategy Integration: Lands properties as bun-property rows in the ISA Test Strategy table, complementing example-based bun-test rows. - Use Case: Ask to property-test a slug parser, and the Skill writes round-trip and idempotence properties with 1000 runs, pins the seed on failure, and records the resulting ISC rows. ## Quick Start Ask the agent to property-test the slug parser and add the resulting properties as bun-property rows in the test strategy.

Frequently Asked Questions about Hardening

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write property-based tests with fast-check?▼

Property-based tests with fast-check use fc.assert with fc.property, combining generators like fc.record or fc.string with a predicate. Set numRuns to 1000 by default, and pin the seed in a comment when a failure shrinks to a counterexample.

What functions are good candidates for property-based testing?▼

Pure deterministic functions are the candidates: parser and serializer pairs for round-trip properties, normalizers for idempotency, multi-argument functions for commutativity, and state machines for invariant preservation. Side-effecting code must be mocked or have its pure core extracted first.

Does this skill support mutation testing with Stryker?▼

Mutation testing is currently a stub workflow, so kill-rate numbers cannot be promised yet. Only the PropertyTest workflow is built and ready; CrapAnalysis, DryAnalysis, and AcceptanceTestMutation are also planned stubs.

Why do property-based tests produce spurious failures?▼

Spurious failures come from under-constrained generators producing inputs the function never promised to accept, while over-constrained generators hide real bugs. Constrain generators exactly to the function's actual valid input domain.

When should I not use property-based testing?▼

Skip property testing for non-deterministic functions involving disk, network, or clock unless side effects are mocked. It is also not for writing new feature tests, grading agent output quality, UI verification, or finding security vulnerabilities.