Automated Copilot Code Review
This recipe produces evidence-backed findings while leaving implementation, tests, and review artifacts unchanged.
1. Pin the review context
- Use the pull request metadata as the source of truth for base SHA, head SHA, title, description, and changed files.
- Inspect the complete base-to-head diff and every commit in the review range.
- Apply the root instructions and every path-specific instruction file matching a changed path.
- Follow the contract-document pointers named by the applicable instructions when a changed surface reaches them.
Completion check: The base SHA, head SHA, changed paths, applicable instructions, contract documents, and validation scope are recorded.
2. Build the change model
- Trace changed entry points through callers, tests, workflows, package boundaries, and release metadata.
- State the invariant the pull request changes, the owner of that invariant, and the lifecycle and failure boundaries that preserve it.
- Identify affected public APIs, transaction boundaries, mutable state, concurrency, caches, measured operations, and generated artifacts.
Completion check: Every changed surface has an owner, an invariant, and an affected success or failure path.
3. Apply the review gates
Correctness
- Compare the changed behavior with its callers, existing paths, tests, and documented contract.
- Trace identity, ownership, ordering, cardinality, state cleanup, error propagation, and retry behavior across every affected boundary.
- Exercise relevant empty, duplicate, missing, deleted, excluded, repeated, large, concurrent, and failure inputs.
- For transformer or performance-test changes, apply the matching path-specific instructions as the source of detailed domain checks.
Performance validity
- For performance claims, apply the matching performance-review instructions and evaluate measured-operation scope, workload representativeness, comparison isolation, provenance, semantic equivalence, metric interpretation, and failure evidence.
Thermo-nuclear maintainability
Look for the code-judo move: a restructuring that removes concepts, branches, state, or indirection instead of relocating the same complexity.
- Raise a maintainability finding for ad-hoc conditionals, one-off flags, nullable modes, scattered special cases, duplicated helpers, or feature logic in the wrong layer when a simpler ownership model is available.
- Treat a PR-introduced file above 1,000 lines as a decomposition candidate; accept cohesion when the structure has a clear reason to remain together.
- Prefer direct, boring, typed code over magic, identity abstractions, cast-heavy contracts,
any, unclear unknown, and unnecessary optionality.
- Prefer canonical repository helpers and ownership boundaries over bespoke near-duplicates and shared-path leakage.
- Prefer parallel orchestration and atomic updates when they make ownership and failure behavior clearer.
- Raise a structural finding when the PR makes surrounding code materially more coupled, stateful, or difficult to scan despite preserving apparent behavior.
Contract and release impact
- For public behavior, APIs, dependencies, workflows, or performance-test contracts, verify generated reports, change files, package metadata, documentation, and release notes as applicable.
- Use the smallest relevant validation for the changed surface and record environment or credential limitations.
Completion check: Each applicable gate has been considered for every changed surface, and the review distinguishes correctness, performance validity, maintainability, and release findings.
4. Construct evidence-backed findings
- Report actionable findings anchored in changed code; use pre-existing code as context only when the pull request changes it or materially worsens it.
- Give each finding a severity, exact file and line anchor, trigger or input sequence, impact, evidence, smallest complete remediation, confidence, and validation limitation.
- Separate confirmed defects from risks requiring more evidence and from questions that need author clarification.
- Prefer a small set of high-confidence findings over stylistic observations or unsupported hypotheses.
Completion check: Every finding is independently actionable from its anchor and evidence, and every suspected issue that lacks evidence is labeled as uncertainty rather than presented as a defect.
5. Close the review
- Account for every changed file, including tests, workflows, generated API reports, change files, and documentation.
- State the validation commands and relevant results.
- State remaining uncertainty, missing environment access, and the surfaces inspected when no actionable finding remains.
Completion check: The final review contains findings or an evidence-backed no-finding result, validation status, and explicit residual uncertainty.
1---2name: code-review3description: Use when GitHub Copilot Code Review is performing an automated pull request review in this repository. Apply the correctness, performance-validity, and thermo-nuclear maintainability gates.4license: See the repository LICENSE.md5---67<!-- Attribution: The thermo-nuclear maintainability guidance in this skill was adapted from Cursor Team Kit's skill: https://github.com/cursor/plugins/blob/main/cursor-team-kit/skills/thermo-nuclear-code-quality-review/SKILL.md -->89# Automated Copilot Code Review1011This recipe produces evidence-backed findings while leaving implementation, tests, and review artifacts unchanged.1213## 1. Pin the review context1415- Use the pull request metadata as the source of truth for base SHA, head SHA, title, description, and changed files.16- Inspect the complete base-to-head diff and every commit in the review range.17- Apply the root instructions and every path-specific instruction file matching a changed path.18- Follow the contract-document pointers named by the applicable instructions when a changed surface reaches them.1920**Completion check:** The base SHA, head SHA, changed paths, applicable instructions, contract documents, and validation scope are recorded.2122## 2. Build the change model2324- Trace changed entry points through callers, tests, workflows, package boundaries, and release metadata.25- State the invariant the pull request changes, the owner of that invariant, and the lifecycle and failure boundaries that preserve it.26- Identify affected public APIs, transaction boundaries, mutable state, concurrency, caches, measured operations, and generated artifacts.2728**Completion check:** Every changed surface has an owner, an invariant, and an affected success or failure path.2930## 3. Apply the review gates3132### Correctness3334- Compare the changed behavior with its callers, existing paths, tests, and documented contract.35- Trace identity, ownership, ordering, cardinality, state cleanup, error propagation, and retry behavior across every affected boundary.36- Exercise relevant empty, duplicate, missing, deleted, excluded, repeated, large, concurrent, and failure inputs.37- For transformer or performance-test changes, apply the matching path-specific instructions as the source of detailed domain checks.3839### Performance validity4041- For performance claims, apply the matching performance-review instructions and evaluate measured-operation scope, workload representativeness, comparison isolation, provenance, semantic equivalence, metric interpretation, and failure evidence.4243### Thermo-nuclear maintainability4445Look for the **code-judo** move: a restructuring that removes concepts, branches, state, or indirection instead of relocating the same complexity.4647- Raise a maintainability finding for ad-hoc conditionals, one-off flags, nullable modes, scattered special cases, duplicated helpers, or feature logic in the wrong layer when a simpler ownership model is available.48- Treat a PR-introduced file above 1,000 lines as a decomposition candidate; accept cohesion when the structure has a clear reason to remain together.49- Prefer direct, boring, typed code over magic, identity abstractions, cast-heavy contracts, `any`, unclear `unknown`, and unnecessary optionality.50- Prefer canonical repository helpers and ownership boundaries over bespoke near-duplicates and shared-path leakage.51- Prefer parallel orchestration and atomic updates when they make ownership and failure behavior clearer.52- Raise a structural finding when the PR makes surrounding code materially more coupled, stateful, or difficult to scan despite preserving apparent behavior.5354### Contract and release impact5556- For public behavior, APIs, dependencies, workflows, or performance-test contracts, verify generated reports, change files, package metadata, documentation, and release notes as applicable.57- Use the smallest relevant validation for the changed surface and record environment or credential limitations.5859**Completion check:** Each applicable gate has been considered for every changed surface, and the review distinguishes correctness, performance validity, maintainability, and release findings.6061## 4. Construct evidence-backed findings6263- Report actionable findings anchored in changed code; use pre-existing code as context only when the pull request changes it or materially worsens it.64- Give each finding a severity, exact file and line anchor, trigger or input sequence, impact, evidence, smallest complete remediation, confidence, and validation limitation.65- Separate confirmed defects from risks requiring more evidence and from questions that need author clarification.66- Prefer a small set of high-confidence findings over stylistic observations or unsupported hypotheses.6768**Completion check:** Every finding is independently actionable from its anchor and evidence, and every suspected issue that lacks evidence is labeled as uncertainty rather than presented as a defect.6970## 5. Close the review7172- Account for every changed file, including tests, workflows, generated API reports, change files, and documentation.73- State the validation commands and relevant results.74- State remaining uncertainty, missing environment access, and the surfaces inspected when no actionable finding remains.7576**Completion check:** The final review contains findings or an evidence-backed no-finding result, validation status, and explicit residual uncertainty.