mirror of
https://github.com/penpot/penpot.git
synced 2026-11-19 00:20:35 +00:00
📚 Add follow-up verification to code reviews
Include remedies, tests and decisions in review findings. Preserve review context in plans and offer to resume the reviewer after implementation. Keep follow-up verification optional and report deferred findings clearly. AI-assisted-by: gpt-6.1-terra
This commit is contained in:
parent
b76eaa1f5c
commit
e7732541c3
@ -352,7 +352,10 @@ small. To delegate without switching models, delegate to `general`.
|
||||
whether it will create an issue and a branch, the execution style, and a
|
||||
task checklist — and waits for your go-ahead. Say "step by step" to stop
|
||||
after each task (one commit per task) so you can verify as it goes;
|
||||
the default runs all tasks with one final commit.
|
||||
the default runs all tasks with one final commit. For a plan based on a
|
||||
code review, it then asks whether to have the original reviewer verify the
|
||||
corrections. If that session is unavailable, it tells you and uses a new
|
||||
reviewer with the review and implementation context.
|
||||
5. **Land the work.** When it finishes, either push yourself and invoke
|
||||
`@create-pr`, or loop `@review-code` → `@make-a-plan` →
|
||||
`@implement-plan` until the findings are addressed, then push and invoke
|
||||
|
||||
@ -103,6 +103,8 @@ For detailed security guidance, see `security-and-hardening`.
|
||||
|
||||
For each finding, describe the circumstances under which it could fail: specific inputs, load conditions, timing, or user actions that trigger the problem. "This crashes when input is null" is actionable; "this might crash" is not.
|
||||
|
||||
For each finding, propose a concrete remedy and the tests needed to verify it. If a decision requires user input, state the real options, their consequences, and your recommendation within that finding. Do not ask the user to decide during the review, and do not ask about implementation details the code can settle.
|
||||
|
||||
Lead with what matters: correctness and security first, then structural issues, then everything else. A few high-conviction comments beat a long list.
|
||||
|
||||
5. **Check the evidence, do not re-run it** — Which tests cover the change? What did the author run, and what did CI report? Never re-run the full suite or a build yourself: the author's run and CI already cover that, and repeating it only lengthens the review. Run at most the single test file that settles a specific doubt. When no checks have been run at all (a change you did not see tested), run the module's checks before the verdict.
|
||||
@ -127,11 +129,11 @@ Briefly explain what the code does and give an overall assessment.
|
||||
|
||||
### Critical and High-Priority Issues
|
||||
|
||||
List problems that could cause security incidents, data loss, crashes, incorrect behavior, or major performance degradation. Each finding gets its unique ID (`R1`, `R2`, …). For each: state the severity, identify the file/function/code section, explain why it's a problem, describe failure circumstances, and provide a concrete improvement with corrected code when useful.
|
||||
List problems that could cause security incidents, data loss, crashes, incorrect behavior, or major performance degradation. Each finding gets its unique ID (`R1`, `R2`, …). For each: state the severity, identify the file/function/code section, explain why it's a problem, describe failure circumstances, and provide a concrete improvement with corrected code when useful. Include the tests needed and any user decision, options and recommendation in the finding itself.
|
||||
|
||||
### Other Findings
|
||||
|
||||
List medium- and low-priority issues, including maintainability and design concerns. Use `M1`, `M2`, … for Medium/Low and `S1`, `S2`, … for Suggestions.
|
||||
List medium- and low-priority issues, including maintainability and design concerns. Use `M1`, `M2`, … for Medium/Low and `S1`, `S2`, … for Suggestions. Apply the same remedy, test and decision guidance to each finding; say when no new test is needed and why.
|
||||
|
||||
### Suggested Refactoring
|
||||
|
||||
@ -139,7 +141,7 @@ Provide focused code changes or revised snippets. Preserve existing behavior unl
|
||||
|
||||
### Testing Recommendations
|
||||
|
||||
Identify missing tests and describe specific test cases, including edge cases and failure scenarios.
|
||||
Summarize the verification approach and any cross-cutting test cases, including edge cases and failure scenarios. Keep missing tests as severity-tagged findings and link this section to their IDs.
|
||||
|
||||
### Positive Observations
|
||||
|
||||
|
||||
@ -32,6 +32,11 @@ in the local working tree.
|
||||
|
||||
Do not use it to produce plans — that is the `make-a-plan` flow.
|
||||
|
||||
For a plan derived from a code review, retain its review target, reviewer
|
||||
session ID, original findings and decisions. Record the starting revision and
|
||||
the exact commits or diff produced by this implementation, plus test evidence,
|
||||
in session context for follow-up. Do not put commit hashes in the plan file.
|
||||
|
||||
## 1. Read the plan first
|
||||
|
||||
Identify the plan to execute — from the file path the user gave, the
|
||||
@ -146,11 +151,22 @@ stop and ask the user before splitting it.
|
||||
|
||||
## When you are done
|
||||
|
||||
After the entire plan is implemented and verified, including the final task in
|
||||
step-by-step mode, if it addresses code review findings, ask whether the user
|
||||
wants the original reviewer to verify the corrections. Use the `question` tool
|
||||
if available; otherwise ask in chat. Wait for the answer. Do not start the
|
||||
follow-up without consent, and do not ask after each intermediate task.
|
||||
|
||||
If the user accepts, follow `@review-code`'s follow-up procedure with the
|
||||
review context, decisions, exact correction range or diff and test evidence.
|
||||
If the original reviewer cannot be resumed, say so and use a new reviewer with
|
||||
the same context. If the user declines, stop without starting a review. The
|
||||
follow-up is read-only; further fixes require the user's direction.
|
||||
|
||||
End by suggesting the next steps (suggestions, not a required pipeline — any
|
||||
instruction from me overrides them):
|
||||
|
||||
- `@review-code` — to review the changes just committed; it routes to
|
||||
`@make-a-plan` by itself if the findings need one.
|
||||
- `@review-code` — for a new independent review of the changes.
|
||||
- `@create-pr` — when the task is done and the branch is ready to merge.
|
||||
|
||||
## User input, overrides and additional context
|
||||
|
||||
@ -39,6 +39,11 @@ Do not use it to execute a plan — that is the `implement-plan` flow.
|
||||
example, `delegated` in the user context), delegate to the `general` subagent
|
||||
instead — the delegate must also follow the `planner` skill and receive all
|
||||
the relevant session context (a review, user feedback, and so on).
|
||||
When the plan addresses a code review, preserve the review target, reviewer
|
||||
session ID if available, original findings and IDs, and decisions including
|
||||
deferred or rejected findings and their reasons in the local plan. Map
|
||||
accepted findings to tasks. If context is unavailable, mark it unknown; do
|
||||
not invent it. Pass this context to a delegated planner too.
|
||||
2. Before asking me to decide anything, explain the plan and every open question in
|
||||
plain language. Assume I know only the high-level project goal, not the codebase,
|
||||
architecture, implementation terms, or the problem this task solves.
|
||||
|
||||
@ -32,12 +32,17 @@ Act as a senior software engineer and perform a thorough code review.
|
||||
- Read-only: modify no file and create no commit. Reviewing never writes.
|
||||
- Do not invent problems: every finding must be real and actionable.
|
||||
- Missing tests are an issue, not a suggestion — a severity-tagged finding.
|
||||
- For each finding, give a concrete remedy and the tests needed to verify it.
|
||||
If a user decision is needed, include the real options and a recommendation
|
||||
in that finding. Do not pause to ask during the review.
|
||||
- Prioritize by impact: one structural issue outweighs ten nits, and "this
|
||||
could be better" is not a finding — say why and how.
|
||||
- Skip generated files, lockfile-only changes and unrelated modifications
|
||||
unless they introduce security risks.
|
||||
3. When the subagent returns, output the review to the user verbatim. Do not
|
||||
summarize it and do not act on its findings.
|
||||
summarize it and do not act on its findings. Retain the subagent session ID,
|
||||
review target and complete findings in the session context for follow-up;
|
||||
do not invent an ID if the tool does not provide one.
|
||||
4. Right after the review, suggest how to proceed based on the findings. These
|
||||
are suggestions — the user decides:
|
||||
- **Approve (no required changes):** say so — there is nothing to address.
|
||||
@ -45,6 +50,30 @@ Act as a senior software engineer and perform a thorough code review.
|
||||
review is done — no plan needed.
|
||||
- **Substantive findings:** suggest `@make-a-plan` to make a plan to address
|
||||
them.
|
||||
- If the user wants to discuss findings one by one, use `@issue-walkthrough`
|
||||
on request; do not start it automatically.
|
||||
|
||||
### Follow-up after implementation
|
||||
|
||||
When the user agrees to verify corrections, resume the original reviewer using
|
||||
its session ID if the tool supports it. Give it the original review target and
|
||||
findings, the decisions and plan, the exact correction commit range or diff,
|
||||
and the test evidence. Require it to inspect the actual corrections and
|
||||
evidence, not rely on its earlier context alone. If the original session is
|
||||
unavailable or cannot be resumed, tell the user and delegate to a new reviewer
|
||||
with the same context; never claim it is the original reviewer. If the review,
|
||||
decisions or correction range cannot be established, ask for the missing
|
||||
information rather than inventing it.
|
||||
|
||||
The reviewer follows `code-review-criteria` and remains read-only. It reports
|
||||
each original finding with its unchanged ID as **resolved**, **pending**, or
|
||||
**not addressed** (including the agreed reason); report any new problems with
|
||||
new, non-conflicting IDs. For pending and new problems, give evidence, a remedy,
|
||||
tests and any user decision as in the original review. Summarize separately
|
||||
whether all agreed corrections are resolved and whether any findings remain,
|
||||
including deferred findings. Do not equate deferred with resolved. Present the
|
||||
result without implementing fixes; the user chooses whether to iterate, request
|
||||
an independent review, or stop.
|
||||
|
||||
### Hard rule — read-only while reviewing
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user