vibe-action 0.2.2

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

name: faq
about: Ask a question about Vibe Action — YAML structure, fields, modifiers, or usage
clipboard: false
notify: false

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

actions:
  - tag: tag_faq
    run: small
    expect: string
    action: |
      [Data]
      Vibe Action — command router for shell and LLM tasks via YAML pipelines.
      Each action is a YAML manifest loaded recursively from configuration directories to build CLI subcommands.

      Built-in Action Ecosystem (Available CLI Subcommands):
        comment         - Replace TODO with a meaningful comment
        commit          - AI-generated commit message
        describe        - Describe screenshot for text-only LLM understanding
        explain         - Explain what the selected code does in simple terms
        extract         - Extract structured data or matching lines from text and logs
        faq             - Ask a question about Vibe Action — YAML structure, fields, modifiers, or usage
        fetch           - Fetch a web page or PDF and describe its content
        find            - Semantic file finder — finds files by meaning, not just name
        mock            - Generate realistic mock data arrays (JSON, YAML, CSV) for testing
        naming          - Generate code naming suggestions based on a description
        regex           - Generate a regular expression pattern based on your description
        review          - Critically analyze code for bugs and flaws using a powerful model
        scan            - Scan project codebase and export as structured JSON
        spellcheck      - Check and fix spelling in text or files
        synonyms        - Find programming/technical synonyms for a word
        sysinfo         - Generate a human-readable system report
        tone            - Transform rude or aggressive text into a professional tone
        translate-deep  - Deep two-stage translation using local drafting and cloud polishing
        translate-large - One step translation using large model
        translate-small - Translate text or files to another language
        whois           - Identify a person from a screenshot

      Unified Input Tag ({{query}}):
        The {{query}} tag is the unified entry point for data in any pipeline.
        In CLI, it reads from a positional argument or falls back to the system clipboard.
        In IDE, the plugin provides the context based on the `api.input` configuration.

        Available query types (used as {{query|type}}):
          {{query}} or {{query|raw}}  - Raw text input (default behavior)
          {{query|file_path}}       - Validated local file path
          {{query|project_path}}    - Project root path (searches for .git or markers upwards)
          {{query|line}}            - First line of the input text
          {{query|prompt}}          - Interactive prompt (terminal input in CLI, dialog in IDE)
          {{query|image}}           - Image as base64 PNG (from clipboard or file path)

      IDE Plugin Integration (api block):
        Defines how IDE plugins interact with the action.
        - output: Target for the final result (replace | clipboard | dialog)
        - input: Source to fill the {{query}} tag (e.g., query, query|file_path, query|prompt)
        Example:
          api:
            output: replace
            input: query

      System Commands:
        clean          - Remove all cache
        status         - Show system status
        bench          - Run benchmarks
        stop           - Stop all running processes

      Built-in System Context Tags (Runtime Environment Variables):
        {{system_arch}}            - CPU architecture (e.g., aarch64, x86_64)
        {{system_date}}            - Current local system date formatted as ISO 8601 (YYYY-MM-DD)
        {{system_dir_download}}    - Absolute path to the user's downloads directory
        {{system_dir_home}}        - Absolute path to the user's home directory
        {{system_dir_pwd}}         - Current working directory absolute path
        {{system_dir_temp}}        - Absolute path to the operating system temporary directory
        {{system_hostname}}        - Machine hostname
        {{system_language}}        - System language from LANG env (e.g., en, ru, zh)
        {{system_os}}              - Active operating system string name (e.g., macos, linux)
        {{system_pid}}             - Current execution process ID identifier number
        {{system_shell}}           - Current shell (e.g., zsh, bash, fish)
        {{system_time}}            - Current local system time formatted as HH:MM:SS
        {{system_user}}            - Current operating system user name

      Top-Level Manifest Fields:
        name      - Action name (CLI subcommand name, required)
        about     - Short description for CLI help text layout (required)
        check     - Optional global regex validation pattern for the final flow output
        clipboard - Copy final pipeline string result to system clipboard (default: false)
        notify    - Show desktop system notification on flow completion (default: false)
        args      - Collection defining CLI arguments schema (optional)
        actions   - Pipeline steps where execution order is resolved automatically by tag dependencies

      Args Definition Schema Sub-fields:
        name    - Argument flag name (used as --name and referenced via {{name}} tag)
        short   - Short flag alias single character, e.g. -p (optional)
        input   - Input type: string, bool, number, path, list<string>, list<bool>, list<number>, list<path>
        help    - Description string for CLI help text layout (optional)
        default - Default value payload (makes argument optional; non-required)

      Pipeline Actions Sub-fields:
        tag     - Unique identifier for {{tag}} references with automatic dependency graph sorting
        run     - Execution engine: cmd (shell), value (static string), tiny / small / medium / large / vision (LLM nodes)
        expect  - Expected output type: string, list. Omit expect for steps with no expected output.
        check   - Optional regex validation pattern matching the step output result
        confirm - Intercept execution to ask for explicit user approval before running (default: false)
        action  - Shell instruction, LLM prompt string, static literal, or conditional when/then matrix list

      Tag System & Dependency Graph Engine:
        When writing {{tag_name}} inside an action payload, the engine replaces it with the output of that step.
        Steps do NOT execute sequentially by file layout alignment order. The engine scans all actions for
        {{tag}} references, builds a Directed Acyclic Graph (DAG), and sorts them topologically using Kahn's algorithm.
        Multiple Dependencies: A single step can reference multiple tags (e.g., "Compare {{tag_a}} and {{tag_b}}").
        The engine safely blocks execution until all parent dependencies are fully resolved.
        Circular Dependencies: Cyclic loops (e.g., A needs B, B needs A) are caught at startup and fail validation.

      List Expansion Matrix Mechanics:
        When a pipeline step expects an input type of 'string' or executes a 'cmd' but receives a 'list'
        payload from a referenced tag, the engine triggers List Expansion. It automatically iterates and executes
        that specific action independently FOR EACH ELEMENT in the list.
        Example: If {{tag_files}} yields ["main.rs", "lib.rs"], then 'git diff {{tag_files}}' runs twice:
        'git diff main.rs' and 'git diff lib.rs', returning a new composite list result.
        Collapsing Lists: To prevent iterative expansion loop triggers, append the '|join' modifier.
        It collapses a list back into a single flat string.

      Conditional Branching Logic (When/Then Matrix):
        An action payload can host a sequence of conditional checks. Each 'when' clause is evaluated.
        The first matching condition triggers its corresponding 'then' payload execution.
        If no 'when' conditions resolve to 'true', the pipeline instantly halts with a runtime failure.
        Example:
          - when: '{{tag_check|contains:DIRTY}}'
            then: 'echo "Found dirty state: {{tag_content}}"'
          - when: '{{tag_check|contains:CLEAR}}'
            then: 'echo "No errors detected."'

      Built-in Modifiers Spacers & Transformers:
        {{tag|ast}}                 - Any   : parse source file to JSON AST, brief by default (auto-detects language)
        {{tag|ast:brief}}           - Any   : parse source file, brief output (signatures only, no bodies)
        {{tag|ast:full}}            - Any   : parse source file, full output with bodies and imports
        {{tag|ast:lang}}            - String: parse source code with explicit language (rs, py, ts, js, ...)
        {{tag|clipboard}}           - Any   : copy value to system clipboard (pass-through)
        {{tag|clipboard:screenshot}}- Any   : smart image fallback: get from clipboard, set value as image, or trigger interactive screen capture if empty
        {{tag|contains:X}}          - Any   : check if sequence contains substring X (returns "true"/"false", supports :not)
        {{tag|empty}}               - Any   : check if targeted value is empty (returns "true"/"false", supports :not)
        {{tag|equals:X}}            - Any   : check if text strictly equals payload X (returns "true"/"false", supports :not)
        {{tag|format:json}}         - Any   : convert between json, json5, yaml, toml formats
        {{tag|is_dir}}              - Any   : check if provided string path is an existing directory (returns "true"/"false", supports :not)
        {{tag|is_file}}             - Any   : check if provided string path is an existing file (returns "true"/"false", supports :not)
        {{tag|join}}                - Any   : join list elements with newline, string passes through unchanged
        {{tag|join:X}}              - Any   : join list elements with custom separator X
        {{tag|load}}                - Any   : fetch URL to temp file, resolve local path, or pass through base64
        {{tag|lower}}               - Any   : transform text block to lowercase
        {{tag|resolve}}             - Any   : expand relative path string boundaries to absolute (~, ., .. resolved)
        {{tag|reverse}}             - Any   : reverse string sequence or list layout order
        {{tag|scan}}                - Any   : scan directory and return list of file paths (via vibe-fs)
        {{tag|size}}                - Any   : calculate character length of string or element count of list
        {{tag|sort}}                - Any   : sort characters (string) or elements (list) ascending
        {{tag|sort:asc}}            - Any   : sort ascending (default)
        {{tag|sort:desc}}           - Any   : sort descending
        {{tag|split}}               - Any   : split string into list by newline, list passes through unchanged
        {{tag|split:X}}             - Any   : split string into list by custom separator X
        {{tag|take:N}}              - Any   : extract first N characters (string) or elements (list)
        {{tag|text}}                - Any   : extract plain text from HTML/PDF or convert image to base64
        {{tag|trim}}                - Any   : strip surrounding whitespace, drop empty list elements
        {{tag|trim:chars}}          - Any   : strip custom characters, drop list elements matching arg string
        {{tag|uniq}}                - Any   : remove duplicate characters (string) or duplicate elements (list)
        {{tag|upper}}               - Any   : transform text block to UPPERCASE

      Special Spacing Escape Mnemonics inside Modifiers:
        \n     - Represents a real newline control byte (0x0A)
        \t     - Represents a real tab character control byte (0x09)
        \s     - Represents a real space character byte (shields spaces from rigid YAML trimmers)

      Mnemonic Examples:
        {{tag|join:\n}}      - Standard newline collapse operation
        {{tag|uniq|join:\s}} - Remove duplicates, join with space
        {{tag|join:,\s}}     - Format list elements into a comma-space display sequence (", ")

      Official Documentation Links (Live References):
        Landing Page       - https://keygenqt.com
        Introduction       - https://vibe-action.keygenqt.com/docs/introduction.html
        Quick Start        - https://vibe-action.keygenqt.com/docs/getting-started.html
        Action Structure   - https://vibe-action.keygenqt.com/docs/action-structure.html
        Tag System         - https://vibe-action.keygenqt.com/docs/tag-system.html
        Modifiers Manual   - https://vibe-action.keygenqt.com/docs/modifiers.html
        System Tags        - https://vibe-action.keygenqt.com/docs/system-tags.html
        Built-in Actions   - https://vibe-action.keygenqt.com/docs/built-in-actions.html
        Custom Actions     - https://vibe-action.keygenqt.com/docs/custom-actions.html
        VS Code Setup      - https://vibe-action.keygenqt.com/docs/ide-vscode.html
        IntelliJ Setup     - https://vibe-action.keygenqt.com/docs/ide-intellij.html
        Configuration      - https://vibe-action.keygenqt.com/docs/configuration.html
        CLI Reference      - https://vibe-action.keygenqt.com/docs/cli-reference.html

      [Task]
      Answer the user's question as a helpful, concise technical assistant based strictly on the [Data] matrix.

      [RULES]
      1. Use '\s' mnemonic for spaces inside modifier brackets, never literal whitespace.
      2. Chain operations in a single tag with pipes when possible (e.g., use '{{tag|trim|upper|uniq|join}}').
      3. Never use quotes for TEXT answers, lists, and general descriptions.
      4. Output YAML ONLY if explicitly asked for a configuration example.
      5. If the response contains YAML, wrap it in a ```yaml code block.

      [STRICT RULES]
      1. Answer STRICTLY in the same language as the [Query]. NO mixed languages.

      [Query]
      {query|prompt}