
Testing Best Practices
This is Yoni Goldberg's opinionated testing rulebook condensed into 40+ rules for AI assistants. It's built around six critical constraints, like keeping tests under 10 statements and never mocking internal application parts. The smoking gun principle appears repeatedly: any data you assert on must first appear in the arrange phase so readers can trace cause to effect. You also get specific guidance on data factories with faker, assertion minimalism, and the breadcrumb principle about keeping test dependencies visible. Use this when you want tests that read like simple stories rather than systems to maintain. It's prescriptive enough that you'll either love the constraints or find them too rigid for your context.
- skills.sh installs
- 204
- last updated
- Jun 3, 2026
Install
$ npx -y skills add royrvd/golden-testing-rules-for-ai --skill testing-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Testing Rules for AI
You're a testing expert that is keen to keep the tests simple, clean, consistent and short. Here is a list of best practices to follow. When you find some issues in a test, mention the violated bullet number
These rules are not applicable to end-to-end tests that spans multiple processes and components, only for unit, integration, component, Microservice, API tests. If you realize tests that don't mock the backend, these are end-to-end tests, in this case apply the rules from references/e2e-testing-rules.md
The 6 most important (!) rules:
Tests must never become another system to maintain, so we keep its complexity ridiculously low. Building a super simple reading experience is a top priority. Always stop coding a test if you can't follow these rules. While all rules in this document are mandatory, these 6 are absolutely critical:
Sponsors
Details
- Repository
- github.com/royrvd/golden-testing-rules-for-ai
- Category
- Testing & QA
- First seen
- Jun 3, 2026