Files
llmwiki-cli/docs/phase-4.md
doum1004 6a8b9a5612 Phase 1: Bootstrap + Init + Registry
Implement llmwiki-cli v0.1.0 — a CLI tool for LLM agents to build and
maintain personal knowledge bases via pure filesystem + git operations.

Phase 1 includes:
- wiki init: create wiki with directory structure, SCHEMA.md, git init
- wiki registry: list all registered wikis
- wiki use: switch active wiki
- Global registry at ~/.config/llmwiki/
- Wiki resolution chain (--wiki flag > cwd > walk up > default)
- 23 tests passing
- Published to npm as llmwiki-cli
2026-04-10 01:36:17 -04:00

1.6 KiB

Phase 4: Lint + Links + Status

Status: NOT STARTED

Goal: LLM can check wiki health and navigate the link graph.

Files

File Status Description
src/lib/link-parser.ts Pending extractWikilinks, buildLinkGraph, LinkGraph interface
src/lib/frontmatter.ts Pending parseFrontmatter, hasFrontmatter, addFrontmatter
src/commands/lint.ts Pending wiki lint [--json] — broken links, orphans, missing frontmatter, empty pages, index consistency
src/commands/links.ts Pending wiki links <path> — outbound + inbound links
src/commands/backlinks.ts Pending wiki backlinks <path> — inbound only
src/commands/orphans.ts Pending wiki orphans — pages with no inbound links
src/commands/status.ts Pending wiki status [--json] — page counts, link stats, recent activity, git info
test/lint.test.ts Pending Lint detection tests
test/links.test.ts Pending Wikilink extraction, graph building

Commands to Add

wiki lint [--json]
wiki links <path>
wiki backlinks <path>
wiki orphans
wiki status [--json]

Key Design Decisions

  • Wikilink syntax: [[target]] and [[target|display]]
  • Wikilink resolution: check exact match, then check with directory prefix (entities/, concepts/, etc.)
  • Orphan detection excludes index.md and log.md
  • Lint checks: broken links, orphans, missing frontmatter, empty pages, index consistency
  • status shows: page counts by directory, link stats, recent log entries, git info

Entry Points to Update

  • bin/wiki.ts — register new commands