Function Design
Designing pure functions with single purpose, minimal parameters, clear side effects, and high cohesion.
Install
/plugin marketplace add sethdford/claude-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add sethdford/claude-skills --skill function-designgit clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/code-quality/skills/function-design ~/.claude/skills/function-designPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Function Design Principles for writing functions that are easy to understand, test, and maintain. ## Context You are helping the engineer design or refactor functions. If code is provided, assess whether functions follow cohesion, purity, and responsibility principles. A good function is a unit of composition. ## Domain Context - **Single Purpose**: One reason to change; extract if doing multiple things - **Pure Functions**: Same input always yields same output; no hidden dependencies - **Minimal Parameters**: More parameters = harder to test and understand; aim for 0-3 - **High Cohesion**: All statements relate to the function's purpose - **Clear Side Effects**: Document and minimize; prefer immutability ## Instructions 1. **Identify Purpose**: Can you explain the function in one sentence? If not, it's doing too much 2. **Count Parameters**: Refactor if > 3; use Parameter Object or method extraction 3. **Check for Side Effects**: Does it modify global state? Database? Output? Document explicitly 4. **Verify Purity**: Same inputs = same outputs? If not, document the dependency 5. **Measure Cohesion**: Do all lines support the stated purpose? If not, extract 6. **Review Return Value**: Does it return useful information or just status? Prefer returning data 7. **Check Error Handling**: Are failure cases explicit? Return errors, don't swallow silently 8. **Test Independence**: Can you test this function without mocks or fixtures? If not, refactor ## Anti-Patterns
Details
- Skill name
function-design- Repository
- sethdford/claude-skills
- Path
engineer/code-quality/skills/function-design/SKILL.md- License
- MIT
- Repo updated
- 11 March 2026
FAQ
What does the Function Design skill do?
Designing pure functions with single purpose, minimal parameters, clear side effects, and high cohesion.
How do I install the Function Design skill?
Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Function Design popular?
It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.
Related skills
A B Test Design
48sethdford/claude-skills
Design rigorous A/B tests with hypotheses, variants, metrics, and sample size calculations.
A B Test Design Pm
48sethdford/claude-skills
Analytics and experimentation skill for product managers.
Abuse Case Design
48sethdford/claude-skills
Design abuse cases (negative use cases) showing how attackers misuse system features. Use when identifying attacks that exploit intended functionality or business logic flaws.
Gdpr Assessment
48sethdford/claude-skills
Assess GDPR compliance for data processing, rights, privacy controls, and incident response obligations.
Experience Map
48sethdford/claude-skills
Create a holistic experience map showing the full ecosystem of user touchpoints, channels, and relationships.
Gesture Patterns
48sethdford/claude-skills
Design gesture-based interactions for touch and pointer devices.
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.