clean-code

Featured

Apply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity management, error handling, and self-documenting style. Use when the user mentions 'clean code', 'code quality', 'coding guidelines', or 'implementation quality'. Loaded automatically by the code-generating molecules (code-forge, refactor-safely, bug-fix). This skill governs the craft of writing individual code units -- not architecture (see architecture), not security posture (see secure-coding), not test structure (see test-quality), and not refactoring workflows (see refactor-safely).

Code & Development 190 stars 13 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
76
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Clean Code ## Config Resolution Projects can customize this skill's standards. Resolution order: 1. Read `.lattice/config.yaml` in the repo root. 2. If found, check `paths.clean_code` for a custom document path. 3. If a custom document exists at that path, read it and check its YAML frontmatter for `mode`: - **`mode: override`**: the custom document has full precedence. Use it instead of the embedded defaults. It must be comprehensive -- treat it as the sole reference. - **`mode: overlay`** (or no mode field): read the embedded `./references/defaults.md` first, then apply the custom document's sections on top. A custom section replaces the matching default section (matched by exact heading); new sections append after the defaults. 4. If a custom path is configured but no document exists at it → tell the user which configured path is missing, then fall back to `./references/defaults.md`. 5. If there is no config file or no `paths.clean_code` key, read `./references/defaults.md`. 6. **Language adaptation**: if `paths.language_idioms` is set in the config and the document exists, read it and adapt the defaults using these sections: - **"Error Handling"** → adapt §8 (Error Handling) patterns to the language's idioms. Language idioms take precedence over the pseudocode defaults. - **"Type System & Object Model"** → adapt §1 (Single Responsibility) cohesion guidance to the language's constructs (e.g., struct vs class). - **"Naming Conventions"** → adapt §4 (Mean...

Details

Author
techygarg
Repository
techygarg/lattice
Created
6 months ago
Last Updated
4 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Featured

secure-coding

Apply security-conscious thinking when generating or modifying code. Enforces trust boundary awareness, input validation, injection prevention, secrets management, and defense-in-depth authorization. Use when generating code that handles user input, authentication, authorization, database queries, external APIs, or file operations, or when the user mentions 'security review', 'secure this', 'check for vulnerabilities', 'trust boundary', 'input validation', or 'OWASP'. Loaded automatically by the code-generating molecules (code-forge, refactor-safely, bug-fix). This skill governs the security posture of generated code -- not architecture (see architecture) and not code craft (see clean-code).

190 Updated 4 days ago
techygarg
Code & Development Featured

clean-code-refiner

Facilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document that the clean-code atom will use as its override. Use when setting up coding standards, defining code quality rules, or when the user says 'setup clean code', 'define coding standards', 'code quality principles', 'coding guidelines', or 'help me define my code standards'.

190 Updated 4 days ago
techygarg
Code & Development Listed

code-standards

Language-agnostic code standards for writing clean, maintainable code. Covers modular design, functional patterns, error handling, security, and testing. Make sure to use this skill whenever writing, refactoring, or reviewing any code, even for quick fixes, prototypes, or single-file changes. This is the baseline for all code quality. Language-specific skills, if present, may override these defaults.

5 Updated 2 days ago
johanthoren