一键导入
greenlight-pr
Greenlight a PR — fix CI failures, triage review comments, iterate until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Greenlight a PR — fix CI failures, triage review comments, iterate until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Call the premium Fable advisor through Claude Code CLI from Codex for hard judgment, architecture, product thinking, frontend/design critique, and high-stakes decisions. Treat the advisor as the smartest and most expensive local AI. Use when the user asks to call an advisor, consult Fable/Claude, get a second opinion, compare another agent's output, improve design quality, reason through a hard problem, start or resume an advisor session, reuse advisor/Fable session cache, use high thinking/effort, or manage Claude Code background agents while controlling cost. Prefer call-worker for routine implementation, fast code edits, tests, and mechanical cleanup.
Call the fast Codex GPT-5.5 worker through Codex CLI from Codex or another terminal for clean code implementation, focused repo exploration, tests, refactors, bug fixes, and mechanical engineering tasks. Treat the worker as fast and strong at code, but less suited than the Fable advisor for hard judgment and frontend/design taste. Use when the user asks to call a worker, trigger Codex from the CLI, delegate bounded code work, run Codex outside the Codex IDE/app, run non-interactive codex exec, resume or reuse a worker/Codex CLI thread, use GPT-5.5 with high reasoning effort, or wrap Codex CLI behavior for repeatable agent runs. Prefer call-advisor for expensive advisor work, design critique, architecture judgment, and ambiguous strategy.
Before implementing a feature or non-trivial change, scan the code it will land in and surface prep refactors that make the change easy — so the feature lands clean instead of accreting tech debt (Kent Beck "make the change easy, then make the easy change"). Use BEFORE writing code, when about to build a feature, add a new case/provider/handler to an existing pattern, restructure in service of upcoming work, or just after an implementation plan is set. Every proposal must trace to the upcoming change — not generic cleanups. Skip tiny edits and brand-new code; for changes already written use complexity-check instead.
Audit an AI answer back to the searches, sources, citations, and assumptions behind it — which results actually shaped it, and which claims are unsupported model guesswork. Traces what the answer was based on; does not grade whether it is correct. User-run on an answer (with its question if available); read-only — never alters the answer.
Multi-persona naming exploration with consensus. Spawns parallel sub-agents — each embodying a different naming philosophy (David Placek's Lexicon methodology, the Poet, the Linguist, the Culture Hacker, the Futurist) — to explore divergent naming directions for a product or company, then synthesizes into a ranked shortlist. Based on David Placek's naming framework (Lexicon Branding — Swiffer, BlackBerry, Impossible, Sonos, Pentium). Use when naming a product, company, feature, or brand and you want breadth, surprise, and strategic advantage before committing.
Turn an ai-answer-audit into a prioritized plan to get a brand cited in AI answers (ChatGPT, Perplexity, Google AI Overviews). Acts only on the audit's affectable content layer — earned citations, your own pages, open territory — and never promises to move the model layer. User-run on an audit + your brand/URL; a one-shot plan, not citation monitoring.
| name | greenlight-pr |
| description | Greenlight a PR — fix CI failures, triage review comments, iterate until green. |
| argument-hint | [PR number or URL] |
| hooks | {"PostToolUse":[{"matcher":"*","hooks":[{"type":"command","command":"python3 \"$HOME/.claude/skills/skill-feedback/scripts/skill-event.py\" --skill greenlight-pr --event skill_activated --agent-harness claude-code --quiet","timeout":5}]}]} |
Drive a PR to green — fix CI, address AI code reviews, iterate until merge-ready.
You are the decision-maker, not the reviewer. AI review bots do the reviewing. You evaluate their feedback, decide what's worth fixing, fix it well, and iterate until clean.
python3 ~/.claude/skills/greenlight-pr/scripts/gl-snapshot.py [PR]
Returns structured JSON: CI status, review comments (with code context), and recommended actions. State persists in /tmp/gl-{repo}-pr{N}.json.
| Flag | Purpose |
|---|---|
7 | Explicit PR number |
--mark-seen 123,456 | Mark comment IDs as processed |
--retry-failed | Rerun failed CI jobs (budget: 3/SHA) |
--wait-review | Poll until new comments appear (timeout: 5min) |
--timeout 120 | Custom timeout for --wait-review |
--reset | Clear state for fresh start |
The code-review skill posts inline PR comments — just like CodeRabbit or any other bot. Greenlight-pr triages them all the same way.
The difference: code-review signals its status via HTML comment markers in PR comments:
<!-- code-review-status: in_progress --> — review is running<!-- code-review-status: complete --> — review is done, findings postedWhenever you are about to triage comments or wait for reviews, also check if a code-review is in progress. If it is, wait for it to finish before proceeding (poll every 30s, timeout 10min). This is in addition to the existing --wait-review polling for external bots — both must finish before you triage.
# Check if code-review skill is still running
COMMENTS=$(gh pr view [PR] --comments --json comments -q '.comments[].body')
if echo "$COMMENTS" | grep -q 'code-review-status: in_progress' && \
! echo "$COMMENTS" | grep -q 'code-review-status: complete'; then
# Poll until complete
for i in $(seq 1 20); do
sleep 30
COMMENTS=$(gh pr view [PR] --comments --json comments -q '.comments[].body')
echo "$COMMENTS" | grep -q 'code-review-status: complete' && break
done
fi
| State | Meaning | Agent behavior |
|---|---|---|
done | CI green, no pending bot reviews, no new comments | Report merge-ready |
stop_pr_closed | PR was merged or closed | Stop |
stop_exhausted_retries | Flaky CI retry budget used up | Escalate to user |
stop_waiting_review_pending | Timed out waiting; external bot review still pending | Report "blocked on external review" and exit cleanly — do not present as finished or merge-ready. Rerun later. |
snapshot = gl-snapshot.py [PR]
actions = snapshot.actions
loop:
if "stop_pr_closed" in actions:
return "PR merged or closed"
if "stop_exhausted_retries" in actions:
return "CI retries exhausted — ask user"
if "fix_ci" in actions:
for each check in snapshot.ci.failed:
if check.classification == "branch":
read check.log_excerpt
find the failure cause in the code
fix it
commit → push
goto snapshot
if "retry_ci" in actions:
gl-snapshot.py --retry-failed
gh pr checks [PR] --watch --fail-fast
goto snapshot
if "triage_comments" in actions:
check for code-review in progress → wait if needed (see above)
run TRIAGE PROCESS (see references/triage-process.md)
push fixes
gh pr checks [PR] --watch --fail-fast # wait for CI first
snapshot = gl-snapshot.py --wait-review # polls with timeout; returns full snapshot
check for code-review in progress → wait if needed
actions = snapshot.actions # may be stop_waiting_review_pending if timed out
continue loop # re-evaluate from wait result
if "wait_review" in actions:
snapshot = gl-snapshot.py --wait-review # polls with timeout; returns full snapshot
check for code-review in progress → wait if needed
actions = snapshot.actions # may be stop_waiting_review_pending if timed out
continue loop # re-evaluate — do NOT re-snapshot
if "wait_ci" in actions:
gh pr checks [PR] --watch --fail-fast
goto snapshot
if "stop_waiting_review_pending" in actions:
return "CI green, no actionable comments yet, but external bot review still pending. Rerun later."
if "done" in actions:
return "CI green, no pending bot reviews, no new comments — merge-ready"
Concrete commands for the most common flow: bot posts comments → triage → fix → re-review.
# 1. Snapshot
python3 ~/.claude/skills/greenlight-pr/scripts/gl-snapshot.py 42
# → actions: ["triage_comments"], new_comments: [{id: "123", body: "...", code_context: "..."}]
# 2. Triage (see references/triage-process.md)
# Read comments, spawn sub-agents, decide FIX/DISAGREE/DEFER
# Fix the code...
# 3. Commit and push
git add -A && git commit -m "Address review: fix X, Y" && git push
# 4. Reply to each comment
gh api repos/owner/repo/pulls/42/comments/123/replies -f body="Fixed — description. See abc1234"
# 5. Post round summary
gh pr comment 42 --body "## Greenlight — Round 1
**Fixed (2):** X, Y
**Disagreed (1):** Z — reasoning"
# 6. Mark as seen
python3 ~/.claude/skills/greenlight-pr/scripts/gl-snapshot.py --mark-seen 123,456,789
# 7. Wait for bot re-review, then re-snapshot
gh pr checks 42 --watch --fail-fast
python3 ~/.claude/skills/greenlight-pr/scripts/gl-snapshot.py --wait-review
python3 ~/.claude/skills/greenlight-pr/scripts/gl-snapshot.py 42
# → new round: check actions again
The snapshot only returns inline review comments with code_context (the diff hunk). It ignores:
If CodeRabbit auto-marks a comment as "Addressed in commit X", you don't need to reply again unless you want an audit trail.
State persists in /tmp/gl-{repo}-pr{N}.json. If a session is interrupted, just re-run the snapshot — it picks up where you left off with all processed comment IDs intact.
The full process with sub-agent prompts and decision trees is in references/triage-process.md. Summary:
Phase 1 — EVALUATE
spawn sub-agents to evaluate each comment
each returns: verdict (FIX/DISAGREE/DEFER) + reasoning + confidence
Phase 2 — SYNTHESIZE
collect sub-agent results
resolve conflicts (agents may disagree)
filter: only HIGH/MEDIUM confidence FIXes that pass quality check
Phase 3 — ACT
implement fixes (one commit, grouped)
reply to every comment individually
post round summary as PR comment
gl-snapshot.py --mark-seen <ids>
--wait-review then re-snapshot.references/triage-process.md — Sub-agent prompts, decision pseudocode, quality checks, reply templatesreferences/ci-classification.md — Branch vs flaky heuristicsreferences/known-bots.md — AI review bot catalog and re-review patternsAfter the run, if this skill was useful, confusing, broken, or missing context, submit 1-3 safe sentences. Include --agent-harness when known. Include --model-config only if the harness exposes the exact model/config; otherwise leave it as unknown:
python3 ~/.agents/skills/skill-feedback/scripts/skill-feedback.py --skill greenlight-pr --rating idea --text "..."
Never include secrets, private data, source code, long prompts, or stack traces.