docs(skill): load canonical review-merge prompt into workflow file

Replace summary workflow with full §0–§38 canonical PR review/merge rules.
Align review-merge-final-report schema with §37 controller handoff fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
2026-07-07 03:37:42 -04:00
co-authored by Claude Opus 4.8
parent 3976f886e4
commit c05b2f4c05
4 changed files with 1136 additions and 253 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ final-report schema; do not apply rules from other modes.
| Task mode | Workflow | Final report schema | | Task mode | Workflow | Final report schema |
|-----------|----------|---------------------| |-----------|----------|---------------------|
| `review-merge-pr` | [`workflows/review-merge-pr.md`](workflows/review-merge-pr.md) | [`schemas/review-merge-final-report.md`](schemas/review-merge-final-report.md) | | `review-merge-pr` | [`workflows/review-merge-pr.md`](workflows/review-merge-pr.md) (canonical; §0–§38) | [`schemas/review-merge-final-report.md`](schemas/review-merge-final-report.md) |
| `create-issue` | `workflows/create-issue.md` (planned — #333) | `schemas/create-issue-final-report.md` (planned) | | `create-issue` | `workflows/create-issue.md` (planned — #333) | `schemas/create-issue-final-report.md` (planned) |
| `work-issue` | `workflows/work-issue.md` (planned — #333) | `schemas/work-issue-final-report.md` (planned) | | `work-issue` | `workflows/work-issue.md` (planned — #333) | `schemas/work-issue-final-report.md` (planned) |
@@ -1,80 +1,56 @@
# Review-merge final report schema # Review-merge controller handoff schema
**Task mode:** `review-merge-pr` **Task mode:** `review-merge-pr`
Every review or merge run must end with a section titled exactly End every review/merge run with a section titled exactly `Controller Handoff`.
`Controller Handoff` validated by `review_proofs.assess_controller_handoff`. Use this canonical field set. Do not omit fields — use `none` or
`not verified in this session` where appropriate.
Use this schema — not author or issue-filing fields (`PR number opened`, Do not use legacy fields: `Pinned reviewed head`, `Scratch worktree used`,
`Claim/comment status`, `Workspace mutations`). `Workspace mutations`, `Mutations: None` (when mutations occurred).
## Required header
```md ```md
## Controller Handoff ## Controller Handoff
- Task: review-merge-pr - Task:
- Repo: - Repo:
- Role/profile: - Role:
- Identity: - Identity:
- Mode: review-merge-pr - Active profile:
``` - Runtime context:
Identity format: `username / profile` (e.g. `sysadmin / prgs-reviewer`). Do not
include personal email unless required for disambiguation (#305).
## Selection and eligibility
```md
- Selected PR: - Selected PR:
- PR live state:
- Pinned reviewed head:
- Reviewer eligibility:
- Repositories checked:
- Open PR counts:
- Inventory completeness:
- Inventory pagination proof:
- Selected PR or reason none selected:
- Linked issue: - Linked issue:
- Linked issue live status: - Eligibility class:
``` - Queue ordering policy:
- Inventory pagination proof:
Linked issue number must match across all sections (#314). If not verified live: - Earlier PRs skipped:
`Linked issue status: not verified in this session`. - Candidate head SHA:
- Reviewed head SHA:
## Validation proof (#311, #323) - Target branch:
- Target branch SHA:
```md - Already-landed gate:
- Validation command: - Author-safety result:
- Validation working directory: - Prior request-changes state:
- Validation executable proof: - Review worktree used:
- Validation result: - Review worktree path:
- Baseline SHA: (required if full suite failed on PR head) - Review worktree inside branches:
- Baseline validation command/result: (required if approving despite full-suite failure) - Review worktree HEAD state:
- Matching failure list: - Review worktree dirty before validation:
``` - Review worktree dirty after validation:
- Baseline worktree used:
Reject vague claims like "same as master" without baseline worktree proof. - Baseline worktree path:
- Files reviewed:
## Review and merge outcome - Validation:
- Official validation integrity status:
```md - Terminal review mutation:
- Review decision: - Review decision:
- Review mutations: - Merge preflight:
- Merge result: - Merge result:
- Merge commit: - Linked issue status:
- Cleanup status: - Main checkout branch:
``` - Main checkout dirty state:
- Main checkout updated:
`Review mutations` must list exactly one live terminal review unless - File edits by reviewer:
operator-approved correction is documented.
## Mutation ledger (#319, #320)
Use precise categories — **not** `Workspace mutations` or bare `Mutations: None`.
```md
- File edits by reviewer: none
- Worktree/index mutations: - Worktree/index mutations:
- Git ref mutations: - Git ref mutations:
- MCP/Gitea mutations: - MCP/Gitea mutations:
@@ -83,31 +59,24 @@ Use precise categories — **not** `Workspace mutations` or bare `Mutations: Non
- Cleanup mutations: - Cleanup mutations:
- External-state mutations: - External-state mutations:
- Read-only diagnostics: - Read-only diagnostics:
```
Rules:
- `git fetch` → Git ref mutations
- `git worktree add/remove` → Worktree/index mutations
- merge simulation → Worktree/index mutations (#317)
- MCP review/merge calls → MCP/Gitea mutations + Review/Merge mutations
## Proof wording (#330)
Do not claim "live proof" for blockers unless revalidated this session. Prior
feedback at unchanged head: say `prior blocker reused` or `prior request-changes
still applies`.
Reject unsupported phrases: `inventory complete`, `same as master`, `live proof`,
`file edits none` — unless matching evidence is present.
## Blockers and safety
```md
- Blockers: - Blockers:
- Current status:
- Safe next action: - Safe next action:
- Safety: no self-review; no self-merge; no author mutations; no code edits - Safety statement:
``` ```
Long format (§K in SKILL.md) is required when merge occurred, validation failed, ### Already-landed handoff overrides
permissions blocked, or multiple repos were involved.
When eligibility class is `ALREADY_LANDED_RECONCILE_REQUIRED`:
- Reviewed head SHA: `none`
- Review worktree used: `false`
- Review worktree path: `none`
- Review decision: `none`
- Merge result: `none`
Identity format: `username / profile` (not personal email unless required — #305).
Narrative final report and controller handoff must agree on eligibility class,
candidate/reviewed head SHA, mutation state, worktree usage, review decision,
terminal review mutation, merge result, and linked issue status.
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -8,17 +8,21 @@ SKILL_DIR = REPO_ROOT / "skills" / "llm-project-workflow"
def test_review_merge_workflow_file_exists(): def test_review_merge_workflow_file_exists():
path = SKILL_DIR / "workflows" / "review-merge-pr.md" path = SKILL_DIR / "workflows" / "review-merge-pr.md"
text = path.read_text(encoding="utf-8") text = path.read_text(encoding="utf-8")
assert "Task mode:" in text assert "canonical: true" in text
assert "review-merge-pr" in text assert "review-merge-pr" in text
assert "gitea-reviewer" in text assert "## 0. Load the canonical workflow first" in text
assert "scripts/worktree-review" in text assert "## 26A. Terminal review mutation hard-stop" in text
assert "## 37. Controller handoff schema" in text
assert "INVENTORY_PAGINATION_UNPROVEN" in text
assert "ALREADY_LANDED_RECONCILE_REQUIRED" in text
def test_review_merge_final_report_schema_exists(): def test_review_merge_final_report_schema_exists():
path = SKILL_DIR / "schemas" / "review-merge-final-report.md" path = SKILL_DIR / "schemas" / "review-merge-final-report.md"
text = path.read_text(encoding="utf-8") text = path.read_text(encoding="utf-8")
assert "Controller Handoff" in text assert "Controller Handoff" in text
assert "Worktree/index mutations" in text assert "Candidate head SHA:" in text
assert "Terminal review mutation:" in text
assert "Workspace mutations" in text # documented as rejected assert "Workspace mutations" in text # documented as rejected