Hardening
O que ela faz
Aprimora testes de software ao verificar a regra geral por trás dos testes de exemplo, com muitas entradas geradas. Ela é para desenvolvedores que querem encontrar falhas que os exemplos deixam passar.
Quando usar
- ✓Quando seus testes passam, mas você suspeita que eles deixam de fora casos extremos.
- ✓Quando você quer verificar a regra de uma função com muitas entradas aleatórias.
- ✓Quando um caso que falha precisa ser reduzido ao menor exemplo que ainda quebra o código.
Link da skill
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/Hardening/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Nossos testes de análise de datas passam, mas acho que deixamos casos extremos de fora. Você pode fortalecê-los com testes de propriedade?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill declara a afirmação geral por trás dos seus testes de exemplo e a executa com muitas entradas geradas. Se algo falhar, ela reduz a falha à menor entrada que ainda quebra o código, e então a falha ou a propriedade é corrigida.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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.
Perguntas frequentes
Ela substitui meus testes de exemplo?
Não. Ela mantém os exemplos que fortaleceu e adiciona testes de propriedade ao lado deles.
Quais funções ela consegue testar dessa forma?
Funções com uma regra geral clara. Funções com efeitos colaterais ou sem formato de entrada claro continuam para os testes de exemplo.
Que ferramenta ela usa?
Ela usa o fast-check, uma biblioteca de testes baseados em propriedades.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 20 mil
- Posição no ranking
- #10430
- Licença
- MIT
- Atualizada em
- 28/10/2026
Comentários
- …
Mais skills deste repositório
LifeOS
20 milAjuda seu agente a configurar o LifeOS, um sistema pessoal que leva do seu estado atual ao estado ideal por meio de uma entrevista e de um painel.
AnnualReports
20 milAjuda seu agente a encontrar e comparar relatórios anuais de cibersegurança de grandes fornecedores, como tendências de vazamentos e ransomware, com uma fonte para cada número.
ApertureOscillation
20 milEnsina seu agente a testar uma questão de design em um escopo restrito e em um escopo amplo, e depois apontar onde as duas respostas se chocam antes de construir.
Aphorisms
20 milPermite que seu agente encontre, compare e acompanhe citações atribuídas a autores de uma coleção selecionada, evitando as usadas recentemente na sua newsletter.
Skills parecidas
test-driven-development
311 milEnsina seu agente a escrever primeiro um teste que falha, ver a falha e depois escrever o menor código que passa, antes de criar qualquer funcionalidade ou correção.
verification-before-completion
311 milEnsina seu agente a rodar verificações reais e ler a saída antes de afirmar que uma tarefa, correção ou build está concluído ou passando.
migrate-to-shoehorn
310 milSubstitui conversões de tipo arriscadas nos seus arquivos de teste pela biblioteca shoehorn, para que os testes usem dados parciais e ainda passem na checagem de tipos.