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'.
scripts/agent_wiki/coverage.py
View on GitHub"""Coverage and gap reporting for wiki sources.
Identifies which sources from the scan set are covered by topics and which
are gaps. Read-only, no file writes, no LLM, no network.
"""
from __future__ import annotations
from pathlib import Path
from typing import Any
from . import boundary, config, scanner, wiki_index
from .config import nfc as _nfc
def compute_coverage(vault: str | Path, data: dict[str, Any] | None = None) -> dict[str, Any]:
"""Compute coverage and gaps for the vault.
``data`` is a prebuilt ``wiki_index.rebuild`` result; ``None`` rebuilds here.
Returns dict with:
- ok: bool
- covered: int (count of covered sources)
- gaps: list[dict] (uncovered sources, NFC-sorted by path)
- coverage_ratio: float ∈ [0, 1] (1.0 when scan set empty)
"""
boundary.bind(vault)
vault = Path(vault)
# Require initialized wiki
if not config.wiki_root(vault).exists():
raise ValueError("wiki_not_initialized")
# Scan for .md sources
scan_set = set()
for path in scanner.walk_sources(vault):
if path.suffix == ".md":
rel = config.normalize_relpath(path.relative_to(vault).as_posix())
scan_set.add(_nfc(rel))
# Collect covered sources from topics
if data is None:
try:
data, _ = wiki_index.rebuild(vault)
except wiki_index.NormalizedPathCollisionError:
raise ValueError("normalized_path_collision") from None
covered_set = set()
for topic_entry in data.get("topics", {}).values():
for source in topic_entry.get("sources", []):
covered_set.add(_nfc(source))
# Compute gaps (scan - covered)
gaps_set = scan_set - covered_set
# Build gaps list (sorted)
gaps = [{"path": path} for path in sorted(gaps_set)]
# Compute coverage ratio
coverage_ratio = 1.0 if len(scan_set) == 0 else len(covered_set & scan_set) / len(scan_set)
return {
"ok": True,
"covered": len(covered_set & scan_set), # Only count scanned sources
"gaps": gaps,
"coverage_ratio": coverage_ratio,
}
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: 471k | 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 |