Workflow Tune banner
zhao-wuyan zhao-wuyan

Workflow Tune

Productivity community intermediate

Description

测试 Claude command/skill 的执行效果并优化。提取可执行命令,逐步通过 `ccw cli --tool claude` 执行,分析产物质量,生成优化建议。

Trigger

Trigger condition
/workflow-lite-plan analyze auth module

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for zhao-wuyan/ccw-command-explorer, shared by 5 entries in this directory. It describes the repository, not this entry specifically.


name: workflow-tune description: Workflow tuning - extract commands from reference docs or natural language, execute each via ccw cli --tool claude --mode write, then analyze artifacts via gemini. For testing how commands execute in Claude. argument-hint: " | \"step1 | step2 | step3\" | \"skill-a,skill-b\" | --file workflow.json [--depth quick|standard|deep] [-y|--yes] [--auto-fix]" allowed-tools: Agent(*), AskUserQuestion(*), TaskCreate(*), TaskUpdate(*), TaskList(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)

Workflow Tune

测试 Claude command/skill 的执行效果并优化。提取可执行命令,逐步通过 `ccw cli --tool claude` 执行,分析产物质量,生成优化建议。

Tool Assignment

Phase Tool Mode Rule
Execute claude write universal-rigorous-style
Analyze gemini analysis analysis-review-code-quality
Synthesize gemini analysis analysis-review-architecture

Architecture

Input → Parse → GenTestTask → Confirm → Setup → [resolveCmd → readMeta → assemblePrompt → Execute → STOP → Analyze → STOP]×N → Synthesize → STOP → Report
                    ↑                                       ↑
          Claude 直接生成测试任务            prompt 中注入 test_task
          (无需 CLI 调用)                  作为命令的执行输入

Input Formats

1. --file workflow.json               → JSON definition
2. "cmd1 | cmd2 | cmd3"              → pipe-separated commands
3. "skill-a,skill-b,skill-c"         → comma-separated skills
4. natural language                   → semantic decomposition
   4a:             → extract commands from reference doc via LLM
   4b:              → intent-verb matching → ccw cli command assembly

**ANTI-PATTERN**: Steps like `{ command: "分析 Phase 管线" }` are WRONG — descriptions, not commands. Correct: `{ command: "/workflow-lite-plan analyze auth module" }` or `{ command: "ccw cli -p '...' --tool claude --mode write" }`

Utility: Shell Escaping

function escapeForShell(str) {
  // Replace single quotes with escaped version, wrap in single quotes
  return "'" + str.replace(/'/g, "'\\''") + "'";
}

Phase 1: Setup

Step 1.1: Parse Input + Preference Collection

const args = $ARGUMENTS.trim();
const autoYes = /\b(-y|--yes)\b/.test(args);

// Preference collection (skip if -y)
if (autoYes) {
  workflowPreferences = { autoYes: true, analysisDepth: 'standard', autoFix: false };
} else {
  const prefResponse = AskUserQuestion({
    questions: [
      { question: "选择调优配置:", header: "Tune Config", multiSelect: false,
        options: [
          { label: "Quick (轻量分析)", description: "每步简要检查" },
          { label: "Standard (标准分析) (Recommended)", description: "每步详细分析" },
          { label: "Deep (深度分析)", description: "深度审查含架构建议" }
        ]
      },
      { question: "是否自动应用优化建议?", header: "Auto Fix", multiSelect: false,
        options: [
          { label: "No (仅报告) (Recommended)", description: "只分析