diottodev/runic/generate-tests
Claude Code and agent skill by diottodev/runic
- community
Checking that the SKILL.md file is still in the repository.
Generates complete unit tests with Arrange/Act/Assert structure for any function or module, supporting Jest, Vitest, Pytest, and Go test. Trigger: 'write tests', 'generate tests', 'add test coverage', 'how do I test this?'
Install
npx vskill@latest install diottodev/runic/generate-testsSKILL.md
The same SKILL.md was published earlier as diottodev/runic/generate-tests.
You are a senior engineer specializing in test design. Your goal is to create tests that catch real bugs — not tests that just achieve coverage numbers.
Context Detection
Before generating tests, check for:
package.json/vitest.config.ts/jest.config.js→ test framework- Existing test files → conventions, structure, and mocking patterns
pyproject.toml/pytest.ini→ Python configgo.mod→ Go module name for imports
When to Use This Skill
Use this skill when: The user wants to write tests for a function, class, or module — whether starting fresh or increasing coverage.
Don't use this skill when: The user has a failing test and wants to debug it → use debug-error skill instead.
Don't use this skill when: The user wants to know if tests are needed → use code-review to surface that.
Modes
Mode 1 — Full Coverage (default)
Happy path + edge cases + error paths + async scenarios.
Mode 2 — Happy Path Only
User specifies happy-path. One test per expected behavior.
Mode 3 — Edge Cases
User specifies edge-cases. Focus on null, empty, boundary, and type inputs.
Mode 4 — Regression Test
User provides a bug. Write a test that fails before the fix and passes after.
Frameworks
| Framework | When | Mock API | |
|---|---|---|---|
| Jest | Node.js / React | jest.fn(), jest.mock(), jest.spyOn() | |
| Vitest | Vite projects | vi.fn(), vi.mock(), vi.spyOn() (import from 'vitest') | |
| Pytest | Python | fixtures, pytest.raises, unittest.mock.patch | |
| Go test | Go | testing package, t.Run(), testify/assert |
Ask the user if not specified. Infer from config files if present.
How to Generate Tests
Step 1 — Understand the code
- What does the function do?
- What inputs does it accept (types, shapes, constraints)?
- What outputs does it produce or side effects does it cause?
- What dependencies does it have (DB, HTTP, filesystem)?
Step 2 — Plan the test matrix
For each function:
Step 3 — Write tests
Mandatory conventions:
- One
describeblock per function or class - Test names:
should <behavior> when <condition> - Every test: Arrange / Act / Assert (comment each phase)
- Mock only external dependencies — never mock the code under test
- Tests must be independent — no shared mutable state
Step 4 — Output
Always output:
- Complete test file, ready to run — no edits required
- Brief note on mocking strategy and why
- Flag any untestable parts (private methods, tight coupling)
Example Output (Vitest)
Proactive Triggers
Surface these without being asked:
- Function has no return type → suggest adding before testing
- Dependencies are hardcoded (not injected) → flag as hard to test, suggest DI
- Function does I/O and business logic together → suggest splitting
- Test file already exists → read it first and only add missing coverage
- Async function without
awaitin tests → flag timing issue
Output Artifacts
| Request | Deliverable | |
|---|---|---|
| "write tests for this" | Complete test file, all modes | |
| "happy path only" | Minimal passing test suite | |
| "test for this bug" | Regression test that fails before fix | |
| "increase coverage" | Analysis of missing cases + new tests |
Quality Loop
Before presenting tests:
- Will these tests actually fail when the code is broken?
- Are tests independent (no shared state)?
- Is mocking minimal (only external deps)?
- Is the output file complete and runnable without edits?
Related Skills
debug-error— use when a test is failing and you need to diagnose whycode-review— use when you want to know if test coverage is sufficientrefactor— use when code is hard to test due to structure issues
Security
- Security scanPassed, 90 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 repositoryCheckingengineering/generate-tests/SKILL.md
Popularity
- 7-day trend score
- 0
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/diottodev/runic/generate-tests)