复制安装命令
用 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: code-forge
description: "Generate implementation code from an approved design blueprint or verbal requirements. Composes context anchoring, architecture, clean code, DDD, security, and test quality into an inside-out implementation workflow. Use when moving from design to code, implementing approved contracts, or when the user says 'implement', 'code this', 'build it', 'forge the code', or 'generate the code'."Read and apply:
framework:knowledge-priming -- Load project context (stack, architecture, conventions) so implementation matches the real project. (always)framework:context-anchoring -- Find and load the feature's context anchor doc; enrich it as implementation decisions are made (Create / Load / Enrich behaviors). (always)framework:learning-harvest -- Load prior operational learnings to inform implementation at session start; harvest new ones at session end. (always)framework:collaborative-judgment -- Surface genuine judgment calls as structured options instead of silently assuming. (always)framework:architecture -- Layer placement, dependency direction, structural validation. (always)framework:clean-code -- Craft guardrails: SRP, naming, complexity, error handling. (always)framework:domain-driven-design -- Aggregates, entities, value objects, domain services. (conditional: domain-layer components only)framework:secure-coding -- Trust bounds, injection prevention, secrets handling. (conditional: trust-boundary code only)framework:test-quality -- AAA structure, isolation, assertion quality, naming. (always when writing tests)framework:learning-harvest Load behavior. Focus hint: "implementation session — focus: implementation craft, quality signals, reliability".framework:context-anchoring Document Discovery: scan the context base directory (per the atom's Config Resolution) for an existing anchor doc covering this feature's implementation.
Design completeness check — run both gates before Step 2 (no context doc exists → skip both, proceed as "Without approved design"):
Check 1 — status: Read the context doc frontmatter status.
approved → pass.complete → this feature was already implemented. If the current request is new scope, recommend /design-blueprint for a fresh design pass; if the user confirms proceeding on the existing design, continue as "With approved design" (Check 2 still applies).draft or a missing field) → STOP: "Context doc not approved (status: [value]). Run /design-blueprint first. Proceed anyway?" On confirmation → log it in the Decisions Log and continue as "Without approved design".Check 2 — levels present: Scan the body for ## Design: Level 3 and ## Design: Level 4.
Both pass → proceed as "With approved design".
With approved design: extract the component list and layer assignments from the context anchor doc. Use the Level 2 (Components) decisions for layer placement and Level 3 (Interactions) for dependency flow.
Without approved design: classify the required components into architecture layers using the layer definitions from framework:architecture. For each component determine:
If framework:architecture resolved no layer definitions (neither defaults nor a custom doc), surface it: "No architecture rules available. Run /architecture-refiner to define your architecture standards. Proceeding without architecture guidance." Continue with the remaining atom rails.
Present the proposed layer assignments to the user for approval before proceeding.
In both cases, plan an inside-out implementation order following the dependency direction from the loaded architecture doc — start at the innermost layer (no outward dependencies) and work outward, so each layer's dependencies already exist when it is built.
Classify each operation per the flow patterns in the loaded architecture doc (e.g., command vs query flows, or the equivalent distinction in your architecture style).
Present the implementation plan — ordered component list, layer assignments, flow classifications — and confirm with the user before writing code. If the user rejects or corrects the plan, revise and re-present it. STOP: Never start coding on an unagreed plan.
After the plan is approved, ask the user to choose a review mode:
"How should we review the implementation?"
- Layer-by-layer (recommended) — implement each layer fully, pause for review before the next. One review point per layer.
- Full autonomy — implement everything end-to-end, present the complete result. One review point at the end. (If a blueprint exists, still pause on any deviation from the approved design.)
- Component-by-component — pause after each individual component for feedback. Maximum review points.
Default to layer-by-layer if the user expresses no preference.
For each component in planned order, generate code and tests together — tests are not an afterthought.
Every component:
framework:architecture; dependency direction follows the loaded architecture rules.framework:clean-code self-validation during generation. Inline checks: SRP compliance, meaningful naming, low cyclomatic complexity, proper error handling, no magic values, clean function signatures, no dead code, appropriate abstraction level, clear control flow, minimal comments (the code documents itself).framework:test-quality self-validation.Conditional checks per component:
framework:domain-driven-design self-validation.framework:secure-coding self-validation.Post-generation verification (every component, all review modes):
After generating each component, before presenting it to the user:
framework:collaborative-judgment protocol before showing code. Never silently resolve.Pacing — follow the user's chosen review mode:
These checks verify architecture coherence, not code quality (already verified per-component in Step 3). After all components are implemented:
framework:architecture verification across all components — inter-component dependency direction follows the loaded architecture rules; no layer imports from a layer it is not permitted to depend on.framework:secure-coding across component boundaries — data flowing between components crosses trust bounds safely.Throughout Steps 3-4, use framework:context-anchoring Enrich behavior to keep the living doc current:
Harvest learnings: run framework:learning-harvest Harvest behavior. Session context: "implementation session — code generation from design contracts". Synthesize and propose cross-cutting patterns from this session — implementation gotchas, design-to-reality gaps, library/framework lessons. The user confirms what enters the document. STOP: run this before closing the feature lifecycle below.
Close the feature lifecycle: write status: complete into the context doc frontmatter. STOP: required discrete file edit.
STOP: do not write status to requirement_doc. The requirement's status belongs to whoever manages it — a human, or an external system it may live in. This molecule manages only its own context doc.
After enriching the context doc, recommend review:
"Implementation complete. Recommend running
/reviewon the generated code before considering the feature done — it provides an independent quality assessment against the same atom standards, catches issues the generator may be blind to, and captures learnings for future sessions."
评论 (0)
暂无评论,成为第一个评论者吧!