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.

referencesstate-effects-and-failure-behavioruntrusted-or-invalid-input-is-stopped-at-the-boundary.md

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

Untrusted or invalid input is stopped at the boundary

External input is validated, normalized, sanitized, and rejected early enough that invalid or unsafe state does not spread through the system.

Systems should become stricter as data moves inward, not looser. The safest and most maintainable pattern is to validate and normalize external input at the boundary, apply any context-appropriate sanitization before it reaches sensitive destinations, and fail explicitly when input violates assumptions or cannot be trusted. This combines correctness and security into one review lens because both are about preventing bad state from spreading.

Strong signs include explicit boundary checks, parsing and normalization near entry points, destination-aware sanitization or escaping, and failures that make invalid assumptions visible instead of silently tolerating them. Weak signs include raw external values flowing deep into business logic, sanitization deferred until late or applied inconsistently, impossible states represented as ordinary values, and quiet continuation after invalid input in the hope that later code will cope.

This symptom matters because once malformed or unsafe input leaks into the trusted core, every downstream unit has to defend itself and reviewers lose confidence in system truth. Early boundary enforcement reduces bug surface, simplifies reasoning, and lowers security risk. The code becomes easier to review because the trusted and untrusted parts of the system are separated more clearly.

Examples

Bad

function register(request):
  user = users.create(request.body.email, request.body.displayName)
  mailer.sendWelcome(request.body.email)
  audit.record("registered", request.body)
  return user

Good

function register(request):
  input = RegistrationInput.validateAndNormalize(request.body)
  if input.invalid: return BadRequest(input.errors)
  return registerTrusted(input.value)
function registerTrusted(input):
  user = users.create(input.email, input.displayName)
  mailer.sendWelcome(input.email)
  audit.record("registered", input)
  return user

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