clean-code

Solid

Apply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity management, error handling, and self-documenting style. Use during code generation, refactoring, or when the user mentions 'clean code', 'code quality', 'refactor this', 'simplify this', 'improve this', 'make this cleaner', 'clean this up', 'tidy this', 'coding guidelines', or 'implementation quality'. This skill governs the craft of writing individual code units -- not architecture (see architecture), not security posture (see secure-coding), and not test structure (see test-quality).

Code & Development 134 stars 8 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
71
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 Skill support project custom. Order: 1. Look `.lattice/config.yaml` in repo root 2. If found, check `paths.clean_code` for custom doc path 3. If custom path exist, read doc and check YAML frontmatter for `mode`: - **`mode: override`** (or no mode): Custom doc full precedence. Use instead embedded default. Must be comprehensive -- sole reference. - **`mode: overlay`**: Read embedded `./references/defaults.md` first, then apply custom doc sections on top. Custom sections replace matching sections in default (matched by heading). New sections appended after default. 4. If no config/path/file, read `./references/defaults.md` 5. **Language adaptation**: If `paths.language_idioms` exist in config, read that document and adapt defaults using these sections: - **"Error Handling"** → adapt §8 (Error Handling) patterns to language idioms. Language idioms take precedence over pseudocode defaults. - **"Type System & Object Model"** → adapt §1 (Single Responsibility) cohesion guidance to language constructs (e.g., struct vs class). - **"Naming Conventions"** → adapt §4 (Meaningful Naming) patterns to language conventions. - **"Parameter & Function Design"** → adapt §2 (Small, Focused Functions) and §5 (Parameter Design) to language capabilities. - **"Dependency Management"** → adapt §9 (Test-Friendly Code) DI patterns to language idioms. Default ship with skill. Opinionated best practice. Work out of box. Override only when team h...

Details

Author
techygarg
Repository
techygarg/lattice
Created
3 months ago
Last Updated
3 days ago
Language
Shell
License
MIT

Related Skills