mirror of
https://github.com/Piebald-AI/claude-code-system-prompts.git
synced 2026-05-30 05:35:24 +08:00
28 lines
1.4 KiB
Markdown
28 lines
1.4 KiB
Markdown
<!--
|
|
name: 'Agent Prompt: /code-review part 1 base finder angles'
|
|
description: Shared base finder-angle instructions for the /code-review slash command covering line-by-line diff scanning, removed behavior, and cross-file tracing
|
|
ccVersion: 2.1.147
|
|
-->
|
|
### Angle A — line-by-line diff scan
|
|
|
|
Read every hunk in the diff, line by line. Then Read the enclosing function for
|
|
each hunk — bugs in unchanged lines of a touched function are in scope (the PR
|
|
re-exposes or fails to fix them). For every line ask: what input, state, timing,
|
|
or platform makes this line wrong? Look for inverted/wrong conditions,
|
|
off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
|
|
wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
|
|
|
|
### Angle B — removed-behavior auditor
|
|
|
|
For every line the diff DELETES or replaces, name the invariant or behavior it
|
|
enforced, then search the new code for where that invariant is re-established.
|
|
If you can't find it, that's a candidate: a removed guard, a dropped error
|
|
path, a narrowed validation, a deleted test that was covering a real case.
|
|
|
|
### Angle C — cross-file tracer
|
|
|
|
For each function the diff changes, find its callers (Grep for the symbol) and
|
|
check whether the change breaks any call site: a new precondition, a changed
|
|
return shape, a new exception, a timing/ordering dependency. Also check callees:
|
|
does a parallel change in the same PR make a call unsafe?
|