richfrem/agent-plugins-skills / plugins/agent-memory/.apm/skills/managing-obsidian-vaults
managing-obsidian-vaults
VerifiedInteractive vault, wiki and Super-RAG setup in the main conversation. Use for "set up my wiki", "initialize the full knowledge stack" or combined RLM/vector/wiki setup. Manage Obsidian vaults and LLM wikis: initialize vaults, author Markdown and wikilinks, safely edit notes and Bases, create Canvas diagrams, traverse graphs, build concept wikis, distill summary/bullets/deep layers, query and lint knowledge.
scripts/obsidian-parser/tests/test_parser.py
View on GitHub"""
test_parser.py (Tests)
=====================================
Purpose:
Unit tests for ObsidianParser extracting links, embeds, and callout generation.
Layer: Tests
Usage Examples:
python -m unittest plugins/obsidian-integration/scripts/obsidian-parser/tests/test_parser.py
Supported Object Types:
- None
CLI Arguments:
Standard unittest arguments.
Input Files:
- None
Output:
- Test results.
Key Functions:
test_standard_wikilink(): Test standard wikilink extraction.
test_link_with_heading(): Test link with heading.
test_link_with_block(): Test link with block.
test_aliased_link(): Test aliased link.
test_embed_transclusion(): Test embed transclusion.
test_callout_generation(): Test callout generation.
Script Dependencies:
unittest, sys, os, parser
Consumed by:
- None
"""
import unittest
import sys
import os
# Add the parent directory to sys.path so we can import parser.py
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from parser import ObsidianParser
class TestObsidianParser(unittest.TestCase):
def test_standard_wikilink(self) -> None:
"""A plain [[Link]] extracts with no heading, block, or alias."""
text = "Here is a [[Standard Link]] to a note."
links = ObsidianParser.extract_links(text)
self.assertEqual(len(links), 1)
self.assertEqual(links[0]['target'], "Standard Link")
self.assertIsNone(links[0]['heading'])
self.assertIsNone(links[0]['block'])
self.assertIsNone(links[0]['alias'])
def test_link_with_heading(self) -> None:
"""A [[Note#Heading]] link extracts target and heading with no block."""
text = "Check this [[Note#My Heading]] for details."
links = ObsidianParser.extract_links(text)
self.assertEqual(len(links), 1)
self.assertEqual(links[0]['target'], "Note")
self.assertEqual(links[0]['heading'], "My Heading")
self.assertIsNone(links[0]['block'])
def test_link_with_block(self) -> None:
"""A [[Note#^block-id]] link extracts target and block with no heading."""
text = "This is a block transclusion [[Note#^block-123]] reference."
links = ObsidianParser.extract_links(text)
self.assertEqual(len(links), 1)
self.assertEqual(links[0]['target'], "Note")
self.assertEqual(links[0]['block'], "block-123")
self.assertIsNone(links[0]['heading'])
def test_aliased_link(self) -> None:
"""A [[Note|Alias]] link extracts both the target and the alias text."""
text = "Read the [[Note Name|Display Text]] here."
links = ObsidianParser.extract_links(text)
self.assertEqual(len(links), 1)
self.assertEqual(links[0]['target'], "Note Name")
self.assertEqual(links[0]['alias'], "Display Text")
def test_embed_transclusion(self) -> None:
"""An embed ![[image.png]] is picked up by extract_embeds, not extract_links."""
# Embeds should NOT be matched by extract_links, but should be by extract_embeds
text = "Here is an image: ![[image.png]] and a normal [[Link]]."
links = ObsidianParser.extract_links(text)
embeds = ObsidianParser.extract_embeds(text)
self.assertEqual(len(links), 1)
self.assertEqual(links[0]['target'], "Link")
self.assertEqual(len(embeds), 1)
self.assertEqual(embeds[0]['target'], "image.png")
def test_callout_generation(self) -> None:
"""create_callout formats a valid callout type with title and multi-line body."""
result = ObsidianParser.create_callout('warning', 'Important Note', 'This is a warning.\nPlease read.')
expected = "> [!warning] Important Note\n> This is a warning.\n> Please read.\n"
self.assertEqual(result, expected)
def test_invalid_callout_type_fallback(self) -> None:
"""An unrecognized callout type falls back to 'note'."""
result = ObsidianParser.create_callout('invalid_type', 'Title', 'Content')
# Should fallback to a standard 'note'
self.assertTrue(result.startswith("> [!note] Title"))
if __name__ == '__main__':
unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |