Test Cartographer
Create a test strategy grounded in the current repository state.
Inputs
- •Optional
scope: path/module/service to analyze. - •Optional
mode:quickordeep.
Defaults:
- •If
scopeis not provided, analyze the entire repository. - •If
modeis not provided, usedeep.
Workflow
1) Resolve scope and repository context
- •Detect repository root, branch, HEAD, and
git status --short. - •If
scopeis provided, validate that it exists; if not, ask for correction. - •If no scope is provided, set scope to full repository.
2) Discover current test ecosystem
Survey code, docs, and CI to detect:
- •languages/frameworks and manifests
- •current test frameworks and test commands
- •existing test directories, naming conventions, and fixtures
- •CI test jobs and gating behavior
Use only discovered tools/commands unless assumptions are explicitly marked.
3) Inventory existing tests by type
Categorize existing coverage into:
- •unit
- •integration
- •regression
- •contract (if present)
- •end-to-end (if present)
- •performance/security/smoke (if present)
Map tests to target modules/paths and note strong vs weak coverage.
4) Gap analysis
For in-scope code, identify missing coverage across:
- •happy path
- •edge cases
- •failure and error handling paths
- •boundary and data validation cases
- •regression protections for historically fragile paths
Flag test quality concerns:
- •flaky patterns
- •skipped/disabled tests
- •low-assertion tests
- •unclear fixtures/mocks
5) Prioritize plan
Prioritize proposed tests using risk and impact:
- •business/user impact
- •change likelihood
- •defect detectability
Label each proposal High, Medium, or Low priority.
6) Produce plan artifact
Select artifact base directory in this order:
- •
.codex/ - •
.claude/ - •
.agent-cache/
Write:
- •
<base>/test-plan.md - •
<base>/test-plan.json
Required markdown output sections (test-plan.md)
Use this order:
- •Scope and Context
- •Existing Test Inventory
- •Coverage and Gap Analysis
- •Prioritized Test Plan
- •Regression Pack
- •Execution Commands
- •Risks, Assumptions, Unknowns
Output contract (chat)
Return:
- •
Action: generated or updated plan - •
Scope: full-repo or requested area - •
Result: key gaps and highest-priority tests - •
Confidence: High/Medium/Low - •
Next step: recommended immediate implementation sequence
Guardrails
- •Do not propose frameworks not present in repository unless clearly marked as optional recommendations.
- •Do not mutate source code while planning.
- •If scope is narrow, still include cross-module dependencies that materially affect test strategy.
- •Mark unknowns explicitly instead of guessing.