Index of every page on this site: llms.txt
All skills
meza avatar

/clean-code

@982e21e
by mezameza/skills2 stars
Run it yourself

Use when designing, writing, refactoring, reviewing, or explaining code, tests, APIs, modules, or architecture. Provides a progressive catalog of clean-code qualities covering comprehension, domain modeling, state and failure behavior, boundaries, evolvability, operability, safety, and test design.

Use this Skill: https://skilld.dev/gh/meza/skills/clean-code

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescomprehension-and-intentcode-is-easy-to-follow-locally.md

≈503 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Code is easy to follow locally

Control flow and structure are linear and bounded enough that a reviewer can understand a unit without chasing large amounts of external context.

Maintainable code should allow mostly local reasoning. A reader should be able to step through a function or unit in a forward pass, with limited jumping across helpers, conditions, and distant files just to understand the main path. The point is not that every piece of context disappears, but that the amount of hidden context stays small enough for the unit to remain intelligible on its own.

Strong signs include control flow that unfolds in a readable sequence; helpers that clarify rather than fragment the story; a unit whose purpose, assumptions, and main branches can be understood without loading half the codebase; and boundaries that keep relevant state and rules nearby. Weak signs include frequent mental backtracking, helper chains that obscure rather than clarify, behavior that only makes sense after discovering hidden state elsewhere, and units whose meaning depends on tribal knowledge or many distant conventions.

This symptom matters because local reasoning is one of the foundations of safe maintenance. If the reader cannot understand the unit in a bounded scope, review quality drops, debugging slows down, and small changes become risky. Code that reads linearly and can be reasoned about locally is easier to test, easier to refactor, and less likely to produce accidental breakage.

Examples

Bad

function canShip(orderId):
  order = loadOrder(orderId)
  return passesPolicy(order)
function passesPolicy(order):
  if isBlocked(order): return false
  return hasStock(order)
function hasStock(order):
  return inventory.contains(order.items) and shippingEnabled

Good

function canShip(order, inventory, shippingEnabled):
  if not shippingEnabled: return false
  if order.isBlocked: return false
  if not inventory.contains(order.items): return false
  return true

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts28d3 checks · Risk SAFE
  • Gen Agent Trust Hub28d

    The skill 'clean-code' is a comprehensive educational catalog of software engineering principles and clean-code qualities. It provides structured guidance and pseudocode examples to help AI agents reason about code quality, security, and maintainability. No malicious code, hidden instructions, or security risks were identified during the analysis.

  • Socket28d

    No alerts

  • Snyk28d

    Risk: LOW · No issues

Signed by skilld at 982e21e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 3 months ago

README badge

README badge for meza/skills/clean-code