Agent skill
testing-rules
Ultra Builder Pro testing discipline rules
Install this agent skill to your Project
npx add-skill https://github.com/rocky2431/ultra-builder-pro/tree/main/skills/testing-rules
SKILL.md
Testing Rules
These rules are mandatory for all test-related work.
TDD Workflow
RED → GREEN → REFACTOR (all new code).
Test Strategy
| Layer | Test Type | Mock Strategy |
|---|---|---|
| Functional Core | Unit Test | No mocks needed (pure input→output) |
| Imperative Shell | Integration | Testcontainers (real DB/services) |
| External APIs | Test Double | With // Test Double rationale: [reason] |
Forbidden Patterns
These patterns are never acceptable:
| Pattern | Why Forbidden | Alternative |
|---|---|---|
jest.fn() for Repository/Service/Domain |
Invalid test — doesn't prove production works | Testcontainers |
class InMemoryRepository |
Diverges from real DB behavior | Real DB container |
class MockXxx / class FakeXxx |
Hides integration issues | Direct instantiation or Testcontainers |
jest.mock('../services/X') |
Skips real collaboration | Test real collaboration |
it.skip('...database...') |
"Too slow" is not valid | Testcontainers are fast enough |
Coverage Requirements
- 80% overall minimum
- 100% Functional Core (pure logic must be fully tested)
- Critical paths for Imperative Shell
Dev/Prod Parity
Tests must use real dependencies:
- Real database via Testcontainers (not in-memory substitutes)
- Config via environment variables
- Mock tests passing ≠ production working
Detection Checklist
When analyzing test files, flag:
- Any
jest.fn()usage on Repository, Service, or Domain classes - Any
InMemory*orMock*orFake*class definitions - Any
jest.mock()calls on internal modules - Any skipped tests with database/slow excuses
- Missing error case coverage
- Missing edge case coverage
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
recall
Search and manage cross-session memory. Query past sessions by keyword, semantic similarity, or hybrid search. Save summaries and tags for future recall.
code-review-expert
Structured code review checklists: SOLID, security, performance, boundary conditions, removal planning. Injected into code-reviewer agent.
use-railway
Operate Railway infrastructure: create projects, provision services and databases, deploy code, configure environments and variables, manage domains, troubleshoot failures, check status and metrics, and query Railway docs. Use this skill whenever the user mentions Railway, deployments, services, environments, build failures, or infrastructure operations, even if they don't say "Railway" explicitly.
security-rules
Ultra Builder Pro security rules
ai-collab-base
Shared collaboration protocol, modes, and prompt templates for AI collab skills. Consumed by gemini-collab, codex-collab, and ultra-verify as a shared foundation.
Didn't find tool you were looking for?