name: test-surface-review description: Walk the merge-base→HEAD diff of the current branch and produce a test-plan document listing every change, the kind of testing it needs (unit / AI / human), and a concrete way to exercise it.
Test Surface Review
You are performing a testing-surface audit of the current branch. Goal: produce a single test-plan document that lists every change on the branch, buckets it by the kind of testing it needs, and gives a concrete way to validate it.
This is complementary to pre-merge-review. That skill asks "is the code correct?" This one asks "what do we have to do to gain confidence it works?"
Project standards
Before reviewing, read these documents so you understand what "a test" means in this repo:
- AGENTS.md — especially the testing section ("For new work, avoid unit tests. We only want integration tests using Azurite and the Cosmos emulator.") and the tool-registration / ChatManager rules
docs/frontend.md— frontend conventions; confirms what needs browser/manual testingdocs/dev/chatmanager-usage-guide.md— where LLM behaviour is driven fromdocs/dev/tool-uses-flag-guide.md— tool visibility surface (affects what to test)
Flag when a change would naturally want a test that the project style forbids (e.g. a pure helper in a domain that otherwise uses integration tests) — call that out in the output so the reviewer can choose.
Core principle
Treat the final net effect of the branch as the testing surface.
Walk the diff between merge-base and HEAD once, in full. For every change, decide:
- Is this change structural / deterministic? → Unit test.
- Is this change LLM-facing or prompt-driven? → AI validation via CLI.
- Is this change UI, queue, or cross-system? → Human / integration.
Never invent a test category. If a change is a pure refactor with no behaviour shift, say so and skip it explicitly — don't pad the plan.
Do not report on problems that existed only in intermediate commits.
Step 1: Identify branch and merge base
git branch --show-current
git merge-base master HEAD
git log --oneline --decorate master..HEAD
git diff --stat master...HEAD
Note:
- current branch name and jira/PRD id
- rough commit themes
- which subsystems the diff touches (business logic / API / UI / tests / prompts / skills / migrations)
Step 2: Walk the full diff
git diff master...HEAD
For each hunk, decide the minimal unit of change to reason about — usually a function, a file, or a coherent multi-file feature. Group them. Do not list one entry per line.
Read the changed file directly if the diff context isn't enough. Read callers for anything that affects a public signature, a schema, a prompt, or a tool registration.
Step 3: Categorise each change
Use these three buckets. Every entry gets exactly one.
Unit / deterministic
Pure functions, parsers, serializers, helpers, regex, DTO shape, enum values, threshold constants whose meaning is exact. Evidence: can be exercised without a model, without Cosmos, without a browser.
- Default test style: xUnit facts in
MatterAIAPI.Tests, mirroring theLexLabQueryPlannerTests/ComplianceTraceFormatterTestspattern. - If AGENTS.md forbids unit tests in that area (e.g. data access paths), say so and downgrade to "integration test with Azurite + Cosmos emulator" rather than propose a disallowed unit test.
AI / LLM behaviour
Prompt text, planner logic, tool schema/description, tool orchestration, skill definitions, citation flow, anything whose correctness depends on what the model does with it.
- Default test style: a CLI prompt driven through
AltienAICommandLine convo runagainst the relevant KB, with explicit expected signals (trace markers, citation shape, answer grounding). - Give the exact
convo runinvocation and the exact expected trace/output fragment when possible.
Human / UI / integration
Frontend changes, Word add-in flows, admin pages, Cosmos schema migrations, Service Bus queue contracts, auth paths, anything that can only be truly validated by a person clicking through or watching an end-to-end flow.
- Default test style: a short reproducible manual script — which URL, which action, what to look for.
Step 4: Write the plan
Write the plan to docs/dev/{BRANCH_ID}-test-plan.md where {BRANCH_ID} is the JIRA/PRD id from the branch name (e.g. AI-658). If there is no such id, fall back to the branch name with / replaced by -.
Overwrite if it already exists — this is a retrospective audit of the current state, not an accumulator.
Output format (the test plan document)
Use this exact structure:
# Test Plan — {branch-name}
**Branch**: `{current branch}`
**Base**: `master`
**Commits ahead**: {N}
**Generated**: {YYYY-MM-DD}
## Summary
{2–3 sentences: what this branch changes at a high level.}
## Test coverage status
| Category | Total | Already covered | Needs work |
|----------|-------|-----------------|------------|
| Unit / deterministic | | | |
| AI / LLM behaviour | | | |
| Human / UI / integration | | | |
## Unit / deterministic
### {Change title}
- **Evidence**: `path/to/file.cs:LINE` (plus related callers if wider)
- **What changed**: one-sentence description of behaviour delta
- **Existing coverage**: {test file path or "none"}
- **Test to add**: concrete suggestion — function name, inputs, expected outputs. If AGENTS.md forbids unit tests for this area, note that and downgrade to integration-test style.
- **Status**: ☐ todo / ✅ done / ⚠︎ blocked (why)
(…repeat per change…)
## AI / LLM behaviour
### {Change title}
- **Evidence**: `path/to/file.cs:LINE`
- **What changed**: one-sentence
- **Test prompt**: the exact user message to drive through the CLI
- **KB / config**: which KB id and convo-run json to use
- **Expected signals**: specific trace lines, citation shape, answer grounding rules — bullet them
- **CLI command**: the exact `AltienAICommandLine convo run …` invocation, with the prompt quoted
- **Status**: ☐ todo / ✅ done / ⚠︎ blocked
(…repeat per change…)
## Human / UI / integration
### {Change title}
- **Evidence**: `path/to/file.tsx:LINE` or relevant file
- **What changed**: one-sentence
- **Manual steps**: numbered list — where to click, what to type, what to observe
- **Expected result**: what a passing run looks like
- **Status**: ☐ todo / ✅ done / ⚠︎ blocked
(…repeat per change…)
## Out of scope (intentional no-test)
For entries the reviewer has deliberately chosen not to test — pure cosmetic moves, documentation, fixture-only changes, reverted code paths. One bullet each with a reason.
## Risk flags
If during the walk you find something that looks broken or likely to regress but wasn't caught by the branch's own tests, list it here with file:line. Do not open a new investigation — that's `pre-merge-review`'s job — but don't silently ignore it either.
Behaviour rules
- One entry per coherent change, not per line or per hunk. If a helper and its three callers change together, that's one entry.
- Every entry must name the exact file and line that is the evidence of the change.
- AI-category entries must include a runnable CLI prompt and expected trace fragment, not just a vague description. If you can't articulate a concrete expected signal, the change isn't ready to test — flag it as such.
- Unit entries must include either the existing test file or a concrete
ClassName.MethodNameto add. - Be explicit about already-covered changes — if a unit test already exists that exercises the change, mark it ✅ done rather than proposing a duplicate.
- Do not invent a JIRA id if none exists in the branch name — use the branch name itself.
- Overwrite the plan file on each run. This is an audit, not a log.