# Lw Reflect

> Use index-first discovery to find synthesis, contradiction, gap, and output-promotion opportunities across wiki/, save a reflection report to outputs/, update reflect state, and create or recommend high-value canonical pages. Usage: /lw-reflect

- Skill: `geeksfino/lw-reflect` (Agent Skill)
- Install (CLI): `npx skillmds@latest add geeksfino/lw-reflect`
- Raw SKILL.md: https://api.skillmd.com/api/skills/geeksfino/lw-reflect/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: geeksfino (https://skillmd.com/u/geeksfino)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/geeksfino/lw-reflect

---


# LLM Wiki Reflect

Reflect on the wiki to make it smarter over time using a two-stage process: cheap discovery first, targeted deep reading second.

`wiki/` is canonical.
`outputs/` is non-canonical artifact storage that may contain promotion candidates.

## Required reads
1. `.llm-wiki/reflect_state.json`
2. `.llm-wiki/manifest.json`
3. `.llm-wiki/profile.json`
4. Active profile markdown
5. `wiki/index.md`
6. `wiki/log.md`

If `wiki/index.md` is missing, stop and ask the user to initialize or repair the workspace first.

## Step-by-step procedure

### 1. Load reflect state
Read `.llm-wiki/reflect_state.json`.
Extract:
- `last_reflected_at`
- `synthesized_articles`

If the file is missing or empty, treat `last_reflected_at` as null and `synthesized_articles` as an empty list.

### 2. Identify recently changed wiki pages
Read `.llm-wiki/manifest.json`.
Collect manifest entries where:
- `compiled_at` is newer than `last_reflected_at`, or
- `last_reflected_at` is null

Extract their `wiki_articles` as recently changed pages.
Prioritize these during reflection.

### 3. Stage 1 — discovery from index first
Read `wiki/index.md`.
Using only the index and profile priorities, identify the 3–5 strongest candidates for:
- synthesis
- contradiction notes
- relationship pages
- gap pages
- new comparison or query pages
- promotion of durable knowledge currently stranded in `outputs/`

Prioritize candidates that involve recently changed pages.
Skip candidates that clearly duplicate already-synthesized pages recorded in reflect state.

For each candidate, record:
- `type`
- `hypothesis`
- `pages_to_read`
- `proposed_slug`
- `proposed_title`

If nothing is strong enough, return a short summary and stop without writing low-value pages.

### 4. Audit outputs/ for promotion candidates
If `outputs/` exists, inspect markdown/text artifacts that may contain durable knowledge.

Look for outputs that are:
- grounded in existing wiki pages
- substantial enough to help future queries
- not yet represented canonically in `wiki/`

Classify each reviewed artifact as:
- keep as non-canonical output
- promote into `wiki/`
- stale/redundant output

For promotion candidates, add them to the candidate list with:
- `type: output-promotion`
- source output path
- proposed canonical destination under `wiki/`

### 5. Stage 2 — targeted deep read
For each candidate, read only the pages needed to validate the hypothesis.
Read neighboring pages only when they are directly relevant.
Avoid loading the whole wiki unnecessarily.

For output-promotion candidates, read:
- the output artifact itself
- the most relevant canonical wiki pages
- nearby pages needed to avoid duplication or contradiction

### 6. Evaluate synthesis quality
Before writing anything, classify the evidence:
- strong → create or update a page
- weak → log as found-but-not-written in the report

Rules:
- do not create pages from weak evidence
- prefer updating existing high-value pages over creating too many new ones
- respect profile-specific priorities for what kinds of synthesis matter most
- when promoting from `outputs/`, rewrite into canonical wiki form instead of merely copying the artifact wholesale

### 7. Write or update high-value pages
For strong candidates:
- create or update the appropriate page under `wiki/`
- add backlinks or related links when appropriate
- keep contradiction handling explicit
- follow `wiki/SCHEMA.md` if present

For promoted outputs:
- convert the durable knowledge into the right canonical destination such as `wiki/queries/`, `wiki/comparisons/`, or another schema-approved page type
- do not make future query behavior depend on the output artifact
- optionally note in the report that the output has been superseded by canonical wiki content

### 8. Write a reflection report
Write `outputs/YYYY-MM-DD-lw-reflect-report.md`.
Include:
- pages created or updated
- candidates found but not written
- outputs reviewed for promotion and their classification
- suggested next ingestion or maintenance actions

### 9. Update index, log, and reflect state
- update `wiki/index.md` for any new canonical pages and for the reflection report only if the workspace tracks outputs there
- append a reflection entry to `wiki/log.md`
- update `.llm-wiki/reflect_state.json` with:
  - new `last_reflected_at`
  - cumulative `synthesized_articles`

### 10. Print terminal summary
Return:
- candidates reviewed
- pages created or updated
- weak candidates skipped
- outputs promoted or left non-canonical
- follow-up ingestion or lint suggestions
- reflection report path

## Hard rules
- prefer index-first discovery over brute-force reading
- do not create pages from weak evidence
- prioritize recently changed areas when reflect state supports it
- keep reflection outputs durable and stateful
- use reflection as the normal place to promote durable knowledge from `outputs/` into canonical wiki pages

