skills/polish-code/SKILL.md
--- name: polish-code description: Polish and refine code by delegating to a framework-aware simplifier subagent (auto-detected or specified). Use proactively after implementation phases, when asked to "simplify", "clean up", "polish", or "refactor" code. Do NOT use for architectural refactoring (use architect-refactor instead) or for code review (use deep-review instead). argument-hint: [--agent generic|symfony|laravel] [--scope modified|all] [--file <path>] [--dry-run] allowed-tools: Read, Glo
npx skillsauth add nicolas-codemate/claudecodeconfig skills/polish-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Delegates code simplification to the most relevant {framework}-simplifier subagent, mirroring the pattern used by /resolve step 07-simplify.
$ARGUMENTS
--agent generic|symfony|laravel — force specific agent (skip auto-detect)--scope modified|all — scope (default: modified)--file <path> — target a specific file (repeatable)--dry-run — analyze only, do not modify filesIf --agent is not provided, auto-detect from project files:
if [ -f "composer.json" ] && grep -q "symfony/framework-bundle" composer.json; then
AGENT="symfony-simplifier"
elif [ -f "composer.json" ] && grep -q "laravel/framework" composer.json; then
AGENT="laravel-simplifier"
else
AGENT="code-simplifier"
fi
Display: Agent detected: {AGENT}
--file providedUse the listed files as-is.
--scope modified (default)Determine base branch in this priority order:
.claude-work/{ticket-id}/status.json → options.base_branch.claude/ticket-config.json → branches.default_basemainBASE_BRANCH=$(cat .claude-work/*/status.json 2>/dev/null | jq -r '.options.base_branch // empty' | head -1)
[ -z "$BASE_BRANCH" ] && BASE_BRANCH=$(cat .claude/ticket-config.json 2>/dev/null | jq -r '.branches.default_base // "main"')
# Uncommitted first, then branch diff
CHANGED=$(git diff --name-only)
[ -z "$CHANGED" ] && CHANGED=$(git diff --name-only "${BASE_BRANCH}...HEAD")
echo "$CHANGED"
Filter by extension based on agent:
symfony-simplifier / laravel-simplifier → *.phpcode-simplifier → *.js *.ts *.jsx *.tsx *.py *.go *.rs *.rb--scope allAskUserQuestion:
question: "Simplifier tout le codebase peut prendre du temps. Continuer ?"
header: "Scope"
options:
- label: "Oui, tout simplifier"
description: "Analyser tous les fichiers correspondant à l'agent"
- label: "Non, seulement les modifiés"
description: "Limiter aux fichiers modifiés (recommandé)"
Invoke the subagent directly (same pattern as /resolve step 07):
Agent:
subagent_type: {AGENT}
description: "Polish {N} file(s)"
prompt: |
Review and simplify the following files:
{list of absolute paths, one per line}
Project root: {cwd}
Mode: {apply|dry-run}
{if dry-run}
DO NOT modify files. Only report proposed changes.
{else}
Apply improvements directly to each file using Edit.
{endif}
Focus on: clarity, naming, redundancy removal, early returns,
pattern compliance, type annotations. Preserve all behavior.
RETURN FORMAT (mandatory):
```
POLISH_REPORT:
agent: {AGENT}
files_analyzed: {count}
files_modified: {count}
changes:
- file: path/to/file.ext
line: {line range}
category: [Readability | Redundancy | Naming | Abstraction | Consistency]
description: "{what was changed and why}"
no_changes_needed:
- path/to/file.ext (reason: already clean)
summary: "{1-2 sentence overall assessment}"
```
Output the subagent's POLISH_REPORT verbatim. Do NOT summarize — the user needs to see every change to decide whether to keep them.
--dry-runNo changes applied. Re-run without --dry-run to apply, or target specific files:
/polish-code --file {path}
git diff --stat
Display:
Modifications appliquées. Review with `git diff`, then commit when satisfied:
git diff # Full diff
git add -A && git commit -m "refactor: polish code ({AGENT})"
git restore -- <file> # Blocked by hook — ask for override if needed
Do NOT auto-commit and do NOT propose a revert (destructive git is hook-blocked).
# Auto-detect agent, simplify modified files
/polish-code
# Force Symfony agent
/polish-code --agent symfony
# Simplify specific file
/polish-code --file src/Service/UserService.php
# Preview without applying
/polish-code --dry-run
# Simplify entire codebase (with confirmation)
/polish-code --scope all
User-facing messages in French. Code examples and technical output in English.
Begin with $ARGUMENTS:
POLISH_REPORTgit diff and commit instructionstools
--- name: deep-review description: Performs deep code review via an isolated fresh agent (triple perspective, anti-bias). Use when the user asks for an in-depth review of current branch changes, or when invoked by /resolve step 08. Do NOT use for reviewing PRs from GitHub (use review-pr skill instead) or for a quick correctness scan with effort levels (use bundled /code-review instead). argument-hint: [--ticket <id>] [--base <branch>] [--fix] [--severity <level>] allowed-tools: Read, Glob, Grep,
tools
Resolve git rebase conflicts methodically. Classifies each conflict (imports/namespace cleanup vs real logic clash), analyzes the commit introducing the change against the current ticket context, auto-fixes only trivial cases with a per-file summary, and asks the user when ambiguous. Verifies static analysis tools pass at the end and optionally runs functional tests. Use after `git rebase` triggers conflicts, or when the user asks to "resolve conflicts", "fix rebase", "j'ai des conflits", "aide-moi sur ce rebase".
development
Synchronize the markdown test plan in docs/qa/ with the current state of the codebase. Use after adding or modifying features to keep the plan up to date, or to bootstrap a test plan for the first time. Do NOT use to execute tests (use /qa-run instead) and do NOT use to design product specs (use /express-need instead).
tools
Execute the markdown test plan in docs/qa/ via Playwright MCP and create a ticket on each failing scenario. Use after /qa-sync, before a release, or to validate a feature end-to-end. Do NOT use to design or update scenarios (use /qa-sync instead) and do NOT use for visual regression (use visual-verify agent instead).