Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

vx-agent-workflow

БесплатноБез исполняемых скриптовНе проверен

Token-efficient command execution patterns for AI agents using vx. Use when running builds, tests, linting, GitHub operations, or any command that produces…

loonghaoот loonghao944 установки в других каталогах

Об этом скилле

VX Agent Workflow — Token-Efficient Command Execution

Core principle: Use vx rg as the universal cross-platform filter. Never use platform-specific tools like Select-String (PowerShell), grep (Unix), or findstr (cmd). One command, every OS.

Why This Matters

AI agents pay per-token for both input and output. A full cargo test run can produce 500+ lines when you only need the 5 lines showing failures. Agents that dump raw output waste 95% of their context window on noise.

The vx advantage: vx auto-installs rg (ripgrep), jq, fd, and other filtering tools on every platform. Use them instead of shell-specific builtins.

Token Savings Per Operation (Measured)

Based on medium-sized Rust/Python/TypeScript projects:

Operation Frequency/30min Raw tokens Filtered Savings
vx cargo test 5x ~25,000 ~2,500 -90%
vx cargo build 5x ~15,000 ~1,500 -90%
vx cargo clippy 3x ~8,000 ~800 -90%
vx uv run pytest 4x ~8,000 ~800 -90%
vx gh pr view 5x ~3,000 ~300 -90%
vx gh run view --log 3x ~30,000 ~1,500 -95%
vx git status 10x ~3,000 ~600 -80%
vx git diff 5x ~10,000 ~2,500 -75%
vx npm test 5x ~20,000 ~2,000 -90%
vx just quick 3x ~40,000 ~2,000 -95%
Session total ~162,000 ~12,500 -92%

The Universal Filter Pattern

vx <command> 2>&1 | vx rg "<pattern>"

This works identically on:

  • Windows PowerShell 5.1+ / 7+ (pwsh)
  • Windows cmd.exe
  • Linux Bash/Zsh
  • macOS Bash/Zsh

Why NOT platform-specific tools

Platform Native filter Problem
PowerShell Select-String -Pattern "..." | Select-Object -Last 30 Verbose syntax, outputs objects not text, breaks on Unix
Bash/Zsh grep -E "..." | tail -30 Not available on Windows without WSL
cmd.exe findstr /R "..." Limited regex, no tail equivalent, no context lines

With vx, one line replaces all of them:

vx <command> 2>&1 | vx rg -m 30 "pattern"

Deep Recipe: vx cargo (Rust Build & Test)

Build — Progressive Disclosure

# Level 1: Just pass/fail (2 tokens)
vx cargo build 2>&1 && echo "OK" || echo "FAIL"

# Level 2: Error count only (5 tokens)
vx cargo build 2>&1 | vx rg -c "^error"

# Level 3: Error messages only (~50-200 tokens)
vx cargo build 2>&1 | vx rg "^error\[" 

# Level 4: Errors + location (~200-500 tokens)
vx cargo build 2>&1 | vx rg "^error|^\s*--> "

# Level 5: Errors with context (~500-1000 tokens)
vx cargo build 2>&1 | vx rg -B 1 -A 3 "^error\["

# NEVER: Full raw output (5000-20000 tokens)
# vx cargo build  ← don't do this unless debugging a novel issue

Test — Optimal Patterns

# Cheapest: Just the summary line
vx cargo test 2>&1 | vx rg "^test result:"
# Output: test result: ok. 47 passed; 0 failed; 0 ignored

# Failed tests only (names + messages)
vx cargo test 2>&1 | vx rg "FAILED|panicked|thread .+ panicked|assertion"

# Specific crate (80% faster, 80% fewer tokens)
vx cargo test -p vx-cli 2>&1 | vx rg "test result:|FAILED"

# Specific test by name
vx cargo test -p vx-cli test_parse_args 2>&1 | vx rg "test result:|FAILED|panicked"

# JSON format for structured parsing (nightly or with --format)
vx cargo test -- -Z unstable-options --format json 2>&1 | vx jq -c 'select(.event == "failed")'

Clippy — Warnings & Errors

# Count issues (1 token answer)
vx cargo clippy 2>&1 | vx rg -c "^(warning|error)\["

# Issue types only
vx cargo clippy 2>&1 | vx rg -o "(warning|error)\[\w+\]" | sort | uniq -c

# Full warnings with file location
vx cargo clippy 2>&1 | vx rg "^(warning|error)\[|^\s*--> "

# Specific lint only
vx cargo clippy 2>&1 | vx rg "unused_variable|dead_code"

Build + Test Combined (vx just quick)

# Optimal: capture only final results from the full pipeline
vx just quick 2>&1 | vx rg "^(error|warning)\[|test result:|FAILED|Finished|could not compile"

# If expecting success (confirmation only)
vx just quick 2>&1 | vx rg -m 5 "Finished|test result: ok|All checks passed"

Tee Pattern — Save Full Output for Failure Recovery

When a command fails, save full output to a file so you can dig deeper without re-running (inspired by rtk's tee feature):

# Run once, save everything, show only errors
vx cargo test 2>&1 | vx tee .vx-last-output.log | vx rg "FAILED|error|panicked"

# If filtered output is insufficient, read the saved log
vx rg -C 5 "FAILED" .vx-last-output.log

# Alternative: redirect to file + filter separately
vx cargo test > .vx-last-output.log 2>&1; vx rg "test result:|FAILED" .vx-last-output.log

Deep Recipe: vx gh (GitHub CLI)

PR Operations — JSON Field Selection

The single most effective token-saving technique for gh is `--jso

Полный SKILL.md на ClawHub

Установить vx-agent-workflow в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл vx-agent-workflow?

Token-efficient command execution patterns for AI agents using vx. Use when running builds, tests, linting, GitHub operations, or any command that produces verbose output. Teaches agents to filter output cross-platform using vx-managed tools (vx rg, vx jq) instead of platform-specific syntax (Select-String, grep, findstr). Includes token measurement, savings tracking, and deep recipes for cargo, gh, pytest, and more.

Как установить скилл vx-agent-workflow?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл vx-agent-workflow запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить vx-agent-workflow с