复制安装命令
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
Composable AI skills that teach assistants structured thinking — design-first, context-aware, an...
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
来源文件:README.md
Composable AI skills that teach assistants structured thinking — design-first, context-aware, and architecture-guided.
AI coding assistants jump straight to code, silently make design decisions, forget constraints mid-conversation, and produce output nobody reviewed against real standards. Lattice fixes this with composable skills in three tiers — atoms, molecules, refiners — that embed battle-tested engineering disciplines plus a living context layer that accumulates your project's standards, decisions, and review insights across every feature cycle.
Three principles guided Lattice's design:
.lattice/ folder grows smarter with every feature cycle rather than being configured once and forgotten| Tier | Purpose |
|---|---|
| Atoms | Single-principle guardrails — clean code, architecture, DDD, secure coding, test quality, design-first, and more |
| Molecules | Multi-step workflows that compose atoms — design, implement, refactor, fix, review |
| Refiners | Guided interviews that produce project-specific standards, customizing how atoms behave for your team |

See How It Works for the full skill inventory and mechanics.
Skills form a delivery lifecycle: requirement-forge → design-blueprint → code-forge → review, with refactor-safely and bug-fix covering structural and defect-driven work. requirement-forge starts the pipeline — it acts as a senior PM + BA pair to produce structured feature specs in .lattice/requirements/ that feed directly into design-blueprint. For teams with existing codebases, architecture-compass sits before the pipeline — it scans the repository, runs a structured interview, and produces an agreed architectural direction that orients the team before any code changes begin. Each stage consumes and produces artifacts in .lattice/, growing the living context layer.

Install Lattice — choose the path that fits your setup:
Option A — Claude Code plugin (also works in Cursor — reads Claude Code skills automatically)
/plugins marketplace add techygarg/lattice
/plugins install lattice
/reload-plugins
Option B — Codex-compatible plugin package
codex plugin marketplace add techygarg/lattice
codex plugin add lattice@lattice
codex plugin list | rg -i lattice
The Codex plugin manifest lives in .codex-plugin/ and is registered by .agents/plugins/marketplace.json. Like every host plugin here, it's a thin manifest only — it points at the same shared, flat skills/ folder every other host uses, plus the verification runner script (scripts/run-verification.sh) — Codex has no subagent concept, so verification always runs the script directly rather than via a subagent. Grok (.grok-plugin/) and Kimi (.kimi-plugin/) follow the same pattern.
Option C — Clone and install locally (any AI tool)
git clone https://github.com/techygarg/lattice.git
cd lattice
./tools/install.sh /absolute/path/to/your/skills/folder
Pass the skills directory for your tool: ~/.claude/skills/ for Claude Code, .cursor/skills/ for Cursor, or any tool's skills folder.
Option D — Agent Plugins 1.0-conformant clients
A root plugin.json conforming to the open, vendor-neutral Agent Plugins standard ships alongside the host-specific manifests above — any conformant client auto-discovers skills straight from the skills/ folder with zero extra install steps. Shipped in Codex CLI, Cursor, VS Code / GitHub Copilot, and Kiro as of this writing.
See docs/plugins.md for the full per-host status table and how to add a new host.
Try it immediately. The repo includes
sample/— a realistic .NET 8 User Service spec with requirements, domain concepts, and constraints already written. Copy thesample/folder contents into any empty directory and follow the steps below.
Run /lattice-init in your AI tool's chat — scans the project, suggests refiners in priority order, creates .lattice/config.yaml. All skill commands (/lattice-init,/requirement-forge, /design-blueprint, /code-forge, etc.) are typed in the AI chat, not the terminal.
Spec (optional but recommended) — /requirement-forge acts as a senior PM + BA pair to define epics and feature specs before any design begins. Accepts existing PRDs, feature lists, or a verbal description. Produces .lattice/requirements/ as direct input to design-blueprint.
Design — /design-blueprint walks through five progressive design levels before any code is written.
Implement — /code-forge generates implementation from the approved blueprint, applying all quality atoms.
Review — /review audits the change and persists insights into .lattice/ for the next cycle.
.lattice/config.yaml key documentedHelper skills for creating and maintaining Lattice itself — see dev-skills/.
MIT
name: clean-code-refiner
description: "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'.".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 updated
评论 (0)
暂无评论,成为第一个评论者吧!