.claude/skills/testing/SKILL.md
Test infrastructure reference for Shadow Master. Use when writing tests, finding existing test files, or running test suites. Covers Vitest unit tests, Playwright E2E tests, and testing patterns.
npx skillsauth add Jasrags/ShadowMaster testingInstall 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.
Shadow Master uses Vitest for unit/integration tests and Playwright for E2E browser tests.
pnpm test # Run all unit tests
pnpm test:watch # Watch mode for development
pnpm test:ci # CI mode (no watch, exits with code)
pnpm test:e2e # Run Playwright E2E tests
pnpm test:e2e:ui # E2E with visual UI for debugging
pnpm check-tests # Check staged files for missing tests (non-blocking)
pnpm check-tests:all # Check all source files for missing tests
pnpm check-tests:strict # Strict mode (fails if tests are missing)
Tests are co-located with source code in __tests__ directories:
/__tests__/ # Root level tests
/lib/auth/__tests__/ # Auth unit tests (3 files)
/lib/storage/__tests__/ # Storage layer tests (10 files)
/lib/security/__tests__/ # Security tests (1 file)
/lib/rules/__tests__/ # Core rules tests (8 files)
/lib/rules/action-resolution/__tests__/ # Action resolution tests (2 files)
/lib/rules/action-resolution/combat/__tests__/ # Combat handler tests (2 files)
/lib/rules/advancement/__tests__/ # Advancement logic tests (8 files)
/lib/rules/augmentations/__tests__/ # Augmentation tests (6 files)
/lib/rules/character/__tests__/ # Character state machine tests (1 file)
/lib/rules/encumbrance/__tests__/ # Encumbrance tests (1 file)
/lib/rules/gear/__tests__/ # Gear validation tests (2 files)
/lib/rules/inventory/__tests__/ # Inventory tests (1 file)
/lib/rules/magic/__tests__/ # Magic system tests (5 files)
/lib/rules/matrix/__tests__/ # Matrix tests (1 file)
/lib/rules/qualities/__tests__/ # Quality system tests (7 files)
/lib/rules/rigging/__tests__/ # Rigging tests (2 files)
/app/api/**/__tests__/ # API route tests (~25 files)
/e2e/ # Playwright E2E tests
import { describe, it, expect, beforeEach } from "vitest";
import { myFunction } from "../myModule";
describe("myFunction", () => {
beforeEach(() => {
// Setup
});
it("should handle normal case", () => {
const result = myFunction(input);
expect(result).toBe(expected);
});
it("should handle edge case", () => {
expect(() => myFunction(badInput)).toThrow();
});
});
import { describe, it, expect, vi, beforeEach } from "vitest";
import { GET, POST } from "../route";
import { NextRequest } from "next/server";
// Mock auth
vi.mock("@/lib/auth/session", () => ({
getSession: vi.fn(),
}));
describe("GET /api/endpoint", () => {
beforeEach(() => {
vi.clearAllMocks();
});
it("returns 401 when unauthenticated", async () => {
const request = new NextRequest("http://localhost/api/endpoint");
const response = await GET(request);
expect(response.status).toBe(401);
});
});
/signup/characters/create/sheet end-to-end/data directory for persisted JSONPriority areas for test coverage:
/lib/rules/) - Core game mechanics must be correct/lib/storage/) - Data integrity is critical/lib/auth/) - Security-sensitive code/app/api/) - User-facing endpointstesting
# Verify Reference Data Run the hybrid verification pipeline to compare extracted reference material against edition data files. ## Usage ``` /verify-reference # Run all mapping configs /verify-reference street-gear-weapons-armor # Run specific mapping by name /verify-reference --fix # Run and attempt semantic fixes ``` ## Phase 1 — Structural Verification (Script) Run `pnpm verify-reference` to execute structural checks: ```bash # All mappings p
development
# Ship Current Work 1. Run `npm run typecheck` and fix any TypeScript errors 2. Run `npm test` and fix any test failures 3. Run `git status` to review changes 4. Create a descriptive commit with conventional commit format (feat:, fix:, etc.) 5. Push to the current feature branch 6. Create a PR using `gh pr create` with a descriptive title and body referencing the GitHub issue 7. Report the PR URL Never commit to main. If on main, ask the user for a branch name first.
content-media
Redesigns character sheet display components to match the character creation card aesthetic. Use when updating any component in /components/character/sheet/ to use grouped sections, value pills, and the established dark-mode-first color system.
development
Applies Shadowrun cyberpunk aesthetic to UI components. Use when building character sheets, creation cards, gear panels, modal dialogs, or any SR-themed interface elements. Combines systematic craft principles with the distinctive visual language of the Sixth World.