Dianel555/DSkills / skills/agent-wiki
agent-wiki
UnverifiedIncremental 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', 'incremental knowledge base'.
tests/test_immutability_capture.py
View on GitHubimport hashlib
import subprocess
import sys
from pathlib import Path
from agent_wiki import config, frontmatter
ROOT = Path(__file__).resolve().parents[1]
CLI = ROOT / "scripts" / "agent_wiki_cli.py"
def run_cli(*args):
return subprocess.run([sys.executable, str(CLI), *args], text=True, encoding="utf-8", capture_output=True)
def _fingerprint(path: Path) -> tuple[bytes, int]:
return hashlib.sha256(path.read_bytes()).digest(), path.stat().st_mtime_ns
def test_capture_canvas_home_status_never_touch_sources(tmp_path):
run_cli("init", "--vault", str(tmp_path))
# source notes (root + nested) and an attachment, all outside wiki/
root_note = tmp_path / "root.md"
root_note.write_text("# Root\n[[N]] ![[img.png]]\n", encoding="utf-8")
nested = tmp_path / "笔记" / "deep.md"
nested.parent.mkdir(parents=True)
nested.write_text("# Deep\n", encoding="utf-8")
attachment = tmp_path / "attachments" / "img.png"
attachment.parent.mkdir(parents=True)
attachment.write_bytes(b"\x89PNG\r\n\x1a\n binary")
# wiki artifacts referencing those sources
(config.topics_dir(tmp_path) / "T.md").write_text(
frontmatter.dump({"title": "T", "sources": ["root.md", "笔记/deep.md"]}, "见 [[N]]\n"), encoding="utf-8")
(config.topics_dir(tmp_path) / "N.md").write_text(
frontmatter.dump({"title": "N", "sources": []}, "b"), encoding="utf-8")
(config.queries_dir(tmp_path) / "q.md").write_text(
frontmatter.dump({"title": "q", "sources": []}, "b"), encoding="utf-8")
guarded = {p: _fingerprint(p) for p in (root_note, nested, attachment)}
commands = [
("save-report", "q"),
("save-report", "../root"), # traversal escape attempt -> sanitized, capture_not_found
("gen-canvas", "--topic", "T"),
("gen-canvas", "--all"),
("gen-home",),
("gen-home", "--cards", "on"),
("gen-home", "--cards", "off"),
("status",),
]
for cmd in commands:
run_cli(*cmd, "--vault", str(tmp_path))
for path, original in guarded.items():
assert _fingerprint(path) == original, f"{path} changed after {cmd[0]}"
# traversal never created/overwrote a sources/queries page outside its dir
assert not (config.queries_dir(tmp_path) / "root.md").exists()
assert root_note.read_text(encoding="utf-8") == "# Root\n[[N]] ![[img.png]]\n"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |