Obsidian Skills

repository·main·Indexed 13 days ago

https://github.com/kepano/obsidian-skills

Agent Skills for Obsidian that follow the Agent Skills specification, enabling compatible agents like Claude Code, Codex, and OpenCode to interact with Obsidian vaults. Includes specialized skills for JSON Canvas file manipulation and Defuddle for extracting clean markdown from web pages.

Tokens
15.3K
Snippets
62
Records
72
Agent score
96%

What's inside Obsidian Skills

  1. Create callouts for highlighted information

    main

    Callouts use the > [!type] syntax to create highlighted blocks. You can control whether they are expanded or collapsed by default using a prefix on the type.

    Syntax:

    • > [!type]: Basic callout.
    • > [!type] Custom Title: Callout with a custom title.
    • > [!type]-: Collapsed by default.
    • > [!type]+: Expanded by default.

    Common Types: note, tip, warning, info, example, quote, bug, danger, success, failure, question, abstract, todo.

    > [!note]
    > Basic callout.
    
    > [!warning] Custom Title
    > Callout with a custom title.
    
    > [!faq]- Collapsed by default
    > Foldable callout.
  2. How to work with the Duration type

    main

    Subtracting two dates results in a Duration type, not a number.

    Important: A Duration object does NOT support direct mathematical operations like .round(), .floor(), or .ceil(). To perform these operations, you must first access a numeric field (such as .days or .hours) to convert the duration into a number.

    Duration Fields:

    • duration.days: Total days in duration
    • duration.hours: Total hours in duration
    • duration.minutes: Total minutes in duration
    • duration.seconds: Total seconds in duration
    • duration.milliseconds: Total milliseconds in duration
    # CORRECT: Calculate days between dates
    "(date(due_date) - today()).days"                    # Returns number of days
    "(now() - file.ctime).days"                          # Days since created
    
    # CORRECT: Round the numeric result if needed
    "(date(due_date) - today()).days.round(0)"           # Rounded days
    "(now() - file.ctime).hours.round(0)"                # Rounded hours
    
    # WRONG - will cause error:
    # "((date(due) - today()) / 86400000).round(0)"      # Duration doesn't support division then round
  3. Use wikilinks for internal connections

    main

    Wikilinks allow you to connect notes within an Obsidian vault. Obsidian automatically tracks renames for these links.

    Syntax Patterns:

    • [[Note Name]]: Link to a note.
    • [[Note Name|Display Text]]: Link with custom display text.
    • [[Note Name#Heading]]: Link to a specific heading within a note.
    • [[Note Name#^block-id]]: Link to a specific block.
    • [[#Heading in same note]]: Link to a heading within the current note.

    Defining Block IDs: To link to a specific paragraph, append ^block-id to the end of the paragraph: This paragraph can be linked to. ^my-block-id

    For lists or quotes, place the block ID on a new line immediately following the block:

    > A quote block
    
    ^quote-id
    [[Note Name]]
    [[Note Name|Display Text]]
    [[Note Name#Heading]]
    [[Note Name#^block-id]]
    [[#Heading in same note]]
    
    This paragraph can be linked to. ^my-block-id
    
    > A quote block
    
    ^quote-id
  4. Use YAML frontmatter for Properties

    main

    Properties in Obsidian are defined using YAML frontmatter at the very beginning of a note. This allows you to store structured metadata such as titles, dates, tags, and custom status fields.

    ---
    title: My Note Title
    date: 2024-01-15
    tags:
      - project
      - important
    aliases:
      - My Note
      - Alternative Name
    cssclasses:
      - custom-class
    status: in-progress
    rating: 4.5
    completed: false
    due: 2024-02-01T14:30:00
    ---
  5. Understand the JSON Canvas file structure

    main

    A .canvas file follows the JSON Canvas Spec 1.0 and consists of two top-level arrays: nodes and edges.

    • nodes (optional): An array of node objects representing elements on the canvas.
    • edges (optional): An array of edge objects representing connections between nodes.

    Note that the order of nodes in the array determines their z-index: the first node is at the bottom layer, and the last node is at the top layer.

    {
      "nodes": [],
      "edges": []
    }
  6. Configure view types in Obsidian Bases

    main

    Bases support several view types to visualize your data. Each view is defined in the views array.

    • table: A spreadsheet-like view. Supports groupBy and summaries.
    • cards: A gallery-style view, useful for visual items like books or images.
    • list: A simple vertical list of items.
    • map: A geographic view. Requires latitude/longitude properties and the Maps community plugin.

    View Configuration Options

    • type: The view style (table, cards, list, or map).
    • name: The display name for the view.
    • limit: (Optional) Maximum number of results to show.
    • groupBy: (Optional) Group results by a property with direction (ASC or DESC).
    • filters: (Optional) View-specific filters that override or supplement global filters.
    • order: An array of properties to display in sequence.
    • summaries: (Optional) Map properties to summary formulas (e.g., property_name: Average).
    views:
      - type: table
        name: "My Table"
        order:
          - file.name
          - status
          - due_date
        summaries:
          price: Sum
          count: Average
  7. Write formulas for computed properties

    main

    Formulas are defined in the formulas section and compute values from note properties, file properties, or other formulas. Use the formula. prefix to reference them in properties or views.

    Common Formula Patterns

    • Arithmetic: total: "price * quantity"
    • Conditional: status_icon: 'if(done, "✅", "⏳")'
    • String Formatting: formatted_price: 'if(price, price.toFixed(2) + " dollars")'
    • Date Formatting: created: 'file.ctime.format("YYYY-MM-DD")'
    • Duration Calculation: days_old: '(now() - file.ctime).days'

    Key Functions

    FunctionSignatureDescription
    date()date(string): dateParse string to date (YYYY-MM-DD HH:mm:ss)
    now()now(): dateCurrent date and time
    today()today(): dateCurrent date (time = 00:00:00)
    if()if(condition, trueResult, falseResult?)Conditional
    duration()duration(string): durationParse duration string
    file()file(path): fileGet file object
    link()link(path, display?): LinkCreate a link

    Working with Durations

    Subtracting two dates returns a Duration type. To perform math on a duration, you must access a numeric field (like .days) first. Duration does not support .round(), .floor(), or .ceil() directly.

    Correct: "(date(due_date) - today()).days.round(0)" Incorrect: "((date(due) - today()) / 86400000).round(0)"

    formulas:
      days_until_due: 'if(due, (date(due) - today()).days, "")'
      is_overdue: 'if(due, date(due) < today() && status != "done", false)'
  8. Embed content using wikilinks

    main

    Prefix a wikilink with an exclamation mark (!) to embed the content inline rather than just linking to it.

    Supported Embeds:

    • ![[Note Name]]: Embed the full content of another note.
    • ![[Note Name#Heading]]: Embed a specific section of a note.
    • ![[image.png]]: Embed an image.
    • ![[image.png|300]]: Embed an image with a specific width (e.g., 300px).
    • ![[document.pdf#page=3]]: Embed a specific page of a PDF.
    ![[Note Name]]
    ![[Note Name#Heading]]
    ![[image.png]]
    ![[image.png|300]]
    ![[document.pdf#page=3]]
  9. Use Math (LaTeX) and Diagrams (Mermaid)

    main

    Math (LaTeX)

    Use $ for inline math and $$ for block math.

    Diagrams (Mermaid)

    Use mermaid code blocks to render diagrams. To link Mermaid nodes to Obsidian notes, append class NodeName internal-link; inside the mermaid block.

    Example:

    ```mermaid
    graph TD
        A[Start] --> B{Decision}
        B -->|Yes| C[Do this]
        B -->|No| D[Do that]
        class A internal-link;
    
    ```markdown
    $e^{i\pi} + 1 = 0$
    
    $$\frac{a}{b} = c$$
    
    ```mermaid
    graph TD
        A[Start] --> B{Decision}
        B -->|Yes| C[Do this]
        B -->|No| D[Do that]
  10. Use filters to narrow results in Obsidian Bases

    main

    Filters can be applied globally (to all views in the base) or per-view. They can be a single filter string or a recursive object using and, or, or not keys.

    Filter Operators

    OperatorDescription
    ==equals
    !=not equal
    >greater than
    <less than
    >=greater than or equal
    <=less than or equal
    &&logical and
    ||logical or
    !logical not

    Filter Structure Examples

    # Single filter
    filters: 'status == "done"'
    
    # AND - all conditions must be true
    filters:
      and:
        - 'status == "done"'
        - 'priority > 3'
    
    # OR - any condition can be true
    filters:
      or:
        - 'file.hasTag("book")'
        - 'file.hasTag("article")'
    
    # NOT - exclude matching items
    filters:
      not:
        - 'file.hasTag("archived")'
    
    # Nested filters
    filters:
      or:
        - file.hasTag("tag")
        - and:
            - file.hasTag("book")
            - file.hasLink("Textbook")
        - not:
            - file.hasTag("book")
            - file.inFolder("Required Reading")
    filters:
      or:
        - file.hasTag("tag")
        - and:
            - file.hasTag("book")
            - file.hasLink("Textbook")
        - not:
            - file.hasTag("book")
            - file.inFolder("Required Reading")
  11. Use tags and comments

    main

    Tags

    Tags can be used inline or in frontmatter (tags property).

    • #tag: Standard tag.
    • #nested/tag: Hierarchical/nested tag.

    Note: Tags can contain letters, numbers, underscores, hyphens, and forward slashes, but cannot start with a number.

    Comments

    Comments are invisible in Obsidian's reading view.

    • Inline: %%hidden text%%
    • Block:
      %%
      hidden block
      %%
    #tag
    #nested/tag
    
    This is visible %%but this is hidden%% text.
    
    %%
    This entire block is hidden in reading view.
    %%