five
Apply the Five Whys root cause analysis technique to investigate an issue
LLM unit testing best practices checklist for testing internal logic, not API endpoints
$ npx -y skills add wesammustafa/Claude-Code-Everything-You-Need-to-Know --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/testContext preview
What this command does when you run it.
LLM unit testing best practices checklist for testing internal logic, not API endpoints
name: test description: LLM unit testing best practices checklist for testing internal logic, not API endpoints
_Focused on testing internal logic, not API endpoints_
---
Do not infer from names. Derive intent from behavior and direct usage.
Cover expected, edge, malformed, and unexpected scenarios.
Target the logic layer (e.g., services, classes, helpers)—**not** API routes or request handlers.
Do **not** simulate `NextRequest`, `fetch`, or `Express` routes unless explicitly instructed.
Don’t touch other modules, files, or features unless clearly necessary.
Clear, modular tests beat overly clever ones.
Don't install libraries unless there's a **strong, test-specific** reason.
Do not alter global setups, environments, or shared mocks unless explicitly asked.
When testing decision trees or workflows, spawn helpers to aid decomposition and reliability.
---
The unit under test must not include route handlers, HTTP abstractions, or serialization logic.
Reinforces clarity and intention behind test actions.
Prefer: `should_<action>_when_<condition>_given_<context>`
---
Classes, methods, services, pure functions—these are the test targets.
Ensure the unit responds correctly to correct and incorrect usage.
Only mock **I/O or external services**—never mock the unit’s own logic.
This is not the place for `POST(req)` or handler-level simulation.
Use exceptions or return contracts to test failure modes.
Mock or spy on dependencies like loggers, DBs, and queues.
Test resolution order, error propagation, and safe retries where applicable.
---
DBs, APIs, file systems, message queues—never call real ones.
Do not mock:
Prefer named constants or well-described literals.
All tests must be deterministic, stateless, and safe for parallel execution.
No `fetch`, no `NextRequest`, no server context.
---
Assert on return values, thrown errors, and logged events.
Use TS-aware assertions to verify runtime matches compile-time contracts.
Test behavior boundaries, not just return values.
---
Use factories, builders, and setup helpers.
Never mock private internals—only what the consumer sees.
Test business outcomes, not private steps (unless debugging a regression).
---
> You are writing a **unit test** for `$FEATURE`, focusing exclusively on internal logic (e.g., services, helpers, pure functions). > > 🔒 You **must not** simulate API requests, handlers, routers, or HTTP layers. > 🔍 Test business logic, validation rules, branching paths, and error cases. > ✅ Ensure all assertions are observable, meaningful, and test contracts, not internals. > 🧪 Prefer clean test design over full coverage. Quality > quantity. > > Always run `npm run build` and `npm test` to confirm test correctness and build integrity. > Be precise, focused, and insightful. Your job is to ensure the logic is future-proof. > Ultrathink. > Alway Span 4 sub-agents at least to help you accelerate the work completion.
From first prompt to agent teams — one guide. A practical guide to Claude Code — from your first prompt to multi-agent automation, hooks, MCP, and team workflows. Built around clear mental models and real examples, not marketing.
Repo: wesammustafa/Claude-Code-Everything-You-Need-to-Know
Apply the Five Whys root cause analysis technique to investigate an issue
Create a branch, split changes into logical commits, and open a pull request
Run a multi-perspective PR review (product, dev, QA, security, DevOps, UX) and post it to GitHub
Development practices and TDD workflow to follow before starting a feature
Manage project todos in todos.md file
User Experience Designer & UI Specialist persona for design-focused tasks