clean-functions
Use when writing, fixing, editing, or refactoring Python functions. Enforces Clean Code principles—maximum 3 arguments, single responsibility, no flag parameters.
How do I install this agent skill?
npx skills add https://github.com/ertugrul-dmr/clean-code-skills --skill clean-functionsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill is purely instructional, providing best practices for writing clean Python functions. It contains no executable code, network operations, or sensitive data access, and poses no security risks.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerwarn
1/1 file flagged
What does this agent skill do?
Clean Functions
F1: Too Many Arguments (Maximum 3)
# Bad - too many parameters
def create_user(name, email, age, country, timezone, language, newsletter):
...
# Good - use a dataclass or dict
@dataclass
class UserData:
name: str
email: str
age: int
country: str
timezone: str
language: str
newsletter: bool
def create_user(data: UserData):
...
More than 3 arguments means your function is doing too much or needs a data structure.
F2: No Output Arguments
Don't modify arguments as side effects. Return values instead.
# Bad - modifies argument
def append_footer(report: Report) -> None:
report.append("\n---\nGenerated by System")
# Good - returns new value
def with_footer(report: Report) -> Report:
return report + "\n---\nGenerated by System"
F3: No Flag Arguments
Boolean flags mean your function does at least two things.
# Bad - function does two different things
def render(is_test: bool):
if is_test:
render_test_page()
else:
render_production_page()
# Good - split into two functions
def render_test_page(): ...
def render_production_page(): ...
F4: Delete Dead Functions
If it's not called, delete it. No "just in case" code. Git preserves history.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/ertugrul-dmr/clean-code-skills/clean-functions">View clean-functions on skillZs</a>