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

/clean-code-basic

@53afcbc
Run it yourself

Use when writing, reviewing, or refactoring code and you want it to stay clean, simple, readable, and maintainable — applying software-engineering principles like SOLID, KISS, DRY, YAGNI, single responsibility, small focused files and functions, clear naming, low coupling, and performance awareness so the project stays scalable as it grows. Especially useful when generating code with AI agents (which tend toward big files and over-engineering). Use whenever writing or changing code, or when someone says "keep the code clean," "follow best practices," "make it maintainable/scalable," "refactor this," "this function is too complex," or "apply SOLID / clean code."

Use this Skill: https://skilld.dev/gh/hardikpthv/agent-skills/clean-code-basic

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesreview-checklist.md

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

Self-review checklist (run before you finish)

Read the code you just wrote as if reviewing someone else's PR.

Readability

  • Names reveal intent (vars, functions, files).
  • No comment needed to explain what — only why, where non-obvious.
  • Consistent with the surrounding code's style/patterns.

Simplicity

  • Simplest approach that meets the requirement (KISS).
  • No speculative options/abstractions (YAGNI).
  • No clever tricks that slow a reader down.

Structure

  • Each function does one thing; short.
  • Nesting is shallow (guard clauses / early returns).
  • Files are focused; split anything that grew large or mixed concerns.
  • Short parameter lists; no long positional argument soup.

Coupling & duplication

  • Real duplication factored out — but not over-abstracted.
  • Modules talk through clear interfaces, not each other's internals.
  • No magic numbers/strings — named.

Robustness & testability

  • Errors handled at the right layer; no silent failures.
  • Dependencies injectable; logic testable in isolation.
  • Edge cases considered (empty, null, large input).

Performance (hot paths only)

  • No N+1 queries; no repeated work inside loops.
  • Reasonable big-O on paths that run often/at scale.
  • Not micro-optimizing cold paths at the cost of clarity.

Red flags → fix

Smell Fix
Function > one screen / does several things extract functions
File keeps growing / many responsibilities split by concern
Deeply nested ifs guard clauses / early return
Copy-pasted block shared function
manager/util/data catch-all module give it a real, single responsibility
Flag parameter (doThing(true)) split into two functions
Comment explaining a confusing line rewrite the line clearly

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 alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a comprehensive set of architectural and coding best practices for AI agents to follow when generating, reviewing, or refactoring code. It is purely informational, consisting of markdown guidelines and checklists, and contains no executable code or security risks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

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

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago

README badge

README badge for hardikpthv/agent-skills/clean-code-basic