Hardening
できること
このスキルは、例のテストの背後にある一般的なルールを、多数の生成された入力に対して確認することで、ソフトウェアのテストを鋭くします。例のテストが見逃すバグを見つけたい開発者向けです。
使う場面
- ✓テストは通っているが、エッジケースを見逃している疑いがあるとき。
- ✓関数の一般的なルールを、多数のランダムな入力で確認したいとき。
- ✓失敗したケースを、そのバグを再現する最小の例に縮めたいとき。
スキルのリンク
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/Hardening/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“日付の解析テストは通っていますが、エッジケースを見逃していると思います。プロパティテストで強化してもらえますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、例のテストの背後にある一般的な主張を明示し、それを多数の生成された入力に対して実行します。失敗があれば、その失敗を、まだ壊れる最小の入力に縮めます。その後、バグかプロパティを修正します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Hardening Skill
Hardening sharpens tests that already exist without adding new functionality: it turns the universal claim behind a set of example tests into a fast-check property, runs it across generated inputs, and shrinks any failure to the minimal counterexample.
One intent ships. Mutation testing, complexity scoring, duplication scanning, and acceptance-test mutation were once listed here as planned; none is built, and this file no longer advertises them (external review of the v7.40.4 payload, 2026-09-03: a routing table that promises unbuilt intents is the "confidently documented, never existed" class).
Ideal State
- Every property written states the universal claim behind existing example tests, runs across generated inputs drawn from the function's real input domain, and keeps the examples it sharpens.
- Every failure ends shrunk to a minimal counterexample with its seed, and ends in either a fixed bug or a corrected property.
- What hardening lands is recorded where the system reads it: a
bun-propertyrow in the ISA's Test Strategy, and a C/R/L Learning entry when a counterexample taught something. - Functions that cannot carry a universal claim (impure, or no candidate shape) are left to example tests rather than forced into a property.
Intent Routing
| Intent | Trigger | File |
|---|---|---|
| PropertyTest | property test, property based testing, PBT, fast-check, universal quantified claim, shrink counterexample — pure functions, parsers, serializers, data transforms, invariants | Intents/PropertyTest.md |
Integration Points
- Testing Doctrine Rule #12 — names fast-check as the property-testing primitive (
LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md). - ISA format — the
bun-propertyISC type withproperty | generator | runscolumns (LIFEOS/DOCUMENTATION/ISA/ISAFormat.md§ ISC Type Vocabulary). Abun-propertyrow is a first-class assert: it counts toward every-ISC-an-assert coverage (H8) andbunker testruns it like any deterministic row. - Algorithm — hardening is elected during verification when a run's criteria warrant property depth; spend is discovered from the work.
- System prompt — Verification Is the Mechanism section at top (
LIFEOS/LIFEOS_SYSTEM_PROMPT.md).The Bunker CLI is maintainer-private and not in the public release; run code rows with
bun test ./<path>and suite rows withbun skills/Assay/Tools/EvalRunner.ts.
Gotchas
No skill-wide gotchas; the fast-check ones live in Intents/PropertyTest.md § Gotchas.
Examples
- "Property-test the slug parser" → PropertyTest → round-trip and idempotence properties in a
.property.test.tsfile at 1000 runs, abun-propertyrow in the ISA, and any failure shrunk with its seed pinned. - "What bugs are my example tests missing?" → PropertyTest → the pure functions (parsers, serializers, transforms) that have only example coverage, listed as property-test candidates.
よくある質問
例のテストを置き換えますか?
いいえ。鋭くした例のテストは残し、プロパティテストを並べて追加します。
どの関数をこの方法でテストできますか?
明確な一般的なルールを持つ関数です。不純な関数や、明確な入力の形がない関数は、例のテストに任されます。
どのツールを使いますか?
高速なプロパティベーステストのライブラリである fast-check を使います。
詳細
作者による元の説明
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 the tests. NOT FOR new feature tests (bun test directly), grading agent output (Assay), UI verification (Interceptor), finding security vulnerabilities, or building new functionality.
repo: danielmiessler/LifeOS
人気
- GitHubのスター
- 20k
- ランキング
- #10430
- ライセンス
- MIT
- 更新日
- 2026/10/28
コメント
- …
このリポジトリの他のスキル
LifeOS
20kインタビューとダッシュボードを通じて、現在の状態を理想の状態へ結びつける個人システム LifeOS を、エージェントが設定するのを支援します。
AnnualReports
20k主要ベンダーのサイバーセキュリティの年次レポートを探して比較し、侵害やランサムウェアの傾向などをまとめます。すべての数字に出典を付けます。
ApertureOscillation
20k一つの設計上の問いを、狭い範囲と広い範囲の両方でテストし、構築する前に二つの答えが食い違う箇所を指摘するよう、エージェントに教えます。
Aphorisms
20k新聞の編集テーマに合う、出典の確かな引用を、キュレーションされたコレクションから見つけ、照合し、最近使ったものを避けて管理するよう、エージェントを支援します。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。