$npx -y skills add Dianel555/DSkills --skill agent-wikiIncremental LLM-friendly wiki generator for Obsidian note vaults. Use when: (1) Building wiki from notes, (2) Ingesting notes to wiki, (3) Obsidian LLM wiki, (4) Incremental knowledge base management. Triggers: 'build wiki from notes', 'ingest notes to wiki', 'Obsidian LLM wiki',
| 1 | # agent-wiki |
| 2 | |
| 3 | 增量式 Obsidian 笔记仓库 Wiki 生成器,为 LLM 优化的知识库管理工具。 |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | ```bash |
| 8 | pip install PyYAML |
| 9 | ``` |
| 10 | |
| 11 | ## References (load on demand) |
| 12 | |
| 13 | Detailed specs live under `references/` in this skill directory — read them only when the task needs them: |
| 14 | |
| 15 | | File | Read when | |
| 16 | |------|-----------| |
| 17 | | `references/topic-authoring.md` | Authoring/enriching topic pages (type taxonomy, per-type section templates, conflict convention, quality metric detail) | |
| 18 | | `references/homepage.md` | Working on `wiki/index.md` (layout templates, managed cards, REST write-through, optional CSS) | |
| 19 | | `references/site-export.md` | Running/debugging `gen-site` (design system, page anatomy, determinism guarantees) | |
| 20 | | `references/index-schema.md` | Consuming/producing index or frontmatter fields (full `.wiki-index.json` schema, Bases views, capture contract) | |
| 21 | |
| 22 | ## Execution |
| 23 | |
| 24 | The skill provides a Python CLI with the following subcommands: |
| 25 | |
| 26 | ```bash |
| 27 | # Initialize wiki structure |
| 28 | python scripts/agent_wiki_cli.py init --vault /path/to/vault |
| 29 | |
| 30 | # Scan for changed sources |
| 31 | python scripts/agent_wiki_cli.py scan --vault /path/to/vault |
| 32 | |
| 33 | # Plan a batched ingest: split pending sources into rounds (default 20/round) |
| 34 | python scripts/agent_wiki_cli.py plan --batch-size 20 --vault /path/to/vault |
| 35 | |
| 36 | # Mark a round complete (verifies every doc in the batch was cache-put) |
| 37 | python scripts/agent_wiki_cli.py batch-done --batch 1 --vault /path/to/vault |
| 38 | |
| 39 | # Get cache entry for a source |
| 40 | python scripts/agent_wiki_cli.py cache-get <relative-path> --vault /path/to/vault |
| 41 | |
| 42 | # Record ingest result |
| 43 | python scripts/agent_wiki_cli.py cache-put <relative-path> --topics topic1.md,topic2.md --vault /path/to/vault |
| 44 | |
| 45 | # Clean up deleted sources |
| 46 | python scripts/agent_wiki_cli.py cleanup --vault /path/to/vault |
| 47 | |
| 48 | # Get wiki health status |
| 49 | python scripts/agent_wiki_cli.py status --vault /path/to/vault |
| 50 | |
| 51 | # Rebuild the retrieval index (wiki/.wiki-index.json) without writing .base files |
| 52 | python scripts/agent_wiki_cli.py index --vault /path/to/vault |
| 53 | |
| 54 | # Backfill source_type frontmatter to match each topic's sources[] file formats |
| 55 | python scripts/agent_wiki_cli.py normalize-source-type --vault /path/to/vault |
| 56 | |
| 57 | # Generate Obsidian Bases (.base) views: wiki/index.base + <name>.base master table |
| 58 | python scripts/agent_wiki_cli.py gen-base --name sources --vault /path/to/vault |
| 59 | |
| 60 | # Register an Agent-authored research report (wiki/queries/<name>.md) and tag kind: query |
| 61 | python scripts/agent_wiki_cli.py save-report <name> --vault /path/to/vault |
| 62 | |
| 63 | # Generate per-topic JSON Canvas knowledge graphs under wiki/graphs/ (one topic or all) |
| 64 | python scripts/agent_wiki_cli.py gen-canvas --topic <name> --vault /path/to/vault |
| 65 | python scripts/agent_wiki_cli.py gen-canvas --all --vault /path/to/vault |
| 66 | |
| 67 | # Build/refresh the wiki/index.md skeleton + its managed "工作区" card block |
| 68 | python scripts/agent_wiki_cli.py gen-home --vault /path/to/vault |
| 69 | |
| 70 | # Extract raw 作者 rows from each topic's source notes (read-only) |
| 71 | python scripts/agent_wiki_cli.py extract-authors --vault /path/to/vault |
| 72 | |
| 73 | # Deduplicated first-author list per topic, for frontmatter backfill (read-only) |
| 74 | python scripts/agent_wiki_cli.py aggregate-authors --vault /path/to/vault |
| 75 | |
| 76 | # Compute quality tier distribution and per-topic metrics (read-only) |
| 77 | python scripts/agent_wiki_cli.py quality --vault /path/to/vault |
| 78 | |
| 79 | # Identify covered sources vs gaps (read-only) |
| 80 | python scripts/agent_wiki_cli.py coverage --vault /path/to/vault |
| 81 | |
| 82 | # Get maintenance worklists: wanted (broken links) and stale topics (read-only) |
| 83 | python scripts/agent_wiki_cli.py worklist --vault /path/to/vault |
| 84 | |
| 85 | # Generate static HTML site (optional, requires markdown package) |
| 86 | python scripts/agent_wiki_cli.py gen-site --vault /path/to/vault |
| 87 | ``` |
| 88 | |
| 89 | **Vault Path Resolution**: Use `--vault PATH` or set environment variable `AGENT_WIKI_VAULT`. |
| 90 | |
| 91 | ## CLI Command Matrix |
| 92 | |
| 93 | | Command | Purpose | Input | Output (JSON) | |
| 94 | |---------|---------|-------|---------------| |
| 95 | | `init` | Create wiki structure | vault path | `{"status": "ok"\|"already_initialized", "created": [...]}` | |
| 96 | | `scan` | Classify sources as new/modified/deleted | vault path | `{"version": 1, "vault": "...", "stats": {...}, "new": [...], "modified": [...], "deleted": [...]}` | |
| 97 | | `plan` | Split pending sources (new+modified) into batches; write task report to `wiki/_archived/ingest-tasks.md` | vault path, `--batch-size` (default 20) | `{"ok": true, "total": N, "batch_size": N, "report": "...", "batches": [{"id": 1, "status": "pending", "count": N, "items": [...]}]}` | |
| 98 | | `batch-done` | Mark a round complete after verifying every doc in it was `cache-put` | vault path, `--batch` | `{"ok": true, "batch": N, "remaining": [...], "complete": bool}` |