Testing Best Practices
CheckedHelps with testing, best practices as part of testing, debugging, and quality assurance workflows.
Install on your platform
Showing Claude Code. One command installs this skill into any of the agents below.
- 1
Run this in your project
terminal$ npx skills add asyrafhussin/agent-skills --skill testing-best-practices -a claude-code Uses the open-source
skillsCLI and needs Node.js. Add-gto install it for your user instead of this project.
What we know about this skill
Publisher
asyrafhussin
Taken from the source listing. We haven't verified who controls this account.
Install target
Live repository
Not pinned. Installing fetches whatever the repository holds at the time you run the command.
Automated safety checks
This skill passed all 6 checks. We read its files at one commit and looked for the things that make a skill dangerous to run — not for whether it works.
Declares what it does: passed
SKILL.md parses and declares a name and a description.
SKILL.md exists, its frontmatter parses, and it declares a name and a description.
No undeclared network calls: passed
Only contacts known or declared hosts: github.com.
Every host the skill dials — from its scripts, its config endpoints or the commands it tells the agent to run — is either well-known package and API infrastructure or declared in its own frontmatter. Links in documentation are not counted.
Hosts contacted
github.comsource hostNo obfuscated payloads: passed
No encoded or obfuscated payloads.
No base64, hex or compressed blob is decoded and then executed, and no encoded shell commands.
No credential access: passed
Reads no keys, tokens, keychains or credential files.
Neither the code nor the SKILL.md instructions read SSH keys, cloud credentials, keychains, token stores, browser cookie databases or dotfiles that hold secrets.
No pipe-to-shell installers: passed
No pipe-to-shell or download-and-run installers.
No `curl … | sh` pattern, in the code or in the instructions, that runs code fetched at run time.
Pinned to a commit: passed
Scanned asyrafhussin/agent-skills at 1aa0ff717c.
The exact upstream commit SHA that was scanned is recorded, so the result refers to specific bytes.
- Commit
- 1aa0ff717c
- Scanned
- 40 files, 9,805 lines
About this skill
What it does
This skill provides a comprehensive guide to testing best practices, focusing on unit and integration testing using TypeScript with Jest/Vitest. It offers 34 rules across seven categories designed to help developers write reliable, maintainable test suites. The skill assists in improving code quality by providing guidelines for structuring tests, ensuring isolation, crafting assertions, managing test data, utilizing mocking effectively, achieving meaningful coverage, and optimizing performance.
When to use it
- When writing new unit or integration tests.
- During code reviews to assess the quality of existing test code.
- To improve overall test coverage strategy.
- When setting up a testing infrastructure.
- For debugging flaky or slow tests.
- To ensure tests run independently and reliably.
Key capabilities
- Rule-Based Guidance: Provides 34 specific rules categorized by priority (Critical, High, Medium, Low).
- Test Structure Best Practices: Covers principles like the Arrange, Act, Assert (AAA) pattern, descriptive test names, and proper setup/teardown.
- Isolation Focus: Emphasizes independent tests with no shared state and deterministic results.
- Assertion Guidelines: Promotes specific assertions, meaningful error messages, and avoiding "magic numbers."
- Test Data Management: Includes techniques like factories, builders, and using realistic fake data.
- Mocking Strategies: Offers guidance on strategic mocking and verifying interactions.
- Coverage Optimization: Focuses on achieving meaningful coverage of edge cases and error scenarios rather than striving for 100% coverage.
Example prompts
- "Show me the rules related to test structure."
- "What are some best practices for isolating my tests?"
- "Give me an example of how to use a data factory in my testing workflow."
- “How can I improve the performance of my unit tests?”
Tips & gotchas
- The skill is primarily geared towards TypeScript projects using Jest/Vitest.
- Focus on understanding and applying the "Critical" priority rules first, as these have the most significant impact on test reliability.
- Remember that 100% code coverage isn't always a worthwhile goal; focus on covering meaningful scenarios and edge cases instead.