Trigger when the user wants to check recent code changes for style alignment against the project's coding conventions in CLAUDE.md/AGENTS.md. Do NOT trigger for functional reviews or bug detection.
Review recent code changes for style alignment and elegance, then let the user choose which refinements to apply.
Before starting, check echo $AGENT_AUTONOMY_MODE. If it is set to yolo, this skill operates fully autonomously:
In order of importance, extract style preferences from the following files if they exist:
AGENTS.mdCLAUDE.md.cursorrules.github/copilot-instructions.md~/.agents/preferences/js-style.md (see AGENTS.md for other preference paths)Focus on:
Collect what to review:
git diff (unstaged) and git diff --staged (staged) to find uncommitted changesgit log --pretty=format:"%h %ad | %s" --date=iso to find recent commits, select those since the last review or the last hourIf there are no changes to review, inform the user and stop.
For each piece of changed code within the confirmed scope, consider:
If the analysis finds no style issues across the confirmed scope, report that the code is clean and aligned with the project's style preferences, then stop immediately. Do not proceed to Step 6. Do not ask the user anything. A clean review 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).
Structure the output clearly:
Number each suggestion for easy reference. For each:
#1
Location: [path/to/file:line]
Current Code:
[the existing code]
Suggested Refinement:
[the more elegant alternative]
Rationale: [Why this is more aligned with the user's style preferences and/or more elegant. Reference specific preferences from the instruction file when applicable.]
Offer these options:
If the user picks specific ones, ask them to list the numbers. Then apply only those changes.
Wait for the user's reply before taking any action, unless this skill is running in an autonomous/YOLO mode, in which case apply all suggestions immediately without asking.