skills/global/.agents/skills/simplify/SKILL.md
Use after manual code changes to improve clarity/readability without changing behavior. Not for AI slop cleanup.
npx skillsauth add erikstmartin/dotfiles simplifyInstall 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.
Refine recently modified code for clarity and consistency without changing behavior.
Before:
def proc(d):
r = []
for k in d:
if d[k] is not None:
if d[k] > 0:
r.append(k)
return r
After:
def positive_keys(data: dict) -> list:
return [key for key, value in data.items() if value is not None and value > 0]
The refactored version uses a descriptive name, type hints, and a single comprehension that reads as a sentence. Don't collapse further — splitting the condition across lines is acceptable if it aids readability.
Flatten when nesting is purely defensive or structural:
// Before — two levels of nesting for a simple guard
function process(items) {
if (items) {
if (items.length > 0) {
return items.map(transform)
}
}
return []
}
// After — early return eliminates nesting
function process(items) {
if (!items?.length) return []
return items.map(transform)
}
Extract when a block has a distinct purpose:
// Before — mixed concerns in one function
function handleSubmit(form) {
const errors = []
if (!form.email.includes('@')) errors.push('Invalid email')
if (form.password.length < 8) errors.push('Password too short')
if (errors.length > 0) { showErrors(errors); return }
submitToAPI(form)
}
// After — validation extracted with a clear name
function validateForm(form): string[] {
const errors = []
if (!form.email.includes('@')) errors.push('Invalid email')
if (form.password.length < 8) errors.push('Password too short')
return errors
}
function handleSubmit(form) {
const errors = validateForm(form)
if (errors.length > 0) { showErrors(errors); return }
submitToAPI(form)
}
fetchUser, parseConfig, is_valid)is_/has_/can_ prefixdata, info, obj, temp, helper, utils as primary names — qualify them (orderData, configInfo)i in a loop, e in a catch)testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
tools
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions