{"slug": "i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit", "title": "I writes code fast, so I use skills to build the gates that catch the bugs unit tests miss", "summary": "A developer building the micro-signal runtime and protocol adapters for @wcomp/elementum used a portable skill pack to run a formal-verification pass after the project's 200+ unit tests passed at over 95% line coverage. The generated zero-dependency Node script (tools/verify-formal-invariants.js, run via npm run verify:formal) checks 6,162 states and graph topologies in under a second and immediately surfaced two real bugs that example-based tests had missed, each fixed in under 20 minutes. The developer recommends wiring the verifier into CI alongside npm test for modules where ordering, concurrency or untrusted input can silently corrupt state.", "body_md": "When a coding agent can generate a new component or reactive helper in 20 seconds, writing code is no longer the bottleneck. The bottleneck is proving that the code holds up under cases nobody thought to write an example test for.\n\nWhen I built the micro-signal runtime and protocol adapters for `@wcomp/elementum`, all 200+ unit tests were green and line coverage sat above 95%. Every happy path passed. Every regression test I wrote passed.\n\nThen I asked a harder question: what happens when two signals update inside a `batch()` across an arbitrary dependency graph, or when one subscriber throws halfway through a flush, or when an async fetcher reads its own state?\n\nNo example-based unit test answered those questions.\n\nInstead of asking a chat window to \"write more tests\" and hoping for the best, I installed my portable skill pack (`npx skills add pinguxx/skills --global`) and ran four skills in order:\n\n`spec`:` plan`:` implement-plan`:` formal-verification`:\nYou do not need formal methods for a button or a CSS layout. You run `formal-verification` on the modules where ordering, concurrency, or untrusted input can corrupt state silently.\n\nRunning `formal-verification` against `@wcomp/elementum` produced a zero-dependency Node script (`tools/verify-formal-invariants.js`, run with `npm run verify:formal`) that checks 6,162 states and graph topologies in under one second:\n\n`computed()` updates`batch()` fault isolation when one subscriber throws`AsyncSignal` out-of-order race monotonicity and self-subscription freedom`<el-toaster>` active-deck exclusivity`runId` and JSON Patch path allowlist isolation\nRemember that the unit test suite was already green at 95%+ line coverage. The very first run of `npm run verify:formal` failed immediately on two real bugs:\n\nNeither bug appeared in normal usage. Both took less than 20 minutes to fix once the verifier printed the exact failing state.\n\nInstall the skill pack once globally:\n\n```\nnpx skills add pinguxx/skills --global\n```\n\nPick the one module in your repository that would hurt most if it failed silently, and invoke `formal-verification` on it. Wire the generated script into CI next to `npm test`.\n\nAs code generation gets cheaper, your highest-impact work shifts from typing implementations to defining invariants and running the skills that turn them into permanent CI gates.\n\n`npm run verify:formal`):", "url": "https://wpnews.pro/news/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit", "canonical_source": "https://dev.to/pinguxx/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit-tests-miss-1eog", "published_at": "2026-12-01 13:41:00+00:00", "updated_at": "2026-12-01 13:44:07.146650+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["@wcomp/elementum", "pinguxx/skills", "npm"], "also_reported_by": [], "takeaway": "A formal-verification script checking 6,162 states and graph topologies in under a second caught two real bugs that a 200+ test suite at 95%+ line coverage missed, so run invariant checks in CI on modules where ordering or concurrency can silently corrupt state.", "recommendation": {"advice": "Pick the module that would hurt most if it failed silently and wire a generated formal-invariant verifier into CI next to your unit tests.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit", "markdown": "https://wpnews.pro/news/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit.md", "text": "https://wpnews.pro/news/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit.txt", "jsonld": "https://wpnews.pro/news/i-writes-code-fast-so-i-use-skills-to-build-the-gates-that-catch-the-bugs-unit.jsonld"}}