jeffreytse/grimoire-core/with-stable
Claude Code and agent skill by jeffreytse/grimoire-core
- community
Checking that the SKILL.md file is still in the repository.
Use when implementing any function, method, or module that contains logic — before or immediately after writing the code.
Install
npx vskill@latest install jeffreytse/grimoire-core/with-stableSKILL.md
The same SKILL.md was published earlier as jeffreytse/grimoire-core/with-stable.
Write Unit Test
Verify a single unit of logic in isolation with an automated, repeatable test.
Why This Is Best Practice
Adopted by: Google (mandated in Google Engineering Practices, 2014), Microsoft, Meta, Stripe, Airbnb, and virtually every mature engineering organization. Kent Beck formalized it with TDD in 2002; it has been mainstream for 20+ years without serious challenge. Impact: Unit tests reduce defect escape rate by 40–80% depending on coverage (Capers Jones, Software Engineering Best Practices, 2010). Google reports that code with unit test coverage has 50% fewer production incidents than untested code (Google SRE Book, 2016). Teams practicing TDD deliver 15–35% fewer defects with no significant productivity loss after initial learning (IBM Research, George & Williams 2004). Why best: No other technique catches logic errors earlier or cheaper. Manual testing is not repeatable; integration tests are too slow for rapid iteration; code review misses subtle logic errors. Unit tests are the only practice that makes refactoring safe at speed.
Sources: Kent Beck TDD (2002), Google Engineering Practices, IBM Research George & Williams (2004)
Steps
- Write the test before writing the implementation (RED): define expected inputs and outputs.
- Run the test — it must fail. A test that passes before implementation tests nothing.
- Write the minimum code to make the test pass (GREEN).
- Refactor the implementation while keeping the test green (REFACTOR).
- Repeat for each distinct behavior.
Rules
- Test behavior, not implementation: test what a function does, not how it does it.
- Each test must be independent — no shared mutable state between tests.
- Name tests descriptively:
it('returns null when input is empty')notit('test1'). - Keep tests fast: unit tests must complete in milliseconds, not seconds.
Common Mistakes
- Testing the framework instead of application logic.
- Writing tests that only test the happy path — edge cases and error paths matter.
- Sharing state between tests so that test order affects results.
- Coupling tests to implementation details, causing them to break during refactoring.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingschema/tests/valid/with-stable/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jeffreytse/grimoire-core/with-stable)