rea-analysis-optimization
MOmorluto/rea485k近 7 天新增 9,215 个 star
Simplify and clean up code after changes are complete. Reduces complexity, improves readability, and ensures consistency.
Clean up and simplify code after making changes.
Run this skill after completing a feature or fix to ensure the code is clean, readable, and maintainable.
with statements for resource managementenumerate() instead of manual indexingzip() for parallel iterationpathlib for file pathsIdentify Changed Files
Analyze Each File
Apply Simplifications
Format and Lint
ruff format .ruff check --fix .Verify
pytestOptionally specify files or directories to simplify.
Usage:
/code-simplifier - Simplify recently changed files/code-simplifier src/module.py - Simplify specific file/code-simplifier src/ - Simplify entire directoryBefore:
result = []
for i in range(len(items)):
if items[i].is_valid == True:
result.append(items[i].value)
After:
result = [item.value for item in items if item.is_valid]
Before:
if x != None:
if y != None:
if z != None:
process(x, y, z)
After:
if all(v is not None for v in (x, y, z)):
process(x, y, z)
MOmorluto/rea485k近 7 天新增 9,215 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star