/lattice:code-forgefrom lattice
Generates implementation code from approved design blueprints or verbal requirements. Composes context anchoring, architecture, clean code, DDD, security, and test quality into an inside-out workflow.
Ships in lattice. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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)Where this workflow overrides its atoms — on these points the text here wins over the atom's own wording:
## Constraints; ask for a paste only when none are recorded.status stays approved. A bigger change goes to design-blueprint.STOP: Before Step 1, read additional_instructions.code_forge (one line or a list) from .lattice/config.yaml. No file or no key → skip silently.
When lines are found:
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 checks before Step 2 and ask at most once (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 and its doc is closed. New scope → recommend /design-blueprint, which designs it in a new context doc. A follow-up on the existing design that the user confirms → continue as "With approved design" (Check 2 still applies).draft or a missing field) → fail.Check 2 — levels present: Scan the body for ## Design: Level 3 and ## Design: Level 4. A one-line placeholder section (Not walked — … or Taken from …) counts as present; a section marked stale counts as missing.
Either check failed → STOP, one question naming everything that failed: "Context doc not approved (status: [value]) / missing [Level 3 / Level 4 / both]. Run /design-blueprint first, or proceed anyway?" On confirmation → log the status and the absent levels in the Decisions Log. Check 1 failed → continue as "Without approved design". Only Check 2 failed → continue as "With approved design" and treat the absent levels as gaps to fill during implementation.
Both pass → proceed as "With approved design".
Resume first: the context doc's Key Files table already lists components of this design → an earlier session built them. Confirm the files exist, mark those components built in the plan, and start at the first unbuilt one. A [Reopen] row in the Decisions Log → the design changed after some components were built; check each built component against the reopened level and add the needed changes to the plan. STOP: Never regenerate a built component unless the user asks.
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. A level that is a one-line placeholder carries no design — derive that part as under "Without approved design".
Without approved design: explore the codebase first and map each required component to the existing module it extends or modifies, or mark it new. Start from any level sections the context doc does have. Then classify the 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.
Architecture fit: no paths.architecture document is configured and the existing code is not organized in the default layers → follow the code. Place components in the existing structure, say so in the plan ("No architecture document configured — following the existing structure, not the clean-architecture defaults. Run /architecture-refiner to record it."), and apply the architecture checks in Steps 3–4 only where they do not contradict that structure. A [Level 2] decision in the context doc already settled this → follow it. An empty repository has nothing to follow — the defaults apply.
In both cases, plan an inside-out implementation order following the dependency direction from the loaded architecture doc (or of the existing structure, when the plan follows the code) — 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 any components already built — 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.
In the same message as the plan, 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. When a requirement doc is readable, each acceptance criterion this component fulfils gets a test named for it.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:
## Design: Level 4 text in place (and the Design Summary where it repeats that contract) so the doc matches the code, log it as a [Level 4] decision with the reason, leave status unchanged, and continue.## Open Questions as [for design] … and tell the user: "This changes the approved design. Run /design-blueprint to reopen Level [N], then /code-forge to continue." The doc's status is complete → design-blueprint never reopens it: skip the [for design] entry and say instead: "This changes the implemented design. Run /design-blueprint to design the change in a new context doc, then /code-forge on that doc." Stop work on the affected components; components the change does not touch may continue.Record as you go (all review modes): after each layer — each component in component-by-component mode — use framework:context-anchoring Enrich before starting the next, so an interrupted session leaves the doc current (no context doc exists → skip this; Step 5 suggests creating one):
These checks verify architecture coherence, not code quality (already verified per-component in Step 3). After all components are implemented:
Design override line in the requirement doc's ## Links that names this context doc, or names none) against the override. A criterion with neither → add the missing test or code, or tell the user it is uncovered. Requirement doc unreadable or unreachable → say the check was skipped. STOP: Never report the feature done with an uncovered criterion the user has not accepted.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.Use framework:context-anchoring Enrich to write anything from Step 3's "Record as you go" that is still missing — key files, implementation decisions, resolved open questions. No context doc exists and significant implementation decisions were made → suggest creating one.
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 (when a context doc exists): write status: complete into the context doc frontmatter once every planned component is implemented and Step 4 left nothing unresolved. STOP: required discrete file edit. Work remains — unbuilt components, failing tests, a change the user asked for → leave status unchanged and list what remains.
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 (work remains → replace "Implementation complete." with a one-line list of what remains):
"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."
What SKILL.md sets; muted values are Claude Code's defaults
27 skills in this plugin
/architectureEnforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode). Defaults to clean architecture; supports any architecture style via the architecture-refiner. Validates layer responsibilities, dependency direction, and structural constraints using the loaded architecture rules. Use when generating code, reviewing architecture, creating new files, or when the user mentions 'architecture', 'layers', 'structure', 'dependency rules', 'hexagonal architecture', 'ports and adapters', 'modular monolith', or 'onion architecture'. Also use when reviewing generated code for structural compliance./architecture-compassArchitectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a shareable insights document. Scoped to one repository, module, or folder. Does not execute transformation — it orients. Use when the user says 'assess my codebase architecture', 'what direction should my codebase go', 'architecture compass', 'understand my architecture', 'audit architecture drift', 'architectural assessment', or 'help me understand what is wrong with my codebase'.npx claudepluginhub techygarg/lattice --plugin latticeOther plugins' skills for the same job