skill-validate
# Skill Validator The skill-validate tool validates Lattice SKILL.md files against structural requirements, tier-specific conventions, and cross-reference integrity, reading authoritative rules from CLAUDE.md and convention-rules.md. Use this after creating or modifying any skill file to catch structural errors, broken framework references, and convention violations before repository submission.
git clone --depth 1 https://github.com/techygarg/lattice /tmp/skill-validate && cp -r /tmp/skill-validate/dev-skills/skill-validate ~/.claude/skills/skill-validateSKILL.md
# Skill Validator
**Core responsibility:** Verify that a SKILL.md is structurally correct, follows all Lattice tier conventions, and composes correctly with the rest of the framework.
**Input:** One or more of:
- A file path: `skills/atoms/clean-code/SKILL.md`
- A skill name: `clean-code` (resolves to the correct path automatically)
- A tier: `atoms` (validates all skills in that tier)
- No argument: validates all skills across all three tiers (count derived from `skills/` at runtime — never hardcoded)
**Output:** A findings report per skill:
```
## Skill Validator — {skill-name}
Tier: {atom | molecule | refiner}
### Structural PASS / FAIL — specific findings
### Tier conventions PASS / FAIL — specific findings
### Cross-references PASS / FAIL — specific findings
### Three-angle review PASS / WARN / FAIL per lens
Result: PASS | FAIL (N errors, M warnings)
```
**How to verify this skill did its job:**
- Every finding references a specific file and section (no vague "missing content" — says exactly what is missing and where)
- FAIL findings have an actionable fix, not just a description of the problem
- The report distinguishes errors (must fix) from warnings (judgment calls)
- After "fix mode" is applied, re-running the validator returns PASS
Validates one or more Lattice SKILL.md files against all conventions. Always reads conventions from `CLAUDE.md` — never from memory.
## Step 1: Load conventions
Read `CLAUDE.md` — Skill Conventions section. This is the source of truth. Do not rely on memory.
Read `references/convention-rules.md` for the detailed per-tier checklist.
## Step 2: Run structural checks (all tiers)
For every SKILL.md being validated:
```
[ ] Frontmatter: name field present, lowercase-hyphenated
[ ] Frontmatter: description field present and non-empty
[ ] Frontmatter: description contains trigger phrases (what the user would type)
[ ] Folder name matches name field exactly
[ ] No inline atom content in molecules (no duplicating what framework:{atom} already provides)
```
## Step 3: Run tier-specific checks
Read `references/convention-rules.md` for the full per-tier checklist. Apply the relevant section based on tier (determined from file path: atoms/, molecules/, refiners/).
## Step 4: Run cross-reference checks
For every `framework:{atom-name}` reference in a molecule:
```bash
ls skills/atoms/{atom-name}/SKILL.md 2>/dev/null || echo "BROKEN REF: framework:{atom-name}"
```
For every `paths.{key}` config key referenced in a refiner or atom:
- Check it appears in `docs/configuration.md` paths table
For every `.lattice/{subfolder}/` path referenced in a molecule:
- Check that subfolder is in the known subfolders list in `CLAUDE.md`
## Step 5: Three-angle structural review
These three lenses are fixed — they match the three stakeholder types who depend on Lattice skills working correctly. This is a structural review (does the skill follow conventions?), not a behavioral review (does it work in practice?) — use `skill-review` for the latter.
Each lens asks a different question:
**Product Owner lens** — "Will this produce the right output for its users?"
- If a molecule: does the output document structure (from the SKILL.md template) give a PO a clear picture of what was produced?
- If an atom: are the quality checks grounded in real user need, not just technical form?
- If a refiner: does the produced standards document solve the configuration problem the user has?
**Business Analyst / Practitioner lens** — "Are the rules complete and enforceable?"
- Are checklists specific enough to have a clear pass/fail for each item?
- Are anti-patterns named with a fix, not just a symptom?
- Are ambiguity signals genuinely ambiguous, or are they just gaps in the rules?
- For molecules: are all practical scenarios handled (fresh start, existing material, interrupted session, single-item request)?
**Technical Lead lens** — "Does this compose correctly with the rest of the framework?"
- Do atom references (`framework:{name}`) resolve to real skills?
- Do config keys follow snake_case and match what's in configuration.md?
- Does the molecule write to a named `.lattice/` subfolder (never root)?
- For planning molecules: is the session resume check present at Step 1?
- For generative molecules: are there no confirmation gates?
## Step 6: Report
Format findings as:
```
## Skill Validator — {skill-name}
Tier: {atom | molecule | refiner}
### Structural
PASS — all structural checks clean
### Tier conventions
FAIL — [Atom] Self-Validation Checklist missing STOP language on check 3
FAIL — [Molecule] Planning molecule Step 2 has no confirmation gate
### Cross-references
PASS — all framework: references resolve
### Three-angle review
[PO] PASS
[BA] WARN — Scenario: no guidance for interrupted session (resume behavior)
[Tech] FAIL — .lattice/myoutput/ is not in CLAUDE.md known subfolders list
---
Result: FAIL (2 errors, 1 warning)
Fix errors before writing to the repo. Warnings are judgment calls.
```
Distinguish errors (must fix) from warnings (should consider).
## Step 7: Fix mode (optional)
If the user says "fix it" or "apply fixes" — apply all error-level findings directly to the files. Re-run validation after fixes. Do not fix warnings without asking which ones to apply.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.
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'.
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'.