| name | debug-and-test |
| description | Use when debugging or validating an Air Jam project so diagnostics, logging, and tests stay intentional, structured, and aligned with the project architecture. |
Debug And Test
Use this skill when adding debug helpers, using logs, or deciding what to test.
Read First
docs/debug-and-testing.md
docs/development-loop.md
docs/generated/unified-dev-logs.md
Debug Order
- inspect the canonical Air Jam dev log stream first
- use framework diagnostics second
- use domain-level debug helpers third
- add custom logs only when they add clear value
Canonical Log Workflow
Use the unified Air Jam log stream early when debugging host/controller/server issues.
Key facts:
- the canonical file is
.airjam/logs/dev-latest.ndjson
- it resets when the Air Jam server process restarts
pnpm exec air-jam-server logs is the preferred path
- direct file reads are valid when you need the raw stream
- standard dev-runner failures from Vite and similar tools should also appear there as
workspace events
- this should usually come before adding new temporary logs
Query order:
- start with
pnpm exec air-jam-server logs --view=signal
- use
--trace for host-session stories
- use
--room for one multiplayer room story
- use
--controller for one player/controller path
- use
--runtime and --epoch for embedded runtime problems
- use
--process when the likely failure is in one local dev process such as platform, server, or the active game
- use
--source when you already know which producer layer you need
- fall back to raw NDJSON when signal view is still not enough
Test Order
- pure domain logic with unit tests
- focused gameplay systems with behavior tests
- targeted integration coverage only where the boundary really matters
If the starter testing layout exists, prefer:
tests/game/domain/
tests/game/stores/
tests/game/engine/
tests/game/adapters/
tests/game/ui/
Structure Rules
- keep debug helpers under
src/game/debug/
- keep debug-only code out of hot gameplay paths
- prefer structured logs over ad hoc console noise
- keep core logic testable without rendering where practical
Anti-Patterns
- bolting debug code directly into render hot paths
- waiting until the project is tangled before writing tests
- testing implementation details instead of behavior