testing-mastery/SKILL.md
Unified testing skill — TDD workflow, unit/integration patterns, E2E/Playwright strategies. Replaces tdd-workflow + testing-patterns + webapp-testing.
npx skillsauth add tai-ch0802/skills-bundle testing-masteryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write tests that document intent, catch regressions, and run fast. Choose the right strategy for the right situation.
Is this a new feature?
├─ YES → Use TDD (see references/tdd-cycle.md)
│ Write failing test → Minimal code → Refactor
└─ NO
├─ Is this a bug fix?
│ └─ YES → Write regression test first, then fix
├─ Is this a critical user flow (login, checkout)?
│ └─ YES → E2E test (see references/e2e-playwright.md)
└─ Is this business logic / data transformation?
└─ YES → Unit + Integration tests (see references/unit-integration.md)
/\ E2E (Few, ~10%)
/ \ Critical user flows only
/----\
/ \ Integration (Some, ~20%)
/--------\ API, DB, service contracts
/ \
/------------\ Unit (Many, ~70%)
Functions, classes, utilities
| Principle | Rule | |-----------|------| | AAA | Arrange → Act → Assert | | Fast | Unit < 100ms, Integration < 1s | | Isolated | No test depends on another | | Behavior | Test WHAT, not HOW | | Minimal | One assertion per test (ideally) |
| I need to... | Use | Reference | |--------------|-----|-----------| | Build feature test-first | TDD (RED-GREEN-REFACTOR) | tdd-cycle.md | | Write unit/integration tests | Mocking, data strategies, patterns | unit-integration.md | | Test critical user flows in browser | E2E with Playwright | e2e-playwright.md |
| ❌ Don't | ✅ Do | |----------|-------| | Test implementation details | Test observable behavior | | Write tests after shipping | Write tests before/during | | Duplicate test code | Use factories & fixtures | | Complex test setup | Simplify or split | | Ignore flaky tests | Fix root cause | | Skip cleanup | Reset state in teardown | | Multiple asserts per test | One behavior per test |
| Script | Purpose | Command |
|--------|---------|---------|
| scripts/test_runner.py | Unified test execution | python scripts/test_runner.py <project_path> |
| scripts/playwright_runner.py | Browser E2E testing | python scripts/playwright_runner.py <url> |
| | With screenshot | python scripts/playwright_runner.py <url> --screenshot |
| | Accessibility check | python scripts/playwright_runner.py <url> --a11y |
Remember: The test is the specification. If you can't write a test for it, you don't understand the requirement.
testing
Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
Spec-Driven Development (SDD): A structured workflow (Requirement -> Analysis -> Implementation) enforcing explicit documentation before coding.
development
Methodologies for System Analysis (SA), focusing on technical architecture, data flow modeling, and API design.
tools
Guidelines and techniques for identifying code smells and refactoring code, based on Refactoring.guru principles and adapted for Vanilla JS Chrome Extensions.