From f8d323a63ea8870c8673611a4243547f37527923 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:43:46 +0100 Subject: [PATCH 1/3] docs(gemini-task): Gemini reviews its finished work with a fresh subagent Before the hand-over, Gemini starts one reviewer subagent that sees only Acceptance and the diff, runs the mutation table plus its own breaks, and reports findings; Gemini fixes what holds up and lists every finding under ## Self-review in the PR body. Claude's independent review stays. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/gemini-task/SKILL.md | 51 ++++++++++++++++++++++++----- changelog.d/gemini-self-review.md | 11 +++++++ 2 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 changelog.d/gemini-self-review.md diff --git a/.claude/skills/gemini-task/SKILL.md b/.claude/skills/gemini-task/SKILL.md index d61b90f1d54..4852a87669c 100644 --- a/.claude/skills/gemini-task/SKILL.md +++ b/.claude/skills/gemini-task/SKILL.md @@ -273,7 +273,7 @@ This section is for the Gemini agent in the owner's agy session. to take. Reading GitHub is fine. Your only writes are your own branch and your own - draft PR (step 7); never create, edit, comment on, label, or close anything + draft PR (step 8); never create, edit, comment on, label, or close anything else. **Scale out when there is work for several agents (owner, 2026-10-30).** @@ -313,9 +313,10 @@ This section is for the Gemini agent in the owner's agy session. gates and test commands on the merged result; its path checks (which files may change) hold per package, so run those on its package branch (`git diff --name-only origin/main...origin/gemini/-`). Add one - changelog fragment for the task, push, and open one draft PR (step 7) - whose `## Plan` lists each package with its merge commit. A package that - failed stays out; name it under open steps. + changelog fragment for the task, push, have the whole task reviewed + (step 7), and open one draft PR (step 8) whose `## Plan` lists each + package with its merge commit. A package that failed stays out; name it + under open steps. - **A review round** is an owner's comment on the draft PR that lists packages the way briefs do (section 3, step 4). Work it as above, with these differences: round ``'s packages branch from @@ -323,8 +324,9 @@ This section is for the Gemini agent in the owner's agy session. `gemini/` the same way; path checks diff against `origin/gemini/` instead of `origin/main`; and the fragment and the draft PR exist already, so update the fragment only if the round changes - what it says. After the push, comment on the PR with each package's merge - commit and the result of every mutation-table row. + what it says. After the push, have the round reviewed (step 7), then + comment on the PR with each package's merge commit, the result of every + mutation-table row, and the self-review's findings. - Do not use `/teamwork` for this repository: it builds in its own folder (`~/teamwork_projects/`) without branches or PRs. 2. **Work in the dedicated clone on your own branch.** That clone is @@ -401,7 +403,32 @@ This section is for the Gemini agent in the owner's agy session. Co-Authored-By: Antigravity () ``` -7. **Hand over** when you finish or stop, whether on a blocker or at the end of +7. **Have the finished work reviewed before you hand it over** (owner, + 2026-10-30: code quality comes before saving tokens). When every step is + done, for a task in packages after the integration in step 1, and the + gates pass, push the branch and start one fresh subagent as the reviewer, + in its own worktree (the `branch` mode) on a detached checkout of + `origin/gemini/`. Its prompt names only: + - the Acceptance section of each brief, to `cat` itself, or of the issue; + - the diff: `git diff origin/main...origin/gemini/`, or for a review + round only the round's changes, + `git diff ...origin/gemini/`; + - its job: read the whole diff for defects (bugs, missed edge cases, + behavior the brief does not ask for, broken conventions, tests that + would stay green against a broken implementation); run the mutation + table, if Acceptance has one, and add two or three breaks of its own in + the code the change claims to cover; report each finding with + `path:line`, severity, and a concrete fix; commit and push nothing. + + Leave out your plan and your notes, so the reviewer judges the code and + not your intent. Fix the findings that hold up, in commits of their own, + run the gates again, and push. The PR body lists every finding under + `## Self-review`, fixed with its commit or declined with the reason. A + hand-over on a blocker skips this step. The self-review does not replace + Claude's review (section 3, step 3): a reviewer of the same model shares + the author's blind spots, so Claude's stays the independent one. + +8. **Hand over** when you finish or stop, whether on a blocker or at the end of the session. Push your branch and open a draft PR, or update the one you opened before. Write the body into a temp file first, in the repository's PR format, so Claude can ship it without rewriting it: @@ -426,6 +453,10 @@ This section is for the Gemini agent in the owner's agy session. ## Decisions - The choices the task left to you, and what you chose. + ## Self-review + - Each finding of the review subagent (step 7): fixed in , or + declined and why. + ## Open steps and questions - The steps still open and your questions, or "None". ``` @@ -496,7 +527,9 @@ This section is for the Gemini agent in the owner's agy session. package that drifted stands out. - Add Fable for high-risk diffs: security, production data, sandboxing, privacy. - - Gemini never reviews its own work. + - Gemini's self-review (section 2, step 7) does not replace this one, and + the subagent never sees it. Afterwards, judge each finding the + self-review declined in the PR body yourself. - **New tests need their mutation table run** by the subagent: apply each row to the real code, check that a test turns red, and revert; add a break or two of its own in the logic the tests claim to cover. On @@ -550,7 +583,7 @@ This section is for the Gemini agent in the owner's agy session. branch, never by rebasing a pushed branch. 5. **Ship.** Run the open-pr gates, add the PR number to the changelog fragment, and add one Summary bullet to the PR body, which Gemini wrote in - the repository's format (section 2, step 7): the change was implemented by + the repository's format (section 2, step 8): the change was implemented by Gemini 4 Argon in the owner's interactive agy session and reviewed by Claude, with the defects the review found and the commits that fixed them. This is provenance for the reviewer, not a "Generated with" footer. Then diff --git a/changelog.d/gemini-self-review.md b/changelog.d/gemini-self-review.md new file mode 100644 index 00000000000..8fd51a7807d --- /dev/null +++ b/changelog.d/gemini-self-review.md @@ -0,0 +1,11 @@ +### Changed + +- **Gemini reviews its own finished work before it hands over.** In the + `gemini-task` skill, Gemini starts one fresh subagent as a reviewer once a + task or a review round is done. The reviewer sees only Acceptance and the + diff, reads the whole diff for defects, and runs the mutation table plus + breaks of its own. Gemini fixes the findings that hold up and lists every + finding in a new `## Self-review` section of the PR body, as fixed or + declined. Claude's independent Opus review stays, because a reviewer of + the same model shares the author's blind spots. The owner's reason: code + quality comes before saving tokens. From 3b8a28e87c8308d1528f5bce0799754a02183364 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:44:08 +0100 Subject: [PATCH 2/3] docs(changelog): add the PR number to the self-review fragment Co-Authored-By: Claude Opus 5.5 --- changelog.d/gemini-self-review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/gemini-self-review.md b/changelog.d/gemini-self-review.md index 8fd51a7807d..8b2ee6eb383 100644 --- a/changelog.d/gemini-self-review.md +++ b/changelog.d/gemini-self-review.md @@ -8,4 +8,4 @@ finding in a new `## Self-review` section of the PR body, as fixed or declined. Claude's independent Opus review stays, because a reviewer of the same model shares the author's blind spots. The owner's reason: code - quality comes before saving tokens. + quality comes before saving tokens. (#12476) From 6642d97329cef3afa6a05a11ee4c8bac0ebdc730 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:47:58 +0100 Subject: [PATCH 3/3] docs(gemini-task): self-review covers single briefs, sees Constraints, has a blocker line Copilot review on #12476 (three low findings). Co-Authored-By: Claude Opus 5.5 --- .claude/skills/gemini-task/SKILL.md | 17 ++++++++++------- changelog.d/gemini-self-review.md | 5 +++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.claude/skills/gemini-task/SKILL.md b/.claude/skills/gemini-task/SKILL.md index 4852a87669c..cf7de97690b 100644 --- a/.claude/skills/gemini-task/SKILL.md +++ b/.claude/skills/gemini-task/SKILL.md @@ -404,17 +404,19 @@ This section is for the Gemini agent in the owner's agy session. ``` 7. **Have the finished work reviewed before you hand it over** (owner, - 2026-10-30: code quality comes before saving tokens). When every step is - done, for a task in packages after the integration in step 1, and the - gates pass, push the branch and start one fresh subagent as the reviewer, - in its own worktree (the `branch` mode) on a detached checkout of + 2026-10-30: code quality comes before saving tokens). This holds for every + task, a single brief as much as one in packages. When every step is done + (for packages: after the integration in step 1) and the gates pass, push + the branch and start one fresh subagent as the reviewer, in its own + worktree (the `branch` mode) on a detached checkout of `origin/gemini/`. Its prompt names only: - - the Acceptance section of each brief, to `cat` itself, or of the issue; + - the Constraints and Acceptance sections of each brief, to `cat` itself, + or of the issue; - the diff: `git diff origin/main...origin/gemini/`, or for a review round only the round's changes, `git diff ...origin/gemini/`; - its job: read the whole diff for defects (bugs, missed edge cases, - behavior the brief does not ask for, broken conventions, tests that + changes outside the Constraints, broken conventions, tests that would stay green against a broken implementation); run the mutation table, if Acceptance has one, and add two or three breaks of its own in the code the change claims to cover; report each finding with @@ -455,7 +457,8 @@ This section is for the Gemini agent in the owner's agy session. ## Self-review - Each finding of the review subagent (step 7): fixed in , or - declined and why. + declined and why. On a blocker hand-over: "Not run: hand-over on a + blocker." ## Open steps and questions - The steps still open and your questions, or "None". diff --git a/changelog.d/gemini-self-review.md b/changelog.d/gemini-self-review.md index 8b2ee6eb383..bca9e819340 100644 --- a/changelog.d/gemini-self-review.md +++ b/changelog.d/gemini-self-review.md @@ -2,8 +2,9 @@ - **Gemini reviews its own finished work before it hands over.** In the `gemini-task` skill, Gemini starts one fresh subagent as a reviewer once a - task or a review round is done. The reviewer sees only Acceptance and the - diff, reads the whole diff for defects, and runs the mutation table plus + task, single or in packages, or a review round is done. The reviewer sees + only the brief's Constraints and Acceptance and the diff, reads the whole + diff for defects, and runs the mutation table plus breaks of its own. Gemini fixes the findings that hold up and lists every finding in a new `## Self-review` section of the PR body, as fixed or declined. Claude's independent Opus review stays, because a reviewer of