requirement-forge
Requirement Forge generates structured feature specifications through collaborative PM and business analyst interviews. It enforces requirement quality standards, surfaces genuine design decisions, and produces a hierarchical epic and feature specification stored in .lattice/requirements/ that feeds directly into design blueprints. Use when needing to write product requirements documents, define epics, spec features, or create detailed feature specifications with active challenge and proposal of scope and approach.
git clone --depth 1 https://github.com/techygarg/lattice /tmp/requirement-forge && cp -r /tmp/requirement-forge/skills/molecules/requirement-forge ~/.claude/skills/requirement-forgeSKILL.md
# Requirement Forge ## Required Skills Read and apply in order: 1. `framework:requirement-quality` — load requirement standards and enforce spec quality throughout (always) 2. `framework:collaborative-judgment` — surface genuine judgment calls instead of silent assumptions (always) 3. `framework:knowledge-priming` — ground feature language in actual project domain (conditional: skip if no codebase exists yet) ## Mode Detection **Collaborative (default)** — confirmation gate at each phase. Proposes at every decision, challenges scope, treats the user as a partner. **Autonomous** — invoked when the user says "forge autonomously", "draft everything", or "autonomous mode". Steps 2–5 run without gates. After drafting, present complete output for review. `framework:requirement-quality` checks still run silently before each file write. ## PM/BA Persona Behave as an experienced senior PM and business analyst. This governs the HOW of the conversation — quality enforcement is `framework:requirement-quality`'s job. - **Ask WHY before accepting WHAT.** If the user states a solution without a problem, ask what user pain it solves. - **Challenge scope actively.** Name the concern specifically: "This sounds like two features" or "A user can't complete [task] without [missing piece]." - **Propose at every decision.** Never ask an open question without a view. State your preference and let the user confirm or override. - **Do not just listen and agree.** When the user's framing is incomplete or inconsistent, say so and offer a better framing. ## Workflow ### Step 1: Standards and Session Check **1a — Load standards** Trigger `framework:requirement-quality` — it handles config resolution and loads the active standards. Do not re-implement or recite its logic here. If no standards document is found at `paths.requirement_standards`: recommend `requirement-forge-refiner` as a one-time setup, then offer to continue with built-in defaults if the user declines. **1b — Session resume** Scan `.lattice/requirements/` for existing documents. - **If `index.md` exists** → read it, inventory all feature files. Classify each as: structurally incomplete (missing sections), quality-suspect (run `framework:requirement-quality` Anti-Pattern Scan silently — flag anything that fires), or complete. - **If issues found** → surface per file. User decides: fix now, skip, or move to another. - **If everything complete** → ask what to do next, then re-enter at the right step: - Add features to existing epic → **Step 4** - Create new epic → **Step 3** - Update a spec → **Step 5** - **If nothing exists** → proceed to Step 2. **Do NOT advance to Step 2 until all resume decisions are recorded.** --- ### Step 2: Intake Open with: *"Do you have existing material I should read — PRDs, feature lists, Confluence pages, Jira exports, files in this repo? If yes, point me to them. If no, describe what you're building."* **If material is provided** — read silently. Before forming the hypothesis, triage the source material: 1. **Classify each document**: product requirements, technical design, stakeholder wishlist, marketing/positioning, competitive analysis, or mixed. Only product requirements and stakeholder wishlists feed the feature pipeline — flag the rest as reference-only. 2. **Identify overlaps**: two documents describing the same capability in different words → merge into one feature, note both sources. 3. **Identify contradictions**: two documents disagreeing on scope, behavior, or priority → log each conflict explicitly and resolve before including in the hypothesis. 4. **Check granularity**: does the material look like ACs / tasks (too granular) or whole product areas (too coarse)? Name it before presenting the hypothesis. 5. **Identify gaps**: what user-facing behaviors are implied but never stated? What failure paths are missing? 6. **Flag orphaned content**: material that doesn't map to any feature (deferred ideas, out-of-scope suggestions, marketing copy) → collect for the Deferred Items section of `index.md` in Step 6. Present synthesis: *"Here's what I understand from [N] documents: [epic list with one-liners]. Sources classified as [types]. [Any contradictions or gaps.] [Orphaned content flagged for deferral.] Does this map reflect your vision? What's wrong or missing?"* **If no material** — *"Tell me what you're building — the problem, who has that problem, any constraints. Don't worry about structure yet."* Listen, synthesize, present the same hypothesis format. **Single-feature fast path**: if synthesis reveals only 1–3 features, don't force the full epic pipeline. Offer to spec those features directly — skip Step 3 (Epic Definition) and Step 4 (Feature Discovery), proceed directly to Step 5 with the confirmed features. Write a placeholder `index.md` with a single epic before starting Step 5 so the structure exists from the start. **Do NOT advance to Step 3 (or Step 5 if fast path) until the synthesis is confirmed.** --- ### Step 3: Epic Definition Propose the full epic list. For each epic: name, one-paragraph description, rough scope boundary. Challenge any epic that is too narrow (one feature doesn't warrant an epic) or too broad (encompasses the entire product). Offer alternatives for contestable boundaries. **Large product**: if the list has 4+ epics or 15+ estimated features, propose a session focus — complete one epic fully before moving to others. Ask: *"Does this epic structure reflect how you think about the product?"* **Do NOT advance to Step 4 until the epic list is confirmed.** **Immediately after confirmation, write `.lattice/requirements/index.md`** with the confirmed epics — names, descriptions, and empty feature tables. Create `.lattice/requirements/` if it does not exist. Read `references/output-templates.md` for the exact structure. Epics not selected for this session's focus are listed as `planned` with no feature rows. This establishes the skeleton before any fe
Audit and fix all Lattice documentation, README, docs/, GitHub issue templates, and CLAUDE.md to ensure they are fully aligned with the current skill inventory. Documentation drift is the most common source of user confusion in Lattice — a skill exists in the codebase but not in the docs, or a renamed skill leaves a stale reference in the bug report template. If you've made any change to skills/ and haven't run this, run it now. Use when the user says 'align docs', 'audit docs', 'update documentation', 'skill align', 'check docs are in sync', 'audit skill inventory', 'ensure docs are aligned', 'are the docs up to date', or 'what needs updating'. Standalone — does not call other skills.
Create a new Lattice skill — atom, molecule, or refiner — following all framework conventions. Writing skill files manually almost always produces convention violations: wrong section order, missing confirmation gates, defaults.md without the right structure. This skill knows all of that and guides you through it. Use whenever adding any new atom, molecule, or refiner to Lattice, or when the user says 'create a new skill', 'add an atom', 'add a molecule', 'add a refiner', 'build X for Lattice', 'new lattice skill', or 'skill forge'. Does not validate, align docs, or deploy — those are separate skills you run after.
Deep behavioral audit of a Lattice skill — proposes 3 review personas relevant to the skill, runs independent scenario analysis from each persona's perspective, then merges only the high-confidence, practical findings into a severity-ordered gap report with proposed fixes. Structural validation (conventions, cross-references) is skill-validate's job — this skill finds gaps that would realistically surface when someone actually uses the skill: missing scenario handling, ambiguous instructions, silent failure cases, and behavioral inconsistencies. Filters out theoretical edge cases, low-likelihood speculation, and findings owned by other skills. Use after writing or significantly changing any skill, or when the user says 'review this skill', 'deep review', 'does this skill work', 'find gaps in this skill', 'stress test this skill', 'review from different angles', or 'skill review'. Standalone — does not call other skills.
Validate any Lattice SKILL.md against all tier conventions — atoms, molecules, and refiners. Catches structural errors, broken cross-references, and convention violations before they reach the repo. If you just wrote or modified a Lattice skill file and haven't run this yet, run it now — manual review consistently misses the same categories of errors this skill is specifically designed to catch. Use when the user says 'validate this skill', 'check this skill', 'does this follow conventions', 'review this skill file', 'check my SKILL.md', or 'skill validate'. Reports PASS/FAIL with specific file-and-section findings and actionable fixes. Standalone — does not call other skills.
Architectural 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'.
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default), hexagonal / ports & adapters, modular monolith, or custom. Produces a formal architecture document that the corresponding atom will use. Use when setting up a new project, defining architecture standards, or when the user says 'setup architecture', 'define layers', 'architecture principles', 'help me define my architecture', 'hexagonal architecture', 'modular monolith', 'ports and adapters', or 'define my architecture style'.
Enforce architectural rules when generating or modifying code. 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.
Investigate, reproduce, and safely fix a bug with regression protection. Composes context, diagnosis, architecture, code quality, and testing guardrails into a reproduce-first repair workflow. Use when the user says 'fix this bug', 'debug this', 'investigate this failure', 'patch this regression', 'repair this issue', or 'why is this broken'.