Clean code
Enforce human-readable Python with the cleancode analyzer. Use this to check existing files or to generate and validate new code based on instructions.From its SKILL.md
npx -y skills add LukasB24/clean-code --skill clean-codeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.4 KB, 442 tokens by cl100k_base, as published. Nobody here has run it
Clean Code Analyzer
Run the clean-code static analyzer on the targeted Python file or directory to enforce formatting, structure, and readability standards.
Workflow
-
If
target_pathis provided: Execute:clean-code check "{{target_path}}" -
If no
target_pathis provided but aninstructionis:- Generate the requested Python code based on the
instruction. - Save the code to a temporary path (
{{generated_file_path}}). - Execute:
clean-code check "{{generated_file_path}}"
- Generate the requested Python code based on the
Guidelines
- By default,
info-severity violations (the fuzziest, lowest-signal rules) are hidden to avoid context noise. - If the summary indicates violations hidden below
--min-severity warning, and a deeper pass is required, rerun the command with:clean-code check --min-severity info "{{target_path}}"(or the generated path). - Review the output from the analyzer. If any violations are reported, modify the source code directly using the suggested
fix:patterns. - Do not silence violations using inline comments unless specifically requested by the user.
DP701/SD801/SD802findings are SOLID/DRY smells, not local style nits — thefix:suggestion (extract a shared helper, replace a type-switch with polymorphism/a dispatch table, split a class) usually means introducing a new function/class or changing call sites, not a one-line edit. Apply the refactor, but summarize what you restructured and why when presenting the result, since these findings reshape the code's structure more than the other rules do.DP701compares functions across every file reached in onecheckrun — it still runs (and can still catch within-file duplicates) on a single-filetarget_path, but a single-file check can't see a duplicate living in a sibling file. Prefer checking the containing directory (or the whole project) when hunting for cross-file duplication, not just the one file you touched.- Present the final cleaned code back to the user.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.