Skip to content
Agentmart
Submit a tool

clean-code

Clean code principles, SOLID, design patterns, readability, error handling, and universal quality tooling.

Skill by dragoscirjan

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dragoscirjan-clean-code

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Clean code principles, SOLID, design patterns, readability, error handling, and universal quality tooling. Load when writing or reviewing code.

Use cases: design, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/clean-code

What's inside

Skill name
clean-code
Description
Clean code principles, SOLID, design patterns, readability, error handling, and universal quality tooling. Load when writing or reviewing code.
License
MIT
Instructions
64 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Clean Code & Design Principles

## Readability

- Code should read like well-written prose — clear intent at every level
- Use meaningful, descriptive names for variables, functions, classes, and modules
- Keep functions short and focused — each function does one thing well
- Avoid deep nesting — extract early returns, guard clauses, and helper functions
- Write meaningful comments for _why_, not _what_ — the code itself should explain the what

## Clean Code Principles

- **KISS** — Keep It Simple. Prefer the simplest solution that works correctly.
- **DRY** — Don't Repeat Yourself. Extract shared logic, but don't over-abstract prematurely.
- **YAGNI** — You Aren't Gonna Need It. Don't add functionality "just in case."
- **Boy Scout Rule** — Leave the code cleaner than you found it.
- **Fail Fast** — Validate inputs early, surface errors immediately.
- **Least Surprise** — Code should behave as the reader expects.

## SOLID Principles

- **Single Responsibility** — A class/module should have one reason to change
- **Open/Closed** — Open for extension, closed for modification
- **Liskov Substitution** — Subtypes must be substitutable for their base types
- **Interface Segregation** — Prefer small, focused interfaces over large ones
- **Dependency Inversion** — Depend on abstractions, not concretions

## Design Patterns

- Apply design patterns where they solve a real problem — not for their own sake
- Favor composition over inheritance
- Use dependency injection for testability and flexibility
- Prefer immutable data structures when practical
- Use the Strategy pattern for interchangeable behaviors, Observer for event-driven logic, Factory for complex object creation — but only when the pattern genuinely simplifies the code

## Error Handling

- Handle errors properly — no swallowed exceptions
- Use typed/specific errors over generic ones
- Provide meaningful error messages with context
- Clean up resources in error paths (finally, defer, using, etc.)

## Universal Quality Tools

Apply these cross-language tools on every project:

| Tool                      | Purpose                                        | Reference                           |
| ------------------------- | ---------------------------------------------- | ----------------------------------- |
| `.editorconfig`           | Cross-editor indent, charset, EOL consistency  | https://editorconfig.org            |
| `jscpd`                   | Copy-paste detection (all languages)           | https://github.com/kucherenko/jscpd |
| `Semgrep`                 | Multi-language static analysis, custom rules   | https://semgrep.dev                 |
| `SonarQube` / `SonarLint` | Code quality + security dashboard              | https://www.sonarsource.com         |
| `MegaLinter`              | Meta-linter for CI (orchestrates 100+ linters) | https://megalinter.io               |
| `pre-commit`              | Git hook framework for linters/formatters      | https://pre-commit.com              |
| `Trunk`                   | Auto-detect and run linters/formatters         | https://trunk.io                    |
| `Taskfile`                | Task runner for build/test/lint/format         | https://taskfile.dev                |
| `commitlint`              | Commit message convention enforcement          | https://commitlint.js.org           |

- Every project **must** have an `.editorconfig` at the root
- Use `run-quality-checks` to enforce duplicated code checks to catch duplicated code blocks
- Use `run-quality-checks` to enforce linting/formatting before commit
- Use `Taskfile` for consistent `task lint`, `task format`, `task test`, `task validate` commands

From dragoscirjan/opencode-config, MIT.

More from dragoscirjan/opencode-config

Signals

Stars
0
Forks
0
Open issues
3
Last commit (this folder)
May 28, 2026 (5 months ago)
Last release
Jun 2, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dragoscirjan

Cite this page

clean-code skill. Agent Mart. https://agentmart.dev/skills/dragoscirjan-clean-code (last updated 2026-10-24)