Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/techygarg/lattice/clean-code-refinernpx skills add techygarg/lattice --skill clean-code-refinergit clone --depth 1 https://github.com/techygarg/latticeWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00084 | $0.02734 |
| Opus 5 | $0.00042 | $0.01367 |
| Sonnet 5 | $0.00017 | $0.00547 |
| Haiku 4.5 | $0.00008 | $0.00273 |
Grade A, and why
clean-code-refiner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Code Refiner
What This Produces
- Output:
.lattice/standards/clean-code.md(or custom path from.lattice/config.yaml->paths.clean_code) - Two modes:
- Overlay (
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. - Override (
mode: override): A comprehensive standalone document that fully replaces the atom's embedded defaults. For teams with fundamentally different coding standards.
- Overlay (
- Default mode: Overlay -- produces only what the user wants to change
- Config key:
paths.clean_codein.lattice/config.yaml - Template: Read
./assets/template.mdfor the full document structure, default content, and interview guidance comments
Scope Clarification
This 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:
- Clean code -- function size, naming, complexity, error handling, testability, abstraction discipline
- Clean architecture -- layers, dependency direction, command/query flows, structural placement
- DDD -- aggregates, entities, value objects, domain events, repository patterns
Before You Begin
Check for existing documents
Before starting the interview, check whether a custom document already exists:
- Read
.lattice/config.yaml-- doespaths.clean_codepoint to a file? - If yes, read that file. Ask the user:
- "You already have a custom clean code document. Would you like to revise it (update specific sections), start fresh (new interview), or add to it (add new sections)?"
- Revise: Load the existing document, walk through only the sections the user wants to change, and update in place.
- Start fresh: Proceed with the full interview flow below.
- Add to it: Skip to the "New Sections" part of the interview.
- If no config or no existing document, proceed with the full interview flow.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 221 lines · 84 tokens per session scan A e8eb5ef4d438
clean-code-refiner is a skill published in the GitHub repository techygarg/lattice (183 stars, last pushed 4d ago), licensed MIT. It adds 84 tokens to every session and 2,734 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
xiaoyaoclaw-workspace-initializer
OpenClaw workspace initialization & standardization. Sets up a proper agent home: standard directory structure (projects/tasks/outputs/knowledge/scripts/ memory/tmp) + WORKSPACE.md rules + multi-agent config safety (config.patch, never config.apply) + memory log. Use when an agent enters a new/empty workspace root, or…
learn
Search, install, update, and rate AI agent skills from agentskill.sh (100,000+ skills). Use when the user asks to find skills, install extensions or plugins, discover new capabilities, check what skills are available, or says "how do I do X" when a skill might help. Also handles listing installed skills, checking for…
review-skill
Review and improve AI agent skills (SKILL.md files) against best practices from the Agent Skills specification and Anthropic's authoring guidelines. Scores skills on 10 quality dimensions, identifies specific issues, and rewrites problem areas. Use when creating, editing, auditing, or improving agent skills. Triggers…
building-chatgpt-apps
Guides creation of ChatGPT Apps with interactive widgets using OpenAI Apps SDK and MCP servers. Use when building ChatGPT custom apps with visual UI components, embedded widgets, or rich interactive experiences. Covers widget architecture, MCP server setup with FastMCP, response metadata, and Developer Mode…
memory-systems
Design and implement memory architectures for agent systems. Use when building agents that need to persist state across sessions, maintain entity consistency, or reason over structured knowledge.
multi-agent-patterns
Design multi-agent architectures for complex tasks. Use when single-agent context limits are exceeded, when tasks decompose naturally into subtasks, or when specializing agents improves quality.