$npx -y skills add techygarg/lattice --skill code-forgeGenerate 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 cont
| 1 | # Code Forge |
| 2 | |
| 3 | ## Required Skills |
| 4 | |
| 5 | Read, apply: |
| 6 | |
| 7 | 1. `framework:knowledge-priming` -- Load proj context (stack, arch, conventions) so impl matches real proj (always) |
| 8 | 2. `framework:context-anchoring` -- Load/find context anchor doc; enrich as impl decisions made (always) |
| 9 | 3. `framework:learning-harvest` -- Load prior operational learnings inform impl; harvest new patterns at session end (always) |
| 10 | 4. `framework:collaborative-judgment` -- Surface real judgment calls w/ structured opts vs silent assume (always) |
| 11 | 5. `framework:architecture` -- Layer place, dep direction, struct valid (always) |
| 12 | 6. `framework:clean-code` -- Craft rails: SRP, naming, complexity, err handle (always) |
| 13 | 7. `framework:domain-driven-design` -- Aggregates, entities, VOs, domain svcs (conditional: only when touch domain folder) |
| 14 | 8. `framework:secure-coding` -- Trust bounds, injection prevent, secrets mgmt (conditional: only boundary-cross code) |
| 15 | 9. `framework:test-quality` -- AAA struct, isolation, assert quality, naming (always when write tests) |
| 16 | |
| 17 | ## Workflow |
| 18 | |
| 19 | ### Step 1: Establish Implementation Context |
| 20 | |
| 21 | Use `framework:learning-harvest` Load behavior. Focus hint: "implementation session — focus: implementation craft, quality signals, reliability". |
| 22 | |
| 23 | Use `framework:context-anchoring` Doc Discovery check existing context anchor doc for feature impl. |
| 24 | |
| 25 | - **If found** → Load (context-anchor Load behavior). Present struct ack -- feature name, **status**, decision count, open Qs, constraints. Honor all logged decisions/constraints as active commits. |
| 26 | - **If not found** → Nudge user: "Have design doc/blueprint for feature? Or work from discussed?" Accept either graceful. |
| 27 | - User provides doc → load, follow. |
| 28 | - Proceed without → all atom rails still apply; just no approved design doc to reference. Work from verbal reqs in convo. |
| 29 | |
| 30 | **Design completeness check** — STOP gates before Step 2: |
| 31 | |
| 32 | **Check 1 — status:** Read frontmatter `status`. |
| 33 | - `approved` → pass. |
| 34 | - Anything else → STOP: "Context doc not approved (`status: [value]`). Run design-blueprint first. Proceed anyway?" Confirm → log in Decisions Log, continue as "Without approved design." |
| 35 | |
| 36 | **Check 2 — levels present:** Scan body for `## Design: Level 3` and `## Design: Level 4`. |
| 37 | - Both present → pass. |
| 38 | - Either missing → STOP: "Missing [Level 3 / Level 4 / both]. Proceed anyway?" Confirm → log absent levels in Decisions Log, treat as gaps to fill during implementation. |
| 39 | |
| 40 | Both pass → proceed as **"With approved design"**. |
| 41 | |
| 42 | ### Step 2: Plan Implementation Order |
| 43 | |
| 44 | **With approved design**: Extract component list, layer assigns from context anchor doc. Use L2 (Components) decisions for layer place, L3 (Interactions) for dep flow. |
| 45 | |
| 46 | **Without approved design**: Classify req components→arch layers using layer defs from `framework:architecture`. Each component, determine: |
| 47 | |
| 48 | - Primary responsibility? (biz rules, data access, coord, external I/O) |
| 49 | - Which layer in loaded arch doc matches responsibility? |
| 50 | - Dep constraints for that layer? |
| 51 | |
| 52 | If `framework:architecture` no loaded layer defs (neither defaults nor custom doc resolved), warn: "No arch rules avail. Run `/architecture-refiner` define arch standards. Proceed w/o arch guidance." Continue w/ only remaining atom rails. |
| 53 | |
| 54 | Present proposed layer assigns→user for approval before proceed. |
| 55 | |
| 56 | Both cases, plan **inside-out impl order** following dep direction from loaded arch doc — start innermost layer (no outward deps), work outward. Each layer's deps should exist when built. |
| 57 | |
| 58 | Classify each op per flow patterns in loaded arch doc (e.g., cmd vs query flows, or equiv distinction your arch style). |
| 59 | |
| 60 | Present impl plan -- ordered component list, layer assigns, flow classifs -- confirm w/ user before write code. |
| 61 | |
| 62 | After plan approved, ask user choose **review mode**: |
| 63 | |
| 64 | > "How review impl?" |
| 65 | > 1. **Layer-by-layer** (rec) -- Impl each layer fully, pause for review before next. One review pt/layer. |
| 66 | > 2. **Full autonomy** -- Impl everything end-to-end, present complete result. One review pt at end. (If blueprint exists, still pause any deviation from approved design.) |
| 67 | > 3. **Component-by-component** -- Pause after each individual component for feedback. Max review pts. |
| 68 | |
| 69 | Default **layer-by-layer** if user no preference. |
| 70 | |
| 71 | ### Step 3: Implement Per Component |
| 72 | |
| 73 | Each component in planned order, gen **code+tests together** -- tests not afterthought. |
| 74 | |
| 75 | Every component: |
| 76 | |
| 77 | - **Prefer the simpler path first.** Before writing custom code: does a stdlib function, platform built-in, or existing dependency already cover this? If yes — use it. Can it be expressed in shorter code? Use |