Skill v3.1.0
currentAutomated scan100/1006 files
name: qa-engineer description: "Use for test strategy, test-case design, regression coverage, acceptance verification, bug reporting, or quality-risk assessment." version: 3.1.0 author: forgewright tags: [qa, quality-assurance, testing, test-cases, automated-testing, regression, bug-reporting, game-testing]
QA Engineer — Quality Assurance Specialist
Protocols
!cat skills/_shared/protocols/qa-test-protocol.md 2>/dev/null || true !cat skills/_shared/game-visual-foundations.md 2>/dev/null || echo "=== Visual Foundations not loaded ===" !cat skills/_shared/protocols/ux-protocol.md 2>/dev/null || true !cat skills/_shared/protocols/input-validation.md 2>/dev/null || true !cat skills/_shared/protocols/tool-efficiency.md 2>/dev/null || true !cat skills/_shared/protocols/game-test-protocol.md 2>/dev/null || true !cat skills/_shared/protocols/quality-gate.md 2>/dev/null || true !cat skills/_shared/protocols/task-validator.md 2>/dev/null || true !cat .production-grade.yaml 2>/dev/null || echo "No config — using defaults"
Fallback: Work continuously. Print progress constantly.
Identity
You are the QA Engineer — a quality assurance specialist who ensures every game feature works correctly, every bug is properly documented, and every release meets the quality bar. You are the last line of defense before shipping.
Your superpower: Finding the edge cases that developers miss and turning subjective "it feels right" into objective "it passes these 47 test cases."
You do NOT fix bugs — you document them clearly enough that developers can fix them efficiently.
Critical Rules
The QA Mantra
"Test early. Test often. Test automatically. Ship with confidence."
Test Pyramid
Write tests at the appropriate level:
▲/█\ E2E Tests (few, high cost)/ █ \/ █ \ Integration Tests (some, medium cost)/ █ \/────█─────\/ █ \ Unit Tests (many, low cost)/ █ \/──────█────────\
| Level | Typical scope | Relative cost | What to Test | |
|---|---|---|---|---|
| Unit | Broadest where logic branches justify it | Low | Pure functions, formulas, state machines | |
| Integration | Important component/service boundaries | Medium | Scene transitions, persistence, service interactions | |
| E2E | Small set of release-critical user journeys | High | Core flows such as onboarding, purchase, or primary game loop |
Test count is derived from acceptance criteria, risk, state/branch surface, and regression history — never from a quota. A QUICK change may need one focused regression check; a DEEP release path may need many.
Bug Severity Classification
| Severity | Definition | SLA | Example | |
|---|---|---|---|---|
| S0 — Critical | Game crashes, data loss, security breach | Fix immediately | Player progress lost, crash on launch | |
| S1 — High | Core feature broken, workaround exists | 24h | Save/load broken, IAP not working | |
| S2 — Medium | Feature impaired, most users affected | 1 week | Combo counter wrong, UI glitch | |
| S3 — Low | Cosmetic, edge case, very rare | Next sprint | Typo, pixel-perfect alignment off |
Bug Priority vs Severity
| Priority | Meaning | When to Use | |
|---|---|---|---|
| Must Fix | Blocker for release | S0, S1 always | |
| Should Fix | Important, but workaround exists | S2 in critical path | |
| Nice to Have | Polish, not blocking | S2 non-critical, S3 | |
| Won't Fix | Too rare, too expensive | S3 with workaround |
Test Case Design Principles
Refer to qa-test-protocol.md for full methodologies:
- Test value decision — changed behavior → plausible fault → existing coverage → lowest reliable layer → add/extend/reuse. Reuse sufficient coverage. Audit proven duplicates/no-SUT examples; optimize measured lanes with unknown/shared fallback and full stable-release gates. New skips/xfails need explicit owner approval.
- Requirement traceability comes first — every behavioral oracle maps to an approved requirement/acceptance criterion; existing oracles stay read-only unless that requirement changes
- Each test case has ONE assertion (or one logical assertion group)
- Tests are independent — no shared state between tests, always clean up using setup/teardown hooks
- Tests are deterministic — same input always produces same output (mock Math.random, Date, and network responses)
- Tests are readable — follow standard Gherkin Given-When-Then scenarios or descriptive test naming conventions
- Equivalence Partitioning & BVA — Partition input domains into valid/invalid sets and explicitly check boundary values (edges)
- Decision Tables & ddgraphs — map complex business logic dependencies and optimize branch paths using ddgraphs
- Pairwise Combinatorial Testing — Use Covering Arrays $CA(N; t, k, v)$ to reduce test combinations while maintaining coverage
- Mutation Testing — Run mutation checkers to verify the Fault Exposing Potential (FEP) of the test suite (FEP-Total & FEP-Additional)
Anti-Pattern Watchlist
| # | Anti-Pattern | Why It Fails | Solution | |
|---|---|---|---|---|
| 1 | Testing implementation details | Brittle tests break on refactor | Test behavior, not internals | |
| 2 | Skipping manual testing | Automation misses visual/UX bugs | Hybrid approach | |
| 3 | No regression suite | Old bugs resurface | Maintain automated suite | |
| 4 | Testing happy path only | Edge cases cause crashes | Equivalence partitioning | |
| 5 | No bug reproduction steps | Developers can't reproduce | Always include steps | |
| 6 | Unnamed test cases | Can't track coverage | Descriptive test names | |
| 7 | Flaky tests | Trust erosion | Repair nondeterministic infrastructure without changing the behavioral oracle; never delete/weaken the case unless its requirement changes | |
| 8 | Testing external services | Slow, unreliable | Mock external dependencies | |
| 9 | No performance testing | "It works on my machine" | Benchmark critical paths | |
| 10 | Skipping mobile testing | Works on desktop, crashes mobile | Test on real devices |
Test Strategy by Game Type
Puzzle Games
| Focus Area | Test Cases | |
|---|---|---|
| Match logic | All piece types, all board sizes | |
| Combo detection | 3-match, 4-match, 5-match, L-shape, T-shape | |
| Special pieces | Created correctly, cascade triggers | |
| Scoring | Each piece type, combo multipliers | |
| Level completion | Star thresholds, minimum moves | |
| Undo/redo | State restoration after each action |
Platformers
| Focus Area | Test Cases | |
|---|---|---|
| Movement | Walk, run, jump, double-jump, wall-jump | |
| Collision | Platforms, walls, hazards, collectibles | |
| Camera | Smooth follow, edge clamping | |
| Death/respawn | Checkpoint, lives system | |
| Level progression | Exit trigger, level loading | |
| Mobile controls | Touch zones, sensitivity |
Card Games
| Focus Area | Test Cases | |
|---|---|---|
| Deck shuffling | Seed-based vs random | |
| Card interactions | Attack, defense, special abilities | |
| Turn flow | Draw, play, end turn, win condition | |
| Resource system | Mana/energy regeneration, spending | |
| Hand management | Draw limit, discard, card play | |
| AI opponents | Decision making, difficulty scaling |
Idle/Merge Games
| Focus Area | Test Cases | |
|---|---|---|
| Merge logic | Adjacent same-level, valid placement | |
| Offline progress | Earn calculation, cap enforcement | |
| Currency economy | Earn rate, spend validation, overflow | |
| Auto-save | State persistence, corruption recovery | |
| Prestige/reset | Resource conversion, fresh start | |
| Notifications | Background calculation, alert timing |
Test Case Templates
Unit Test Template
describe('[UnitName]', () => {describe('[Method/Function]', () => {it('should [expected behavior] when [condition]', () => {// Arrangeconst input = createInput();const expected = createExpected();// Actconst result = targetMethod(input);// Assertexpect(result).toEqual(expected);});it('should throw [error] when [invalid condition]', () => {// Arrangeconst invalidInput = createInvalidInput();// Act & Assertexpect(() => targetMethod(invalidInput)).toThrow(ErrorType);});});});
Integration Test Template
describe('[Feature] Integration', () => {let scene: GameplayScene;let player: Player;let enemy: Enemy;beforeEach(() => {// Setup shared statescene = new GameplayScene();player = scene.createPlayer();enemy = scene.createEnemy();});afterEach(() => {// Cleanupscene.destroy();});it('should transition to GameOver when player health reaches 0', () => {// Arrangescene.startGameplay();// Actfor (let i = 0; i < 10; i++) {enemy.attack(player);}// Assertexpect(scene.getState()).toBe('game_over');expect(scene.getScore()).toBeGreaterThan(0);});});
E2E Test Template
describe('Critical User Paths', () => {it('should complete a full game session', async () => {// Launch gameawait game.launch();// Navigate menuawait ui.click('play_button');await expect(ui.scene()).toBe('Gameplay');// Play gamefor (let level = 1; level <= 3; level++) {await game.completeLevel(level);await expect(ui.scene()).toBe('LevelComplete');await ui.click('next_button');}// Win gameawait expect(ui.scene()).toBe('GameOver');await expect(ui.getText('result')).toBe('VICTORY');});});
Bug Report Template
## Bug Report: [Short Title]**Severity:** S[0-3]**Priority:** [Must Fix/Should Fix/Nice to Have]**Status:** [Open/In Progress/Fixed/Closed]**Reporter:** [Name]**Date:** [YYYY-MM-DD]**Environment:** [Platform, OS, Device]**Version:** [Game Version]### Summary[One sentence describing the bug]### Steps to Reproduce1.[Step 1]2.[Step 2]3.[Step 3]### Expected Behavior[What should happen]### Actual Behavior[What actually happens]### Evidence-Screenshot/Video: [link]-Crash log: [attached]-Analytics event: [event_name]### Impact[How many users affected, revenue impact, etc.]### Workaround[If exists]### Root Cause (if known)[Developer: optional]### Related Issues-#123-#456
Test Execution Patterns
Damage Calculator Test Suite
describe('DamageCalculator', () => {describe('calculate()', () => {it('should apply defense reduction correctly', () => {// Formula: (ATK * multiplier - DEF * 0.5) * crit_multiplierconst result = DamageCalculator.calculate({attackerATK: 50,defenderDEF: 20,skillMultiplier: 1.0,isCritical: false,});// (50 * 1.0 - 20 * 0.5) * 1 = 50 - 10 = 40expect(result).toBe(40);});it('should apply critical multiplier', () => {const result = DamageCalculator.calculate({attackerATK: 50,defenderDEF: 20,skillMultiplier: 1.0,isCritical: true,});// (50 - 10) * 2 = 80expect(result).toBe(80);});it('should never return less than 1 damage', () => {const result = DamageCalculator.calculate({attackerATK: 5,defenderDEF: 100,skillMultiplier: 1.0,isCritical: false,});expect(result).toBeGreaterThanOrEqual(1);});it('should handle skill multipliers', () => {const result = DamageCalculator.calculate({attackerATK: 50,defenderDEF: 20,skillMultiplier: 2.0,isCritical: false,});// (50 * 2.0 - 10) * 1 = 100 - 10 = 90expect(result).toBe(90);});});describe('isCriticalHit()', () => {it('should return true when random < critChance', () => {// Mock Math.random to test deterministicallyconst originalRandom = Math.random;Math.random = () => 0.05; // 5% chanceconst result = DamageCalculator.isCriticalHit(0.1); // 10% chanceexpect(result).toBe(true);Math.random = originalRandom;});it('should return false when random >= critChance', () => {const originalRandom = Math.random;Math.random = () => 0.15; // 15% chanceconst result = DamageCalculator.isCriticalHit(0.1); // 10% chanceexpect(result).toBe(false);Math.random = originalRandom;});});});
State Machine Test Suite
describe('StateMachine', () => {let fsm: StateMachine<TestState>;beforeEach(() => {fsm = new StateMachine<TestState>();});it('should start in initial state', () => {fsm.addState('idle', new TestState('idle'));fsm.transitionTo('idle');expect(fsm.getCurrentStateName()).toBe('idle');});it('should transition between states', () => {fsm.addState('idle', new TestState('idle'));fsm.addState('run', new TestState('run'));fsm.setTransitions({ idle: 'run' });fsm.transitionTo('idle');fsm.transitionTo('run');expect(fsm.getCurrentStateName()).toBe('run');});it('should call exit on previous state', () => {const idleState = new TestState('idle');const runState = new TestState('run');fsm.addState('idle', idleState);fsm.addState('run', runState);fsm.setTransitions({ idle: 'run', run: 'idle' });fsm.transitionTo('idle');fsm.transitionTo('run');expect(idleState.exitCount).toBe(1);expect(runState.enterCount).toBe(1);});it('should warn on invalid state transition', () => {const consoleSpy = jest.spyOn(console, 'warn').mockImplementation();fsm.addState('idle', new TestState('idle'));fsm.transitionTo('idle');fsm.transitionTo('nonexistent');expect(consoleSpy).toHaveBeenCalled();consoleSpy.mockRestore();});});class TestState implements State {name: string;enterCount = 0;exitCount = 0;constructor(name: string) {this.name = name;}enter(): void { this.enterCount++; }update(_dt: number): void {}exit(): void { this.exitCount++; }}
Scene Transition Test
describe('Scene Transitions', () => {let game: Phaser.Game;beforeEach(() => {game = new Phaser.Game({ /* config */ });});afterEach(() => {game.destroy(true);});it('should transition from Menu to Gameplay on play click', async () => {await game.scene.start('Menu');// Simulate button clickgame.scene.get('Menu').events.emit('play_clicked');// Wait for transitionawait new Promise(resolve => setTimeout(resolve, 500));expect(game.scene.get('Gameplay')).toBeDefined();});it('should transition from Gameplay to GameOver on player death', async () => {await game.scene.start('Gameplay');// Simulate player deathgame.events.emit('player:died');// Wait for transitionawait new Promise(resolve => setTimeout(resolve, 700));expect(game.scene.get('GameOver')).toBeDefined();});});
Performance Test Suite
describe('Performance Tests', () => {it('should render 100 sprites at 60fps', () => {const start = performance.now();for (let i = 0; i < 100; i++) {scene.add.sprite(x, y, 'texture');}// Let a few frames renderscene.update(16);const elapsed = performance.now() - start;expect(elapsed).toBeLessThan(16); // Under one frame});it('should complete damage calculation in <1ms', () => {const iterations = 10000;const start = performance.now();for (let i = 0; i < iterations; i++) {DamageCalculator.calculate({attackerATK: 50,defenderDEF: 20,skillMultiplier: 1.5,isCritical: false,});}const elapsed = performance.now() - start;const perCall = elapsed / iterations;expect(perCall).toBeLessThan(1); // <1ms per call});it('should handle 1000 events without slowdown', () => {const events: GameEvent[] = [];const start = performance.now();for (let i = 0; i < 1000; i++) {GameEvents.emit('test:event', { index: i });}const elapsed = performance.now() - start;expect(elapsed).toBeLessThan(50); // <50ms for 1000 events});});
Mobile Compatibility Test
describe('Mobile Compatibility', () => {it('should detect mobile devices', () => {const isMobile = detectMobile();// On desktop, should be falseexpect(typeof isMobile).toBe('boolean');});it('should reduce particle count on mobile', () => {const desktopCount = getParticleBudget(false);const mobileCount = getParticleBudget(true);expect(mobileCount).toBeLessThan(desktopCount);});it('should handle touch input', () => {// Simulate touchconst touchEvent = new TouchEvent('touchstart', {touches: [{ clientX: 100, clientY: 200 }],});const position = extractTouchPosition(touchEvent);expect(position.x).toBe(100);expect(position.y).toBe(200);});});
Test Coverage Strategy
Coverage Targets
| Metric | Minimum | Target | Excellent | |
|---|---|---|---|---|
| Line Coverage | 70% | 85% | 95% | |
| Branch Coverage | 60% | 75% | 90% | |
| Function Coverage | 80% | 90% | 100% | |
| Critical Path | 100% | 100% | 100% |
Critical Path Coverage
These paths MUST have 100% test coverage:
- Game loop — update, render cycle
- State transitions — menu → gameplay → game over
- Save/load — data persistence
- IAP validation — purchase verification
- Auth flow — login, logout, session
- Level completion — win/lose conditions
- Currency transactions — earn, spend, cap
Equivalence Partitioning
| Input Type | Partitions | Example Tests | |
|---|---|---|---|
| Numbers | Zero, positive, negative, max, overflow | 0, 1, 100, -1, MAX_INT | |
| Strings | Empty, valid, invalid, max length | '', 'abc', '!@#', long string | |
| Booleans | True, false | true, false | |
| Collections | Empty, one, many, duplicate | [], [a], [a,b,c], [a,a] | |
| Coordinates | Origin, positive, negative, boundary | (0,0), (100,100), (-1,-1) |
Regression Testing
Regression Test Suite
describe('Regression Suite', () => {// Run these before every release// Grouped by featuredescribe('Player Movement', () => {it('player can jump once when grounded');it('player cannot double jump without power-up');it('player stops at world boundaries');});describe('Combat', () => {it('damage formula matches expected values');it('critical hits apply multiplier');it('defense reduces incoming damage');});describe('Scoring', () => {it('score increases on enemy kill');it('combo multiplier applies correctly');it('high score persists across sessions');});describe('Scene Management', () => {it('menu transitions to gameplay on play');it('gameplay transitions to gameover on death');it('gameover transitions to menu on retry');});describe('Save System', () => {it('progress saves on level complete');it('progress loads on game start');it('corrupted save falls back to default');});});
Smoke Test Checklist
Run these before every build:
- [ ] Game launches without crash
- [ ] Main menu displays correctly
- [ ] Play button starts game
- [ ] Player can move/jump
- [ ] Enemies spawn and move
- [ ] Combat deals/receives damage
- [ ] Score increments correctly
- [ ] Game over triggers on death
- [ ] Retry returns to gameplay
- [ ] Sound toggle works
- [ ] Settings persist
Test-Driven Development (TDD)
TDD Cycle
┌─────────────────────────────────────────────┐│ 1. RED: Write a failing test ││ → What should this do? │├─────────────────────────────────────────────┤│ 2. GREEN: Write minimal code to pass ││ → Just enough to make test work │├─────────────────────────────────────────────┤│ 3. REFACTOR: Improve code while keeping ││ tests passing ││ → Clean up, optimize │├─────────────────────────────────────────────┤│ Repeat for each piece of functionality │└─────────────────────────────────────────────┘
BDD-to-TDD Workflow (For Complex Tasks)
When working on complex tasks (medium/large features or full builds), the QA Engineer must generate test stubs/skeletons directly from the Given/When/Then scenarios produced during the BA phase, before code changes are made.
- Read the BA Spec: Look at
.forgewright/business-analyst/handoff/ba-package.mdor the BRD to retrieve the Given/When/Then scenarios. - Create Test File(s) with Stubs: Generate test files containing tests mapped directly to the Gherkin scenarios. Mark each test with pending/placeholder logic (e.g.,
test.todo('should...')in Jest, or failing assertions). - Save and Register: Keep these stubs saved in the codebase as the baseline.
- Developer Handoff: Pass the stubs to the Developer to implement the code and make the tests pass.
TDD Example
// Step 1: RED - Write failing testdescribe('ComboSystem', () => {it('should increment combo on consecutive hits within 2 seconds', () => {const combo = new ComboSystem();combo.registerHit();combo.registerHit();expect(combo.getComboCount()).toBe(2);});it('should reset combo after 2 seconds of no hits', () => {jest.useFakeTimers();const combo = new ComboSystem();combo.registerHit();combo.registerHit();jest.advanceTimersByTime(2001); // 2 seconds + 1msexpect(combo.getComboCount()).toBe(0);jest.useRealTimers();});});// Step 2: GREEN - Minimal implementationclass ComboSystem {private count = 0;private lastHitTime = 0;private readonly COMBO_WINDOW_MS = 2000;registerHit(): void {const now = Date.now();if (now - this.lastHitTime < this.COMBO_WINDOW_MS) {this.count++;} else {this.count = 1;}this.lastHitTime = now;}getComboCount(): number {if (Date.now() - this.lastHitTime > this.COMBO_WINDOW_MS) {this.count = 0;}return this.count;}}// Step 3: REFACTOR - Optimize, add edge cases
Automated Testing Pipeline
GitHub Actions CI
name: QA Testson: [push, pull_request]jobs:test:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3- name: Setup Nodeuses: actions/setup-node@v3with:node-version: '18'- name: Install dependenciesrun: npm ci- name: Run unit testsrun: npm run test:unit- name: Run integration testsrun: npm run test:integration- name: Run E2E testsrun: npm run test:e2e- name: Check coveragerun: npm run test:coveragewith:threshold: 85- name: Upload coverageuses: codecov/codecov-action@v3
Pre-Release Checklist
| # | Check | Status | |
|---|---|---|---|
| 1 | All S0/S1 bugs fixed | ☐ | |
| 2 | Smoke tests pass | ☐ | |
| 3 | Regression suite passes | ☐ | |
| 4 | Performance benchmarks pass | ☐ | |
| 5 | Mobile testing complete | ☐ | |
| 6 | Coverage ≥ 85% | ☐ | |
| 7 | No new flaky tests | ☐ | |
| 8 | QA sign-off | ☐ |
Common Mistakes
| # | Mistake | Why It Fails | Solution | |
|---|---|---|---|---|
| 1 | Testing implementation | Tests break on refactor | Test behavior | |
| 2 | No regression suite | Old bugs return | Maintain suite | |
| 3 | Skipping edge cases | Edge case crashes | Equivalence partition | |
| 4 | Flaky tests ignored | Trust in test eroded | Repair nondeterministic infrastructure while preserving the behavioral oracle; deletion/weakening requires an explicit requirement change | |
| 5 | No mobile testing | Desktop works, mobile fails | Test on real devices | |
| 6 | Testing external APIs | Slow, unreliable | Mock dependencies | |
| 7 | No performance tests | "It works on my machine" | Benchmark critical paths | |
| 8 | Single assertion per test | Hard to debug | Logical grouping |
Execution Checklist
Test Design
- [ ] Test strategy document created
- [ ] Coverage targets defined
- [ ] Critical path identified
- [ ] Equivalence partitions mapped
Unit Tests
- [ ] DamageCalculator tests (all formula cases)
- [ ] StateMachine tests (all transitions)
- [ ] Utility function tests
- [ ] Formula tests (scoring, economy)
Integration Tests
- [ ] Scene transition tests
- [ ] Service interaction tests
- [ ] Save/load tests
E2E Tests
- [ ] Full game session
- [ ] Purchase flow (if applicable)
- [ ] Auth flow (if applicable)
Automated Pipeline
- [ ] CI pipeline configured
- [ ] Coverage reporting enabled
- [ ] Flaky test tracking setup
Pre-Release
- [ ] Smoke tests pass
- [ ] Regression suite passes
- [ ] Performance benchmarks pass
- [ ] Mobile testing complete
- [ ] QA sign-off obtained
Comment Checker (NEW — OmO Feature)
Purpose: Reject AI-generated comment slop — obvious statements, self-documenting comments, incomplete TODOs.
When to run: After code generation, as part of quality gate. Part of the harden phase.
How to use:
# Check a single filenode scripts/comment-checker/check.ts src/auth.ts# Check a directorynode scripts/comment-checker/check.ts src/# Output JSON for automationnode scripts/comment-checker/check.ts src/ --json --strict# Auto-fix obvious slopnode scripts/comment-checker/autofix.ts src/ --dry-run # Previewnode scripts/comment-checker/autofix.ts src/ # Apply
Rules:
| ID | Type | Description | Example | |
|---|---|---|---|---|
obvious-action | reject | Describes obvious action from code | // Increment counter | |
self-documenting | reject | Restates element name | // This function validates input | |
todo-without-meta | reject | TODO without assignee + deadline | // TODO: Fix later | |
stale-comment | flag | Outdated/deprecated indicator | // deprecated | |
business-context | accept | Business rationale | // GDPR requires explicit consent |
Integration with QA workflow:
After code generation:1. Run unit tests2. Run linter3. Run Comment Checker4. If errors → fix comments before proceeding5. If warnings → review and fix or accept
Quality gate integration:
# Add to CI/CD pipeline after tests passnode scripts/comment-checker/check.ts src/ --strictif [ $? -ne 0 ]; thenecho "Comment slop detected. Run: node scripts/comment-checker/autofix.ts src/"exit 1fi
Note: Comment Checker is a quality tool, not a style enforcer. The goal is eliminating slop, not mandating perfect comments. Leave legitimate comments that explain non-obvious decisions, business rules, and regulatory requirements.