Agent skill

Clean Functions

by ertugrul-dmr in ertugrul-dmr/clean-code-skills

A skill your agent uses when writing, fixing, editing, or refactoring Python functions.

MITAuto-check passedDevelopment

Install Clean Functions

skills CLI
$ npx skills add ertugrul-dmr/clean-code-skills --skill clean-functions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ertugrul-dmr/clean-code-skills clean-functions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ertugrul-dmr/clean-code-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/python/clean-functions .claude/skills/clean-functions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clean-functions
GitHub stars
197
Token cost
~450 tokens
SKILL.md length
69 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing, fixing, editing, or refactoring Python functions.

  • Refactoring Python functions
  • SKILL.md covers F1: Too Many Arguments…, F2: No Output Arguments, F3: No Flag Arguments and F4: Delete Dead Functions
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Code quality

What it does

Clean Functions is an agent skill from ertugrul-dmr/clean-code-skills. Use when writing, fixing, editing, or refactoring Python functions. Enforces Clean Code principles—maximum 3 arguments, single responsibility, no flag parameters.

Its SKILL.md is about 450 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code quality and Refactoring. It works with Python. The licence is MIT.

When your agent uses it

  • Refactoring Python functions
  • Tasks that involve Code quality
  • Tasks that involve Refactoring

Example prompts

  • “/clean-functions”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 1b6b3cc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Clean Functions loads about 450 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 69 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~450

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ertugrul-dmr/clean-code-skills at commit 1b6b3cc, republished under its MIT licence (© ertugrul-dmr). 69 words, ~450 tokens.

Download SKILL.mdSave it as .claude/skills/clean-functions/SKILL.md (or your agent's skills folder).
name
clean-functions
description
Use when writing, fixing, editing, or refactoring Python functions. Enforces Clean Code principles—maximum 3 arguments, single responsibility, no flag parameters.
when_to_use
Also trigger on: functions with 4+ parameters, boolean flag parameters like `enabled=True`, functions that mutate their arguments in place, one-off…

Clean Functions

F1: Too Many Arguments (Maximum 3)

python
# 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.

python
# 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.

python
# 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.

© ertugrul-dmr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/python/clean-functions of ertugrul-dmr/clean-code-skills.

Open the folder on GitHubat commit 1b6b3cc

Compare with similar skills

Clean Functions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clean Functions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clean Functions this skillertugrul-dmr/clean-code-skills197—~450Automated safety check: PassMIT
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Odoo Workflowunclecatvn/agent-skills145—~4.7kAutomated safety check: PassMIT
Code Refactor Masteryennanliu/CS_basics141—~3.3kAutomated safety check: PassNone
Code Revieweralirezarezvani/claude-skills28k1 repos~1.6kAutomated safety check: PassMIT
Code ReviewerLeoYeAI/openclaw-master-skills2.2k1 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Odoo Workflow

    unclecatvn/agent-skills

    Mandatory pre-code gate and definition-of-done for ANY Odoo change (add field, override method, inherit view/xpath, OWL/JS patch, wizard, cron, controller, report, security, migration, bug fix…

    145 GitHub stars~4.7k tokensUpdated 17 days ago
    DevelopmentAuto-check passed
  • Code Refactor Master

    yennanliu/CS_basics

    Code refactoring expert for improving code quality, readability, maintainability, and performance.

    141 GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Reviewer

    alirezarezvani/claude-skills

    Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin, C, .NET, Java, C, C++, Rust, Ruby, PHP, and Dart/Flutter.

    28k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Code Reviewer

    LeoYeAI/openclaw-master-skills

    Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin.

    2.2k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Code Smell Detector

    ArabelaTso/Skills-4-SE

    Identify and report code smells indicating poor design or maintainability issues in Python code, including duplicate code, magic numbers, hardcoded values, God classes, feature envy, inappropriate…

    253 GitHub stars~3.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from ertugrul-dmr/clean-code-skills

All 14 skills in this repo
  • Boy Scout

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when fixing, editing, changing, debugging, or working with any Python code.

    197 GitHub stars~978 tokensUpdated 5 mo ago
    Auto-check passed
  • Boy Scout

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when fixing, editing, changing, debugging, or working with any TypeScript code.

    197 GitHub stars~996 tokensUpdated 5 mo ago
    Auto-check passed
  • Clean General

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when writing, fixing, editing, or reviewing Python code quality.

    197 GitHub stars~666 tokensUpdated 5 mo ago
    Auto-check passed
  • Clean General

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when writing, fixing, editing, or reviewing TypeScript code quality.

    197 GitHub stars~847 tokensUpdated 5 mo ago
    Auto-check passed
  • Clean Names

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when naming, renaming, or fixing names of variables, functions, classes, or modules in Python.

    197 GitHub stars~919 tokensUpdated 5 mo ago
    Auto-check passed
  • Clean Names

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when naming, renaming, or fixing names of variables, functions, classes, interfaces, or modules in TypeScript.

    197 GitHub stars~1k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about Clean Functions

What does Clean Functions do?

A skill your agent uses when writing, fixing, editing, or refactoring Python functions. Clean Functions is an agent skill from ertugrul-dmr/clean-code-skills. Use when writing, fixing, editing, or refactoring Python functions.

When should I use Clean Functions?

Clean Functions fits situations like: refactoring Python functions; tasks that involve Code quality; tasks that involve Refactoring.

How do I install Clean Functions in Claude Code?

Run `npx skills add ertugrul-dmr/clean-code-skills --skill clean-functions -a claude-code`. Or copy the skill folder (skills/python/clean-functions in ertugrul-dmr/clean-code-skills) into .claude/skills/clean-functions in your project. Claude Code loads it when a task matches its description.

How do I install Clean Functions in Codex?

Run `npx skills add ertugrul-dmr/clean-code-skills --skill clean-functions -a codex`. Or copy the skill folder (skills/python/clean-functions in ertugrul-dmr/clean-code-skills) into .agents/skills/clean-functions in your project. Codex loads it when a task matches its description.

Can I use Clean Functions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ertugrul-dmr/clean-code-skills --skill clean-functions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clean-functions, .gemini/skills/clean-functions, .github/skills/clean-functions and .opencode/skills/clean-functions in your project.

What does Clean Functions need to run?

SKILL.md names no scripts, command-line tools or credentials: Clean Functions is instructions for the agent only. Our summary lists: Python 3.

Does Clean Functions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Clean Functions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clean Functions use?

Clean Functions is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clean Functions use?

About 450 tokens (SKILL.md is roughly 1.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Clean Functions?

Skills that share tags, products or a category with Clean Functions: Dignified Python Standards (docling-project/docling, 69k stars), Odoo Workflow (unclecatvn/agent-skills, 145 stars), Code Refactor Master (yennanliu/CS_basics, 141 stars) and Code Reviewer (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clean Functions?

ertugrul-dmr (a GitHub user) maintains it in ertugrul-dmr/clean-code-skills, which has 197 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on April 21, 2026.

Source: ertugrul-dmr/clean-code-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.