Hardening
ما الذي تفعله
تُحسّن هذه المهارة الاختبارات البرمجية بفحص القاعدة العامة خلف الاختبارات بالأمثلة عبر مدخلات كثيرة مولّدة. وهي موجهة للمطورين الذين يريدون اكتشاف أخطاء تفوتها الأمثلة.
متى تستخدمها
- ✓عندما تنجح اختباراتك لكنك تشك في أنها تغفل حالات طرفية.
- ✓عندما تريد فحص قاعدة دالة عبر مدخلات عشوائية كثيرة.
- ✓عندما يجب تقليص حالة فاشلة إلى أصغر مثال يكسرها.
رابط المهارة
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/Hardening/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“اختبارات تحليل التاريخ عندنا تنجح، لكنني أظن أنها تغفل حالات. هل تقويها باختبارات خصائص؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تصرّح المهارة بالادعاء العام الذي تقوم عليه اختباراتك بالأمثلة، وتشغّله على مدخلات كثيرة مولّدة. إذا فشل شيء، تُقلَّص الحالة إلى أصغر مدخل ما زال يكسرها، ثم يُصلح الخطأ أو الخاصية.
المحتوى التقني (ملف 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
- آخر تحديث
- 28/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
LifeOS
20kيساعد وكيلك على إعداد LifeOS، وهو نظام شخصي يربط حالتك الحالية بحالتك المثالية عبر مقابلة ولوحة متابعة.
AnnualReports
20kيساعد وكيلك على إيجاد التقارير السنوية للأمن السيبراني من كبار المزودين ومقارنتها، مثل اتجاهات الاختراقات وبرامج الفدية، مع مصدر لكل رقم.
ApertureOscillation
20kيعلّم وكيلك اختبار سؤال تصميم واحد على نطاق ضيق ونطاق واسع، ثم تسمية النقاط التي تتعارض فيها الإجابتان قبل البناء.
Aphorisms
20kيساعد وكيلك على إيجاد الاقتباسات المنسوبة إلى أصحابها من مجموعة منتقاة ومطابقتها وتتبعها، مع تجنّب ما استُخدم منها مؤخراً في نشرتك.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.