Skip to content

richfrem/agent-plugins-skills / plugins/agent-memory/.apm/skills/managing-obsidian-vaults

managing-obsidian-vaults

Verified

Interactive 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.

FileKindSize
SKILL.mdskill md5.9 KB
assets/templates/config.yaml.templateother556 B
assets/templates/raw-sources.json.exampleother862 B
assets/templates/wiki-node.template.mdmarkdown410 B
evals/README.mdmarkdown569 B
evals/evals.jsonconfig23.4 KB
evals/legacy/obsidian-bases-manager/evals.jsonconfig692 B
evals/legacy/obsidian-bases-manager/results.tsvother301 B
evals/legacy/obsidian-canvas-architect/evals.jsonconfig731 B
evals/legacy/obsidian-canvas-architect/results.tsvother301 B
evals/legacy/obsidian-graph-traversal/evals.jsonconfig706 B
evals/legacy/obsidian-graph-traversal/results.tsvother301 B
evals/legacy/obsidian-init/evals.jsonconfig667 B
evals/legacy/obsidian-init/results.tsvother301 B
evals/legacy/obsidian-markdown-mastery/evals.jsonconfig652 B
evals/legacy/obsidian-markdown-mastery/results.tsvother301 B
evals/legacy/obsidian-query-agent/evals.jsonconfig767 B
evals/legacy/obsidian-rlm-distiller/evals.jsonconfig685 B
evals/legacy/obsidian-vault-crud/evals.jsonconfig638 B
evals/legacy/obsidian-vault-crud/results.tsvother301 B
evals/legacy/obsidian-wiki-builder/evals.jsonconfig732 B
evals/legacy/obsidian-wiki-linter/evals.jsonconfig1.5 KB
evals/results.tsvother73 B
evals/task-success.jsonconfig3.5 KB
references/acceptance-criteria.mdmarkdown2.9 KB
references/architecture-background.mdmarkdown2.8 KB
references/dependencies.mdmarkdown1.7 KB
references/interactive-setup.mdmarkdown7.0 KB
references/interactive-stack-setup.mdmarkdown5.6 KB
references/kepano-analysis-summary.mdmarkdown1.7 KB
references/obsidian-bases-manager-acceptance-criteria.mdmarkdown628 B
references/obsidian-bases-manager-fallback-tree.mdmarkdown787 B
references/obsidian-bases-manager.mdmarkdown2.1 KB
references/obsidian-canvas-architect-acceptance-criteria.mdmarkdown645 B
references/obsidian-canvas-architect-fallback-tree.mdmarkdown836 B
references/obsidian-canvas-architect.mdmarkdown1.9 KB
references/obsidian-graph-traversal-acceptance-criteria.mdmarkdown690 B
references/obsidian-graph-traversal-fallback-tree.mdmarkdown877 B
references/obsidian-graph-traversal.mdmarkdown2.2 KB
references/obsidian-init-acceptance-criteria.mdmarkdown650 B
references/obsidian-init-fallback-tree.mdmarkdown1.1 KB
references/obsidian-init.mdmarkdown2.0 KB
references/obsidian-markdown-mastery-acceptance-criteria.mdmarkdown700 B
references/obsidian-markdown-mastery-fallback-tree.mdmarkdown889 B
references/obsidian-markdown-mastery.mdmarkdown2.2 KB
references/obsidian-query-agent.mdmarkdown1.8 KB
references/obsidian-rlm-distiller.mdmarkdown1.8 KB
references/obsidian-vault-crud-acceptance-criteria.mdmarkdown833 B
references/obsidian-vault-crud-fallback-tree.mdmarkdown1.1 KB
references/obsidian-vault-crud.mdmarkdown2.2 KB
references/obsidian-vault-onboarding-guide.mdmarkdown3.7 KB
references/obsidian-wiki-builder.mdmarkdown1.8 KB
references/obsidian-wiki-linter.mdmarkdown1.7 KB
references/resource-index.mdmarkdown4.3 KB
references/safety-learnings.mdmarkdown2.7 KB
references/wiki-builder-guide.mdmarkdown2.7 KB
references/wiki-distillation-guide.mdmarkdown1.7 KB
references/wiki-linting-guide.mdmarkdown2.1 KB
references/wiki-query-guide.mdmarkdown2.1 KB
requirements.inother32 B
requirements.txtmanifest463 B
scripts/audit.pyscript9.0 KB
scripts/bases_ops.pyscript7.8 KB
scripts/canvas_gen.pyscript7.9 KB
scripts/canvas_ops.pyscript11.5 KB
scripts/concept_extractor.pyscript10.2 KB
scripts/constants.pyscript908 B
scripts/distill_wiki.pyscript12.9 KB
scripts/graph_ops.pyscript11.7 KB
scripts/ingest.pyscript8.3 KB
scripts/init_vault.pyscript5.7 KB
scripts/lint_wiki.pyscript9.3 KB
scripts/obsidian-parser/parser.pyscript6.5 KB
scripts/obsidian-parser/tests/test_parser.pyscript4.1 KB
scripts/query_wiki.pyscript21.3 KB
scripts/raw_manifest.pyscript14.3 KB
scripts/vault_ops.pyscript13.4 KB
scripts/wiki_builder.pyscript14.3 KB

scripts/obsidian-parser/parser.py

View on GitHub
"""
parser.py (CLI)
=====================================

Purpose:
    Core parser for Obsidian-flavored Markdown syntax.
    Extracts links, embeds, and facilitates creating callouts.

Layer: Core Operations

Usage Examples:
    python.py analyze --file example.md
    python.py callout --type info --title "Note" --text "Content"

Supported Object Types:
    - .md (Markdown notes with Obsidian syntax)

CLI Arguments:
    Subcommands: analyze, callout. Run with --help for details.

Input Files:
    - .md files.

Output:
    - JSON analysis or formatted callout block.

Key Functions:
    extract_links(): Extracts standard Obsidian links.
    extract_embeds(): Extracts Obsidian transclusions.
    create_callout(): Wraps content in a callout.

Script Dependencies:
    re, argparse, sys, json, typing

Consumed by:
    - obsidian-markdown-mastery skill
"""
import re
import argparse
import sys
import json
from typing import List, Dict, Optional

class ObsidianParser:
    """Core parser for Obsidian-flavored Markdown syntax."""

    @staticmethod
    def extract_links(text: str) -> List[Dict[str, str]]:
        """
        Extracts all standard Obsidian links (wikilinks) from the text.
        This explicitly avoids matching embeds (which start with !).
        """
        results = []
        # Complex regex to capture wikilinks while avoiding transclusions.
        # Logic: look behind for whitespace or beginning of string (or anything NOT a '!').
        # Using a negative lookbehind `(?<!\!)` ensures we don't grab `![[embed]]`.
        pattern = re.compile(r'(?<!\!)\[\[(.*?)\]\]')
        
        for match in pattern.finditer(text):
            inner_content = match.group(1)
            
            target = inner_content
            alias = None
            heading = None
            block = None
            
            # 1. Split Alias (if present)
            if '|' in inner_content:
                parts = inner_content.split('|', 1)
                target = parts[0]
                alias = parts[1]
                
            # 2. Split Heading or Block (if present)
            if '#' in target:
                parts = target.split('#', 1)
                target = parts[0]
                anchor = parts[1]
                
                if anchor.startswith('^'):
                    block = anchor[1:]
                else:
                    heading = anchor
                    
            results.append({
                'type': 'wikilink',
                'target': target.strip() if target else "",
                'heading': heading.strip() if heading else None,
                'block': block.strip() if block else None,
                'alias': alias.strip() if alias else None
            })
            
        return results

    @staticmethod
    def extract_embeds(text: str) -> List[Dict[str, str]]:
        """
        Extracts Obsidian transclusions/embeds (![[Note Name]]).
        """
        results = []
        pattern = re.compile(r'!\[\[(.*?)\]\]')
        
        for match in pattern.finditer(text):
            inner_content = match.group(1)
            
            target = inner_content
            heading = None
            block = None
            
            # Embeds don't technically support aliases in standard markdown rendering,
            # but sometimes people use them for image dimensions (e.g., ![[image.png|100]])
            if '|' in inner_content:
                target = inner_content.split('|', 1)[0]
                
            if '#' in target:
                parts = target.split('#', 1)
                target = parts[0]
                anchor = parts[1]
                
                if anchor.startswith('^'):
                    block = anchor[1:]
                else:
                    heading = anchor
                    
            results.append({
                'type': 'embed',
                'target': target.strip() if target else "",
                'heading': heading.strip() if heading else None,
                'block': block.strip() if block else None
            })
            
        return results

    @staticmethod
    def create_callout(callout_type: str, title: str, content: str) -> str:
        """
        Wraps content in an Obsidian-flavored callout.
        """
        valid_types = ['info', 'warning', 'error', 'success', 'note', 'tip', 'important']
        callout_type = callout_type.lower()
        if callout_type not in valid_types:
            callout_type = 'note'
            
        lines = content.strip().split('\n')
        callout_lines = [f"> [!{callout_type}] {title}"]
        for line in lines:
            callout_lines.append(f"> {line}")
            
        return '\n'.join(callout_lines) + '\n'

def main() -> None:
    """Parse CLI arguments and execute analyze or callout subcommand."""
    parser = argparse.ArgumentParser(description="Obsidian Markdown Parser")
    subparsers = parser.add_subparsers(dest='command', help='Commands')

    # Analyze command
    analyze_parser = subparsers.add_parser('analyze', help='Analyze a markdown file for Obsidian syntax')
    analyze_parser.add_argument('--file', required=True, help='Path to markdown file')

    # Callout command
    callout_parser = subparsers.add_parser('callout', help='Generate an Obsidian callout')
    callout_parser.add_argument('--type', required=True, help='Callout type (info, warning, etc.)')
    callout_parser.add_argument('--title', required=True, help='Callout title')
    callout_parser.add_argument('--text', required=True, help='Callout content text')

    args = parser.parse_args()

    if args.command == 'analyze':
        try:
            with open(args.file, 'r', encoding='utf-8') as f:
                content = f.read()
            
            links = ObsidianParser.extract_links(content)
            embeds = ObsidianParser.extract_embeds(content)
            
            result = {
                'file': args.file,
                'wikilinks': links,
                'embeds': embeds,
                'metrics': {
                    'total_links': len(links),
                    'total_embeds': len(embeds)
                }
            }
            print(json.dumps(result, indent=2))
        except FileNotFoundError:
            print(json.dumps({"error": f"File not found: {args.file}"}))
            sys.exit(1)
            
    elif args.command == 'callout':
        # Handle literal \n if passed from CLI
        text = args.text.replace('\\n', '\n')
        print(ObsidianParser.create_callout(args.type, args.title, text))

if __name__ == '__main__':
    main()
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall