一键导入
prp-done
Issue closure gate — verifies PR merged, review artifact exists, verify artifact exists, and Vera QA passed before closing a GitHub issue.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Issue closure gate — verifies PR merged, review artifact exists, verify artifact exists, and Vera QA passed before closing a GitHub issue.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Multi-agent PR review — spawns parallel specialized agents for deep code review.
Multi-agent PR review — spawns parallel specialized agents for deep code review.
Execute an implementation plan with rigorous validation loops — typecheck, lint, test, and build after every change. TDD approach with automatic failure recovery.
Create a comprehensive implementation plan by analyzing the codebase, discovering patterns, and producing a step-by-step actionable plan document.
Execute an implementation plan with rigorous validation loops — typecheck, lint, test, and build after every change. TDD approach with automatic failure recovery.
Create a comprehensive implementation plan by analyzing the codebase, discovering patterns, and producing a step-by-step actionable plan document.
| name | prp-done |
| description | Issue closure gate — verifies PR merged, review artifact exists, verify artifact exists, and Vera QA passed before closing a GitHub issue. |
| metadata | {"short-description":"Close issue after all gates pass"} |
Issue number and options: $ARGUMENTS
Format: <issue-number> [--repo <owner/repo>] [--skip-vera --reason="..."]
Verify that all completion gates have passed before closing a GitHub issue. Prevents premature issue closure when a PR was merged but QA or requirements verification was not completed.
The Gates (checked in order):
Fixes #N or Closes #N in PR body).prp-output/reviews/pr-{PR}-agents-review*.md).prp-output/reviews/pr-{PR}-verify.md)Extract issue number from $ARGUMENTS. If not provided: STOP — "Issue number required. Usage: /prp-done <issue-number>"
SKIP_VERA = false
SKIP_REASON = ""
REPO = "{from --repo flag}"
| Flag | Action |
|---|---|
--repo <owner/repo> | Set REPO = value |
--skip-vera | Set SKIP_VERA = true |
--reason="..." | Set SKIP_REASON = value |
Validation: If SKIP_VERA = true AND SKIP_REASON is empty → STOP: "--skip-vera requires --reason="""
# Auto-detect if not provided via --repo
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner' 2>/dev/null)
If REPO is still empty: STOP — "Cannot determine repo. Use --repo <owner/repo>."
gh issue view {ISSUE_NUMBER} -R {REPO} --json title,body,state,comments
| Result | Action |
|---|---|
| state=CLOSED | WARN: "Issue #{N} is already closed." → display gate status below, EXIT 0. |
| state=OPEN | Proceed to Phase 1. |
| Not found | STOP: "Issue #{N} not found in {REPO}." |
Find the merged PR linked to this issue:
# Search for merged PRs mentioning this issue number
gh pr list -R {REPO} --search "closes #{ISSUE_NUMBER}" --state merged --json number,title,mergedAt
gh pr list -R {REPO} --search "fixes #{ISSUE_NUMBER}" --state merged --json number,title,mergedAt
If multiple PRs found: use the most recently merged one.
| Result | Gate 1 |
|---|---|
| Merged PR found | ✅ PASS — set PR_NUMBER |
| No merged PR | ❌ FAIL — "No merged PR found for issue #{N}. Merge a PR with 'Fixes #{N}' in body first." |
Set PR_NUMBER from the found PR for subsequent gates.
Check for multi-agent review artifact in cwd:
ls .prp-output/reviews/pr-${PR_NUMBER}-agents-review*.md 2>/dev/null
| Result | Gate 2 |
|---|---|
| File found | ✅ PASS |
| No file | ❌ FAIL — "No review artifact for PR #${PR_NUMBER}. Run: /prp-review-agents ${PR_NUMBER}" |
Check for requirements verification artifact in cwd:
ls .prp-output/reviews/pr-${PR_NUMBER}-verify.md 2>/dev/null
| Result | Gate 3 |
|---|---|
| File found | ✅ PASS |
| No file | ❌ FAIL — "No verify artifact for PR #${PR_NUMBER}. Run: /prp-verify ${PR_NUMBER} --issue ${ISSUE_NUMBER}" |
Skip if SKIP_VERA = true (proceed to 1.5 audit log).
Search issue comments for Vera QA verdict (most recent comment wins):
gh issue view {ISSUE_NUMBER} -R {REPO} --json comments -q '.comments[].body'
Search for QA verdict patterns (case-insensitive):
QA PASSED (with warnings) → PASSQA PASSED → PASSQA FAILED → FAIL| Result | Gate 4 |
|---|---|
| "QA PASSED" or "QA PASSED (with warnings)" found (last match) | ✅ PASS |
| "QA FAILED" found (last match) | ❌ FAIL — "Vera QA failed. Fix and re-delegate: /prp-qa --delegate=vera --issue #{N}" |
| No QA comment | ⏳ PENDING — "Vera QA not completed. Delegate: /prp-qa --delegate=vera --issue #{N}" |
If SKIP_VERA = true:
logger -t prp-done "SKIP_VERA issue=\"${ISSUE_NUMBER}\" pr=\"${PR_NUMBER}\" repo=\"${REPO}\" reason=\"${SKIP_REASON}\"" 2>/dev/null || true
Gate 4 status: ⏭️ SKIPPED (audit-logged)
## Done Gate Report: Issue #{N}
| Gate | Check | Status | Detail |
|------|-------|--------|--------|
| Gate 1 | PR merged | {✅ PASS / ❌ FAIL} | PR #{PR_NUMBER} merged on {date} |
| Gate 2 | Review artifact | {✅ PASS / ❌ FAIL} | {filename or "not found"} |
| Gate 3 | Verify artifact | {✅ PASS / ❌ FAIL} | {filename or "not found"} |
| Gate 4 | Vera QA | {✅ PASS / ❌ FAIL / ⏳ PENDING / ⏭️ SKIPPED} | {detail} |
| Condition | Action |
|---|---|
| All gates PASS | Close issue → Phase 2.3 |
| Gate 4 SKIPPED + gates 1–3 PASS | Close issue → Phase 2.3 (with skip note) |
| Any gate FAIL | STOP — report failed gates, do NOT close |
| Gate 4 PENDING | STOP — "Vera QA not completed. Cannot close until QA passes or use --skip-vera." |
Post summary comment then close:
gh issue comment {ISSUE_NUMBER} -R {REPO} --body "## All Gates Passed ✅
{gate table from 2.1}
Closing issue — all completion criteria verified.
{If SKIP_VERA: \"\\n⚠️ Gate 4 (Vera QA) skipped — reason: {SKIP_REASON}\"}
Closed by: /prp-done"
gh issue close {ISSUE_NUMBER} -R {REPO}
On success:
DONE GATE REPORT: Issue #{N}
Gate 1 (PR merged): ✅ PASS — PR #M merged
Gate 2 (Review artifact): ✅ PASS — pr-M-agents-review.md found
Gate 3 (Verify artifact): ✅ PASS — pr-M-verify.md found
Gate 4 (Vera QA): ✅ PASS — QA PASSED comment found
Issue #{N} CLOSED ✅
On failure:
DONE GATE REPORT: Issue #{N}
Gate 1 (PR merged): ✅ PASS — PR #M merged
Gate 2 (Review artifact): ✅ PASS
Gate 3 (Verify artifact): ❌ FAIL — no verify artifact found
Gate 4 (Vera QA): ⏳ PENDING
BLOCKED: 2 gates failed. Issue NOT closed.
To fix:
/prp-verify M --issue N
/prp-qa --delegate=vera --issue N
/prp-done 166
/prp-done 166 --repo gobikom/agent-devops
/prp-done 166 --skip-vera --reason="no UI changes — API-only fix"
| Situation | Action |
|---|---|
| Multiple merged PRs for issue | Use most recently merged one |
| PR linked via comment (not body) | Still counts — search all PR references |
| Vera commented FAIL then PASS | Use latest verdict (last matching comment wins) |
| Verify artifact is PARTIAL verdict | Still passes Gate 3 — artifact existence is the gate, not verdict content |
| Issue already closed | WARN and exit 0 — display gate status for reference |
--skip-vera without audit log available | logger fails silently ( |