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_cleanup_init_strict.py
View on GitHubimport json
import subprocess
import sys
from pathlib import Path
import pytest
from agent_wiki import cache, commands, 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 test_cleanup_preserves_utf8_bom_when_rewriting_topic(tmp_path):
(tmp_path / "wiki" / "topics").mkdir(parents=True)
topic = tmp_path / "wiki" / "topics" / "T.md"
body = frontmatter.dump({"sources": ["a.md", "b.md"]}, "# Body\n")
topic.write_text("" + body, encoding="utf-8")
data = cache.empty_schema()
cache.upsert(data, "a.md", "old", 1000000000000000000, 1, ["T.md"])
cache.save(tmp_path, data)
result = run_cli("cleanup", "--vault", str(tmp_path))
assert result.returncode == 0, result.stderr
assert topic.read_text(encoding="utf-8").startswith("---")
def test_cleanup_reports_stable_frontmatter_parse_error_and_keeps_cache(tmp_path):
(tmp_path / "wiki" / "topics").mkdir(parents=True)
topic = tmp_path / "wiki" / "topics" / "Bad.md"
topic.write_text("---\nsources: [\n---\nbody", encoding="utf-8")
data = cache.empty_schema()
cache.upsert(data, "missing.md", "old", 1000000000000000000, 1, ["Bad.md"])
cache.save(tmp_path, data)
result = run_cli("cleanup", "--vault", str(tmp_path))
payload = json.loads(result.stdout)
assert payload["removed"] == 0
assert payload["errors"] == [{"path": "Bad.md", "error": "frontmatter_parse_failed"}]
assert "missing.md" in cache.load(tmp_path)["sources"]
def test_init_fails_before_partial_state_when_preflight_rejects(tmp_path, monkeypatch, capsys):
class Args:
vault = str(tmp_path)
monkeypatch.setattr(commands, "_ensure_wiki_writable", lambda vault: commands.fail({"error": "wiki_not_writable"}, 1))
with pytest.raises(SystemExit):
commands.cmd_init(Args())
assert json.loads(capsys.readouterr().err) == {"error": "wiki_not_writable"}
assert not (tmp_path / "wiki").exists()
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 |