Lintel on GitHub Copilot. Generated from
skills/code-review/SKILL.md; edit the canonical file, then runli-copilot init.
- Resource root:
../../..from this skill's base directory (the Lintel source withbin/,lib/,skills/). Write plans, state and evidence into the working repository's.claude/tree, never into the resource root.- Skill-relative paths: this skill's own
scripts/,references/anddata/folders (and a<base>that the workflow defines as its own directory) mean../../../skills/code-review/in the Lintel source, not this generated folder.${LINTEL_SKILLS_DIR:-skills}means the skills root,../../../skills. Abin/li-runstep runs in the working repository, so use$LINTEL_SKILLS_DIR/code-review/there.- Shell steps: run Bash snippets with Bash (Git for Windows'
bash.exeon Windows, neverSystem32\bash.exe). Save a snippet to a temporary.shfile and runbash "<resource root>/bin/li-run" <file>; it preparesLINTEL_SOURCE_ROOT,LINTEL_REPO_ROOTand the profile context.- Tools: Read=
view, Write=create, Edit=edit, Bash=bash/powershell, Grep=grep, Glob=glob, AskUserQuestion=ask_user, TodoWrite=the plan checklist, Task or a named role=taskwith that custom agent, WebFetch=web_fetch.- Other Lintel workflows are native skills: invoke
/li-<name>rather than reading their files. Named roles such asCodeReviewerare custom agents.
/code-review
Reviews the selected changed result before landing. Use /inspect for plan-stage
engineering/design/devex assessment; use this workflow for the implemented diff.
An existing plan supplies acceptance, not a reason to skip reviewing the code.
Auto-scales by aggregate risk: mechanical diffs may use explicitly labeled inline review; substantive changes need a separately attributable reviewer. An optional outside-review tool does not substitute for missing independence.
When to use
- Branch is feature-complete, no design doc exists
- Quick correctness pass before
/ship - Small fixes / refactors needing focused correctness and quality feedback
/shipneeds the latest applicable content-bound review, not a clearance heading
When NOT to use
- Only a plan exists, with no implementation to inspect — use
/inspecton that plan - Trivial mechanical diff — inline review is proportionate; record the actual mode
- Tests fail — fix first, review after
Inputs
- Optional
--base <ref>— compare against this explicit local base rather than the repository's known default branch; resolve an unknown base instead of guessing. - Optional
--cross-check— request an additional independent pass through/cross-check. - Optional
--no-cross-check— skip that optional additional pass; this does not waive required independent review of substantive work. - Optional
--reviewer <name>— select an actual reviewer/client for--cross-check; requires that flag. Codex remains a valid explicitly authorized client. - Optional
--depth auto|lean|standard|deep— use the shared adaptive depth; default auto. An explicit depth cannot remove required controls or approve a multi-model panel.
Invocation: /code-review [--base <ref>] [--cross-check [--reviewer <name>] | --no-cross-check].
Conflicting cross-check flags are an input error, not a reason to choose silently.
Workflow
For ad-hoc work with no initiative map, keep this lightweight: capture an explicit
snapshot, review it and return useful read-only findings. Do not create a duplicate
plan/backlog merely to get review feedback. The shared snapshot + inspect
commands can bind observations without a map; they explicitly report
release_clearance: false. Mapped authority and full evidence are needed only to
enter the strict SHIP path. See inspection mode.
- Bind scope — follow the shared evidence procedure.
Include explicitly selected tracked, staged, unstaged, new and deleted files,
documentation/config inputs and the selected package/leaf acceptance. Use the
snapshot manifest for scope;
git diff <base>...HEAD --statcovers only committed changes. Preserve useful SMALL/MEDIUM/LARGE reporting without using line count to downgrade substantive risk. - Read selected content — inspect every selected changed state and relevant surrounding functions/tests. A commit-only diff cannot clear dirty/new files.
- Shared method review (no routine per-issue approval interview) — render the
Review Method packet, kind
code-review, stagequality, with assessed depth, confirmed surface tags and selected mandatory question IDs. Architecture, correctness, coverage and performance remain useful lenses, not a separate severity or evidence rubric. Check the report against its metadata and original packet body; preserve required unknowns, optional limitations and applicable pattern coverage. - Independent pass — use an actual available independent reviewer for substantive
scope.
--cross-checkrequests an additional separate opinion; skipping it does not waive required independence. Keep findings read-only and route fixes to the builder. Forward the exact selected snapshot to/cross-check --diff, including any explicit reviewer choice; do not substitute the current committed diff for it. A selected unavailable reviewer leaves that pass unverified, never silently replaced. - Persist via
bin/li-review-logwithskill: code-review(distinct from Phase-6/review, plan/repository/inspectand an additionalcross-checkdecision). - Output: findings list + severity + suggested fixes.
Report format
Review Status: <branch> vs <base>
Diff scope: 173 lines changed across 8 files (MEDIUM)
Additional cross-check: optional, not requested
## Findings (3)
[P2] (confidence: 8/10) src/services/billing.ts:47 — N+1 query in refund flow
Loop calls payment.fetch() per refund; batch via .fetchMany()
Suggested: ~5 line refactor
[P3] (confidence: 7/10) src/utils/format.ts:12 — DRY violation
formatDate duplicated in format.ts and date-helpers.ts; consolidate
[P2] (confidence: 9/10) tests/billing.test.ts:NEW — Missing required edge case
Selected acceptance requires refundPayment with 0 amount; no test covers it.
Add the regression check and report its actual result.
## Verdict
- P1 count: 0 — no block
- P2 count: 2 — must resolve before /ship
- P3 count: 1 — advisory improvement
Resolve P1/P2 findings, then recheck the exact result through the shared evidence gate.
An empty finding count alone is not release clearance.
Persist the full version-2 decision with skill: code-review through the shared
writer, then consume the shared reader with the same expected context and actual
host/human corroboration. The procedure defines
the executable commands. Preserve work/package/leaf IDs, attempt, profile context/
generation/digest and required policy; verify the current reference before consumption.
Missing/unverified mandatory controls block independently of advisory findings.
Empty or placeholder commits and loose clearance strings
are not valid evidence.
Compliance integration
- Sanity scan on diff content (secrets, customer-data, PII) — fast pre-check. Blocks if hit.
cli_support+voicefrontmatter validation on any new/changed skill or agent files in the diff.
Optional MARS panel
For a high-risk diff (auth, data loss, concurrency, migration or a security boundary),
offer MARS once when li-mars.py offer (caller code-review) returns 0.
The panel sends the same Review Method packet (kind
code-review, stage quality) as the single reviewer and binds the same selection,
depth and mandatory inventory. Findings stay read-only inspection input; the optional
--cross-check pass, required independence and the shared evidence gate are unchanged.
Confidence scoring
Use the shared method's 1-10 confidence and E1-E4 evidence levels. Confidence never changes consequence-based severity or hides an unresolved mandatory observation. Separate a concrete defect from a hypothesis and state the check that would settle it.
Failure modes
- Diff empty: implementation clearance is blocked. An approved verification-only task may use its actual acceptance evidence without inventing changes.
- Diff too large to fully analyze: report unreviewed files/controls explicitly; partial findings cannot clear their mandatory acceptance.
- Outside reviewer unavailable: use an available separate reviewer or manual handoff. A main-agent self-review remains declared, not independently corroborated.
bin/li-review-logunavailable: print findings; strict clearance remains blocked.
Examples
Small clean diff:
> /code-review
Diff scope: 23 lines, 2 files (SMALL)
No findings. Ready for the shared evidence gate, not clearance from this sentence.
Medium diff with findings:
> /code-review
[3 findings reported]
P1: 0, P2: 1, P3: 2
Action: fix P2 before /ship.
Large diff with a corroborated independent P1 finding:
> /code-review
Diff: 412 lines, 18 files (LARGE)
Independent reviewer: P1 found — race condition in payment-handler.ts:108
✗ /ship BLOCKED until P1 resolved
See also
/inspect— engineering/design/devex lenses over a selected plan or repository/diagnose— debugging when /code-review finds something broken/cross-check— an additional separate opinion using an available authorized reviewer/verify— read-only validation of the reviewed result; repair requires explicit authority/ship— consumes the latest applicable content-bound decision and same-context read-only QA