unit-tests
What it does
This skill adds focused unit tests to a codebase, starting with the most important logic. It is for developers who want more confidence when they change code.
When to use it
- ✓When a project has important functions or components with no unit tests.
- ✓When someone wants tests in place before refactoring risky code.
- ✓When a team asks for tests that run in CI and catch regressions early.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/unit-tests/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Our checkout calculation has no tests and I'm afraid to change it. Can you write unit tests for the key logic?”
5 new skills a week. 1 minute to read.
How it works
The agent finds untested functions and writes focused tests that describe expected behavior. It mocks outside services rather than internal modules, so the tests stay reliable.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Write unit tests
Unit tests catch bugs before they reach production, serve as documentation for expected behavior, and give developers confidence to refactor code without breaking functionality.
Quick Reference
- Test business logic, utilities, and edge cases
- Aim for 80%+ coverage on critical paths
- Use descriptive test names that explain behavior
- Mock external dependencies, not internal modules
- Run tests in CI to catch regressions early
Check
Check if this codebase has unit tests with good coverage for critical functionality.
Fix
Write unit tests for untested functions and components to improve code reliability.
Explain
Explain how unit tests catch bugs early and serve as documentation for expected behavior.
Code Review
Review tests, CI workflows, and enforcement points related to Write unit tests. Flag exact gaps where the rule is not automatically verified or where failures do not block regressions.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/testing/unit-tests
FAQ
How much test coverage is enough?
The skill aims for 80 percent or more on critical paths, rather than treating every line as equally important.
Should the tests run automatically?
Yes. The skill recommends running them in CI so regressions are caught early.
What makes a good test name?
A descriptive name that explains the behavior being checked.
Details
Original description by the author
Use when reviewing CI coverage, automated checks, or test strategy related to Write unit tests. Focus on whether the rule is continuously verified, not just documented.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3070
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.