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'.
npx skills add https://github.com/techygarg/lattice --skill clean-code-refiner
.lattice/standards/clean-code.md (or custom path from .lattice/config.yaml -> paths.clean_code)mode: overlay): A slim document containing only sections that differ from the defaults. The clean-code atom reads its embedded defaults first, then applies this document's sections on top. This is the expected common case.mode: override): A comprehensive standalone document that fully replaces the atom's embedded defaults. For teams with fundamentally different coding standards.paths.clean_code in .lattice/config.yaml./assets/template.md for the full document structure, default content, and interview guidance commentsThis skill defines the *rules of code craftsmanship* -- how individual functions, classes, and modules should be written. It does not define architecture (that is the architecture-refiner) or domain modeling (that is the ddd-refiner). The boundaries:
Before starting the interview, check whether a custom document already exists:
.lattice/config.yaml -- does paths.clean_code point to a file?Look for signals that inform the conversation:
Share relevant findings with the user at the start: "I noticed your project has ESLint configured with max-complexity: 15 and uses Prettier for formatting. I'll use that as context."
If the project is new with no code, proceed with pure defaults as the starting point.
The first decision in the conversation. Present the three options:
"How would you like to define your clean code principles?
The defaults cover standard clean code practices well. Option 1 is recommended unless your coding standards are fundamentally different."
Map the choice:
mode: overlaymode: overrideThis should be fast. Many sections will be "keep as-is."
This is thorough. Every section gets attention and appears in the output.
Read ./assets/template.md and follow the <!-- INTERVIEW GUIDANCE: --> comments for each section. Those comments contain the specific questions to ask, probing questions, and what is customizable vs fixed.
Decisions in early sections affect later sections. When a user changes an early section, flag the dependent sections:
| Decision in | Affects | How |
|-------------|---------|-----|
| §1 -- SRP scope (classes vs functions-only) | §2 (extraction targets), §10 (checklist) | Functional codebases extract to functions only; class-based codebases also extract to classes |
| §2 -- Function size thresholds | §3 (complexity thresholds), §10 (checklist) | Shorter functions imply lower complexity budgets |
| §3 -- Complexity thresholds | §2 (function size) | Lower complexity limits may require stricter function size |
| §4 -- Naming conventions | §7 (comment necessity) | Better naming reduces the need for "what" comments |
| §5 -- Parameter design | §1 (SRP signals) | Long parameter lists often signal SRP violations |
| §8 -- Error handling strategy | §9 (testability patterns) | Result types vs exceptions change how error paths are tested |
When a dependency is triggered, inform the user: "Since you changed [X], we should also review [Y] -- it's affected by that decision."
For each of the 10 default sections:
For each of the 10 default sections:
mode: overlaydefaults.md exactly (the atom matches sections by heading)mode: overrideStrip all <!-- INTERVIEW GUIDANCE: --> comments from the output. The final document is a clean specification.
Determine output path:
.lattice/config.yaml exists and has paths.clean_code, use that path..lattice/standards/clean-code.md.Write the document:
.lattice/standards/ directory (and .lattice/ parent) if it does not exist.Update config:
.lattice/config.yaml does not exist, create it with: paths:
clean_code: .lattice/standards/clean-code.md
.lattice/config.yaml exists but has no paths.clean_code, add the key. Preserve all existing content..lattice/config.yaml exists and already has the key, no config change needed.Confirm to user:
"Your clean code document has been written to [PATH] in [overlay|override] mode. The clean-code atom will now use it [on top of the defaults | instead of the defaults]."
Before writing the final document, verify:
defaults.md exactly (for section matching by the atom)<!-- INTERVIEW GUIDANCE: --> comments remainmode: overlay<!-- INTERVIEW GUIDANCE: --> comments remainmode: override.lattice/config.yaml) is correctly updatedGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take techygarg/clean-code-refiner from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.