vibe-action 0.2.2

Command router — execute shell commands and LLM prompts via simple YAML actions.
version: 0.0.1

name: spellcheck
about: Check and fix spelling in text or files
notify: true

# IDE plugin integration: maps argument names to IDE contexts
api:
  # Target for the final result (replace | clipboard | dialog)
  output: replace
  # Source for the {query} tag
  input: query

actions:
  # Read input from query (prioritize file path if valid, otherwise use raw text)
  - tag: tag_content
    run: cmd
    expect: string
    check: .+
    action:
      - when: '{query|file_path|empty:not}'
        then: cat "{query|file_path|load}"
      - when: '{query|empty:not}'
        then: echo "{query}"
      - when: 'true'
        then: echo "ERROR - No input provided"

  # LLM checks if text contains any errors
  - tag: tag_check_errors
    run: small
    expect: string
    action: |
      [Task]
      Analyze the text below for typos, spelling mistakes, and grammar errors.
      If errors exist, reply strictly with "DIRTY". If no errors exist, reply strictly with "CLEAR".

      [Text]
      {tag_content}

  # If errors found, pass text through; otherwise return "No errors found."
  - tag: tag_check_errors_filter
    run: cmd
    expect: string
    action:
      - when: '{tag_check_errors|contains:DIRTY}'
        then: echo "{tag_content}"
      - when: '{tag_check_errors|contains:CLEAR}'
        then: echo "No errors found."

  # LLM fixes all errors while preserving formatting
  - tag: tag_checked
    run: small
    expect: string
    action: |
      [Task]
      Fix all spelling mistakes, typos, and grammar errors in the text below.
      Strict rules: Preserve all code syntax, markdown tags, and formatting exactly as-is.

      [Text]
      {tag_check_errors_filter}

  # Copy result to clipboard and output
  - tag: tag_clipboard
    run: value
    expect: string
    action: '{tag_checked|clipboard}'