The Tester Agent
The tester agent runs all test suites against code produced by the developer agent, analyzes coverage, investigates failures, and produces a structured QA report. Cook will not proceed to code review or finalization unless the tester reports 100% of tests passing.
Role
The tester agent’s job is verification, not implementation. It executes existing test commands, reads output, identifies root causes of failures, and reports findings. It owns only test files — it reads implementation files but never edits them.
When the Tester Is Invoked
Cook spawns the tester automatically after each implementation phase completes. You can also invoke it directly via the skill:
/gk:test "Run all tests for the auth module and report coverage"
Or for UI verification:
/gk:test ui http://localhost:3000/login
What the Tester Executes
The tester identifies the project’s test runner from package.json or project config and runs the appropriate commands:
# JavaScript / TypeScript
npm test
npm run test:coverage
# Python
pytest
pytest --cov=src --cov-report=term-missing
# Go
go test ./...
# Rust
cargo test
For frontend work, the tester activates the /gk:chrome-devtools skill for visual regression, responsive layout checks, and accessibility audits.
Test Scope
The tester validates three layers:
| Layer | What It Checks |
|---|---|
| Unit tests | Individual functions and classes in isolation |
| Integration tests | API endpoints, database interactions, service composition |
| E2E tests | Full user flows from request to response |
Analyzing Failures
When tests fail, the tester does not immediately report back. It first:
- Reads the full failure output, including stack traces
- Identifies whether the failure is in the test itself or the implementation
- Checks if the failure is deterministic or environment-related
- Activates the
/gk:debugskill for complex failures requiring deeper trace analysis - Activates
/gk:sequential-thinkingfor failures with unclear root causes
Only after this analysis does it produce its report, with a clear recommendation for the developer agent.
QA Report Format
The tester saves a structured report to plans/reports/:
## QA Report — Auth Module
### Test Results
- Total: 24 tests
- Passed: 22
- Failed: 2
- Coverage: 87%
### Failed Tests
1. `auth.test.ts:45` — login with expired token should return 401
Root cause: jwt-verify.ts line 23 catches all errors, swallows expiry
Fix needed: Check err.name === 'TokenExpiredError' separately
2. `auth.test.ts:67` — logout should invalidate session
Root cause: Session store not cleared on logout endpoint
Fix needed: Add await sessionStore.delete(token) in logout handler
### Recommendations
- Fix jwt-verify.ts error handling before proceeding
- Add session cleanup to logout route
File Ownership
The tester agent may create new test files when coverage gaps are found, but it must declare these in its task ownership:
File ownership (tester):
- src/**/*.test.ts (create/edit)
- src/**/*.spec.ts (create/edit)
- tests/**/* (create/edit)
It reads (but never writes) implementation files to understand what needs testing.
Next Steps
- The Code Reviewer Agent — quality review after tests pass
- Skills: Using Skills — how to invoke
/gk:testwith flags directly