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_status_worklist.py
View on GitHub"""Tests for status command worklist metrics."""
import json
from pathlib import Path
from agent_wiki import config, frontmatter, wiki_index
def _topic(vault: Path, name: str, meta: dict, body: str = "x") -> Path:
"""Create a topic with frontmatter and body."""
topics = config.topics_dir(vault)
topics.mkdir(parents=True, exist_ok=True)
path = topics / name
path.write_text(frontmatter.dump(meta, body), encoding="utf-8")
return path
def _init(vault: Path) -> None:
"""Initialize wiki structure."""
config.topics_dir(vault).mkdir(parents=True, exist_ok=True)
def test_status_includes_wanted_count(tmp_path, capsys):
"""status includes wanted_count metric."""
_init(tmp_path)
# Create topic with broken link
_topic(tmp_path, "A.md", {"title": "A"}, "Links [[Missing1]] and [[Missing2]].")
# Save index
data, _ = wiki_index.rebuild(tmp_path)
wiki_index.save_index(tmp_path, data)
import agent_wiki_cli
agent_wiki_cli.main(["status", "--vault", str(tmp_path)])
captured = capsys.readouterr()
result = json.loads(captured.out)
assert "wanted_count" in result
assert result["wanted_count"] == 2 # Missing1 and Missing2
def test_status_includes_stale_count(tmp_path, capsys):
"""status includes stale_count metric."""
_init(tmp_path)
# Create stub and basic topics (low tier)
_topic(tmp_path, "stub.md", {"title": "Stub"}, "Short.")
_topic(tmp_path, "basic.md", {"title": "Basic"}, "## Section\n\nSome content.")
# Save index
data, _ = wiki_index.rebuild(tmp_path)
wiki_index.save_index(tmp_path, data)
import agent_wiki_cli
agent_wiki_cli.main(["status", "--vault", str(tmp_path)])
captured = capsys.readouterr()
result = json.loads(captured.out)
assert "stale_count" in result
assert result["stale_count"] == 2 # stub and basic
def test_status_worklist_counts_are_non_negative(tmp_path, capsys):
"""status worklist counts are always >= 0."""
_init(tmp_path)
# Empty vault
data, _ = wiki_index.rebuild(tmp_path)
wiki_index.save_index(tmp_path, data)
import agent_wiki_cli
agent_wiki_cli.main(["status", "--vault", str(tmp_path)])
captured = capsys.readouterr()
result = json.loads(captured.out)
assert result["wanted_count"] >= 0
assert result["stale_count"] >= 0
def test_status_worklist_metrics_graceful_on_error(tmp_path, capsys):
"""status worklist metrics gracefully fallback to 0 on errors."""
_init(tmp_path)
# Create topic but don't save index (will trigger some internal errors)
_topic(tmp_path, "topic.md", {"title": "Topic"}, "Content.")
import agent_wiki_cli
agent_wiki_cli.main(["status", "--vault", str(tmp_path)])
captured = capsys.readouterr()
result = json.loads(captured.out)
# Should have graceful fallback
assert "wanted_count" in result
assert "stale_count" in result
assert isinstance(result["wanted_count"], int)
assert isinstance(result["stale_count"], int)
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 |