clean-codejs-functions
Function design patterns emphasizing single responsibility and clarity.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "clean-codejs-functions"
description: "Function design patterns emphasizing single responsibility and clarity."
license: "MIT"
---
# Clean Code JavaScript – Function Patterns
## Table of Contents
- Single Responsibility
- Function Size
- Parameters
- Side Effects
## Single Responsibility
```js
// ❌ Bad
function handleUser(user) {
saveUser(user);
sendEmail(user);
}
// ✅ Good
function saveUser(user) {}
function notifyUser(user) {}
```
## Function Size
Keep functions small (ideally < 20 lines).
## Parameters
```js
// ❌ Bad
function createUser(name, age, city, zip) {}
// ✅ Good
function createUser({ name, age, address }) {}
```
## Side Effects
```js
// ❌ Bad
let total = 0;
function add(value) {
total += value;
}
// ✅ Good
function add(total, value) {
return total + value;
}
```More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

