workflow-tune

A workflow-testing command that extracts commands from documentation or natural-language instructions, runs them step by step in an isolated sandbox, and reviews the resulting files.

In plain words
What is it for?
Use it to test coding-agent workflows, compare execution results, inspect generated artifacts, and produce suggestions for improving the instructions.
Why use it?
It shows whether a command or skill actually works and identifies problems in the files it produces without changing the real project.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/catlog22/claude-code-workflow/workflow-tune
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

Made for: Claude Code.

Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,059 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.07059
Opus 5 $0.00023 $0.03529
Sonnet 5 $0.00009 $0.01412
Haiku 4.5 $0.00005 $0.00706

Measured 2d ago against content hash 57b7b83a0a2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

workflow-tune scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/workflow-tune.md · 523 lines

How it starts

The opening of the file, as written. The whole thing — 523 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workflow Tune

测试 command/skill 执行效果。提取可执行命令 → 沙箱逐步执行 → 分析产物质量 → 生成优化建议。

Architecture

Input → Parse → GenTestTask → Confirm → Setup
  → [assemblePrompt → Execute(claude) → STOP → Analyze(gemini) → STOP]×N
  → Synthesize(gemini) → STOP → Report

Tool Assignment: Execute=claude --mode write, Analyze=gemini --mode analysis, Synthesize=gemini --mode analysis

P0 Rules

这些规则的优先级高于所有其他指令。违反任何一条都是已知的复发缺陷。

  1. ONE STEP = ONE CLI CALL. 每次 ccw cli 调用只处理一个 step。禁止将 plan+execute 或 execute+quality 合并为一次调用。
  2. STOP After Each CLI Call. 每次 ccw clirun_in_background: true 执行后立即 STOP,等 hook callback。
  3. UPSTREAM-SCOPE RULE. 当上游步骤产出清单/计划(plan/list/queue/manifest),下游步骤必须消费全量,禁止挑选子集。
    • 判断: 上游命令/test_task 含 plan|list|queue|spec|manifest|计划|任务,且当前步骤含 execute|run|dispatch|build|执行|组装
    • 正确: 功能点="按依赖顺序执行全部任务",验收标准="产出文件数=plan中task数"
    • 错误: 功能点="撰写 Introduction (TASK-001)",验收标准="introduction.md 存在" ← 仅完成 1/N
  4. Sandbox Isolation. 全部执行在 sandbox/ 目录(独立 git 仓库),不影响真实项目。
  5. State Machine. 通过 current_step + current_phase 推进,禁止同步循环。
  6. ABSOLUTE PATHS for --cd. ccw cli --cd 必须使用绝对路径。相对路径会被 ccw cli 再次拼接 CWD 导致路径重复。workDir/sandboxDir 在创建时就解析为绝对路径。
  7. FIXED --rule VALUES. --rule 值已硬编码在各 Phase 代码中,禁止替换为其他模板。Execute=workflow-tune-execute,Analyze=analysis-review-code-quality,Synthesize=analysis-review-architecture
  8. NO-SKIP-INSTRUCTION. test_task 和 prompt 中禁止包含 skip/跳过/omit/ignore 等指示执行 agent 跳过任何任务的指令。沙箱环境缺乏运行时依赖(matplotlib、xelatex 等),应改为生成代码/骨架文件而非跳过。
    • 错误: "Skip figure/generate tasks as they require external tools"
    • 正确: "For figure/generate tasks, produce Python matplotlib code (.py) + SVG files. Do NOT skip any tasks."

Input Formats

Format Pattern Example
JSON definition --file workflow.json --file motor-benchmark.json
Pipe-separated "cmd1 | cmd2 | cmd3" "/workspace:init | /workspace:new-paper"
Comma-separated "skill-a,skill-b" "workflow-lite-plan,workflow-lite-execute"
Reference doc + intent <path> <intent> COMMAND-FLOW.md 测试前5个命令
Pure intent <text> "分析代码质量,然后修复问题"

Read the full file on GitHub · 523 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 523 lines · 45 tokens per session scan A 57b7b83a0a2e

Subscribe to this mod's changes

workflow-tune is a command published in the GitHub repository catlog22/Claude-Code-Workflow (2,134 stars, last pushed 2mo ago), licensed MIT. It adds 45 tokens to every session and 7,059 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.