Trigger when the user wants to review recent work for intent alignment, code elegance, and potential bugs. Do NOT trigger for style-only reviews (use the style skill), test execution (use the test skill), changelog updates (use the changelog skill), or when no code changes exist.
Review recent work through three lenses: intent alignment, elegance, and bug detection. When actionable findings exist, this skill enters plan mode to produce a structured assessment with suggestions the user can cherry-pick. When there are no findings, it reports a clean result and stops without entering plan mode.
Before starting, check the environment variable AGENT_AUTONOMY_MODE via Bash (e.g. echo $AGENT_AUTONOMY_MODE) — compare case-insensitively. If it is set to yolo, this skill operates fully autonomously:
Always first use the Skill tool to run the /pr-comments skill to pull in review comments from the current PR. Even if there were no code changes, the PR might have new comments.
Then triage the results — for each comment, decide:
Keep only the "worth addressing" comments — these are collected here and folded into Step 4's three-lens assessment. When a comment aligns with one of the lenses (intent, elegance, bugs), include it under that lens. If no PR exists or there are no comments, skip this step silently.
Collect the full picture of what changed recently:
git diff (unstaged) and git diff --staged (staged)git log --oneline -10 to see recent historygit branch --show-currentgit show --stat <hash> and git show <hash> to understand the full scope of recent workIf there are no uncommitted changes AND no recent commits, inform the user there's nothing to reflect on and stop immediately. Do not proceed to any further steps.
Before assessing anything, understand what the developer was trying to do:
Analyze signals - Look at:
feat/user-auth, fix/login-bug)State the inferred intent - Write a clear 1-3 sentence summary of what you believe the developer intended to accomplish
Ask for confirmation - Present the inferred intent and ask the user to confirm or correct it. Do NOT proceed with the assessment until the intent is confirmed. This grounds the entire reflection. In YOLO mode or autonomous context, skip this step — state the inferred intent and proceed directly.
Work through these three questions sequentially. For each, reference the confirmed intent and the actual code changes.
Compare the code against the confirmed intent:
Be specific. Reference file paths and line numbers.
Reference the project's AGENTS.md (or CLAUDE.md) style preferences and consider:
This is about architectural elegance and approach-level decisions.
Look for concrete issues, not theoretical concerns:
Only flag issues you have reasonable confidence are actual problems, not speculative "what-ifs".
If the assessment finds no actionable suggestions across all three lenses, report that the code looks solid and stop immediately. Do not enter plan mode. Do not ask the user what to fix. Do not invent findings. A clean reflection is a good outcome — output a brief "all clear" summary as regular conversation text and end. This applies in all modes (regular, autonomous, and YOLO).
Only reach this step if there are actionable findings from Step 4.
Enter plan mode to structure the findings as a plan. The plan file becomes the reflection document.
After completing the assessment, structure the output in the plan file:
Start with a brief overall assessment (2-3 sentences). Is the work solid? What stands out?
Group findings by the three lenses. For each finding:
Lens: Intent / Elegance / Bugs
Location: [file:line]
Finding: [What you observed]
Current Code:
[the existing code]
Suggested Change:
[the improved alternative]
Rationale: [Why this matters, referencing the confirmed intent or style preferences]
After presenting all findings as regular conversation text, end with a plain text prompt. Do NOT use a modal prompt or confirmation dialog here — it hides the findings the user needs to reference. Instead, end the message with:
Reply with the finding numbers you'd like me to address (e.g. "1, 3"), "all" to apply everything, or "skip" to leave as-is.
Wait for the user's reply before taking any action, unless this skill is running in an autonomous context where the user has explicitly asked for you to work autonomously, or YOLO mode is active. In either case, proceed to apply all findings without asking for confirmation.