/unicorn-team:testingfrom unicorn-team
Guides test-first development and test strategy decisions including TDD, test types (unit/integration/e2e), coverage thresholds, and what to test vs. what not to test.
Ships in unicorn-team. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
# RED
def test_user_full_name():
user = User(first="Jane", last="Doe")
assert user.full_name() == "Jane Doe"
# GREEN
class User:
def __init__(self, first, last):
self.first = first
self.last = last
def full_name(self):
return f"{self.first} {self.last}"
# REFACTOR: tests pass, clean up if needed
See: references/tdd-deep-dive.md for advanced TDD techniques.
DO test (behavior):
DON'T test (implementation):
See: references/test-patterns-by-language.md for language-specific frameworks and idioms.
def test_shopping_cart_total():
# Arrange
cart = ShoppingCart()
cart.add_item(Item("Book", 10.00))
# Act
total = cart.calculate_total()
# Assert
assert total == 10.00
Prefer one assertion per test. Exception: related assertions on the same object.
| Metric | Threshold |
|---|---|
| Line coverage | 80% minimum (CI-enforced) |
| Branch coverage | More important than line coverage |
| Critical paths | 100% |
| Language | Command |
|---|---|
| Python | pytest --cov=myapp --cov-report=html --cov-fail-under=80 |
| JavaScript | jest --coverage --coverageThreshold='{"global":{"lines":80}}' |
| Go | go test -cover -coverprofile=coverage.out && go tool cover -html=coverage.out |
| Rust | cargo tarpaulin --out Html --output-dir coverage |
See: references/coverage-strategies.md for branch coverage, mutation testing, and coverage-driven development.
| Mock | Don't Mock |
|---|---|
| Network calls (APIs, databases) | Internal implementation details |
| Filesystem access | Value objects and data structures |
| Time/randomness dependencies | The code under test |
| Slow or unreliable dependencies | Simple collaborators (prefer real objects) |
| Paid third-party APIs |
| Language | Tool | Verify Call |
|---|---|---|
| Python | unittest.mock.Mock() | assert_called_once() |
| JavaScript | jest.fn() | expect().toHaveBeenCalled() |
| Go | Interfaces + mock structs | Track call state manually |
| Rust | Traits + mock impls | RefCell for interior mutability |
See: references/mocking-strategies.md for comprehensive patterns and anti-patterns.
| Anti-Pattern | Problem | Fix |
|---|---|---|
| Testing implementation | Brittle tests that break on refactor | Test WHAT (outputs/behavior), not HOW (internal calls) |
| Flaky tests | Non-deterministic failures | Inject time deps, isolate state, use wait conditions for async |
| Over-mocking | Tests verify mocks, not behavior | Only mock external boundaries, use real objects internally |
unit/, integration/, e2e/ directoriestest_*.py, *.test.js, *_test.go, tests.rstest_user_login_with_invalid_password_returns_error() not test_case_1()| Task | Python | JavaScript | Go | Rust |
|---|---|---|---|---|
| Run tests | pytest -x | npm test -- --watch | go test ./... | cargo test |
| Coverage | pytest --cov=. --cov-fail-under=80 | jest --coverage | go test -cover | cargo tarpaulin |
references/tdd-deep-dive.md - Advanced TDD techniques and when to break rulesreferences/mocking-strategies.md - Comprehensive mocking patterns and anti-patternsreferences/test-patterns-by-language.md - Language-specific testing patternsreferences/coverage-strategies.md - Advanced coverage techniques and mutation testingWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/code-readingStrategic code comprehension protocol for navigating existing codebases. ALWAYS trigger on "understand this code", "how does this work", "refactor", "before changing", "legacy code", "code review", "what does this do", "explain this codebase", "walk me through", "unfamiliar code", "read through". Use when exploring unfamiliar code, preparing to modify legacy systems, debugging complex issues, or conducting code reviews. Different from pattern-transfer which maps known solutions across domains -- this skill builds accurate mental models of existing code./domain-devopsGuides the user through containerization, CI/CD pipelines, Kubernetes deployments, observability, and infrastructure management. ALWAYS trigger on "dockerize", "CI/CD", "kubernetes", "deploy", "monitoring", "logging", "metrics", "helm", "infrastructure", "observability", "rollback", "scaling", "pipeline", "container", "k8s", "GitOps", "Dockerfile", "health check", "troubleshoot deployment". Use when containerizing applications, building pipelines, deploying services, setting up monitoring, or debugging infrastructure issues. Different from the DevOps agent (agents/devops.md) which handles orchestration and runbook execution rather than pattern guidance./estimationGuides the user through risk-based task estimation using decomposition, three-point estimates, and PERT formula. ALWAYS trigger on "estimate", "how long will this take", "time to complete", "sizing", "scope this", "effort estimate", "how many hours", "story points", "project timeline", "when will this be done", "cost estimate", "level of effort". Use when sizing any work item, feature, or project.npx claudepluginhub aj-geddes/unicorn-team --plugin unicorn-teamOther plugins' skills for the same job