Make Claude Code the primary interface — no API key needed

Add .claude/commands/ slash commands (/wiki-ingest, /wiki-query,
/wiki-lint, /wiki-graph) so the wiki works directly inside Claude Code
without any Python or API key. CLAUDE.md updated to lead with Claude
Code usage. Python tools remain as optional standalone scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Anil Matcha
2026-04-07 07:07:23 +05:30
parent d12089aaaf
commit 116ccc4d3c
6 changed files with 182 additions and 72 deletions

View File

@@ -0,0 +1,18 @@
Build the LLM Wiki knowledge graph.
Usage: /wiki-graph
First try running: python tools/build_graph.py --open
If that fails (missing dependencies), build the graph manually:
1. Use Grep to find all [[wikilinks]] across every file in wiki/
2. Build a nodes list: one node per wiki page, with id=relative-path, label=title, type from frontmatter
3. Build an edges list: one edge per [[wikilink]], tagged EXTRACTED
4. Infer additional implicit relationships between pages not captured by wikilinks — tag these INFERRED with a confidence score (0.01.0); tag low-confidence ones AMBIGUOUS
5. Write graph/graph.json with {nodes, edges, built: today}
6. Write graph/graph.html as a self-contained vis.js page (nodes colored by type, edges colored by type, interactive, searchable)
After building, summarize: node count, edge count, breakdown by type, and the most connected nodes (hubs).
Append to wiki/log.md: ## [today's date] graph | Knowledge graph rebuilt

View File

@@ -0,0 +1,18 @@
Ingest a source document into the LLM Wiki.
Usage: /wiki-ingest $ARGUMENTS
$ARGUMENTS should be the path to a file in raw/, e.g. `raw/articles/my-article.md`
Follow the Ingest Workflow defined in CLAUDE.md exactly:
1. Read the source file at the given path
2. Read wiki/index.md and wiki/overview.md for current context
3. Write wiki/sources/<slug>.md (source page format per CLAUDE.md)
4. Update wiki/index.md — add the new entry under Sources
5. Update wiki/overview.md — revise synthesis if warranted
6. Create/update entity pages (wiki/entities/) for key people, companies, projects
7. Create/update concept pages (wiki/concepts/) for key ideas and frameworks
8. Flag any contradictions with existing wiki content
9. Append to wiki/log.md: ## [today's date] ingest | <Title>
After completing all writes, summarize: what was added, which pages were created or updated, and any contradictions found.

View File

@@ -0,0 +1,19 @@
Health-check the LLM Wiki for issues.
Usage: /wiki-lint
Follow the Lint Workflow defined in CLAUDE.md:
Structural checks (use Grep and Glob tools):
1. Orphan pages — wiki pages with no inbound [[wikilinks]] from other pages
2. Broken links — [[WikiLinks]] pointing to pages that don't exist
3. Missing entity pages — names referenced in 3+ pages but lacking their own page
Semantic checks (read and reason over page content):
4. Contradictions — claims that conflict between pages
5. Stale summaries — pages not updated after newer sources changed the picture
6. Data gaps — important questions the wiki can't answer; suggest specific sources to find
Output a structured markdown lint report. At the end, ask if the user wants it saved to wiki/lint-report.md.
Append to wiki/log.md: ## [today's date] lint | Wiki health check

View File

@@ -0,0 +1,14 @@
Query the LLM Wiki and synthesize an answer.
Usage: /wiki-query $ARGUMENTS
$ARGUMENTS is the question to answer, e.g. `What are the main themes across all sources?`
Follow the Query Workflow defined in CLAUDE.md:
1. Read wiki/index.md to identify the most relevant pages
2. Read those pages (up to ~10 most relevant)
3. Synthesize a thorough markdown answer with [[PageName]] wikilink citations
4. Include a ## Sources section at the end listing pages you drew from
5. Ask the user if they want the answer saved as wiki/syntheses/<slug>.md
If the wiki is empty, say so and suggest running /wiki-ingest first.