Skip to content
Back to skills

Clean Code

ASecurity

Code-level quality cues for any layer and language. Judgment over metrics. Use when implementing or reviewing code.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsexpress

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add samuel-stidham/smithy --skill clean-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/samuel-stidham-clean-code-smithy/badge)](https://www.skillsdirectory.com/skills/samuel-stidham-clean-code-smithy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-code
description: Code-level quality cues for any layer and language. Judgment over metrics. Use when implementing or reviewing code.
user-invocable: false
---

# Clean code

Judgment cues for code inside any layer. These record where this
codebase's owner differs from common defaults. Apply them over generic
best practice.

- **Optimize total reading cost, never function length.** Length is a
  weak signal. The real signals are deep nesting and long boolean
  chains. Extract a helper only when its name lets the caller be read
  without opening the body. A linear forty-line function often beats
  eight scattered helpers. Shattering one coherent operation across a
  file is the same complexity in a different outfit.
- **Keep related code close.** A helper used once, meaningful only
  beside its caller, belongs next to its caller. Every extraction adds
  a reader jump. Extract for clarity, never to relocate complexity
  somewhere less visible.
- **Temper DRY.** Unify duplication only when two sites express one
  rule that must stay in sync. A wrong abstraction costs more than a
  little repetition. Flags and branches accumulating in a shared
  function prove the abstraction was wrong. Prefer the duplication.
- **Name intent at call sites.** Raw literals and bare booleans hide
  meaning exactly where calls are read. Use named constants, enums, or
  named arguments whenever meaning is not obvious in place. The
  constant explains meaning, never restates the value: `MAX_RETRIES`,
  never `THREE`.
- **Guard early.** Handle edge cases and errors at the top and return.
  The happy path stays at the lowest indentation level.
- **Errors carry context.** Handle where you can act meaningfully.
  Propagate upward with context added otherwise. Never swallow, never
  return a silent default unless documented as intentional.
- **Comments explain why.** The code already says what. Unclear code
  gets rewritten, never narrated. No commented-out code. Version
  control remembers.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.