architecting-systems
Guides clean, scalable system architecture during the build phase. Use when designing modules, defining boundaries, structuring…
Writes behavior-focused tests using Testing Trophy model with real dependencies. Use when writing tests, choosing test types, or avoiding anti-patterns like testing mocks.
$ npx -y skills add rileyhilliard/claude-essentials --skill writing-tests --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/writing-testsContext preview
The summary Claude sees to decide when to auto-load this skill.
Writes behavior-focused tests using Testing Trophy model with real dependencies. Use when writing tests, choosing test types, or avoiding anti-patterns like testing mocks.
name: writing-tests description: Writes behavior-focused tests using Testing Trophy model with real dependencies. Use when writing tests, choosing test types, or avoiding anti-patterns like testing mocks.
If the current repo has its own rules/skills covering this topic (check .claude/rules/ and repo CLAUDE.md), those take precedence — apply this skill only where they're silent.
**Core principle:** Test user-observable behavior with real dependencies. Tests should survive refactoring.
> "The more your tests resemble the way your software is used, the more confidence they can give you." — Kent C. Dodds
**Why this matters:** Tests exist to give you confidence. The Testing Trophy prioritizes integration tests because they test real behavior across real modules — giving maximum confidence per test written. Unit tests in isolation often just test mocks, not your actual system.
| Priority | Type | When | | -------- | ----------- | ----------------------------------------------- | | 1st | Integration | Default - multiple units with real dependencies | | 2nd | E2E | Complete user workflows | | 3rd | Unit | Pure functions only (no dependencies) |
**Default: Don't mock. Use real dependencies.**
**Only mock:**
**Never mock:**
**Before mocking, ask:** "What side effects does this have? Does my test need those?" If unsure, run with real implementation first, then add minimal mocking only where needed.
Complete user workflow? → E2E test Pure function (no side effects)? → Unit test Everything else → Integration test
| Context | Assert On | Avoid | | ------- | --------------------- | --------------------------- | | UI | Visible text, roles | CSS classes, internal state | | API | Response body, status | Internal DB state | | Library | Return values | Private methods |
| Pattern | Fix | | ------------------------------- | --------------------------- | | Testing mock calls | Test actual outcome | | Test-only methods in production | Move to test utilities | | `sleep(500)` | Poll for actual condition | | Asserting on internal state | Assert on observable output | | Incomplete mocks | Mirror real API completely |
Wait for the actual condition, not a guess about how long it takes.
// Bad: arbitrary delay await new Promise(r => setTimeout(r, 2000)); expect(element).toBeVisible(); // Good: poll for condition await waitFor(() => expect(element).toBeVisible());
**Prefer framework built-ins:**
**Language-specific waiting patterns:**
---
**Remember:** Behavior over implementation. Real over mocked. Outputs over internals.
A unified development plugin for Claude Code with essential skills and specialized agents, all accessible under the ce namespace.
Guides clean, scalable system architecture during the build phase. Use when designing modules, defining boundaries, structuring…
Enforces precise, minimal design for dashboards and admin interfaces. Use when building SaaS UIs, data-heavy interfaces, or any…
Executes implementation plans directly with a verification gate and conditional code review. Use when carrying out a written plan…
Diagnose and fix tests that pass in isolation but fail when run concurrently. Covers shared state isolation, resource conflicts,…
Prevents silent failures and context loss in error handling. Use when writing try-catch blocks, designing error propagation,…
Guides database architecture for PostgreSQL, DuckDB, Parquet, PGVector, and Neo4j. Use when designing schemas, choosing storage…