luna
Audit and review open, non-draft PRs unmodified for >8 hours using codexl (GPT-6 Luna) and pil (DeepSeek-4.1-flash). Diagnoses CI failures, merge conflicts, missing evidence, and outputs actionable fix plans.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- luna
- description
- Audit and review open, non-draft PRs unmodified for >8 hours using codexl (GPT-6 Luna) and pil (DeepSeek-4.1-flash). Diagnoses CI failures, merge conflicts, missing evidence, and outputs actionable fix plans.
02 资源文件 1
- 脚本scripts/audit_prs.py18.3 KB
03 SKILL.md 正文
/luna: Automated Stale PR Review & Remediation Skill
The /luna skill orchestrates automated reviews of open, non-draft pull requests that have stalled or remained unmodified for 8 or more hours. It uses a tri-engine architecture:
codexl(codex-luna, OpenAI nativegpt-6-lunawith high reasoning effort): For deep architectural analysis, test-harness failures, state-machine logic, and complex multi-file reviews where 80%+ prompt caching hit rates and deep reasoning are essential.pil(pi --provider lunaroute --model deepseek-4.1-flash): For rapid diagnostic passes, diff scanning, lint verification, and fast triage using DeepSeek V4 Flash with zero CLI initialization overhead.pig(pi --provider lunaroute --model glm-5.3): For long-horizon agentic task planning, tool recovery, and GLM-5.3 semantic evaluations.
When to Use
- When auditing stale open PRs to determine what fixes, rebases, or evidence updates are required.
- When unblocking CI failures on PRs that haven't been touched in over 8 hours.
- When checking merge readiness, conflicts with
origin/main, and evidence compliance (/es,/er).
Workflow
Step 1: Scan and Categorize Stale Open Non-Draft PRs
Run the /luna automated audit script:
~/.claude/skills/luna/scripts/audit_prs.py
The target repository is --repo <owner>/<repo>, else $GITHUB_REPOSITORY, else the
repository gh repo view resolves from the current directory; with none of these the
script exits non-zero naming GITHUB_REPOSITORY.
This immediately parses all open non-draft PRs older than 8 hours, evaluates their CI status via GitHub check rollups and mergeability in parallel, and categorizes them into:
- CI Failed: Dispatches
codexlfor test failure diagnosis. - Conflicting / Dirty: Flags for rebase onto
origin/mainvia/fixpr. - Clean & Green: Lists PRs awaiting final evidence signoff or operator
MERGE APPROVED.
To review a specific PR immediately with ultra-fast triage:
~/.claude/skills/luna/scripts/audit_prs.py --review <PR_NUMBER>
Step 2: Tri-Engine Specialized Reviews
A. Fast Diagnostic Pass (pil) with -nc
For checking diff size, syntax, and basic rule conformance with zero context bloat (<2s latency):
gh pr diff <PR_NUMBER> | pil -nc -p "Review this diff against main. Identify any obvious syntax errors, unreceipted deltas, or missing test coverage."
B. Agentic Tool & Planning Review (pig)
For complex tool chains, multi-step migration plans, or SWE-bench level task execution:
pig -p "Analyze the planned migration in PR #<PR_NUMBER>. Verify whether all required tool definitions and error-recovery paths are addressed."
C. Deep Architectural / Harness Review (codexl)
For investigating broken CI tests, complex state machine bugs, or prompt/schema coupling where 80%+ cache hit rate and deep reasoning are essential:
codexl "Review PR #<PR_NUMBER> on branch <BRANCH>. Inspect the failing CI tests from GitHub checks. Diagnose the root cause and propose the exact minimal patch to resolve it."
Step 4: Generate Actionable Fix Roadmap
For every audited PR, output a structured summary table:
| PR # | Title | Stale Age | CI Status | Mergeable | Primary Blocker | Recommended Action | Engine |
|---|---|---|---|---|---|---|---|
| #1234 | fix: <title>... | 28h | ❌ Failed | CONFLICT | CI test failure & rebase needed | Rebase on main, fix exception mapping | codexl |
Each item must specify:
- Root Cause: Why the PR stalled or failed.
- Immediate Next Step: Exact shell commands to checkout, reproduce, fix, and verify.
- Verification Command: Exact test or check required to confirm green.
Tooling Invariants
codexlResolution: Always maps tocodex-luna(codex --yolo --search -m gpt-6-luna --config model_reasoning_effort=high).pilResolution: Uses LunaRoute gatewaydeepseek-4.1-flash(pi --provider lunaroute --model deepseek-4.1-flash).- Evidence Hygiene: All review artifacts and logs must be stored under the canonical scratch directory via
"$(~/.claude/skills/scratch-space/scripts/scratch-dir.sh "<repo-name>/luna-reviews")", where<repo-name>is the name part of the targetowner/repo(referencing~/.claude/skills/scratch-space/SKILL.md). Never litter repository workspaces. - Absolute Paths: Always cite full absolute paths for modified or inspected files.
04 同仓库更多 Skills
instinct
Use when the user invokes /instinct or /in, or asks to "message Instinct", "ask Instinct", "tell Instinct", "check Instinct", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.
hr
Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.
history-resume
Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.
grok
Alias for the canonical grokbot browser conversation workflow; /grok talks to the Grok bot the same way /dot talks to Dot.
codexa-bench
Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.