property-test
Skill1 starsChanged 2 months agoMITView on GitHub
ランダム入力で不変条件を検証するとき、「プロパティテストして」「hypothesisでテストして」と言われたときに必ず使う。
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Jinbae10/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- architecture-checkSkill
- brainstormSkill
- branch-namingSkill
- codex-delegateSkill
- config-explainSkill
- config-setSkill
- cross-reviewSkill
- design-interviewSkill
- diagnosing-bugsSkill
- fix-ciSkill
- handoffSkill
- leakage-checkSkill
- literature-reviewSkill
- mlflow-logSkill
- multi-seedSkill
- mutation-testSkill
- paper-writingSkill
- pre-mortemSkill
- python-standardsSkill
- refactor-scoutSkill
- regression-suiteSkill
- retrospectiveSkill
- security-reviewSkill
- spec-checklistSkill
- tddSkill
The file
Files
プロパティベーステスト
tdd(1つの振る舞いを具体的な入力でテストする)とは異なり、 ランダムに生成した大量の入力で「常に成り立つべき性質(不変条件)」を検証する。 入力の組み合わせが多い前処理・データ変換・バッグ処理に特に有効。
いつ使うか
- 入力の型やshapeのバリエーションが多い関数(前処理、正規化、データ変換)
- 往復の正しさが求められる処理(encode→decode、serialize→deserialize)
- 冪等性が期待される処理(2回適用しても結果が変わらないべき操作)
- tdd の具体的な入力値だけでは見逃す境界値バグを探したいとき
進め方
- 作業スコープ直下に CONTEXT.md があれば先に読む。
- 対象の関数を特定する。
- その関数の「有効な入力」をモデル化する。
- 型: int, float, str, list, ndarray, tensor 等
- 値域: 正の数のみ、0を含むか、NaN/Inf を含むか
- shape: 固定か可変か、空を許すか
- 以下の不変条件から該当するものを選び、テストを書く。
代表的な不変条件
| 不変条件 | 説明 | 例 |
| 往復(roundtrip) | encode→decode で元に戻る | decode(encode(x)) == x |
| 冪等性 | 2回適用しても結果が同じ | f(f(x)) == f(x) |
| 出力の型・shape保存 | 入力と出力の型やshapeが対応する | output.shape[0] == input.shape[0] |
| 単調性 | 入力が増えたら出力も増える(または減らない) | x <= y → f(x) <= f(y) |
| 値域の制約 | 出力が常に有効な範囲に収まる | 0 <= normalize(x) <= 1 |
| ゼロ・空入力 | 空リスト、ゼロ行列、空文字列でクラッシュしない | f([]) → 例外ではなく空の結果 |
テストの書き方(Hypothesis ライブラリ)
from hypothesis import given, strategies as st
@given(st.lists(st.floats(allow_nan=False, allow_infinity=False), min_size=1))
def test_normalize_output_range(values):
result = normalize(values)
assert all(0 <= v <= 1 for v in result)Hypothesis がインストールされていなければ uv add --dev hypothesis で追加する。
テストの保存先
作業スコープ配下の tests/ に保存する(tdd と同じ場所)。
ファイル名は test_property_<対象モジュール名>.py とする。
注意
- tdd スキルとの使い分け: tdd は「この入力→この出力」の具体的な振る舞いを テストする。property-test は「どんな入力でもこの性質が成り立つ」を テストする。両方あるのが理想で、どちらかの代替ではない。
- 生成されたテストが既存のバグを「正解」として固定しないよう注意する。 不変条件が怪しい場合はユーザーに確認する。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

