$npx -y skills add techygarg/lattice --skill skill-alignAudit and fix all Lattice documentation, README, docs/, PROJECT.md, 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
| 1 | # Lattice Sync |
| 2 | |
| 3 | **Core responsibility:** Keep every public-facing document in sync with the actual skill inventory. The skills directory is the source of truth — all documents derive from it. |
| 4 | |
| 5 | **Input:** None required. Reads the live state of `skills/` and all documentation on every run. Optionally: a specific skill name or tier to focus the audit. |
| 6 | |
| 7 | **Output:** |
| 8 | - A findings report listing every gap as `[GAP]`, `[STALE]`, or `[WRONG]` with file and description |
| 9 | - All found gaps fixed in-place across: `README.md`, `docs/how-it-works.md`, `docs/configuration.md`, `docs/practical-guide.md`, `PROJECT.md`, `CLAUDE.md`, `.github/ISSUE_TEMPLATE/bug_report.yml` |
| 10 | - A final clean confirmation: "No gaps found" or a list of what was changed |
| 11 | |
| 12 | **How to verify this skill did its job:** |
| 13 | ```bash |
| 14 | grep -rn "requirements atom\|framework:requirements\b" \ |
| 15 | docs/ README.md PROJECT.md CLAUDE.md .github/ skills/ \ |
| 16 | --include="*.md" --include="*.yml" |
| 17 | ``` |
| 18 | Any result from this grep means the sync is incomplete. A clean run returns no output. |
| 19 | |
| 20 | Also verify: every skill in `skills/` appears in the bug_report.yml dropdown and the how-it-works.md inventory tables. |
| 21 | |
| 22 | ## When to run |
| 23 | |
| 24 | - After creating any new atom, molecule, or refiner |
| 25 | - After renaming or removing a skill |
| 26 | - After changing a skill's config key, consumed-by relationships, or output path |
| 27 | - When a user suspects docs are out of date |
| 28 | |
| 29 | ## Phase 1 — Build the live inventory |
| 30 | |
| 31 | Read the skills directory tree. **STOP: do NOT assume you already know the inventory** — always read from files. |
| 32 | |
| 33 | ```bash |
| 34 | find skills/ -name "SKILL.md" | sort |
| 35 | ``` |
| 36 | |
| 37 | For each SKILL.md found, extract: |
| 38 | - `name:` field (frontmatter) |
| 39 | - `tier:` inferred from path (`atoms/`, `molecules/`, `refiners/`) |
| 40 | - Config key: grep for `paths\.\w+` in the file |
| 41 | - Consumes: grep for `framework:` references (molecules only) |
| 42 | - Produces: grep for `.lattice/standards/` path (refiners only) |
| 43 | - Output subfolder: grep for `.lattice/\w+/` paths (molecules only) |
| 44 | |
| 45 | Build a structured inventory: |
| 46 | ``` |
| 47 | atoms: [name, config_key, has_refiner, has_defaults_md] |
| 48 | molecules: [name, composes[], output_subfolder] |
| 49 | refiners: [name, config_key, produces_path, consumed_by_atom] |
| 50 | ``` |
| 51 | |
| 52 | Read `references/audit-checklist.md` for the complete per-document audit rules before starting Phase 2. |
| 53 | |
| 54 | --- |
| 55 | |
| 56 | ## Phase 2 — Audit each document |
| 57 | |
| 58 | Work through every document in this order. For each, apply the checks in `references/audit-checklist.md`. **STOP: a document with zero findings gets no entry in the report** — do not print a heading or a "no gaps" line for it. Log every finding as: |
| 59 | |
| 60 | ``` |
| 61 | [GAP] file:line — description of what is missing or wrong |
| 62 | [STALE] file:line — description of what refers to something that no longer exists |
| 63 | [WRONG] file:line — description of a relationship (consumed-by, produces) that is incorrect |
| 64 | ``` |
| 65 | |
| 66 | Documents to audit: |
| 67 | 1. `docs/how-it-works.md` |
| 68 | 2. `docs/configuration.md` |
| 69 | 3. `docs/practical-guide.md` |
| 70 | 4. `README.md` |
| 71 | 5. `PROJECT.md` — Skill Conventions, Known subfolders list, and Repository Structure counts all live here |
| 72 | 6. `.github/ISSUE_TEMPLATE/bug_report.yml` |
| 73 | 7. `.github/ISSUE_TEMPLATE/skill_request.yml` *(generic — only check if skill-specific examples are present)* |
| 74 | 8. `.github/ISSUE_TEMPLATE/documentation.yml` *(generic — only check if skill names appear)* |
| 75 | 9. `knowledge-base/requirement-forge-requirements.md` *(if exists — check it matches current skill names)* |
| 76 | |
| 77 | Present a consolidated findings report before making any changes: |
| 78 | |
| 79 | ``` |
| 80 | ## Lattice Sync — Findings |
| 81 | |
| 82 | ### docs/how-it-works.md |
| 83 | [GAP] Atoms table missing: requirement-quality |
| 84 | [STALE] Refiners in Depth: requirement-forge-refiner consumed-by says "molecule" but should say "requirement-quality atom" |
| 85 | |
| 86 | ### .github/ISSUE_TEMPLATE/bug_report.yml |
| 87 | [GAP] Skill dropdown missing: requirement-quality (atom) |
| 88 | |
| 89 | Total: N gaps, M stale references, P wrong relationships |
| 90 | ``` |
| 91 | |
| 92 | Ask: *"Ready to apply all fixes? Or are there any findings you want to skip?"* |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## Phase 3 — Fix |
| 97 | |
| 98 | Apply every agreed fix. For each document, make all changes in a single edit pass. **STOP: do not make multiple passes over the same file.** |
| 99 | |
| 100 | After all fixes are applied, run one final verification grep to confirm no old references remain: |
| 101 | |
| 102 | ```bash |
| 103 | # Check for stale atom names or wrong consumed-by text |
| 104 | gr |