code-polish
npx machina-cli add skill PaulRBerg/agent-skills/code-polish --openclawCode Polish
Combined simplification and review pipeline. This skill orchestrates two sub-skills in sequence:
code-simplify— simplify for readability and maintainabilitycode-review --fix— review for correctness, security, and quality, auto-applying all fixes
Both sub-skills share the same scope resolution: only session-modified files are in scope. If there are no session-modified files, they fall back to all uncommitted tracked changes. See each sub-skill for full details.
Workflow
1) Run code-simplify
Invoke the code-simplify skill, forwarding $ARGUMENTS as-is.
2) Run code-review --fix
Invoke the code-review skill with the --fix flag appended to $ARGUMENTS.
3) Report
Combine the outputs from both skills into a single summary:
- Scope: Files and functions touched.
- Simplifications: Key changes from
code-simplify. - Review findings and fixes: Findings and applied fixes from
code-review. - Verification: Commands run and outcomes.
- Residual risks: Assumptions or items needing manual review.
Source
git clone https://github.com/PaulRBerg/agent-skills/blob/main/skills/code-polish/SKILL.mdView on GitHub Overview
Code Polish orchestrates two sub-skills in sequence: code-simplify to improve readability, and code-review --fix to identify and auto-apply fixes for correctness, security, and quality. It operates only on session-modified files, falling back to all uncommitted tracked changes if none are present. This tight loop helps ensure changes are readable, correct, and ready for review.
How This Skill Works
It forwards the ARGUMENTS to the code-simplify sub-skill, then runs code-review --fix with the same ARGUMENTS, and finally combines the outputs into a single summary that includes scope, simplifications, review findings and fixes, verification commands, and residual risks.
When to Use It
- You’ve just changed code and want both readability improvements and fixes in one pass
- You’re preparing a change for review and want a polished, error-checked version
- You need to auto-apply fixes discovered during review after simplifying code
- You want to enforce scope strictly on session-modified files, or fallback to uncommitted tracked changes if none exist
- You want a consolidated report showing scope, simplifications, fixes, verification results, and residual risks
Quick Start
- Step 1: Invoke code-simplify on the target changes, forwarding your ARGUMENTS as-is
- Step 2: Invoke code-review --fix using the same ARGUMENTS to apply fixes
- Step 3: Review the consolidated report showing Scope, Simplifications, Review findings, Verification, and Residual risks
Best Practices
- Always forward your ARGUMENTS to both sub-skills as-is to preserve intent
- Rely on the scope rule: only session-modified files or uncommitted tracked changes as fallback
- Review the combined summary sections and verify no residual risks remain
- Run in a reproducible environment to ensure fixes align with original changes
- Prefer running code-polish just before committing or merging to reduce drift
Example Use Cases
- Polish a recently changed utility module in a Node project for readability and correctness
- Polish and fix a Python data processing script after a refactor
- Polish a React component and ensure security-related review findings are auto-applied
- Polish a performance-critical C++ module with session-changes before PR
- Polish and fix a microservice’s edited codepath to ensure maintainability