From engineering
Clean-code craft - naming, small functions, readable control flow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/engineering:clean-code-craftThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write code that explains itself. Names carry intent, functions do one thing, control flow reads top to bottom, and nothing stays that does not earn its place.
Write code that explains itself. Names carry intent, functions do one thing, control flow reads top to bottom, and nothing stays that does not earn its place.
Names reveal intent. The reader should never decode them.
fetchUser, isExpired), nouns for values (user, retryCount).isActive, hasAccess, shouldRetry.i, j).function d(u: User): number { return Date.now() - u.t; }
function accountAgeMs(user: User): number {
return Date.now() - user.createdAt;
}
Name length tracks scope. A tight, short-lived scope tolerates a short name; a wide or long-lived one demands a descriptive one.
for (let i = 0; i < items.length; i++) process(items[i]);
export const MAX_LOGIN_ATTEMPTS_BEFORE_LOCKOUT = 5;
A comment that restates the code is a smell. Extract a well-named function or constant instead.
if (user.age >= 18 && user.country === "US") allow();
const isEligibleAdult = user.age >= LEGAL_AGE && user.country === "US";
if (isEligibleAdult) allow();
A function has one reason to change. Extract until each does one thing. Prefer early returns over nested conditionals.
function save(user: User) {
if (!user.email) throw new Error("email required");
if (!user.name) throw new Error("name required");
db.insert(user);
}
function render(node: Node, asDraft: boolean) {
if (asDraft) return renderDraft(node);
return renderPublished(node);
}
function renderDraft(node: Node) { /* ... */ }
function renderPublished(node: Node) { /* ... */ }
is/has/should).npx claudepluginhub shoto290/shoto --plugin engineeringGuides test-driven development for Django applications using pytest-django, factory_boy, and Django REST Framework. Covers red-green-refactor workflow, conftest fixtures, and coverage reporting.