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_plugins.py
View on GitHubimport json
from pathlib import Path
from agent_wiki import plugins
def _obsidian(tmp_path: Path, community=None, dv_data=None) -> Path:
cfg = tmp_path / ".obsidian"
cfg.mkdir()
if community is not None:
(cfg / "community-plugins.json").write_text(json.dumps(community), encoding="utf-8")
if dv_data is not None:
dv = cfg / "plugins" / "dataview"
dv.mkdir(parents=True)
(dv / "data.json").write_text(json.dumps(dv_data), encoding="utf-8")
return cfg
# --- config dir discovery (walk up) ----------------------------------------
def test_config_dir_found_at_vault(tmp_path):
cfg = _obsidian(tmp_path)
assert plugins.obsidian_config_dir(tmp_path) == cfg
def test_config_dir_found_above_vault(tmp_path):
cfg = _obsidian(tmp_path)
nested = tmp_path / "记录" / "wiki"
nested.mkdir(parents=True)
assert plugins.obsidian_config_dir(nested) == cfg
def test_config_dir_none_when_absent(tmp_path):
assert plugins.obsidian_config_dir(tmp_path) is None
# --- dataview installed -----------------------------------------------------
def test_dataview_installed_true(tmp_path):
_obsidian(tmp_path, community=["dataview", "obsidian-banners"])
assert plugins.dataview_installed(tmp_path) is True
def test_dataview_installed_false_when_absent_from_list(tmp_path):
_obsidian(tmp_path, community=["obsidian-banners"])
assert plugins.dataview_installed(tmp_path) is False
def test_dataview_installed_false_when_no_obsidian(tmp_path):
assert plugins.dataview_installed(tmp_path) is False
def test_dataview_installed_false_on_bad_json(tmp_path):
cfg = _obsidian(tmp_path)
(cfg / "community-plugins.json").write_text("{not json", encoding="utf-8")
assert plugins.dataview_installed(tmp_path) is False
# --- dataviewjs enabled -----------------------------------------------------
def test_dataviewjs_enabled_true(tmp_path):
_obsidian(tmp_path, dv_data={"enableDataviewJs": True})
assert plugins.dataviewjs_enabled(tmp_path) is True
def test_dataviewjs_enabled_false_when_flag_off(tmp_path):
_obsidian(tmp_path, dv_data={"enableDataviewJs": False})
assert plugins.dataviewjs_enabled(tmp_path) is False
def test_dataviewjs_enabled_false_when_missing(tmp_path):
_obsidian(tmp_path)
assert plugins.dataviewjs_enabled(tmp_path) is False
# --- combined gate ----------------------------------------------------------
def test_cards_available_requires_both(tmp_path):
_obsidian(tmp_path, community=["dataview"], dv_data={"enableDataviewJs": True})
assert plugins.cards_available(tmp_path) is True
def test_cards_available_false_without_js(tmp_path):
_obsidian(tmp_path, community=["dataview"], dv_data={"enableDataviewJs": False})
assert plugins.cards_available(tmp_path) is False
def test_cards_available_false_without_install(tmp_path):
_obsidian(tmp_path, community=[], dv_data={"enableDataviewJs": True})
assert plugins.cards_available(tmp_path) is False
def test_cards_available_false_without_obsidian(tmp_path):
assert plugins.cards_available(tmp_path) is False
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 |