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/frontmatter.py
View on GitHub"""YAML frontmatter parsing and serialization."""
from __future__ import annotations
from pathlib import Path
from typing import Any
try:
import yaml
except ImportError as exc: # pragma: no cover
raise RuntimeError("PyYAML is required: pip install PyYAML") from exc
class FrontmatterError(ValueError):
pass
def parse_file(path: Path) -> tuple[dict[str, Any], str] | None:
"""``parse`` a note on disk; ``None`` when unreadable or malformed."""
try:
return parse(path.read_text(encoding="utf-8-sig"))
except (UnicodeDecodeError, OSError, FrontmatterError):
return None
def parse(text: str) -> tuple[dict[str, Any], str]:
bom = "" if text.startswith("") else ""
source = text[1:] if bom else text
lines = source.splitlines(keepends=True)
if not lines or lines[0].strip() != "---":
return {}, text
end = None
for index, line in enumerate(lines[1:], 1):
if line.strip() == "---":
end = index
break
if end is None:
return {}, text
raw_meta = "".join(lines[1:end])
body = "".join(lines[end + 1 :])
if body.startswith("\r\n"):
body = body[2:]
elif body.startswith("\n"):
body = body[1:]
try:
meta = yaml.safe_load(raw_meta) or {}
except yaml.YAMLError as exc:
raise FrontmatterError(str(exc)) from exc
if not isinstance(meta, dict):
raise FrontmatterError("frontmatter must be a mapping")
return meta, body
def dump(meta: dict[str, Any], body: str) -> str:
yaml_text = yaml.safe_dump(meta, allow_unicode=True, sort_keys=False).strip()
return f"---\n{yaml_text}\n---\n\n{body}"
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 |