<< All versions

Skill v3.1.0

currentAutomated scan100/100
buiphucminhtam/forgewright/qa-engineer

6 files

──Details
PublishedNovember 1, 2026 at 06:34 AM
Content Hashsha256:534e66f6814bcd29...
Git SHAc6d9b4160f6a
Bump Typepatch
Compare with v3.0.0
──Files
Files (1 file, 28.5 KB)
SKILL.md28.5 KBactive
SKILL.md · 890 lines · 28.5 KB

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)
/ █ \
/──────█────────\
LevelTypical scopeRelative costWhat to Test
UnitBroadest where logic branches justify itLowPure functions, formulas, state machines
IntegrationImportant component/service boundariesMediumScene transitions, persistence, service interactions
E2ESmall set of release-critical user journeysHighCore 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

SeverityDefinitionSLAExample
S0 — CriticalGame crashes, data loss, security breachFix immediatelyPlayer progress lost, crash on launch
S1 — HighCore feature broken, workaround exists24hSave/load broken, IAP not working
S2 — MediumFeature impaired, most users affected1 weekCombo counter wrong, UI glitch
S3 — LowCosmetic, edge case, very rareNext sprintTypo, pixel-perfect alignment off

Bug Priority vs Severity

PriorityMeaningWhen to Use
Must FixBlocker for releaseS0, S1 always
Should FixImportant, but workaround existsS2 in critical path
Nice to HavePolish, not blockingS2 non-critical, S3
Won't FixToo rare, too expensiveS3 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-PatternWhy It FailsSolution
1Testing implementation detailsBrittle tests break on refactorTest behavior, not internals
2Skipping manual testingAutomation misses visual/UX bugsHybrid approach
3No regression suiteOld bugs resurfaceMaintain automated suite
4Testing happy path onlyEdge cases cause crashesEquivalence partitioning
5No bug reproduction stepsDevelopers can't reproduceAlways include steps
6Unnamed test casesCan't track coverageDescriptive test names
7Flaky testsTrust erosionRepair nondeterministic infrastructure without changing the behavioral oracle; never delete/weaken the case unless its requirement changes
8Testing external servicesSlow, unreliableMock external dependencies
9No performance testing"It works on my machine"Benchmark critical paths
10Skipping mobile testingWorks on desktop, crashes mobileTest on real devices

Test Strategy by Game Type

Puzzle Games

Focus AreaTest Cases
Match logicAll piece types, all board sizes
Combo detection3-match, 4-match, 5-match, L-shape, T-shape
Special piecesCreated correctly, cascade triggers
ScoringEach piece type, combo multipliers
Level completionStar thresholds, minimum moves
Undo/redoState restoration after each action

Platformers

Focus AreaTest Cases
MovementWalk, run, jump, double-jump, wall-jump
CollisionPlatforms, walls, hazards, collectibles
CameraSmooth follow, edge clamping
Death/respawnCheckpoint, lives system
Level progressionExit trigger, level loading
Mobile controlsTouch zones, sensitivity

Card Games

Focus AreaTest Cases
Deck shufflingSeed-based vs random
Card interactionsAttack, defense, special abilities
Turn flowDraw, play, end turn, win condition
Resource systemMana/energy regeneration, spending
Hand managementDraw limit, discard, card play
AI opponentsDecision making, difficulty scaling

Idle/Merge Games

Focus AreaTest Cases
Merge logicAdjacent same-level, valid placement
Offline progressEarn calculation, cap enforcement
Currency economyEarn rate, spend validation, overflow
Auto-saveState persistence, corruption recovery
Prestige/resetResource conversion, fresh start
NotificationsBackground calculation, alert timing

Test Case Templates

Unit Test Template

typescript
describe('[UnitName]', () => {
describe('[Method/Function]', () => {
it('should [expected behavior] when [condition]', () => {
// Arrange
const input = createInput();
const expected = createExpected();
// Act
const result = targetMethod(input);
// Assert
expect(result).toEqual(expected);
});
it('should throw [error] when [invalid condition]', () => {
// Arrange
const invalidInput = createInvalidInput();
// Act & Assert
expect(() => targetMethod(invalidInput)).toThrow(ErrorType);
});
});
});

Integration Test Template

typescript
describe('[Feature] Integration', () => {
let scene: GameplayScene;
let player: Player;
let enemy: Enemy;
beforeEach(() => {
// Setup shared state
scene = new GameplayScene();
player = scene.createPlayer();
enemy = scene.createEnemy();
});
afterEach(() => {
// Cleanup
scene.destroy();
});
it('should transition to GameOver when player health reaches 0', () => {
// Arrange
scene.startGameplay();
// Act
for (let i = 0; i < 10; i++) {
enemy.attack(player);
}
// Assert
expect(scene.getState()).toBe('game_over');
expect(scene.getScore()).toBeGreaterThan(0);
});
});

E2E Test Template

typescript
describe('Critical User Paths', () => {
it('should complete a full game session', async () => {
// Launch game
await game.launch();
// Navigate menu
await ui.click('play_button');
await expect(ui.scene()).toBe('Gameplay');
// Play game
for (let level = 1; level <= 3; level++) {
await game.completeLevel(level);
await expect(ui.scene()).toBe('LevelComplete');
await ui.click('next_button');
}
// Win game
await expect(ui.scene()).toBe('GameOver');
await expect(ui.getText('result')).toBe('VICTORY');
});
});

Bug Report Template

markdown
## 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 Reproduce
1.[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

typescript
describe('DamageCalculator', () => {
describe('calculate()', () => {
it('should apply defense reduction correctly', () => {
// Formula: (ATK * multiplier - DEF * 0.5) * crit_multiplier
const result = DamageCalculator.calculate({
attackerATK: 50,
defenderDEF: 20,
skillMultiplier: 1.0,
isCritical: false,
});
// (50 * 1.0 - 20 * 0.5) * 1 = 50 - 10 = 40
expect(result).toBe(40);
});
it('should apply critical multiplier', () => {
const result = DamageCalculator.calculate({
attackerATK: 50,
defenderDEF: 20,
skillMultiplier: 1.0,
isCritical: true,
});
// (50 - 10) * 2 = 80
expect(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 = 90
expect(result).toBe(90);
});
});
describe('isCriticalHit()', () => {
it('should return true when random < critChance', () => {
// Mock Math.random to test deterministically
const originalRandom = Math.random;
Math.random = () => 0.05; // 5% chance
const result = DamageCalculator.isCriticalHit(0.1); // 10% chance
expect(result).toBe(true);
Math.random = originalRandom;
});
it('should return false when random >= critChance', () => {
const originalRandom = Math.random;
Math.random = () => 0.15; // 15% chance
const result = DamageCalculator.isCriticalHit(0.1); // 10% chance
expect(result).toBe(false);
Math.random = originalRandom;
});
});
});

State Machine Test Suite

typescript
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

typescript
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 click
game.scene.get('Menu').events.emit('play_clicked');
// Wait for transition
await 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 death
game.events.emit('player:died');
// Wait for transition
await new Promise(resolve => setTimeout(resolve, 700));
expect(game.scene.get('GameOver')).toBeDefined();
});
});

Performance Test Suite

typescript
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 render
scene.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

typescript
describe('Mobile Compatibility', () => {
it('should detect mobile devices', () => {
const isMobile = detectMobile();
// On desktop, should be false
expect(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 touch
const 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

MetricMinimumTargetExcellent
Line Coverage70%85%95%
Branch Coverage60%75%90%
Function Coverage80%90%100%
Critical Path100%100%100%

Critical Path Coverage

These paths MUST have 100% test coverage:

  1. Game loop — update, render cycle
  2. State transitions — menu → gameplay → game over
  3. Save/load — data persistence
  4. IAP validation — purchase verification
  5. Auth flow — login, logout, session
  6. Level completion — win/lose conditions
  7. Currency transactions — earn, spend, cap

Equivalence Partitioning

Input TypePartitionsExample Tests
NumbersZero, positive, negative, max, overflow0, 1, 100, -1, MAX_INT
StringsEmpty, valid, invalid, max length'', 'abc', '!@#', long string
BooleansTrue, falsetrue, false
CollectionsEmpty, one, many, duplicate[], [a], [a,b,c], [a,a]
CoordinatesOrigin, positive, negative, boundary(0,0), (100,100), (-1,-1)

Regression Testing

Regression Test Suite

typescript
describe('Regression Suite', () => {
// Run these before every release
// Grouped by feature
describe('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.

  1. Read the BA Spec: Look at .forgewright/business-analyst/handoff/ba-package.md or the BRD to retrieve the Given/When/Then scenarios.
  2. 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).
  3. Save and Register: Keep these stubs saved in the codebase as the baseline.
  4. Developer Handoff: Pass the stubs to the Developer to implement the code and make the tests pass.

TDD Example

typescript
// Step 1: RED - Write failing test
describe('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 + 1ms
expect(combo.getComboCount()).toBe(0);
jest.useRealTimers();
});
});
// Step 2: GREEN - Minimal implementation
class 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

yaml
name: QA Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit
- name: Run integration tests
run: npm run test:integration
- name: Run E2E tests
run: npm run test:e2e
- name: Check coverage
run: npm run test:coverage
with:
threshold: 85
- name: Upload coverage
uses: codecov/codecov-action@v3

Pre-Release Checklist

#CheckStatus
1All S0/S1 bugs fixed☐
2Smoke tests pass☐
3Regression suite passes☐
4Performance benchmarks pass☐
5Mobile testing complete☐
6Coverage ≥ 85%☐
7No new flaky tests☐
8QA sign-off☐

Common Mistakes

#MistakeWhy It FailsSolution
1Testing implementationTests break on refactorTest behavior
2No regression suiteOld bugs returnMaintain suite
3Skipping edge casesEdge case crashesEquivalence partition
4Flaky tests ignoredTrust in test erodedRepair nondeterministic infrastructure while preserving the behavioral oracle; deletion/weakening requires an explicit requirement change
5No mobile testingDesktop works, mobile failsTest on real devices
6Testing external APIsSlow, unreliableMock dependencies
7No performance tests"It works on my machine"Benchmark critical paths
8Single assertion per testHard to debugLogical 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:

bash
# Check a single file
node scripts/comment-checker/check.ts src/auth.ts
# Check a directory
node scripts/comment-checker/check.ts src/
# Output JSON for automation
node scripts/comment-checker/check.ts src/ --json --strict
# Auto-fix obvious slop
node scripts/comment-checker/autofix.ts src/ --dry-run # Preview
node scripts/comment-checker/autofix.ts src/ # Apply

Rules:

IDTypeDescriptionExample
obvious-actionrejectDescribes obvious action from code// Increment counter
self-documentingrejectRestates element name// This function validates input
todo-without-metarejectTODO without assignee + deadline// TODO: Fix later
stale-commentflagOutdated/deprecated indicator// deprecated
business-contextacceptBusiness rationale// GDPR requires explicit consent

Integration with QA workflow:

After code generation:
1. Run unit tests
2. Run linter
3. Run Comment Checker
4. If errors → fix comments before proceeding
5. If warnings → review and fix or accept

Quality gate integration:

bash
# Add to CI/CD pipeline after tests pass
node scripts/comment-checker/check.ts src/ --strict
if [ $? -ne 0 ]; then
echo "Comment slop detected. Run: node scripts/comment-checker/autofix.ts src/"
exit 1
fi

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.

← v3.0.0All versions