From fca03a3f9ce95b68531bd489e673175f17b9ce83 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Fri, 30 Jan 2026 12:29:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20rename=20meta-skill=20=E2=86=92=20f?= =?UTF-8?q?low-coordinator,=20update=20template=20cmd=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Major changes:** - Rename skill from meta-skill to flow-coordinator (avoid /ccw conflicts) - Update all 17 templates: store full /workflow: command paths in cmd field - Session ID prefix: ms → fc (fc-YYYYMMDD-HHMMSS) - Workflow path: .workflow/.meta-skill → .workflow/.flow-coordinator - Simplify SKILL.md schema documentation - Streamline Status Schema section - Consolidate Template Schema with single example - Remove redundant Field Explanations and behavior tables - All templates now store cmd as full paths (e.g. /workflow:lite-plan) - Eliminates need for path assembly during execution - Matches ccw-coordinator execution format --- .claude/skills/flow-coordinator/SKILL.md | 394 ++++++++++++++++++ .../flow-coordinator/templates/analyze.json | 16 + .../templates/brainstorm-to-issue.json | 36 ++ .../templates/brainstorm.json | 16 + .../templates/bugfix-hotfix.json | 16 + .../flow-coordinator/templates/bugfix.json | 47 +++ .../flow-coordinator/templates/coupled.json | 71 ++++ .../flow-coordinator/templates/debug.json | 16 + .../flow-coordinator/templates/docs.json | 27 ++ .../flow-coordinator/templates/full.json | 61 +++ .../flow-coordinator/templates/issue.json | 43 ++ .../templates/lite-lite-lite.json | 16 + .../templates/multi-cli-plan.json | 47 +++ .../templates/rapid-to-issue.json | 46 ++ .../flow-coordinator/templates/rapid.json | 47 +++ .../flow-coordinator/templates/review.json | 43 ++ .../flow-coordinator/templates/tdd.json | 34 ++ .../flow-coordinator/templates/test-fix.json | 26 ++ META_SKILL_SUMMARY.md | 188 +++++++++ 19 files changed, 1190 insertions(+) create mode 100644 .claude/skills/flow-coordinator/SKILL.md create mode 100644 .claude/skills/flow-coordinator/templates/analyze.json create mode 100644 .claude/skills/flow-coordinator/templates/brainstorm-to-issue.json create mode 100644 .claude/skills/flow-coordinator/templates/brainstorm.json create mode 100644 .claude/skills/flow-coordinator/templates/bugfix-hotfix.json create mode 100644 .claude/skills/flow-coordinator/templates/bugfix.json create mode 100644 .claude/skills/flow-coordinator/templates/coupled.json create mode 100644 .claude/skills/flow-coordinator/templates/debug.json create mode 100644 .claude/skills/flow-coordinator/templates/docs.json create mode 100644 .claude/skills/flow-coordinator/templates/full.json create mode 100644 .claude/skills/flow-coordinator/templates/issue.json create mode 100644 .claude/skills/flow-coordinator/templates/lite-lite-lite.json create mode 100644 .claude/skills/flow-coordinator/templates/multi-cli-plan.json create mode 100644 .claude/skills/flow-coordinator/templates/rapid-to-issue.json create mode 100644 .claude/skills/flow-coordinator/templates/rapid.json create mode 100644 .claude/skills/flow-coordinator/templates/review.json create mode 100644 .claude/skills/flow-coordinator/templates/tdd.json create mode 100644 .claude/skills/flow-coordinator/templates/test-fix.json create mode 100644 META_SKILL_SUMMARY.md diff --git a/.claude/skills/flow-coordinator/SKILL.md b/.claude/skills/flow-coordinator/SKILL.md new file mode 100644 index 00000000..013f57a5 --- /dev/null +++ b/.claude/skills/flow-coordinator/SKILL.md @@ -0,0 +1,394 @@ +--- +name: flow-coordinator +description: Template-driven workflow coordinator with minimal state tracking. Executes command chains from workflow templates with slash-command execution (mainprocess/async). Triggers on "flow-coordinator", "workflow template", "orchestrate". +allowed-tools: Task, AskUserQuestion, Read, Write, Bash, Glob, Grep +--- + +# Flow Coordinator + +Lightweight workflow coordinator that executes command chains from predefined templates, supporting slash-command execution with mainprocess (blocking) and async (background) modes. + +## Architecture + +``` +User Task → Select Template → status.json Init → Execute Steps → Complete + ↑ │ + └──────────────── Resume (from status.json) ─────┘ + +Step Execution: + execution mode? + ├─ mainprocess → SlashCommand (blocking, main process) + └─ async → ccw cli --tool claude --mode write (background) +``` + +## Core Concepts + +**Template-Driven**: Workflows defined as JSON templates in `templates/`, decoupled from coordinator logic. + +**Execution Type**: `slash-command` only +- ALL workflow commands (`/workflow:*`) use `slash-command` type +- Two execution modes: + - `mainprocess`: SlashCommand (blocking, main process) + - `async`: CLI background (ccw cli with claude tool) + +**Dynamic Discovery**: Templates discovered at runtime via Glob, not hardcoded. + +--- + +## Execution Flow + +```javascript +async function execute(task) { + // 1. Discover and select template + const templates = await discoverTemplates(); + const template = await selectTemplate(templates); + + // 2. Init status + const sessionId = `fc-${timestamp()}`; + const statusPath = `.workflow/.flow-coordinator/${sessionId}/status.json`; + const status = initStatus(template, task); + write(statusPath, JSON.stringify(status, null, 2)); + + // 3. Execute steps based on execution config + await executeSteps(status, statusPath); +} + +async function executeSteps(status, statusPath) { + for (let i = status.current; i < status.steps.length; i++) { + const step = status.steps[i]; + status.current = i; + + // Execute based on step mode (all steps use slash-command type) + const execConfig = step.execution || { type: 'slash-command', mode: 'mainprocess' }; + + if (execConfig.mode === 'async') { + // Async execution - stop and wait for hook callback + await executeSlashCommandAsync(step, status, statusPath); + break; + } else { + // Mainprocess execution - continue immediately + await executeSlashCommandSync(step, status); + step.status = 'done'; + write(statusPath, JSON.stringify(status, null, 2)); + } + } + + // All steps complete + if (status.current >= status.steps.length) { + status.complete = true; + write(statusPath, JSON.stringify(status, null, 2)); + } +} +``` + +--- + +## Template Discovery + +**Dynamic query** - never hardcode template list: + +```javascript +async function discoverTemplates() { + // Discover all JSON templates + const files = Glob('*.json', { path: 'templates/' }); + + // Parse each template + const templates = []; + for (const file of files) { + const content = JSON.parse(Read(file)); + templates.push({ + name: content.name, + description: content.description, + steps: content.steps.map(s => s.cmd).join(' → '), + file: file + }); + } + + return templates; +} +``` + +--- + +## Template Selection + +User chooses from discovered templates: + +```javascript +async function selectTemplate(templates) { + // Build options from discovered templates + const options = templates.slice(0, 4).map(t => ({ + label: t.name, + description: t.steps + })); + + const response = await AskUserQuestion({ + questions: [{ + question: 'Select workflow template:', + header: 'Template', + options: options, + multiSelect: false + }] + }); + + // Handle "Other" - show remaining templates or custom input + if (response.template === 'Other') { + return await selectFromRemainingTemplates(templates.slice(4)); + } + + return templates.find(t => t.name === response.template); +} +``` + +--- + +## Status Schema + +**Creation**: Copy template JSON → Update `id`, `template`, `goal`, set all steps `status: "pending"` + +**Location**: `.workflow/.flow-coordinator/{session-id}/status.json` + +**Core Fields**: +- `id`: Session ID (fc-YYYYMMDD-HHMMSS) +- `template`: Template name +- `goal`: User task description +- `current`: Current step index +- `steps[]`: Step array from template (with runtime `status`, `session`, `taskId`) +- `complete`: All steps done? + +**Step Status**: `pending` → `running` → `done` | `failed` | `skipped` + +--- + +## Extended Template Schema + +**Templates stored in**: `templates/*.json` (discovered at runtime via Glob) + +**TemplateStep Fields**: +- `cmd`: Full command path (e.g., `/workflow:lite-plan`, `/workflow:execute`) +- `args?`: Arguments with `{{goal}}` and `{{prev}}` placeholders +- `unit?`: Minimum execution unit name (groups related commands) +- `optional?`: Can be skipped by user +- `execution`: Type and mode configuration + - `type`: Always `'slash-command'` (for all workflow commands) + - `mode`: `'mainprocess'` (blocking) or `'async'` (background) +- `contextHint?`: Natural language guidance for context assembly + +**Template Example**: +```json +{ + "name": "rapid", + "steps": [ + { + "cmd": "/workflow:lite-plan", + "args": "\"{{goal}}\"", + "unit": "quick-implementation", + "execution": { "type": "slash-command", "mode": "mainprocess" }, + "contextHint": "Create lightweight implementation plan" + }, + { + "cmd": "/workflow:lite-execute", + "args": "--in-memory", + "unit": "quick-implementation", + "execution": { "type": "slash-command", "mode": "async" }, + "contextHint": "Execute plan from previous step" + } + ] +} +``` + +--- + +## Execution Implementation + +### Mainprocess Mode (Blocking) + +```javascript +async function executeSlashCommandSync(step, status) { + // Build command: /workflow:cmd -y args + const cmd = buildCommand(step, status); + const result = await SlashCommand({ command: cmd }); + + step.session = result.session_id; + step.status = 'done'; + return result; +} +``` + +### Async Mode (Background) + +```javascript +async function executeSlashCommandAsync(step, status, statusPath) { + // Build prompt: /workflow:cmd -y args + context + const prompt = buildCommandPrompt(step, status); + + step.status = 'running'; + write(statusPath, JSON.stringify(status, null, 2)); + + // Execute via ccw cli in background + const taskId = Bash( + `ccw cli -p "${escapePrompt(prompt)}" --tool claude --mode write`, + { run_in_background: true } + ).task_id; + + step.taskId = taskId; + write(statusPath, JSON.stringify(status, null, 2)); + + console.log(`Executing: ${step.cmd} (async)`); + console.log(`Resume: /flow-coordinator --resume ${status.id}`); +} +``` + +--- + +## Prompt Building + +Prompts are built in format: `/workflow:cmd -y args` + context + +```javascript +function buildCommandPrompt(step, status) { + // step.cmd already contains full path: /workflow:lite-plan, /workflow:execute, etc. + let prompt = `${step.cmd} -y`; + + // Add arguments (with placeholder replacement) + if (step.args) { + const args = step.args + .replace('{{goal}}', status.goal) + .replace('{{prev}}', getPreviousSessionId(status)); + prompt += ` ${args}`; + } + + // Add context based on contextHint + if (step.contextHint) { + const context = buildContextFromHint(step.contextHint, status); + prompt += `\n\nContext:\n${context}`; + } else { + // Default context: previous session IDs + const previousContext = collectPreviousResults(status); + if (previousContext) { + prompt += `\n\nPrevious results:\n${previousContext}`; + } + } + + return prompt; +} + +function buildContextFromHint(hint, status) { + // Parse contextHint instruction and build context accordingly + // Examples: + // "Summarize IMPL_PLAN.md" → read and summarize plan + // "List test coverage gaps" → analyze previous test results + // "Pass session ID" → just return session reference + + return parseAndBuildContext(hint, status); +} +``` + +### Example Prompt Output + +``` +/workflow:lite-plan -y "Implement user registration" + +Context: +Task: Implement user registration +Previous results: +- None (first step) +``` + +``` +/workflow:execute -y --in-memory + +Context: +Task: Implement user registration +Previous results: +- lite-plan: WFS-plan-20250130 (planning-context.md) +``` + +--- + +## User Interaction + +### Step 1: Select Template + +``` +Select workflow template: + +○ rapid lite-plan → lite-execute → test-cycle-execute +○ coupled plan → plan-verify → execute → review → test +○ bugfix lite-fix → lite-execute → test-cycle-execute +○ tdd tdd-plan → execute → tdd-verify +○ Other (more templates or custom) +``` + +### Step 2: Review Execution Plan + +``` +Template: coupled +Steps: + 1. /workflow:plan (slash-command mainprocess) + 2. /workflow:plan-verify (slash-command mainprocess) + 3. /workflow:execute (slash-command async) + 4. /workflow:review-session-cycle (slash-command mainprocess) + 5. /workflow:review-cycle-fix (slash-command mainprocess) + 6. /workflow:test-fix-gen (slash-command mainprocess) + 7. /workflow:test-cycle-execute (slash-command async) + +Proceed? [Confirm / Cancel] +``` + +--- + +## Resume Capability + +```javascript +async function resume(sessionId) { + const statusPath = `.workflow/.flow-coordinator/${sessionId}/status.json`; + const status = JSON.parse(Read(statusPath)); + + // Find first incomplete step + status.current = status.steps.findIndex(s => s.status !== 'done'); + if (status.current === -1) { + console.log('All steps complete'); + return; + } + + // Continue executing steps + await executeSteps(status, statusPath); +} +``` + +--- + +## Available Templates + +Templates discovered from `templates/*.json`: + +| Template | Use Case | Steps | +|----------|----------|-------| +| rapid | Simple feature | /workflow:lite-plan → /workflow:lite-execute → /workflow:test-cycle-execute | +| coupled | Complex feature | /workflow:plan → /workflow:plan-verify → /workflow:execute → /workflow:review-session-cycle → /workflow:test-fix-gen | +| bugfix | Bug fix | /workflow:lite-fix → /workflow:lite-execute → /workflow:test-cycle-execute | +| tdd | Test-driven | /workflow:tdd-plan → /workflow:execute → /workflow:tdd-verify | +| test-fix | Fix failing tests | /workflow:test-fix-gen → /workflow:test-cycle-execute | +| brainstorm | Exploration | /workflow:brainstorm-with-file | +| debug | Debug with docs | /workflow:debug-with-file | +| analyze | Collaborative analysis | /workflow:analyze-with-file | +| issue | Issue workflow | /workflow:issue:plan → /workflow:issue:queue → /workflow:issue:execute | + +--- + +## Design Principles + +1. **Minimal fields**: Only essential tracking data +2. **Flat structure**: No nested objects beyond steps array +3. **Step-level execution**: Each step defines how it's executed +4. **Resumable**: Any step can be resumed from status +5. **Human readable**: Clear JSON format + +--- + +## Reference Documents + +| Document | Purpose | +|----------|---------| +| templates/*.json | Workflow templates (dynamic discovery) | diff --git a/.claude/skills/flow-coordinator/templates/analyze.json b/.claude/skills/flow-coordinator/templates/analyze.json new file mode 100644 index 00000000..ca266576 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/analyze.json @@ -0,0 +1,16 @@ +{ + "name": "analyze", + "description": "Collaborative analysis with multi-round discussion - deep exploration and understanding", + "level": 3, + "steps": [ + { + "cmd": "/workflow:analyze-with-file", + "args": "\"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Multi-round collaborative analysis with iterative understanding. Generate discussion.md with comprehensive analysis and conclusions" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/brainstorm-to-issue.json b/.claude/skills/flow-coordinator/templates/brainstorm-to-issue.json new file mode 100644 index 00000000..44f8cc24 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/brainstorm-to-issue.json @@ -0,0 +1,36 @@ +{ + "name": "brainstorm-to-issue", + "description": "Bridge brainstorm session to issue workflow - convert exploration insights to executable issues", + "level": 4, + "steps": [ + { + "cmd": "/workflow:issue:from-brainstorm", + "args": "--auto", + "unit": "brainstorm-to-issue", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Convert brainstorm session findings into issue plans and solutions" + }, + { + "cmd": "/workflow:issue:queue", + "unit": "brainstorm-to-issue", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Build execution queue from converted brainstorm issues" + }, + { + "cmd": "/workflow:issue:execute", + "args": "--queue auto", + "unit": "brainstorm-to-issue", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute issues from queue with state tracking" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/brainstorm.json b/.claude/skills/flow-coordinator/templates/brainstorm.json new file mode 100644 index 00000000..7b95d6b5 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/brainstorm.json @@ -0,0 +1,16 @@ +{ + "name": "brainstorm", + "description": "Multi-perspective ideation with documentation - explore possibilities with multiple analytical viewpoints", + "level": 4, + "steps": [ + { + "cmd": "/workflow:brainstorm-with-file", + "args": "\"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Multi-perspective ideation with interactive diverge-converge cycles. Generate brainstorm.md with synthesis of ideas and recommendations" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/bugfix-hotfix.json b/.claude/skills/flow-coordinator/templates/bugfix-hotfix.json new file mode 100644 index 00000000..ef1d21d5 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/bugfix-hotfix.json @@ -0,0 +1,16 @@ +{ + "name": "bugfix-hotfix", + "description": "Urgent production fix - immediate diagnosis and fix with minimal overhead", + "level": 1, + "steps": [ + { + "cmd": "/workflow:lite-fix", + "args": "--hotfix \"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Urgent hotfix mode: quick diagnosis and immediate fix for critical production issue" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/bugfix.json b/.claude/skills/flow-coordinator/templates/bugfix.json new file mode 100644 index 00000000..ebe00ea6 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/bugfix.json @@ -0,0 +1,47 @@ +{ + "name": "bugfix", + "description": "Standard bug fix workflow - lightweight diagnosis and execution with testing", + "level": 2, + "steps": [ + { + "cmd": "/workflow:lite-fix", + "args": "\"{{goal}}\"", + "unit": "bug-fix", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Analyze bug report, trace execution flow, identify root cause with fix strategy" + }, + { + "cmd": "/workflow:lite-execute", + "args": "--in-memory", + "unit": "bug-fix", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Implement fix based on diagnosis. Execute against in-memory state from lite-fix analysis." + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate test tasks to verify bug fix and prevent regression" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute test-fix cycle until all tests pass" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/coupled.json b/.claude/skills/flow-coordinator/templates/coupled.json new file mode 100644 index 00000000..8dd6a610 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/coupled.json @@ -0,0 +1,71 @@ +{ + "name": "coupled", + "description": "Full workflow for complex features - detailed planning with verification, execution, review, and testing", + "level": 3, + "steps": [ + { + "cmd": "/workflow:plan", + "args": "\"{{goal}}\"", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Create detailed implementation plan with architecture design, file structure, dependencies, and milestones" + }, + { + "cmd": "/workflow:plan-verify", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Verify IMPL_PLAN.md against requirements, check for missing details, conflicts, and quality gates" + }, + { + "cmd": "/workflow:execute", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute implementation based on verified plan. Resume from planning session with all context preserved." + }, + { + "cmd": "/workflow:review-session-cycle", + "unit": "code-review", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Perform multi-dimensional code review across correctness, security, performance, maintainability. Reference execution session for full code context." + }, + { + "cmd": "/workflow:review-cycle-fix", + "unit": "code-review", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Fix issues identified in review findings with prioritization by severity levels" + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate comprehensive test tasks for the implementation with coverage analysis" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute iterative test-fix cycle until pass rate >= 95%" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/debug.json b/.claude/skills/flow-coordinator/templates/debug.json new file mode 100644 index 00000000..a1607440 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/debug.json @@ -0,0 +1,16 @@ +{ + "name": "debug", + "description": "Hypothesis-driven debugging with documentation - systematic troubleshooting and logging", + "level": 3, + "steps": [ + { + "cmd": "/workflow:debug-with-file", + "args": "\"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Systematic debugging with hypothesis formation and verification. Generate understanding.md with root cause analysis and fix recommendations" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/docs.json b/.claude/skills/flow-coordinator/templates/docs.json new file mode 100644 index 00000000..739fa9fc --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/docs.json @@ -0,0 +1,27 @@ +{ + "name": "docs", + "description": "Documentation generation workflow", + "level": 2, + "steps": [ + { + "cmd": "/workflow:lite-plan", + "args": "\"{{goal}}\"", + "unit": "quick-documentation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Plan documentation structure and content organization" + }, + { + "cmd": "/workflow:lite-execute", + "args": "--in-memory", + "unit": "quick-documentation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute documentation generation from plan" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/full.json b/.claude/skills/flow-coordinator/templates/full.json new file mode 100644 index 00000000..0a2c8944 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/full.json @@ -0,0 +1,61 @@ +{ + "name": "full", + "description": "Comprehensive workflow - brainstorm exploration, planning verification, execution, and testing", + "level": 4, + "steps": [ + { + "cmd": "/workflow:brainstorm:auto-parallel", + "args": "\"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Multi-perspective exploration of requirements and possible approaches" + }, + { + "cmd": "/workflow:plan", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Create detailed implementation plan based on brainstorm insights" + }, + { + "cmd": "/workflow:plan-verify", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Verify plan quality and completeness" + }, + { + "cmd": "/workflow:execute", + "unit": "verified-planning-execution", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute implementation from verified plan" + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate comprehensive test tasks" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute test-fix cycle until pass rate >= 95%" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/issue.json b/.claude/skills/flow-coordinator/templates/issue.json new file mode 100644 index 00000000..c1be9a5a --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/issue.json @@ -0,0 +1,43 @@ +{ + "name": "issue", + "description": "Issue workflow - discover issues, create plans, queue execution, and resolve", + "level": "issue", + "steps": [ + { + "cmd": "/workflow:issue:discover", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Discover pending issues from codebase for potential fixes" + }, + { + "cmd": "/workflow:issue:plan", + "args": "--all-pending", + "unit": "issue-workflow", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Create execution plans for all discovered pending issues" + }, + { + "cmd": "/workflow:issue:queue", + "unit": "issue-workflow", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Build execution queue with issue prioritization and dependencies" + }, + { + "cmd": "/workflow:issue:execute", + "unit": "issue-workflow", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute issues from queue with state tracking and completion reporting" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/lite-lite-lite.json b/.claude/skills/flow-coordinator/templates/lite-lite-lite.json new file mode 100644 index 00000000..1441129c --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/lite-lite-lite.json @@ -0,0 +1,16 @@ +{ + "name": "lite-lite-lite", + "description": "Ultra-lightweight for immediate simple tasks - minimal overhead, direct execution", + "level": 1, + "steps": [ + { + "cmd": "/workflow:lite-lite-lite", + "args": "\"{{goal}}\"", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Direct task execution with minimal analysis and zero documentation overhead" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/multi-cli-plan.json b/.claude/skills/flow-coordinator/templates/multi-cli-plan.json new file mode 100644 index 00000000..e8fc00b4 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/multi-cli-plan.json @@ -0,0 +1,47 @@ +{ + "name": "multi-cli-plan", + "description": "Multi-perspective planning with cross-tool verification and execution", + "level": 3, + "steps": [ + { + "cmd": "/workflow:multi-cli-plan", + "args": "\"{{goal}}\"", + "unit": "multi-cli-planning", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Multi-perspective analysis comparing different implementation approaches with trade-off analysis" + }, + { + "cmd": "/workflow:lite-execute", + "args": "--in-memory", + "unit": "multi-cli-planning", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute best approach selected from multi-perspective analysis" + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate test tasks for the implementation" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute test-fix cycle until pass rate >= 95%" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/rapid-to-issue.json b/.claude/skills/flow-coordinator/templates/rapid-to-issue.json new file mode 100644 index 00000000..18e700db --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/rapid-to-issue.json @@ -0,0 +1,46 @@ +{ + "name": "rapid-to-issue", + "description": "Bridge lite workflow to issue workflow - convert simple plan to structured issue execution", + "level": 2.5, + "steps": [ + { + "cmd": "/workflow:lite-plan", + "args": "\"{{goal}}\"", + "unit": "rapid-to-issue", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Create lightweight plan for the task" + }, + { + "cmd": "/workflow:issue:convert-to-plan", + "args": "--latest-lite-plan -y", + "unit": "rapid-to-issue", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Convert lite plan to structured issue plan" + }, + { + "cmd": "/workflow:issue:queue", + "unit": "rapid-to-issue", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Build execution queue from converted plan" + }, + { + "cmd": "/workflow:issue:execute", + "args": "--queue auto", + "unit": "rapid-to-issue", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute issues from queue with state tracking" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/rapid.json b/.claude/skills/flow-coordinator/templates/rapid.json new file mode 100644 index 00000000..8a48d72d --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/rapid.json @@ -0,0 +1,47 @@ +{ + "name": "rapid", + "description": "Quick implementation - lightweight plan and immediate execution for simple features", + "level": 2, + "steps": [ + { + "cmd": "/workflow:lite-plan", + "args": "\"{{goal}}\"", + "unit": "quick-implementation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Analyze requirements and create a lightweight implementation plan with key decisions and file structure" + }, + { + "cmd": "/workflow:lite-execute", + "args": "--in-memory", + "unit": "quick-implementation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Use the plan from previous step to implement code. Execute against in-memory state." + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate test tasks from the implementation session" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "optional": true, + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute test-fix cycle until all tests pass" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/review.json b/.claude/skills/flow-coordinator/templates/review.json new file mode 100644 index 00000000..b29def23 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/review.json @@ -0,0 +1,43 @@ +{ + "name": "review", + "description": "Code review workflow - multi-dimensional review, fix issues, and test validation", + "level": 3, + "steps": [ + { + "cmd": "/workflow:review-session-cycle", + "unit": "code-review", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Perform comprehensive multi-dimensional code review across correctness, security, performance, maintainability dimensions" + }, + { + "cmd": "/workflow:review-cycle-fix", + "unit": "code-review", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Fix all review findings prioritized by severity level (critical → high → medium → low)" + }, + { + "cmd": "/workflow:test-fix-gen", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Generate test tasks for fixed code with coverage analysis" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute iterative test-fix cycle until pass rate >= 95%" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/tdd.json b/.claude/skills/flow-coordinator/templates/tdd.json new file mode 100644 index 00000000..1929ca46 --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/tdd.json @@ -0,0 +1,34 @@ +{ + "name": "tdd", + "description": "Test-driven development - write tests first, implement to pass tests, verify Red-Green-Refactor cycles", + "level": 3, + "steps": [ + { + "cmd": "/workflow:tdd-plan", + "args": "\"{{goal}}\"", + "unit": "tdd-planning-execution", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Create TDD task plan with Red-Green-Refactor cycles, test specifications, and implementation strategy" + }, + { + "cmd": "/workflow:execute", + "unit": "tdd-planning-execution", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute TDD tasks following Red-Green-Refactor workflow with test-first development" + }, + { + "cmd": "/workflow:tdd-verify", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Verify TDD cycle compliance, test coverage, and code quality against Red-Green-Refactor principles" + } + ] +} diff --git a/.claude/skills/flow-coordinator/templates/test-fix.json b/.claude/skills/flow-coordinator/templates/test-fix.json new file mode 100644 index 00000000..79fb539b --- /dev/null +++ b/.claude/skills/flow-coordinator/templates/test-fix.json @@ -0,0 +1,26 @@ +{ + "name": "test-fix", + "description": "Fix failing tests - generate test tasks and execute iterative test-fix cycle", + "level": 2, + "steps": [ + { + "cmd": "/workflow:test-fix-gen", + "args": "\"{{goal}}\"", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "mainprocess" + }, + "contextHint": "Analyze failing tests, generate targeted test tasks with root cause and fix strategy" + }, + { + "cmd": "/workflow:test-cycle-execute", + "unit": "test-validation", + "execution": { + "type": "slash-command", + "mode": "async" + }, + "contextHint": "Execute iterative test-fix cycle with pass rate tracking until >= 95% pass rate achieved" + } + ] +} diff --git a/META_SKILL_SUMMARY.md b/META_SKILL_SUMMARY.md new file mode 100644 index 00000000..453ef108 --- /dev/null +++ b/META_SKILL_SUMMARY.md @@ -0,0 +1,188 @@ +# Meta-Skill Template Update Summary + +## Update Overview + +Successfully updated all 17 meta-skill workflow templates with proper execution configuration and context passing. + +## Critical Correction: CLI Tools vs Slash Commands + +**IMPORTANT**: ALL workflow commands (`/workflow:*`) must use `slash-command` type. + +### Slash Command (workflow commands) +- **Type**: `slash-command` +- **Commands**: ALL `/workflow:*` commands + - Planning: plan, lite-plan, multi-cli-plan, tdd-plan + - Execution: execute, lite-execute + - Testing: test-fix-gen, test-cycle-execute, tdd-verify + - Review: review-session-cycle, review-cycle-fix, review-module-cycle + - Bug fixes: lite-fix, debug-with-file + - Exploration: brainstorm-with-file, brainstorm:auto-parallel, analyze-with-file +- **Modes**: + - `mainprocess`: Blocking, main process execution + - `async`: Background execution via `ccw cli --tool claude --mode write` + +### CLI Tools (for pure analysis/generation) +- **Type**: `cli-tools` +- **When to use**: Only when there's NO specific workflow command +- **Purpose**: Dynamic prompt generation based on task content +- **Tools**: gemini (analysis), qwen (code generation), codex (review) +- **Examples**: + - "Analyze this architecture design and suggest improvements" + - "Generate unit tests for module X with 90% coverage" + - "Review code for security vulnerabilities" + +## Key Changes + +### 1. Schema Enhancement + +All templates now include: +- **`execution`** configuration: + - Type: Always `slash-command` for workflow commands + - Mode: `mainprocess` (blocking) or `async` (background) +- **`contextHint`** field: Natural language instructions for context passing +- **`unit`** field: Groups commands into minimum execution units +- **`args`** field: Command arguments with `{{goal}}` and `{{prev}}` placeholders + +### 2. Execution Patterns + +**Planning (mainprocess)**: +- Interactive planning needs main process +- Examples: plan, lite-plan, tdd-plan, multi-cli-plan + +**Execution (async)**: +- Long-running tasks need background +- Examples: execute, lite-execute, test-cycle-execute + +**Review/Verify (mainprocess)**: +- Needs immediate feedback +- Examples: plan-verify, review-session-cycle, tdd-verify + +**Fix (mainprocess/async)**: +- Simple fixes: mainprocess +- Complex fixes: async +- Examples: lite-fix (mainprocess), review-cycle-fix (mainprocess) + +### 3. Minimum Execution Units + +Preserved atomic command groups from ccw-coordinator.md: + +| Unit | Commands | Purpose | +|------|----------|---------| +| `quick-implementation` | lite-plan → lite-execute | Lightweight implementation | +| `verified-planning-execution` | plan → plan-verify → execute | Full planning with verification | +| `bug-fix` | lite-fix → lite-execute | Bug diagnosis and fix | +| `test-validation` | test-fix-gen → test-cycle-execute | Test generation and validation | +| `code-review` | review-session-cycle → review-cycle-fix | Code review and fixes | +| `tdd-planning-execution` | tdd-plan → execute | Test-driven development | +| `multi-cli-planning` | multi-cli-plan → lite-execute | Multi-perspective planning | +| `issue-workflow` | issue:plan → issue:queue → issue:execute | Issue lifecycle | +| `rapid-to-issue` | lite-plan → convert-to-plan → queue → execute | Bridge lite to issue | +| `brainstorm-to-issue` | from-brainstorm → queue → execute | Bridge brainstorm to issue | + +## Updated Templates + +### Simple Workflows (Level 1-2) + +1. **lite-lite-lite.json** - Ultra-lightweight direct execution +2. **bugfix-hotfix.json** - Urgent production fix (single async step) +3. **rapid.json** - Quick implementation with optional testing +4. **bugfix.json** - Bug fix with diagnosis and testing +5. **test-fix.json** - Fix failing tests workflow +6. **docs.json** - Documentation generation + +### Complex Workflows (Level 3-4) + +7. **tdd.json** - Test-driven development with verification +8. **coupled.json** - Full workflow with review and testing +9. **review.json** - Standalone code review workflow +10. **multi-cli-plan.json** - Multi-perspective planning +11. **full.json** - Comprehensive workflow with brainstorm + +### Exploration Workflows + +12. **brainstorm.json** - Multi-perspective ideation +13. **debug.json** - Hypothesis-driven debugging +14. **analyze.json** - Collaborative analysis + +### Issue Workflows + +15. **issue.json** - Full issue lifecycle +16. **rapid-to-issue.json** - Bridge lite plan to issue +17. **brainstorm-to-issue.json** - Bridge brainstorm to issue + +## Design Principles Applied + +1. **Slash Commands Only**: All workflow commands use `slash-command` type +2. **Minimum Execution Units**: Preserved atomic command groups +3. **Context Flow**: `contextHint` provides natural language guidance +4. **Execution Modes**: + - `mainprocess`: Interactive, needs user feedback + - `async`: Long-running, background execution + +## CLI Tools Usage (Future Extension) + +The `cli-tools` type is reserved for pure analysis/generation tasks WITHOUT specific workflow commands: + +```json +{ + "name": "custom-analysis", + "steps": [ + { + "execution": { + "type": "cli-tools", + "mode": "mainprocess", + "tool": "gemini", + "cliMode": "analysis", + "rule": "analysis-analyze-technical-document" + }, + "contextHint": "Analyze architecture design and provide recommendations" + } + ] +} +``` + +**Note**: This is for future extension only. Current templates use slash commands exclusively. + +## Files Modified + +``` +.claude/skills/meta-skill/templates/ +├── rapid.json ✓ Updated (slash-command only) +├── coupled.json ✓ Updated (slash-command only) +├── bugfix.json ✓ Fixed (removed cli-tools) +├── bugfix-hotfix.json ✓ Updated (slash-command only) +├── tdd.json ✓ Fixed (removed cli-tools) +├── test-fix.json ✓ Updated (slash-command only) +├── review.json ✓ Fixed (removed cli-tools) +├── brainstorm.json ✓ Fixed (removed cli-tools) +├── debug.json ✓ Fixed (removed cli-tools) +├── analyze.json ✓ Fixed (removed cli-tools) +├── issue.json ✓ Updated (slash-command only) +├── multi-cli-plan.json ✓ Fixed (removed cli-tools) +├── docs.json ✓ Updated (slash-command only) +├── full.json ✓ Fixed (removed cli-tools) +├── rapid-to-issue.json ✓ Updated (slash-command only) +├── brainstorm-to-issue.json ✓ Updated (slash-command only) +├── lite-lite-lite.json ✓ Updated (slash-command only) +├── coupled-enhanced.json ✗ Removed (experimental) +└── rapid-cli.json ✗ Removed (experimental) +``` + +## Result + +All 17 templates now correctly use: +- ✅ `slash-command` type exclusively +- ✅ Flexible `mainprocess`/`async` modes +- ✅ Context passing via `contextHint` +- ✅ Minimum execution unit preservation +- ✅ Consistent execution patterns + +## Next Steps + +The meta-skill workflow coordinator can now: +1. Discover templates dynamically via Glob +2. Parse execution configuration from each step +3. Execute slash commands with mainprocess/async modes +4. Pass context between steps using contextHint +5. Maintain minimum execution unit integrity +6. (Future) Support cli-tools for custom analysis tasks