From 95a7f05aa918b25ceb331822b3aa7aea90f307a7 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Thu, 15 Jan 2026 11:19:30 +0800 Subject: [PATCH] Add unified command indices for CCW and CCW-Help with detailed capabilities, flows, and intent rules - Introduced command.json for CCW-Help with 88 commands and 16 agents, covering essential workflows and memory management. - Created command.json for CCW with comprehensive capabilities for exploration, planning, execution, bug fixing, testing, reviewing, and documentation. - Defined complex flows for rapid iteration, full exploration, coupled planning, bug fixing, issue lifecycle management, and more. - Implemented intent rules for bug fixing, issue batch processing, exploration, UI design, TDD, review, and documentation. - Established CLI tools and injection rules to enhance command execution based on context and complexity. --- .claude/commands/workflow/lite-lite-lite.md | 798 +++++++++++++++ .claude/skills/ccw-help/SKILL.md | 153 +-- .claude/skills/ccw-help/command.json | 511 ++++++++++ .claude/skills/ccw-help/index/all-agents.json | 82 -- .../skills/ccw-help/index/all-commands.json | 882 ----------------- .../skills/ccw-help/index/by-category.json | 914 ------------------ .../skills/ccw-help/index/by-use-case.json | 896 ----------------- .../ccw-help/index/command-relationships.json | 160 --- .../ccw-help/index/essential-commands.json | 112 --- .claude/skills/ccw/SKILL.md | 683 ++++++------- .claude/skills/ccw/command.json | 547 +++++++++++ .../ccw/index/command-capabilities.json | 127 --- .claude/skills/ccw/index/intent-rules.json | 165 ---- .claude/skills/ccw/index/workflow-chains.json | 451 --------- .claude/skills/ccw/phases/actions/bugfix.md | 218 ----- .claude/skills/ccw/phases/actions/coupled.md | 194 ---- .claude/skills/ccw/phases/actions/docs.md | 93 -- .claude/skills/ccw/phases/actions/full.md | 154 --- .claude/skills/ccw/phases/actions/issue.md | 335 ------- .claude/skills/ccw/phases/actions/rapid.md | 104 -- .../skills/ccw/phases/actions/review-fix.md | 84 -- .claude/skills/ccw/phases/actions/tdd.md | 66 -- .claude/skills/ccw/phases/actions/ui.md | 79 -- .claude/skills/ccw/phases/orchestrator.md | 689 ------------- .../skills/ccw/specs/intent-classification.md | 336 ------- .claude/skills/ccw/specs/output-templates.md | 258 ----- .../skills/ccw/specs/requirement-analysis.md | 237 ----- .../templates/dashboard-css/04-lite-tasks.css | 744 ++++++++++++++ ccw/src/templates/dashboard-js/i18n.js | 40 + .../dashboard-js/views/api-settings.js | 32 + .../dashboard-js/views/cli-manager.js | 4 + .../dashboard-js/views/lite-tasks.js | 823 +++++++++++++--- package.json | 1 + 33 files changed, 3709 insertions(+), 7263 deletions(-) create mode 100644 .claude/commands/workflow/lite-lite-lite.md create mode 100644 .claude/skills/ccw-help/command.json delete mode 100644 .claude/skills/ccw-help/index/all-agents.json delete mode 100644 .claude/skills/ccw-help/index/all-commands.json delete mode 100644 .claude/skills/ccw-help/index/by-category.json delete mode 100644 .claude/skills/ccw-help/index/by-use-case.json delete mode 100644 .claude/skills/ccw-help/index/command-relationships.json delete mode 100644 .claude/skills/ccw-help/index/essential-commands.json create mode 100644 .claude/skills/ccw/command.json delete mode 100644 .claude/skills/ccw/index/command-capabilities.json delete mode 100644 .claude/skills/ccw/index/intent-rules.json delete mode 100644 .claude/skills/ccw/index/workflow-chains.json delete mode 100644 .claude/skills/ccw/phases/actions/bugfix.md delete mode 100644 .claude/skills/ccw/phases/actions/coupled.md delete mode 100644 .claude/skills/ccw/phases/actions/docs.md delete mode 100644 .claude/skills/ccw/phases/actions/full.md delete mode 100644 .claude/skills/ccw/phases/actions/issue.md delete mode 100644 .claude/skills/ccw/phases/actions/rapid.md delete mode 100644 .claude/skills/ccw/phases/actions/review-fix.md delete mode 100644 .claude/skills/ccw/phases/actions/tdd.md delete mode 100644 .claude/skills/ccw/phases/actions/ui.md delete mode 100644 .claude/skills/ccw/phases/orchestrator.md delete mode 100644 .claude/skills/ccw/specs/intent-classification.md delete mode 100644 .claude/skills/ccw/specs/output-templates.md delete mode 100644 .claude/skills/ccw/specs/requirement-analysis.md diff --git a/.claude/commands/workflow/lite-lite-lite.md b/.claude/commands/workflow/lite-lite-lite.md new file mode 100644 index 00000000..90d1afe6 --- /dev/null +++ b/.claude/commands/workflow/lite-lite-lite.md @@ -0,0 +1,798 @@ +--- +name: workflow:lite-lite-lite +description: Ultra-lightweight multi-tool analysis and direct execution. No artifacts, auto tool selection based on task analysis, user-driven iteration via AskUser. +argument-hint: "" +allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), mcp__ace-tool__search_context(*) +--- + +# Ultra-Lite Multi-Tool Workflow + +## Quick Start + +```bash +# Basic usage +/workflow:lite-lite-lite "Fix the login bug" + +# Complex task +/workflow:lite-lite-lite "Refactor payment module for multi-gateway support" +``` + +**Core Philosophy**: Minimal friction, maximum velocity. No files, no artifacts - just analyze and execute. + +## What & Why + +### Core Concept + +**Zero-artifact workflow**: Clarify requirements → Auto-select tools → Mixed tool analysis → User decision → Direct execution. All state in memory, all decisions via AskUser. + +**vs multi-cli-plan**: +- **multi-cli-plan**: Full artifacts (IMPL_PLAN.md, plan.json, synthesis.json) +- **lite-lite-lite**: No files, direct in-memory flow, immediate execution + +### Value Proposition + +1. **Ultra-Fast**: No file I/O overhead, no session management +2. **Smart Selection**: Auto-select optimal tool combination based on task +3. **Interactive**: Key decisions validated via AskUser +4. **Direct**: Analysis → Execution without intermediate artifacts + +## Execution Flow + +``` +Phase 1: Clarify Requirements + └─ Parse input → AskUser for missing details (if needed) + +Phase 2: Auto-Select Tools + └─ Analyze task → Match to tool strengths → Confirm selection + +Phase 3: Mixed Tool Analysis + └─ Execute selected tools in parallel → Aggregate results + +Phase 4: User Decision + ├─ Present analysis summary + ├─ AskUser: Execute / Refine / Change tools / Cancel + └─ Loop to Phase 3 if refinement needed + +Phase 5: Direct Execution + └─ Execute solution directly (no plan files) +``` + +## Phase Details + +### Phase 1: Clarify Requirements + +**Parse Task Description**: +```javascript +// Extract intent from user input +const taskDescription = $ARGUMENTS + +// Check if clarification needed +if (taskDescription.length < 20 || isAmbiguous(taskDescription)) { + AskUserQuestion({ + questions: [{ + question: "Please provide more details: target files/modules, expected behavior, constraints?", + header: "Details", + options: [ + { label: "I'll provide more", description: "Add more context" }, + { label: "Continue analysis", description: "Let tools explore autonomously" } + ], + multiSelect: false + }] + }) +} +``` + +**Quick ACE Context** (optional, for complex tasks): +```javascript +// Only if task seems to need codebase context +mcp__ace-tool__search_context({ + project_root_path: process.cwd(), + query: `${taskDescription} implementation patterns` +}) +``` + +### Phase 2: Auto-Select Analysis Tools + +**Tool Categories**: + +| Category | Source | Execution | +|----------|--------|-----------| +| **CLI Tools** | cli-tools.json | `ccw cli -p "..." --tool ` | +| **Sub Agents** | Task tool | `Task({ subagent_type: "...", prompt: "..." })` | + +**Task Analysis Dimensions**: +```javascript +function analyzeTask(taskDescription) { + return { + complexity: detectComplexity(taskDescription), // simple, medium, complex + taskType: detectTaskType(taskDescription), // bugfix, feature, refactor, analysis, etc. + domain: detectDomain(taskDescription), // frontend, backend, fullstack + needsExecution: detectExecutionNeed(taskDescription) // analysis-only vs needs-write + } +} +``` + +**CLI Tools** (dynamically loaded from cli-tools.json): + +```javascript +// Load CLI tools from config file +const cliConfig = JSON.parse(Read("~/.claude/cli-tools.json")) +const cliTools = Object.entries(cliConfig.tools) + .filter(([_, config]) => config.enabled) + .map(([name, config]) => ({ + name, + type: 'cli', + tags: config.tags || [], + model: config.primaryModel, + toolType: config.type // builtin, cli-wrapper, api-endpoint + })) +``` + +**Tags** (user-defined in cli-tools.json, no fixed specification): + +Tags are completely user-defined. Users can create any tags that match their workflow needs. + +**Config Example** (cli-tools.json): +```json +{ + "tools": { + "gemini": { + "enabled": true, + "tags": ["architecture", "reasoning", "performance"], + "primaryModel": "gemini-2.5-pro" + }, + "codex": { + "enabled": true, + "tags": ["implementation", "fast"], + "primaryModel": "gpt-5.2" + }, + "qwen": { + "enabled": true, + "tags": ["implementation", "chinese", "documentation"], + "primaryModel": "coder-model" + } + } +} +``` + +**Sub Agents** (predefined, canExecute marks execution capability): + +```javascript +const agents = [ + { name: 'code-developer', type: 'agent', strength: 'Code implementation, test writing', canExecute: true }, + { name: 'Explore', type: 'agent', strength: 'Fast code exploration', canExecute: false }, + { name: 'cli-explore-agent', type: 'agent', strength: 'Dual-source deep analysis', canExecute: false }, + { name: 'cli-discuss-agent', type: 'agent', strength: 'Multi-CLI collaborative verification', canExecute: false }, + { name: 'debug-explore-agent', type: 'agent', strength: 'Hypothesis-driven debugging', canExecute: false }, + { name: 'context-search-agent', type: 'agent', strength: 'Context collection', canExecute: false }, + { name: 'test-fix-agent', type: 'agent', strength: 'Test execution and fixing', canExecute: true }, + { name: 'universal-executor', type: 'agent', strength: 'General multi-step execution', canExecute: true } +] +``` + +| Agent | Strengths | canExecute | +|-------|-----------|------------| +| **code-developer** | Code implementation, test writing, incremental development | ✅ | +| **Explore** | Fast code exploration, file search, pattern discovery | ❌ | +| **cli-explore-agent** | Dual-source analysis (Bash+CLI), read-only exploration | ❌ | +| **cli-discuss-agent** | Multi-CLI collaboration, cross-verification, solution synthesis | ❌ | +| **debug-explore-agent** | Hypothesis-driven debugging, NDJSON logging, iterative verification | ❌ | +| **context-search-agent** | Multi-layer file discovery, dependency analysis, conflict assessment | ❌ | +| **test-fix-agent** | Test execution, failure diagnosis, code fixing | ✅ | +| **universal-executor** | General execution, multi-domain adaptation | ✅ | + +**Three-Step Selection Flow** (CLI → Mode → Agent): + +```javascript +// Step 1: Present CLI options from config (multiSelect for multi-CLI modes) +function getCliDescription(cli) { + return cli.tags.length > 0 ? cli.tags.join(', ') : cli.model || 'general' +} + +const cliOptions = cliTools.map(cli => ({ + label: cli.name, + description: getCliDescription(cli) +})) + +AskUserQuestion({ + questions: [{ + question: "Select CLI tools for analysis (select 1-3 for collaboration modes)", + header: "CLI Tools", + options: cliOptions, + multiSelect: true // Allow multiple selection for collaboration modes + }] +}) +``` + +```javascript +// Step 2: Select Analysis Mode +const analysisModes = [ + { + name: 'parallel', + label: 'Parallel', + description: 'All CLIs analyze simultaneously, aggregate results', + minCLIs: 1, + pattern: 'A || B || C → Aggregate' + }, + { + name: 'sequential', + label: 'Sequential', + description: 'Chain analysis: each CLI builds on previous via --resume', + minCLIs: 2, + pattern: 'A → B(resume A) → C(resume B)' + }, + { + name: 'collaborative', + label: 'Collaborative', + description: 'Multi-round synthesis: CLIs take turns refining analysis', + minCLIs: 2, + pattern: 'A → B(resume A) → A(resume B) → Synthesize' + }, + { + name: 'debate', + label: 'Debate', + description: 'Adversarial: CLI B challenges CLI A findings, A responds', + minCLIs: 2, + pattern: 'A(propose) → B(challenge, resume A) → A(defend, resume B)' + }, + { + name: 'challenge', + label: 'Challenge', + description: 'Stress test: CLI B finds flaws/alternatives in CLI A analysis', + minCLIs: 2, + pattern: 'A(analyze) → B(challenge, resume A) → Evaluate' + } +] + +// Filter modes based on selected CLI count +const availableModes = analysisModes.filter(m => selectedCLIs.length >= m.minCLIs) + +AskUserQuestion({ + questions: [{ + question: "Select analysis mode", + header: "Mode", + options: availableModes.map(m => ({ + label: m.label, + description: `${m.description} [${m.pattern}]` + })), + multiSelect: false + }] +}) +``` + +```javascript +// Step 3: Present Agent options for execution +const agentOptions = agents.map(agent => ({ + label: agent.name, + description: agent.strength +})) + +AskUserQuestion({ + questions: [{ + question: "Select Sub Agent for execution", + header: "Agent", + options: agentOptions, + multiSelect: false + }] +}) +``` + +**Selection Summary**: +```javascript +console.log(` +## Selected Configuration + +**CLI Tools**: ${selectedCLIs.map(c => c.name).join(' → ')} +**Analysis Mode**: ${selectedMode.label} - ${selectedMode.pattern} +**Execution Agent**: ${selectedAgent.name} - ${selectedAgent.strength} + +> Mode determines how CLIs collaborate, Agent handles final execution +`) + +AskUserQuestion({ + questions: [{ + question: "Confirm selection?", + header: "Confirm", + options: [ + { label: "Confirm and continue", description: `${selectedMode.label} mode with ${selectedCLIs.length} CLIs` }, + { label: "Re-select CLIs", description: "Choose different CLI tools" }, + { label: "Re-select Mode", description: "Choose different analysis mode" }, + { label: "Re-select Agent", description: "Choose different Sub Agent" } + ], + multiSelect: false + }] +}) +``` + +### Phase 3: Multi-Mode Analysis + +**Mode-Specific Execution Patterns**: + +#### Mode 1: Parallel (并行) +```javascript +// All CLIs run simultaneously, no resume dependency +async function executeParallel(clis, taskDescription) { + const promises = clis.map(cli => Bash({ + command: `ccw cli -p " +PURPOSE: Analyze and provide solution for: ${taskDescription} +TASK: • Identify affected files • Analyze implementation approach • List specific changes needed +MODE: analysis +CONTEXT: @**/* +EXPECTED: Concise analysis with: 1) Root cause/approach 2) Files to modify 3) Key changes 4) Risks +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Focus on actionable insights +" --tool ${cli.name} --mode analysis`, + run_in_background: true + })) + + return await Promise.all(promises) +} +``` + +#### Mode 2: Sequential (串联) +```javascript +// Chain analysis: each CLI builds on previous via --resume +async function executeSequential(clis, taskDescription) { + const results = [] + let previousSessionId = null + + for (const cli of clis) { + const resumeFlag = previousSessionId ? `--resume ${previousSessionId}` : '' + + const result = await Bash({ + command: `ccw cli -p " +PURPOSE: ${previousSessionId ? 'Build on previous analysis and deepen' : 'Initial analysis'}: ${taskDescription} +TASK: • ${previousSessionId ? 'Review previous findings • Extend analysis • Add new insights' : 'Identify affected files • Analyze implementation approach'} +MODE: analysis +CONTEXT: @**/* +EXPECTED: ${previousSessionId ? 'Extended analysis building on previous findings' : 'Initial analysis with root cause and approach'} +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | ${previousSessionId ? 'Build incrementally, avoid repetition' : 'Focus on actionable insights'} +" --tool ${cli.name} --mode analysis ${resumeFlag}`, + run_in_background: false + }) + + results.push(result) + previousSessionId = extractSessionId(result) // Extract session ID for next iteration + } + + return results +} +``` + +#### Mode 3: Collaborative (协同) +```javascript +// Multi-round synthesis: CLIs take turns refining analysis +async function executeCollaborative(clis, taskDescription, rounds = 2) { + const results = [] + let previousSessionId = null + + for (let round = 0; round < rounds; round++) { + for (const cli of clis) { + const resumeFlag = previousSessionId ? `--resume ${previousSessionId}` : '' + const roundContext = round === 0 ? 'Initial analysis' : `Round ${round + 1}: Refine and synthesize` + + const result = await Bash({ + command: `ccw cli -p " +PURPOSE: ${roundContext} for: ${taskDescription} +TASK: • ${round === 0 ? 'Initial analysis of the problem' : 'Review previous analysis • Identify gaps • Add complementary insights • Synthesize findings'} +MODE: analysis +CONTEXT: @**/* +EXPECTED: ${round === 0 ? 'Foundational analysis' : 'Refined synthesis with new perspectives'} +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | ${round === 0 ? 'Be thorough' : 'Build collaboratively, add value not repetition'} +" --tool ${cli.name} --mode analysis ${resumeFlag}`, + run_in_background: false + }) + + results.push({ cli: cli.name, round, result }) + previousSessionId = extractSessionId(result) + } + } + + return results +} +``` + +#### Mode 4: Debate (辩论) +```javascript +// Adversarial: CLI B challenges CLI A findings, A responds +async function executeDebate(clis, taskDescription) { + const [cliA, cliB] = clis + const results = [] + + // Step 1: CLI A proposes initial analysis + const proposeResult = await Bash({ + command: `ccw cli -p " +PURPOSE: Propose comprehensive analysis for: ${taskDescription} +TASK: • Analyze problem thoroughly • Propose solution approach • Identify implementation details • State assumptions clearly +MODE: analysis +CONTEXT: @**/* +EXPECTED: Well-reasoned proposal with clear assumptions and trade-offs stated +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Be clear about assumptions and trade-offs +" --tool ${cliA.name} --mode analysis`, + run_in_background: false + }) + results.push({ phase: 'propose', cli: cliA.name, result: proposeResult }) + const proposeSessionId = extractSessionId(proposeResult) + + // Step 2: CLI B challenges the proposal + const challengeResult = await Bash({ + command: `ccw cli -p " +PURPOSE: Challenge and stress-test the previous analysis for: ${taskDescription} +TASK: • Identify weaknesses in proposed approach • Question assumptions • Suggest alternative approaches • Highlight potential risks overlooked +MODE: analysis +CONTEXT: @**/* +EXPECTED: Constructive critique with specific counter-arguments and alternatives +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Be adversarial but constructive, focus on improving the solution +" --tool ${cliB.name} --mode analysis --resume ${proposeSessionId}`, + run_in_background: false + }) + results.push({ phase: 'challenge', cli: cliB.name, result: challengeResult }) + const challengeSessionId = extractSessionId(challengeResult) + + // Step 3: CLI A defends and refines + const defendResult = await Bash({ + command: `ccw cli -p " +PURPOSE: Respond to challenges and refine analysis for: ${taskDescription} +TASK: • Address each challenge point • Defend valid aspects • Acknowledge valid criticisms • Propose refined solution incorporating feedback +MODE: analysis +CONTEXT: @**/* +EXPECTED: Refined proposal that addresses criticisms and incorporates valid alternatives +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Be open to valid criticism, synthesize best ideas +" --tool ${cliA.name} --mode analysis --resume ${challengeSessionId}`, + run_in_background: false + }) + results.push({ phase: 'defend', cli: cliA.name, result: defendResult }) + + return results +} +``` + +#### Mode 5: Challenge (挑战) +```javascript +// Stress test: CLI B finds flaws/alternatives in CLI A analysis +async function executeChallenge(clis, taskDescription) { + const [cliA, cliB] = clis + const results = [] + + // Step 1: CLI A provides initial analysis + const analyzeResult = await Bash({ + command: `ccw cli -p " +PURPOSE: Provide comprehensive analysis for: ${taskDescription} +TASK: • Deep analysis of problem space • Propose implementation approach • List specific changes • Identify risks +MODE: analysis +CONTEXT: @**/* +EXPECTED: Thorough analysis with clear reasoning +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Be thorough and explicit about reasoning +" --tool ${cliA.name} --mode analysis`, + run_in_background: false + }) + results.push({ phase: 'analyze', cli: cliA.name, result: analyzeResult }) + const analyzeSessionId = extractSessionId(analyzeResult) + + // Step 2: CLI B challenges with focus on finding flaws + const challengeResult = await Bash({ + command: `ccw cli -p " +PURPOSE: Stress-test and find weaknesses in the analysis for: ${taskDescription} +TASK: • Find logical flaws in reasoning • Identify missed edge cases • Propose better alternatives • Rate confidence in each criticism (High/Medium/Low) +MODE: analysis +CONTEXT: @**/* +EXPECTED: Detailed critique with severity ratings: [CRITICAL] [HIGH] [MEDIUM] [LOW] for each issue found +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Be ruthlessly critical, find every possible flaw +" --tool ${cliB.name} --mode analysis --resume ${analyzeSessionId}`, + run_in_background: false + }) + results.push({ phase: 'challenge', cli: cliB.name, result: challengeResult }) + + return results +} +``` + +**Mode Router**: +```javascript +async function executeAnalysis(mode, clis, taskDescription) { + switch (mode.name) { + case 'parallel': + return await executeParallel(clis, taskDescription) + case 'sequential': + return await executeSequential(clis, taskDescription) + case 'collaborative': + return await executeCollaborative(clis, taskDescription) + case 'debate': + return await executeDebate(clis, taskDescription) + case 'challenge': + return await executeChallenge(clis, taskDescription) + default: + return await executeParallel(clis, taskDescription) + } +} + +// Execute based on selected mode +const analysisResults = await executeAnalysis(selectedMode, selectedCLIs, taskDescription) +``` + +**Result Aggregation** (mode-aware): +```javascript +function aggregateResults(mode, results) { + const base = { + mode: mode.name, + pattern: mode.pattern, + tools_used: results.map(r => r.cli || 'unknown') + } + + switch (mode.name) { + case 'parallel': + return { + ...base, + findings: results.map(r => parseOutput(r)), + consensus: findCommonPoints(results), + divergences: findDifferences(results) + } + + case 'sequential': + return { + ...base, + evolution: results.map((r, i) => ({ step: i + 1, analysis: parseOutput(r) })), + finalAnalysis: parseOutput(results[results.length - 1]) + } + + case 'collaborative': + return { + ...base, + rounds: groupByRound(results), + synthesis: extractSynthesis(results[results.length - 1]) + } + + case 'debate': + return { + ...base, + proposal: parseOutput(results.find(r => r.phase === 'propose')?.result), + challenges: parseOutput(results.find(r => r.phase === 'challenge')?.result), + resolution: parseOutput(results.find(r => r.phase === 'defend')?.result), + confidence: calculateDebateConfidence(results) + } + + case 'challenge': + return { + ...base, + originalAnalysis: parseOutput(results.find(r => r.phase === 'analyze')?.result), + critiques: parseCritiques(results.find(r => r.phase === 'challenge')?.result), + riskScore: calculateRiskScore(results) + } + } +} + +const aggregatedAnalysis = aggregateResults(selectedMode, analysisResults) +``` + +### Phase 4: User Decision + +**Present Mode-Specific Summary**: + +```javascript +function presentSummary(aggregatedAnalysis) { + const { mode, pattern } = aggregatedAnalysis + + console.log(` +## Analysis Result Summary + +**Mode**: ${mode} (${pattern}) +**Tools**: ${aggregatedAnalysis.tools_used.join(' → ')} +`) + + switch (mode) { + case 'parallel': + console.log(` +### Consensus Points +${aggregatedAnalysis.consensus.map(c => `- ${c}`).join('\n')} + +### Divergence Points +${aggregatedAnalysis.divergences.map(d => `- ${d}`).join('\n')} +`) + break + + case 'sequential': + console.log(` +### Analysis Evolution +${aggregatedAnalysis.evolution.map(e => `**Step ${e.step}**: ${e.analysis.summary}`).join('\n')} + +### Final Analysis +${aggregatedAnalysis.finalAnalysis.summary} +`) + break + + case 'collaborative': + console.log(` +### Collaboration Rounds +${Object.entries(aggregatedAnalysis.rounds).map(([round, analyses]) => + `**Round ${round}**: ${analyses.map(a => a.cli).join(' + ')}` +).join('\n')} + +### Synthesized Result +${aggregatedAnalysis.synthesis} +`) + break + + case 'debate': + console.log(` +### Debate Summary +**Proposal**: ${aggregatedAnalysis.proposal.summary} +**Challenges**: ${aggregatedAnalysis.challenges.points?.length || 0} points raised +**Resolution**: ${aggregatedAnalysis.resolution.summary} +**Confidence**: ${aggregatedAnalysis.confidence}% +`) + break + + case 'challenge': + console.log(` +### Challenge Summary +**Original Analysis**: ${aggregatedAnalysis.originalAnalysis.summary} +**Critiques Found**: ${aggregatedAnalysis.critiques.length} issues +${aggregatedAnalysis.critiques.map(c => `- [${c.severity}] ${c.description}`).join('\n')} +**Risk Score**: ${aggregatedAnalysis.riskScore}/100 +`) + break + } +} + +presentSummary(aggregatedAnalysis) +``` + +**Decision Options**: +```javascript +AskUserQuestion({ + questions: [{ + question: "How to proceed?", + header: "Next Step", + options: [ + { label: "Execute directly", description: "Implement immediately based on analysis" }, + { label: "Refine analysis", description: "Provide more constraints, re-analyze" }, + { label: "Change tools", description: "Select different tool combination" }, + { label: "Cancel", description: "End current workflow" } + ], + multiSelect: false + }] +}) +``` + +**Routing Logic**: +- **Execute directly** → Phase 5 +- **Refine analysis** → Collect feedback, return to Phase 3 +- **Change tools** → Return to Phase 2 +- **Cancel** → End workflow + +### Phase 5: Direct Execution + +**No Artifacts - Direct Implementation**: +```javascript +// Use the aggregated analysis directly +// No IMPL_PLAN.md, no plan.json, no session files + +console.log("Starting direct execution based on analysis...") + +// Execution-capable agents (canExecute: true) +const executionAgents = agents.filter(a => a.canExecute) + +// Select execution tool: prefer execution-capable agent, fallback to CLI +const executionTool = selectedTools.find(t => + t.type === 'agent' && executionAgents.some(ea => ea.name === t.name) +) || selectedTools.find(t => t.type === 'cli') + +if (executionTool.type === 'agent') { + // Use Agent for execution (preferred if available) + Task({ + subagent_type: executionTool.name, + run_in_background: false, + description: `Execute: ${taskDescription.slice(0, 30)}`, + prompt: ` +## Task +${taskDescription} + +## Analysis Results (from previous tools) +${JSON.stringify(aggregatedAnalysis, null, 2)} + +## Instructions +Based on the analysis above, implement the solution: +1. Apply changes to identified files +2. Follow the recommended approach +3. Handle identified risks +4. Verify changes work correctly +` + }) +} else { + // Use CLI with write mode + Bash({ + command: `ccw cli -p " +PURPOSE: Implement the solution based on analysis: ${taskDescription} +TASK: ${extractedTasks.join(' • ')} +MODE: write +CONTEXT: @${affectedFiles.join(' @')} +EXPECTED: Working implementation with all changes applied +RULES: $(cat ~/.claude/workflows/cli-templates/protocols/write-protocol.md) | Apply analysis findings directly +" --tool ${executionTool.name} --mode write`, + run_in_background: false + }) +} +``` + +## TodoWrite Structure + +```javascript +TodoWrite({ todos: [ + { content: "Phase 1: Clarify requirements", status: "in_progress", activeForm: "Clarifying requirements" }, + { content: "Phase 2: Auto-select tools", status: "pending", activeForm: "Analyzing task" }, + { content: "Phase 3: Mixed tool analysis", status: "pending", activeForm: "Running analysis" }, + { content: "Phase 4: User decision", status: "pending", activeForm: "Awaiting decision" }, + { content: "Phase 5: Direct execution", status: "pending", activeForm: "Executing implementation" } +]}) +``` + +## Iteration Patterns + +### Pattern A: Direct Path (Most Common) +``` +Phase 1 → Phase 2 (auto) → Phase 3 → Phase 4 (execute) → Phase 5 +``` + +### Pattern B: Refinement Loop +``` +Phase 3 → Phase 4 (refine) → Phase 3 → Phase 4 → Phase 5 +``` + +### Pattern C: Tool Adjustment +``` +Phase 2 (adjust) → Phase 3 → Phase 4 → Phase 5 +``` + +## Error Handling + +| Error | Resolution | +|-------|------------| +| CLI timeout | Retry with secondary model | +| No enabled tools | Load cli-tools.json, ask user to enable tools | +| Task type unclear | Default to first available CLI + code-developer | +| Ambiguous task | Force clarification via AskUser | +| Execution fails | Present error, ask user for direction | + +## Analysis Modes Reference + +| Mode | Pattern | Use Case | CLI Count | +|------|---------|----------|-----------| +| **Parallel** | `A \|\| B \|\| C → Aggregate` | Fast multi-perspective analysis | 1+ | +| **Sequential** | `A → B(resume) → C(resume)` | Deep incremental analysis | 2+ | +| **Collaborative** | `A → B → A → B → Synthesize` | Multi-round refinement | 2+ | +| **Debate** | `A(propose) → B(challenge) → A(defend)` | Stress-test solutions | 2 | +| **Challenge** | `A(analyze) → B(challenge)` | Find flaws and risks | 2 | + +## Comparison + +| Aspect | lite-lite-lite | multi-cli-plan | +|--------|----------------|----------------| +| **Artifacts** | None | IMPL_PLAN.md, plan.json, synthesis.json | +| **Session** | Stateless (uses --resume for chaining) | Persistent session folder | +| **Tool Selection** | Multi-CLI + Agent via 3-step selection | Config-driven with fixed tools | +| **Analysis Modes** | 5 modes (parallel/sequential/collaborative/debate/challenge) | Fixed synthesis rounds | +| **CLI Collaboration** | Auto --resume chaining | Manual session management | +| **Iteration** | Via AskUser | Via rounds/synthesis | +| **Execution** | Direct | Via lite-execute | +| **Best For** | Quick analysis, adversarial validation, rapid iteration | Complex multi-step implementations | + +## Best Practices + +1. **Be Specific**: Clear task description improves auto-selection accuracy +2. **Trust Auto-Selection**: Algorithm matches task type to tool strengths +3. **Adjust When Needed**: Use "Adjust tools" if auto-selection doesn't fit +4. **Trust Consensus**: When tools agree, confidence is high +5. **Iterate Fast**: Use refinement loop for complex requirements +6. **Direct is Fast**: Skip artifacts when task is straightforward + +## Related Commands + +```bash +# Full planning workflow +/workflow:multi-cli-plan "complex task" + +# Single CLI planning +/workflow:lite-plan "task" + +# Direct execution +/workflow:lite-execute --in-memory +``` diff --git a/.claude/skills/ccw-help/SKILL.md b/.claude/skills/ccw-help/SKILL.md index b2476e96..2166f5ba 100644 --- a/.claude/skills/ccw-help/SKILL.md +++ b/.claude/skills/ccw-help/SKILL.md @@ -1,139 +1,86 @@ --- name: ccw-help -description: Workflow command guide for Claude Code Workflow (78 commands). Search/browse commands, get next-step recommendations, view documentation, report issues. Triggers "CCW-help", "CCW-issue", "ccw-help", "ccw-issue", "ccw" +description: CCW command help system. Search, browse, recommend commands. Triggers "ccw-help", "ccw-issue". allowed-tools: Read, Grep, Glob, AskUserQuestion -version: 6.0.0 +version: 7.0.0 --- # CCW-Help Skill -CCW 命令帮助系统,提供命令搜索、推荐、文档查看和问题报告功能。 +CCW 命令帮助系统,提供命令搜索、推荐、文档查看功能。 ## Trigger Conditions -- 关键词: "CCW-help", "CCW-issue", "ccw-help", "ccw-issue", "帮助", "命令", "怎么用" -- 场景: 用户询问命令用法、搜索命令、请求下一步建议、报告问题 - -## Execution Flow - -```mermaid -graph TD - A[User Query] --> B{Intent Classification} - B -->|搜索| C[Command Search] - B -->|推荐| D[Smart Recommendations] - B -->|文档| E[Documentation] - B -->|新手| F[Onboarding] - B -->|问题| G[Issue Reporting] - B -->|分析| H[Deep Analysis] - - C --> I[Query Index] - D --> J[Query Relationships] - E --> K[Read Source File] - F --> L[Essential Commands] - G --> M[Generate Template] - H --> N[CLI Analysis] - - I & J & K & L & M & N --> O[Synthesize Response] -``` +- 关键词: "ccw-help", "ccw-issue", "帮助", "命令", "怎么用" +- 场景: 询问命令用法、搜索命令、请求下一步建议 ## Operation Modes -### Mode 1: Command Search 🔍 +### Mode 1: Command Search -**Triggers**: "搜索命令", "find command", "planning 相关", "search" +**Triggers**: "搜索命令", "find command", "search" **Process**: -1. Query `index/all-commands.json` or `index/by-category.json` -2. Filter and rank results based on user context -3. Present top 3-5 relevant commands with usage hints +1. Query `command.json` commands array +2. Filter by name, description, category +3. Present top 3-5 relevant commands -### Mode 2: Smart Recommendations 🤖 +### Mode 2: Smart Recommendations -**Triggers**: "下一步", "what's next", "after /workflow:plan", "推荐" +**Triggers**: "下一步", "what's next", "推荐" **Process**: -1. Query `index/command-relationships.json` -2. Evaluate context and prioritize recommendations -3. Explain WHY each recommendation fits +1. Query command's `flow.next_steps` in `command.json` +2. Explain WHY each recommendation fits -### Mode 3: Full Documentation 📖 +### Mode 3: Documentation -**Triggers**: "参数说明", "怎么用", "how to use", "详情" +**Triggers**: "怎么用", "how to use", "详情" **Process**: -1. Locate command in index -2. Read source file via `source` path (e.g., `commands/workflow/lite-plan.md`) -3. Extract relevant sections and provide context-specific examples +1. Locate command in `command.json` +2. Read source file via `source` path +3. Provide context-specific examples -### Mode 4: Beginner Onboarding 🎓 +### Mode 4: Beginner Onboarding -**Triggers**: "新手", "getting started", "如何开始", "常用命令" +**Triggers**: "新手", "getting started", "常用命令" **Process**: -1. Query `index/essential-commands.json` -2. Assess project stage (从0到1 vs 功能新增) -3. Guide appropriate workflow entry point +1. Query `essential_commands` array +2. Guide appropriate workflow entry point -### Mode 5: Issue Reporting 📝 +### Mode 5: Issue Reporting -**Triggers**: "CCW-issue", "报告 bug", "功能建议", "问题咨询" +**Triggers**: "ccw-issue", "报告 bug" **Process**: 1. Use AskUserQuestion to gather context 2. Generate structured issue template -3. Provide actionable next steps -### Mode 6: Deep Analysis 🔬 +## Data Source -**Triggers**: "详细说明", "命令原理", "agent 如何工作", "实现细节" +Single source of truth: **[command.json](command.json)** -**Process**: -1. Read source documentation directly -2. For complex queries, use CLI for multi-file analysis: - ```bash - ccw cli -p "PURPOSE: Analyze command documentation..." --tool gemini --mode analysis --cd ~/.claude - ``` - -## Index Files - -CCW-Help 使用 JSON 索引实现快速查询(无 reference 文件夹,直接引用源文件): - -| 文件 | 内容 | 用途 | -|------|------|------| -| `index/all-commands.json` | 完整命令目录 | 关键词搜索 | -| `index/all-agents.json` | 完整 Agent 目录 | Agent 查询 | -| `index/by-category.json` | 按类别分组 | 分类浏览 | -| `index/by-use-case.json` | 按场景分组 | 场景推荐 | -| `index/essential-commands.json` | 核心命令 | 新手引导 | -| `index/command-relationships.json` | 命令关系 | 下一步推荐 | +| Field | Purpose | +|-------|---------| +| `commands[]` | Flat command list with metadata | +| `commands[].flow` | Relationships (next_steps, prerequisites) | +| `commands[].essential` | Essential flag for onboarding | +| `agents[]` | Agent directory | +| `essential_commands[]` | Core commands list | ### Source Path Format -索引中的 `source` 字段是从 `index/` 目录的相对路径(先向上再定位): +`source` 字段是相对路径(从 `skills/ccw-help/` 目录): ```json { - "name": "workflow:lite-plan", + "name": "lite-plan", "source": "../../../commands/workflow/lite-plan.md" } ``` -路径结构: `index/` → `ccw-help/` → `skills/` → `.claude/` → `commands/...` - -## Configuration - -| 参数 | 默认值 | 说明 | -|------|--------|------| -| max_results | 5 | 搜索返回最大结果数 | -| show_source | true | 是否显示源文件路径 | - -## CLI Integration - -| 场景 | CLI Hint | 用途 | -|------|----------|------| -| 复杂查询 | `gemini --mode analysis` | 多文件分析对比 | -| 文档生成 | - | 直接读取源文件 | - ## Slash Commands ```bash @@ -145,33 +92,25 @@ CCW-Help 使用 JSON 索引实现快速查询(无 reference 文件夹,直接 ## Maintenance -### 更新索引 +### Update Index ```bash cd D:/Claude_dms3/.claude/skills/ccw-help python scripts/analyze_commands.py ``` -脚本功能: -1. 扫描 `commands/` 和 `agents/` 目录 -2. 提取 YAML frontmatter 元数据 -3. 生成相对路径引用(无 reference 复制) -4. 重建所有索引文件 +脚本功能:扫描 commands/ 和 agents/ 目录,生成统一的 command.json -## System Statistics +## Statistics -- **Commands**: 78 -- **Agents**: 14 -- **Categories**: 5 (workflow, cli, memory, task, general) -- **Essential**: 14 核心命令 +- **Commands**: 88+ +- **Agents**: 16 +- **Essential**: 10 核心命令 ## Core Principle -**⚠️ 智能整合,非模板复制** +**智能整合,非模板复制** -- ✅ 理解用户具体情况 -- ✅ 整合多个来源信息 -- ✅ 定制示例和说明 -- ✅ 提供渐进式深度 -- ❌ 原样复制文档 -- ❌ 返回未处理的 JSON +- 理解用户具体情况 +- 整合多个来源信息 +- 定制示例和说明 diff --git a/.claude/skills/ccw-help/command.json b/.claude/skills/ccw-help/command.json new file mode 100644 index 00000000..876422e7 --- /dev/null +++ b/.claude/skills/ccw-help/command.json @@ -0,0 +1,511 @@ +{ + "_metadata": { + "version": "2.0.0", + "total_commands": 88, + "total_agents": 16, + "description": "Unified CCW-Help command index" + }, + + "essential_commands": [ + "/workflow:lite-plan", + "/workflow:lite-fix", + "/workflow:plan", + "/workflow:execute", + "/workflow:session:start", + "/workflow:review-session-cycle", + "/memory:docs", + "/workflow:brainstorm:artifacts", + "/workflow:action-plan-verify", + "/version" + ], + + "commands": [ + { + "name": "lite-plan", + "command": "/workflow:lite-plan", + "description": "Lightweight interactive planning with in-memory plan, dispatches to lite-execute", + "arguments": "[-e|--explore] \"task\"|file.md", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "next_steps": ["/workflow:lite-execute"], + "alternatives": ["/workflow:plan"] + }, + "source": "../../../commands/workflow/lite-plan.md" + }, + { + "name": "lite-execute", + "command": "/workflow:lite-execute", + "description": "Execute based on in-memory plan or prompt", + "arguments": "[--in-memory] \"task\"|file-path", + "category": "workflow", + "difficulty": "Intermediate", + "flow": { + "prerequisites": ["/workflow:lite-plan", "/workflow:lite-fix"] + }, + "source": "../../../commands/workflow/lite-execute.md" + }, + { + "name": "lite-fix", + "command": "/workflow:lite-fix", + "description": "Lightweight bug diagnosis and fix with optional hotfix mode", + "arguments": "[--hotfix] \"bug description\"", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "next_steps": ["/workflow:lite-execute"], + "alternatives": ["/workflow:lite-plan"] + }, + "source": "../../../commands/workflow/lite-fix.md" + }, + { + "name": "plan", + "command": "/workflow:plan", + "description": "5-phase planning with task JSON generation", + "arguments": "\"description\"|file.md", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "next_steps": ["/workflow:action-plan-verify", "/workflow:execute"], + "alternatives": ["/workflow:tdd-plan"] + }, + "source": "../../../commands/workflow/plan.md" + }, + { + "name": "execute", + "command": "/workflow:execute", + "description": "Coordinate agent execution with DAG parallel processing", + "arguments": "[--resume-session=\"session-id\"]", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "prerequisites": ["/workflow:plan", "/workflow:tdd-plan"], + "next_steps": ["/workflow:review"] + }, + "source": "../../../commands/workflow/execute.md" + }, + { + "name": "action-plan-verify", + "command": "/workflow:action-plan-verify", + "description": "Cross-artifact consistency analysis", + "arguments": "[--session session-id]", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "prerequisites": ["/workflow:plan"], + "next_steps": ["/workflow:execute"] + }, + "source": "../../../commands/workflow/action-plan-verify.md" + }, + { + "name": "init", + "command": "/workflow:init", + "description": "Initialize project-level state", + "arguments": "[--regenerate]", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/init.md" + }, + { + "name": "clean", + "command": "/workflow:clean", + "description": "Intelligent code cleanup with stale artifact discovery", + "arguments": "[--dry-run] [\"focus\"]", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/clean.md" + }, + { + "name": "debug", + "command": "/workflow:debug", + "description": "Hypothesis-driven debugging with NDJSON logging", + "arguments": "\"bug description\"", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/debug.md" + }, + { + "name": "replan", + "command": "/workflow:replan", + "description": "Interactive workflow replanning", + "arguments": "[--session id] [task-id] \"requirements\"", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/replan.md" + }, + { + "name": "session:start", + "command": "/workflow:session:start", + "description": "Start or discover workflow sessions", + "arguments": "[--type ] [--auto|--new]", + "category": "workflow", + "subcategory": "session", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "next_steps": ["/workflow:plan", "/workflow:execute"] + }, + "source": "../../../commands/workflow/session/start.md" + }, + { + "name": "session:list", + "command": "/workflow:session:list", + "description": "List all workflow sessions", + "arguments": "", + "category": "workflow", + "subcategory": "session", + "difficulty": "Beginner", + "source": "../../../commands/workflow/session/list.md" + }, + { + "name": "session:resume", + "command": "/workflow:session:resume", + "description": "Resume paused workflow session", + "arguments": "", + "category": "workflow", + "subcategory": "session", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/session/resume.md" + }, + { + "name": "session:complete", + "command": "/workflow:session:complete", + "description": "Mark session complete and archive", + "arguments": "", + "category": "workflow", + "subcategory": "session", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/session/complete.md" + }, + { + "name": "brainstorm:auto-parallel", + "command": "/workflow:brainstorm:auto-parallel", + "description": "Parallel brainstorming with multi-role analysis", + "arguments": "\"topic\" [--count N]", + "category": "workflow", + "subcategory": "brainstorm", + "difficulty": "Advanced", + "source": "../../../commands/workflow/brainstorm/auto-parallel.md" + }, + { + "name": "brainstorm:artifacts", + "command": "/workflow:brainstorm:artifacts", + "description": "Interactive clarification with guidance specification", + "arguments": "\"topic\" [--count N]", + "category": "workflow", + "subcategory": "brainstorm", + "difficulty": "Intermediate", + "essential": true, + "source": "../../../commands/workflow/brainstorm/artifacts.md" + }, + { + "name": "brainstorm:synthesis", + "command": "/workflow:brainstorm:synthesis", + "description": "Refine role analyses through Q&A", + "arguments": "[--session session-id]", + "category": "workflow", + "subcategory": "brainstorm", + "difficulty": "Advanced", + "source": "../../../commands/workflow/brainstorm/synthesis.md" + }, + { + "name": "tdd-plan", + "command": "/workflow:tdd-plan", + "description": "TDD planning with Red-Green-Refactor cycles", + "arguments": "\"feature\"|file.md", + "category": "workflow", + "difficulty": "Advanced", + "flow": { + "next_steps": ["/workflow:execute", "/workflow:tdd-verify"], + "alternatives": ["/workflow:plan"] + }, + "source": "../../../commands/workflow/tdd-plan.md" + }, + { + "name": "tdd-verify", + "command": "/workflow:tdd-verify", + "description": "Verify TDD compliance with coverage analysis", + "arguments": "[session-id]", + "category": "workflow", + "difficulty": "Advanced", + "flow": { + "prerequisites": ["/workflow:execute"] + }, + "source": "../../../commands/workflow/tdd-verify.md" + }, + { + "name": "review", + "command": "/workflow:review", + "description": "Post-implementation review (security/architecture/quality)", + "arguments": "[--type=] [session-id]", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/review.md" + }, + { + "name": "review-session-cycle", + "command": "/workflow:review-session-cycle", + "description": "Multi-dimensional code review across 7 dimensions", + "arguments": "[session-id] [--dimensions=...]", + "category": "workflow", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "prerequisites": ["/workflow:execute"], + "next_steps": ["/workflow:review-fix"] + }, + "source": "../../../commands/workflow/review-session-cycle.md" + }, + { + "name": "review-module-cycle", + "command": "/workflow:review-module-cycle", + "description": "Module-based multi-dimensional review", + "arguments": " [--dimensions=...]", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/review-module-cycle.md" + }, + { + "name": "review-fix", + "command": "/workflow:review-fix", + "description": "Automated fixing of review findings", + "arguments": "", + "category": "workflow", + "difficulty": "Intermediate", + "flow": { + "prerequisites": ["/workflow:review-session-cycle", "/workflow:review-module-cycle"] + }, + "source": "../../../commands/workflow/review-fix.md" + }, + { + "name": "test-gen", + "command": "/workflow:test-gen", + "description": "Generate test session from implementation", + "arguments": "source-session-id", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/test-gen.md" + }, + { + "name": "test-fix-gen", + "command": "/workflow:test-fix-gen", + "description": "Create test-fix session with strategy", + "arguments": "session-id|\"description\"|file", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/test-fix-gen.md" + }, + { + "name": "test-cycle-execute", + "command": "/workflow:test-cycle-execute", + "description": "Execute test-fix with iterative cycles", + "arguments": "[--resume-session=id] [--max-iterations=N]", + "category": "workflow", + "difficulty": "Intermediate", + "source": "../../../commands/workflow/test-cycle-execute.md" + }, + { + "name": "issue:new", + "command": "/issue:new", + "description": "Create issue from GitHub URL or text", + "arguments": " [--priority 1-5]", + "category": "issue", + "difficulty": "Intermediate", + "source": "../../../commands/issue/new.md" + }, + { + "name": "issue:discover", + "command": "/issue:discover", + "description": "Discover issues from multiple perspectives", + "arguments": " [--perspectives=...]", + "category": "issue", + "difficulty": "Intermediate", + "source": "../../../commands/issue/discover.md" + }, + { + "name": "issue:plan", + "command": "/issue:plan", + "description": "Batch plan issue resolution", + "arguments": "--all-pending|", + "category": "issue", + "difficulty": "Intermediate", + "flow": { + "next_steps": ["/issue:queue"] + }, + "source": "../../../commands/issue/plan.md" + }, + { + "name": "issue:queue", + "command": "/issue:queue", + "description": "Form execution queue from solutions", + "arguments": "[--rebuild]", + "category": "issue", + "difficulty": "Intermediate", + "flow": { + "prerequisites": ["/issue:plan"], + "next_steps": ["/issue:execute"] + }, + "source": "../../../commands/issue/queue.md" + }, + { + "name": "issue:execute", + "command": "/issue:execute", + "description": "Execute queue with DAG parallel", + "arguments": "[--worktree]", + "category": "issue", + "difficulty": "Intermediate", + "flow": { + "prerequisites": ["/issue:queue"] + }, + "source": "../../../commands/issue/execute.md" + }, + { + "name": "docs", + "command": "/memory:docs", + "description": "Plan documentation workflow", + "arguments": "[path] [--tool ]", + "category": "memory", + "difficulty": "Intermediate", + "essential": true, + "flow": { + "next_steps": ["/workflow:execute"] + }, + "source": "../../../commands/memory/docs.md" + }, + { + "name": "update-related", + "command": "/memory:update-related", + "description": "Update docs for git-changed modules", + "arguments": "[--tool ]", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/update-related.md" + }, + { + "name": "update-full", + "command": "/memory:update-full", + "description": "Update all CLAUDE.md files", + "arguments": "[--tool ]", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/update-full.md" + }, + { + "name": "skill-memory", + "command": "/memory:skill-memory", + "description": "Generate SKILL.md with loading index", + "arguments": "[path] [--regenerate]", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/skill-memory.md" + }, + { + "name": "load-skill-memory", + "command": "/memory:load-skill-memory", + "description": "Activate SKILL package for task", + "arguments": "[skill_name] \"task intent\"", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/load-skill-memory.md" + }, + { + "name": "load", + "command": "/memory:load", + "description": "Load project context via CLI", + "arguments": "[--tool ] \"context\"", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/load.md" + }, + { + "name": "compact", + "command": "/memory:compact", + "description": "Compact session memory for recovery", + "arguments": "[description]", + "category": "memory", + "difficulty": "Intermediate", + "source": "../../../commands/memory/compact.md" + }, + { + "name": "task:create", + "command": "/task:create", + "description": "Generate task JSON from description", + "arguments": "\"task title\"", + "category": "task", + "difficulty": "Intermediate", + "source": "../../../commands/task/create.md" + }, + { + "name": "task:execute", + "command": "/task:execute", + "description": "Execute task JSON with agent", + "arguments": "task-id", + "category": "task", + "difficulty": "Intermediate", + "source": "../../../commands/task/execute.md" + }, + { + "name": "task:breakdown", + "command": "/task:breakdown", + "description": "Decompose task into subtasks", + "arguments": "task-id", + "category": "task", + "difficulty": "Intermediate", + "source": "../../../commands/task/breakdown.md" + }, + { + "name": "task:replan", + "command": "/task:replan", + "description": "Update task with new requirements", + "arguments": "task-id [\"text\"|file]", + "category": "task", + "difficulty": "Intermediate", + "source": "../../../commands/task/replan.md" + }, + { + "name": "version", + "command": "/version", + "description": "Display version and check updates", + "arguments": "", + "category": "general", + "difficulty": "Beginner", + "essential": true, + "source": "../../../commands/version.md" + }, + { + "name": "enhance-prompt", + "command": "/enhance-prompt", + "description": "Transform prompts with session memory", + "arguments": "user input", + "category": "general", + "difficulty": "Intermediate", + "source": "../../../commands/enhance-prompt.md" + } + ], + + "agents": [ + { "name": "action-planning-agent", "description": "Task planning and generation", "source": "../../../agents/action-planning-agent.md" }, + { "name": "cli-execution-agent", "description": "CLI tool execution", "source": "../../../agents/cli-execution-agent.md" }, + { "name": "cli-explore-agent", "description": "Codebase exploration", "source": "../../../agents/cli-explore-agent.md" }, + { "name": "cli-lite-planning-agent", "description": "Lightweight planning", "source": "../../../agents/cli-lite-planning-agent.md" }, + { "name": "cli-planning-agent", "description": "CLI-based planning", "source": "../../../agents/cli-planning-agent.md" }, + { "name": "code-developer", "description": "Code implementation", "source": "../../../agents/code-developer.md" }, + { "name": "conceptual-planning-agent", "description": "Conceptual analysis", "source": "../../../agents/conceptual-planning-agent.md" }, + { "name": "context-search-agent", "description": "Context discovery", "source": "../../../agents/context-search-agent.md" }, + { "name": "doc-generator", "description": "Documentation generation", "source": "../../../agents/doc-generator.md" }, + { "name": "issue-plan-agent", "description": "Issue planning", "source": "../../../agents/issue-plan-agent.md" }, + { "name": "issue-queue-agent", "description": "Issue queue formation", "source": "../../../agents/issue-queue-agent.md" }, + { "name": "memory-bridge", "description": "Documentation coordination", "source": "../../../agents/memory-bridge.md" }, + { "name": "test-context-search-agent", "description": "Test context collection", "source": "../../../agents/test-context-search-agent.md" }, + { "name": "test-fix-agent", "description": "Test execution and fixing", "source": "../../../agents/test-fix-agent.md" }, + { "name": "ui-design-agent", "description": "UI design and prototyping", "source": "../../../agents/ui-design-agent.md" }, + { "name": "universal-executor", "description": "Universal task execution", "source": "../../../agents/universal-executor.md" } + ], + + "categories": ["workflow", "issue", "memory", "task", "general", "cli"] +} diff --git a/.claude/skills/ccw-help/index/all-agents.json b/.claude/skills/ccw-help/index/all-agents.json deleted file mode 100644 index 619f8f53..00000000 --- a/.claude/skills/ccw-help/index/all-agents.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "name": "action-planning-agent", - "description": "|", - "source": "../../../agents/action-planning-agent.md" - }, - { - "name": "cli-execution-agent", - "description": "|", - "source": "../../../agents/cli-execution-agent.md" - }, - { - "name": "cli-explore-agent", - "description": "|", - "source": "../../../agents/cli-explore-agent.md" - }, - { - "name": "cli-lite-planning-agent", - "description": "|", - "source": "../../../agents/cli-lite-planning-agent.md" - }, - { - "name": "cli-planning-agent", - "description": "|", - "source": "../../../agents/cli-planning-agent.md" - }, - { - "name": "code-developer", - "description": "|", - "source": "../../../agents/code-developer.md" - }, - { - "name": "conceptual-planning-agent", - "description": "|", - "source": "../../../agents/conceptual-planning-agent.md" - }, - { - "name": "context-search-agent", - "description": "|", - "source": "../../../agents/context-search-agent.md" - }, - { - "name": "doc-generator", - "description": "|", - "source": "../../../agents/doc-generator.md" - }, - { - "name": "issue-plan-agent", - "description": "|", - "source": "../../../agents/issue-plan-agent.md" - }, - { - "name": "issue-queue-agent", - "description": "|", - "source": "../../../agents/issue-queue-agent.md" - }, - { - "name": "memory-bridge", - "description": "Execute complex project documentation updates using script coordination", - "source": "../../../agents/memory-bridge.md" - }, - { - "name": "test-context-search-agent", - "description": "|", - "source": "../../../agents/test-context-search-agent.md" - }, - { - "name": "test-fix-agent", - "description": "|", - "source": "../../../agents/test-fix-agent.md" - }, - { - "name": "ui-design-agent", - "description": "|", - "source": "../../../agents/ui-design-agent.md" - }, - { - "name": "universal-executor", - "description": "|", - "source": "../../../agents/universal-executor.md" - } -] \ No newline at end of file diff --git a/.claude/skills/ccw-help/index/all-commands.json b/.claude/skills/ccw-help/index/all-commands.json deleted file mode 100644 index a4c14670..00000000 --- a/.claude/skills/ccw-help/index/all-commands.json +++ /dev/null @@ -1,882 +0,0 @@ -[ - { - "name": "cli-init", - "command": "/cli:cli-init", - "description": "Generate .gemini/ and .qwen/ config directories with settings.json and ignore files based on workspace technology detection", - "arguments": "[--tool gemini|qwen|all] [--output path] [--preview]", - "category": "cli", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/cli/cli-init.md" - }, - { - "name": "enhance-prompt", - "command": "/enhance-prompt", - "description": "Enhanced prompt transformation using session memory and intent analysis with --enhance flag detection", - "arguments": "user input to enhance", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/enhance-prompt.md" - }, - { - "name": "issue:discover", - "command": "/issue:discover", - "description": "Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives.", - "arguments": " [--perspectives=bug,ux,...] [--external]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/discover.md" - }, - { - "name": "execute", - "command": "/issue:execute", - "description": "Execute queue with codex using DAG-based parallel orchestration (solution-level)", - "arguments": "[--worktree] [--queue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/issue/execute.md" - }, - { - "name": "new", - "command": "/issue:new", - "description": "Create structured issue from GitHub URL or text description", - "arguments": " [--priority 1-5]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/new.md" - }, - { - "name": "plan", - "command": "/issue:plan", - "description": "Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)", - "arguments": "--all-pending [,,...] [--batch-size 3] ", - "category": "issue", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/issue/plan.md" - }, - { - "name": "queue", - "command": "/issue:queue", - "description": "Form execution queue from bound solutions using issue-queue-agent (solution-level)", - "arguments": "[--rebuild] [--issue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/queue.md" - }, - { - "name": "code-map-memory", - "command": "/memory:code-map-memory", - "description": "3-phase orchestrator: parse feature keyword → cli-explore-agent analyzes (Deep Scan dual-source) → orchestrator generates Mermaid docs + SKILL package (skips phase 2 if exists)", - "arguments": "\\\"feature-keyword\\\" [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/code-map-memory.md" - }, - { - "name": "compact", - "command": "/memory:compact", - "description": "Compact current session memory into structured text for session recovery, extracting objective/plan/files/decisions/constraints/state, and save via MCP core_memory tool", - "arguments": "[optional: session description]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/compact.md" - }, - { - "name": "docs-full-cli", - "command": "/memory:docs-full-cli", - "description": "Generate full project documentation using CLI execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[path] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-full-cli.md" - }, - { - "name": "docs-related-cli", - "command": "/memory:docs-related-cli", - "description": "Generate/update documentation for git-changed modules using CLI execution with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <15 modules uses direct parallel", - "arguments": "[--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-related-cli.md" - }, - { - "name": "docs", - "command": "/memory:docs", - "description": "Plan documentation workflow with dynamic grouping (≤10 docs/task), generates IMPL tasks for parallel module trees, README, ARCHITECTURE, and HTTP API docs", - "arguments": "[path] [--tool ] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs.md" - }, - { - "name": "load-skill-memory", - "command": "/memory:load-skill-memory", - "description": "Activate SKILL package (auto-detect from paths/keywords or manual) and intelligently load documentation based on task intent keywords", - "arguments": "[skill_name] \\\"task intent description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load-skill-memory.md" - }, - { - "name": "load", - "command": "/memory:load", - "description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context", - "arguments": "[--tool gemini|qwen] \\\"task context description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load.md" - }, - { - "name": "skill-memory", - "command": "/memory:skill-memory", - "description": "4-phase autonomous orchestrator: check docs → /memory:docs planning → /workflow:execute → generate SKILL.md with progressive loading index (skips phases 2-3 if docs exist)", - "arguments": "[path] [--tool ] [--regenerate] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/skill-memory.md" - }, - { - "name": "style-skill-memory", - "command": "/memory:style-skill-memory", - "description": "Generate SKILL memory package from style reference for easy loading and consistent design system usage", - "arguments": "[package-name] [--regenerate]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/style-skill-memory.md" - }, - { - "name": "swagger-docs", - "command": "/memory:swagger-docs", - "description": "Generate complete Swagger/OpenAPI documentation following RESTful standards with global security, API details, error codes, and validation tests", - "arguments": "[path] [--tool ] [--format ] [--version ] [--lang ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/swagger-docs.md" - }, - { - "name": "tech-research-rules", - "command": "/memory:tech-research-rules", - "description": "3-phase orchestrator: extract tech stack → Exa research → generate path-conditional rules (auto-loaded by Claude Code)", - "arguments": "[session-id | tech-stack-name] [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/tech-research-rules.md" - }, - { - "name": "update-full", - "command": "/memory:update-full", - "description": "Update all CLAUDE.md files using layer-based execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[--tool gemini|qwen|codex] [--path ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-full.md" - }, - { - "name": "update-related", - "command": "/memory:update-related", - "description": "Update CLAUDE.md for git-changed modules using batched agent execution (4 modules/agent) with gemini→qwen→codex fallback, <15 modules uses direct execution", - "arguments": "[--tool gemini|qwen|codex]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-related.md" - }, - { - "name": "workflow-skill-memory", - "command": "/memory:workflow-skill-memory", - "description": "Process WFS-* archived sessions using universal-executor agents with Gemini analysis to generate workflow-progress SKILL package (sessions-timeline, lessons, conflicts)", - "arguments": "session | all", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/workflow-skill-memory.md" - }, - { - "name": "breakdown", - "command": "/task:breakdown", - "description": "Decompose complex task into subtasks with dependency mapping, creates child task JSONs with parent references and execution order", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/breakdown.md" - }, - { - "name": "create", - "command": "/task:create", - "description": "Generate task JSON from natural language description with automatic file pattern detection, scope inference, and dependency analysis", - "arguments": "\\\"task title\\", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/create.md" - }, - { - "name": "execute", - "command": "/task:execute", - "description": "Execute task JSON using appropriate agent (@doc-generator/@implementation-agent/@test-agent) with pre-analysis context loading and status tracking", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/execute.md" - }, - { - "name": "replan", - "command": "/task:replan", - "description": "Update task JSON with new requirements or batch-update multiple tasks from verification report, tracks changes in task-changes.json", - "arguments": "task-id [\\\"text\\\"|file.md] | --batch [verification-report.md]", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/replan.md" - }, - { - "name": "version", - "command": "/version", - "description": "Display Claude Code version information and check for updates", - "arguments": "", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/version.md" - }, - { - "name": "action-plan-verify", - "command": "/workflow:action-plan-verify", - "description": "Perform non-destructive cross-artifact consistency analysis between IMPL_PLAN.md and task JSONs with quality gate validation", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/action-plan-verify.md" - }, - { - "name": "api-designer", - "command": "/workflow:brainstorm:api-designer", - "description": "Generate or update api-designer/analysis.md addressing guidance-specification discussion points for API design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/api-designer.md" - }, - { - "name": "artifacts", - "command": "/workflow:brainstorm:artifacts", - "description": "Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis", - "arguments": "topic or challenge description [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/artifacts.md" - }, - { - "name": "auto-parallel", - "command": "/workflow:brainstorm:auto-parallel", - "description": "Parallel brainstorming automation with dynamic role selection and concurrent execution across multiple perspectives", - "arguments": "topic or challenge description\" [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/auto-parallel.md" - }, - { - "name": "data-architect", - "command": "/workflow:brainstorm:data-architect", - "description": "Generate or update data-architect/analysis.md addressing guidance-specification discussion points for data architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/data-architect.md" - }, - { - "name": "product-manager", - "command": "/workflow:brainstorm:product-manager", - "description": "Generate or update product-manager/analysis.md addressing guidance-specification discussion points for product management perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-manager.md" - }, - { - "name": "product-owner", - "command": "/workflow:brainstorm:product-owner", - "description": "Generate or update product-owner/analysis.md addressing guidance-specification discussion points for product ownership perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-owner.md" - }, - { - "name": "scrum-master", - "command": "/workflow:brainstorm:scrum-master", - "description": "Generate or update scrum-master/analysis.md addressing guidance-specification discussion points for Agile process perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/scrum-master.md" - }, - { - "name": "subject-matter-expert", - "command": "/workflow:brainstorm:subject-matter-expert", - "description": "Generate or update subject-matter-expert/analysis.md addressing guidance-specification discussion points for domain expertise perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/subject-matter-expert.md" - }, - { - "name": "synthesis", - "command": "/workflow:brainstorm:synthesis", - "description": "Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/synthesis.md" - }, - { - "name": "system-architect", - "command": "/workflow:brainstorm:system-architect", - "description": "Generate or update system-architect/analysis.md addressing guidance-specification discussion points for system architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/system-architect.md" - }, - { - "name": "ui-designer", - "command": "/workflow:brainstorm:ui-designer", - "description": "Generate or update ui-designer/analysis.md addressing guidance-specification discussion points for UI design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ui-designer.md" - }, - { - "name": "ux-expert", - "command": "/workflow:brainstorm:ux-expert", - "description": "Generate or update ux-expert/analysis.md addressing guidance-specification discussion points for UX perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ux-expert.md" - }, - { - "name": "clean", - "command": "/workflow:clean", - "description": "Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution", - "arguments": "[--dry-run] [\\\"focus area\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/clean.md" - }, - { - "name": "debug", - "command": "/workflow:debug", - "description": "Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved", - "arguments": "\\\"bug description or error message\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/debug.md" - }, - { - "name": "execute", - "command": "/workflow:execute", - "description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking", - "arguments": "[--resume-session=\\\"session-id\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/execute.md" - }, - { - "name": "init", - "command": "/workflow:init", - "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", - "arguments": "[--regenerate]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/init.md" - }, - { - "name": "lite-execute", - "command": "/workflow:lite-execute", - "description": "Execute tasks based on in-memory plan, prompt description, or file content", - "arguments": "[--in-memory] [\\\"task description\\\"|file-path]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-execute.md" - }, - { - "name": "lite-fix", - "command": "/workflow:lite-fix", - "description": "Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents", - "arguments": "[--hotfix] \\\"bug description or issue reference\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-fix.md" - }, - { - "name": "lite-plan", - "command": "/workflow:lite-plan", - "description": "Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation", - "arguments": "[-e|--explore] \\\"task description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-plan.md" - }, - { - "name": "plan", - "command": "/workflow:plan", - "description": "5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs", - "arguments": "\\\"text description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/plan.md" - }, - { - "name": "replan", - "command": "/workflow:replan", - "description": "Interactive workflow replanning with session-level artifact updates and boundary clarification through guided questioning", - "arguments": "[--session session-id] [task-id] \\\"requirements\\\"|file.md [--interactive]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/replan.md" - }, - { - "name": "review-fix", - "command": "/workflow:review-fix", - "description": "Automated fixing of code review findings with AI-powered planning and coordinated execution. Uses intelligent grouping, multi-stage timeline coordination, and test-driven verification.", - "arguments": " [--resume] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-fix.md" - }, - { - "name": "review-module-cycle", - "command": "/workflow:review-module-cycle", - "description": "Independent multi-dimensional code review for specified modules/files. Analyzes specific code paths across 7 dimensions with hybrid parallel-iterative execution, independent of workflow sessions.", - "arguments": " [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-module-cycle.md" - }, - { - "name": "review-session-cycle", - "command": "/workflow:review-session-cycle", - "description": "Session-based comprehensive multi-dimensional code review. Analyzes git changes from workflow session across 7 dimensions with hybrid parallel-iterative execution, aggregates findings, and performs focused deep-dives on critical issues until quality gates met.", - "arguments": "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-session-cycle.md" - }, - { - "name": "review", - "command": "/workflow:review", - "description": "Post-implementation review with specialized types (security/architecture/action-items/quality) using analysis agents and Gemini", - "arguments": "[--type=security|architecture|action-items|quality] [--archived] [optional: session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review.md" - }, - { - "name": "complete", - "command": "/workflow:session:complete", - "description": "Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/complete.md" - }, - { - "name": "list", - "command": "/workflow:session:list", - "description": "List all workflow sessions with status filtering, shows session metadata and progress information", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/workflow/session/list.md" - }, - { - "name": "resume", - "command": "/workflow:session:resume", - "description": "Resume the most recently paused workflow session with automatic session discovery and status update", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/resume.md" - }, - { - "name": "solidify", - "command": "/workflow:session:solidify", - "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", - "arguments": "[--type ] [--category ] \\\"rule or insight\\", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/solidify.md" - }, - { - "name": "start", - "command": "/workflow:session:start", - "description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection", - "arguments": "[--type ] [--auto|--new] [optional: task description for new session]", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/start.md" - }, - { - "name": "tdd-plan", - "command": "/workflow:tdd-plan", - "description": "TDD workflow planning with Red-Green-Refactor task chain generation, test-first development structure, and cycle tracking", - "arguments": "\\\"feature description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-plan.md" - }, - { - "name": "tdd-verify", - "command": "/workflow:tdd-verify", - "description": "Verify TDD workflow compliance against Red-Green-Refactor cycles, generate quality report with coverage analysis", - "arguments": "[optional: WFS-session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-verify.md" - }, - { - "name": "test-cycle-execute", - "command": "/workflow:test-cycle-execute", - "description": "Execute test-fix workflow with dynamic task generation and iterative fix cycles until test pass rate >= 95% or max iterations reached. Uses @cli-planning-agent for failure analysis and task generation.", - "arguments": "[--resume-session=\\\"session-id\\\"] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-cycle-execute.md" - }, - { - "name": "test-fix-gen", - "command": "/workflow:test-fix-gen", - "description": "Create test-fix workflow session from session ID, description, or file path with test strategy generation and task planning", - "arguments": "(source-session-id | \\\"feature description\\\" | /path/to/file.md)", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-fix-gen.md" - }, - { - "name": "test-gen", - "command": "/workflow:test-gen", - "description": "Create independent test-fix workflow session from completed implementation session, analyzes code to generate test tasks", - "arguments": "source-session-id", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-gen.md" - }, - { - "name": "conflict-resolution", - "command": "/workflow:tools:conflict-resolution", - "description": "Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen", - "arguments": "--session WFS-session-id --context path/to/context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/conflict-resolution.md" - }, - { - "name": "gather", - "command": "/workflow:tools:gather", - "description": "Intelligently collect project context using context-search-agent based on task description, packages into standardized JSON", - "arguments": "--session WFS-session-id \\\"task description\\", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/context-gather.md" - }, - { - "name": "task-generate-agent", - "command": "/workflow:tools:task-generate-agent", - "description": "Generate implementation plan documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) using action-planning-agent - produces planning artifacts, does NOT execute code implementation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-agent.md" - }, - { - "name": "task-generate-tdd", - "command": "/workflow:tools:task-generate-tdd", - "description": "Autonomous TDD task generation using action-planning-agent with Red-Green-Refactor cycles, test-first structure, and cycle validation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-tdd.md" - }, - { - "name": "tdd-coverage-analysis", - "command": "/workflow:tools:tdd-coverage-analysis", - "description": "Analyze test coverage and TDD cycle execution with Red-Green-Refactor compliance verification", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/tdd-coverage-analysis.md" - }, - { - "name": "test-concept-enhanced", - "command": "/workflow:tools:test-concept-enhanced", - "description": "Coordinate test analysis workflow using cli-execution-agent to generate test strategy via Gemini", - "arguments": "--session WFS-test-session-id --context path/to/test-context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-concept-enhanced.md" - }, - { - "name": "test-context-gather", - "command": "/workflow:tools:test-context-gather", - "description": "Collect test coverage context using test-context-search-agent and package into standardized test-context JSON", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-context-gather.md" - }, - { - "name": "test-task-generate", - "command": "/workflow:tools:test-task-generate", - "description": "Generate test planning documents (IMPL_PLAN.md, test task JSONs, TODO_LIST.md) using action-planning-agent - produces test planning artifacts, does NOT execute tests", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-task-generate.md" - }, - { - "name": "animation-extract", - "command": "/workflow:ui-design:animation-extract", - "description": "Extract animation and transition patterns from prompt inference and image references for design system documentation", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--focus \"\"] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/animation-extract.md" - }, - { - "name": "workflow:ui-design:codify-style", - "command": "/workflow:ui-design:codify-style", - "description": "Orchestrator to extract styles from code and generate shareable reference package with preview (automatic file discovery)", - "arguments": " [--package-name ] [--output-dir ] [--overwrite]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/codify-style.md" - }, - { - "name": "design-sync", - "command": "/workflow:ui-design:design-sync", - "description": "Synchronize finalized design system references to brainstorming artifacts, preparing them for /workflow:plan consumption", - "arguments": "--session [--selected-prototypes \"\"]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/design-sync.md" - }, - { - "name": "explore-auto", - "command": "/workflow:ui-design:explore-auto", - "description": "Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection", - "arguments": "[--input \"\"] [--targets \"\"] [--target-type \"page|component\"] [--session ] [--style-variants ] [--layout-variants ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/explore-auto.md" - }, - { - "name": "generate", - "command": "/workflow:ui-design:generate", - "description": "Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation", - "arguments": "[--design-id ] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/generate.md" - }, - { - "name": "imitate-auto", - "command": "/workflow:ui-design:imitate-auto", - "description": "UI design workflow with direct code/image input for design token extraction and prototype generation", - "arguments": "[--input \"\"] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/imitate-auto.md" - }, - { - "name": "workflow:ui-design:import-from-code", - "command": "/workflow:ui-design:import-from-code", - "description": "Import design system from code files (CSS/JS/HTML/SCSS) with automatic file discovery and parallel agent analysis", - "arguments": "[--design-id ] [--session ] [--source ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/import-from-code.md" - }, - { - "name": "layout-extract", - "command": "/workflow:ui-design:layout-extract", - "description": "Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--targets \"\"] [--variants ] [--device-type ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/layout-extract.md" - }, - { - "name": "workflow:ui-design:reference-page-generator", - "command": "/workflow:ui-design:reference-page-generator", - "description": "Generate multi-component reference pages and documentation from design run extraction", - "arguments": "[--design-run ] [--package-name ] [--output-dir ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/reference-page-generator.md" - }, - { - "name": "style-extract", - "command": "/workflow:ui-design:style-extract", - "description": "Extract design style from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--variants ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/style-extract.md" - } -] \ No newline at end of file diff --git a/.claude/skills/ccw-help/index/by-category.json b/.claude/skills/ccw-help/index/by-category.json deleted file mode 100644 index 115fb7e9..00000000 --- a/.claude/skills/ccw-help/index/by-category.json +++ /dev/null @@ -1,914 +0,0 @@ -{ - "cli": { - "_root": [ - { - "name": "cli-init", - "command": "/cli:cli-init", - "description": "Generate .gemini/ and .qwen/ config directories with settings.json and ignore files based on workspace technology detection", - "arguments": "[--tool gemini|qwen|all] [--output path] [--preview]", - "category": "cli", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/cli/cli-init.md" - } - ] - }, - "general": { - "_root": [ - { - "name": "enhance-prompt", - "command": "/enhance-prompt", - "description": "Enhanced prompt transformation using session memory and intent analysis with --enhance flag detection", - "arguments": "user input to enhance", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/enhance-prompt.md" - }, - { - "name": "version", - "command": "/version", - "description": "Display Claude Code version information and check for updates", - "arguments": "", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/version.md" - } - ] - }, - "issue": { - "_root": [ - { - "name": "issue:discover", - "command": "/issue:discover", - "description": "Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives.", - "arguments": " [--perspectives=bug,ux,...] [--external]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/discover.md" - }, - { - "name": "execute", - "command": "/issue:execute", - "description": "Execute queue with codex using DAG-based parallel orchestration (solution-level)", - "arguments": "[--worktree] [--queue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/issue/execute.md" - }, - { - "name": "new", - "command": "/issue:new", - "description": "Create structured issue from GitHub URL or text description", - "arguments": " [--priority 1-5]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/new.md" - }, - { - "name": "plan", - "command": "/issue:plan", - "description": "Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)", - "arguments": "--all-pending [,,...] [--batch-size 3] ", - "category": "issue", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/issue/plan.md" - }, - { - "name": "queue", - "command": "/issue:queue", - "description": "Form execution queue from bound solutions using issue-queue-agent (solution-level)", - "arguments": "[--rebuild] [--issue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/queue.md" - } - ] - }, - "memory": { - "_root": [ - { - "name": "code-map-memory", - "command": "/memory:code-map-memory", - "description": "3-phase orchestrator: parse feature keyword → cli-explore-agent analyzes (Deep Scan dual-source) → orchestrator generates Mermaid docs + SKILL package (skips phase 2 if exists)", - "arguments": "\\\"feature-keyword\\\" [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/code-map-memory.md" - }, - { - "name": "compact", - "command": "/memory:compact", - "description": "Compact current session memory into structured text for session recovery, extracting objective/plan/files/decisions/constraints/state, and save via MCP core_memory tool", - "arguments": "[optional: session description]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/compact.md" - }, - { - "name": "docs-full-cli", - "command": "/memory:docs-full-cli", - "description": "Generate full project documentation using CLI execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[path] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-full-cli.md" - }, - { - "name": "docs-related-cli", - "command": "/memory:docs-related-cli", - "description": "Generate/update documentation for git-changed modules using CLI execution with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <15 modules uses direct parallel", - "arguments": "[--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-related-cli.md" - }, - { - "name": "docs", - "command": "/memory:docs", - "description": "Plan documentation workflow with dynamic grouping (≤10 docs/task), generates IMPL tasks for parallel module trees, README, ARCHITECTURE, and HTTP API docs", - "arguments": "[path] [--tool ] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs.md" - }, - { - "name": "load-skill-memory", - "command": "/memory:load-skill-memory", - "description": "Activate SKILL package (auto-detect from paths/keywords or manual) and intelligently load documentation based on task intent keywords", - "arguments": "[skill_name] \\\"task intent description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load-skill-memory.md" - }, - { - "name": "load", - "command": "/memory:load", - "description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context", - "arguments": "[--tool gemini|qwen] \\\"task context description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load.md" - }, - { - "name": "skill-memory", - "command": "/memory:skill-memory", - "description": "4-phase autonomous orchestrator: check docs → /memory:docs planning → /workflow:execute → generate SKILL.md with progressive loading index (skips phases 2-3 if docs exist)", - "arguments": "[path] [--tool ] [--regenerate] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/skill-memory.md" - }, - { - "name": "style-skill-memory", - "command": "/memory:style-skill-memory", - "description": "Generate SKILL memory package from style reference for easy loading and consistent design system usage", - "arguments": "[package-name] [--regenerate]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/style-skill-memory.md" - }, - { - "name": "swagger-docs", - "command": "/memory:swagger-docs", - "description": "Generate complete Swagger/OpenAPI documentation following RESTful standards with global security, API details, error codes, and validation tests", - "arguments": "[path] [--tool ] [--format ] [--version ] [--lang ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/swagger-docs.md" - }, - { - "name": "tech-research-rules", - "command": "/memory:tech-research-rules", - "description": "3-phase orchestrator: extract tech stack → Exa research → generate path-conditional rules (auto-loaded by Claude Code)", - "arguments": "[session-id | tech-stack-name] [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/tech-research-rules.md" - }, - { - "name": "update-full", - "command": "/memory:update-full", - "description": "Update all CLAUDE.md files using layer-based execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[--tool gemini|qwen|codex] [--path ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-full.md" - }, - { - "name": "update-related", - "command": "/memory:update-related", - "description": "Update CLAUDE.md for git-changed modules using batched agent execution (4 modules/agent) with gemini→qwen→codex fallback, <15 modules uses direct execution", - "arguments": "[--tool gemini|qwen|codex]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-related.md" - }, - { - "name": "workflow-skill-memory", - "command": "/memory:workflow-skill-memory", - "description": "Process WFS-* archived sessions using universal-executor agents with Gemini analysis to generate workflow-progress SKILL package (sessions-timeline, lessons, conflicts)", - "arguments": "session | all", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/workflow-skill-memory.md" - } - ] - }, - "task": { - "_root": [ - { - "name": "breakdown", - "command": "/task:breakdown", - "description": "Decompose complex task into subtasks with dependency mapping, creates child task JSONs with parent references and execution order", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/breakdown.md" - }, - { - "name": "create", - "command": "/task:create", - "description": "Generate task JSON from natural language description with automatic file pattern detection, scope inference, and dependency analysis", - "arguments": "\\\"task title\\", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/create.md" - }, - { - "name": "execute", - "command": "/task:execute", - "description": "Execute task JSON using appropriate agent (@doc-generator/@implementation-agent/@test-agent) with pre-analysis context loading and status tracking", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/execute.md" - }, - { - "name": "replan", - "command": "/task:replan", - "description": "Update task JSON with new requirements or batch-update multiple tasks from verification report, tracks changes in task-changes.json", - "arguments": "task-id [\\\"text\\\"|file.md] | --batch [verification-report.md]", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/replan.md" - } - ] - }, - "workflow": { - "_root": [ - { - "name": "action-plan-verify", - "command": "/workflow:action-plan-verify", - "description": "Perform non-destructive cross-artifact consistency analysis between IMPL_PLAN.md and task JSONs with quality gate validation", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/action-plan-verify.md" - }, - { - "name": "clean", - "command": "/workflow:clean", - "description": "Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution", - "arguments": "[--dry-run] [\\\"focus area\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/clean.md" - }, - { - "name": "debug", - "command": "/workflow:debug", - "description": "Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved", - "arguments": "\\\"bug description or error message\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/debug.md" - }, - { - "name": "execute", - "command": "/workflow:execute", - "description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking", - "arguments": "[--resume-session=\\\"session-id\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/execute.md" - }, - { - "name": "init", - "command": "/workflow:init", - "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", - "arguments": "[--regenerate]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/init.md" - }, - { - "name": "lite-execute", - "command": "/workflow:lite-execute", - "description": "Execute tasks based on in-memory plan, prompt description, or file content", - "arguments": "[--in-memory] [\\\"task description\\\"|file-path]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-execute.md" - }, - { - "name": "lite-fix", - "command": "/workflow:lite-fix", - "description": "Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents", - "arguments": "[--hotfix] \\\"bug description or issue reference\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-fix.md" - }, - { - "name": "lite-plan", - "command": "/workflow:lite-plan", - "description": "Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation", - "arguments": "[-e|--explore] \\\"task description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-plan.md" - }, - { - "name": "plan", - "command": "/workflow:plan", - "description": "5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs", - "arguments": "\\\"text description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/plan.md" - }, - { - "name": "replan", - "command": "/workflow:replan", - "description": "Interactive workflow replanning with session-level artifact updates and boundary clarification through guided questioning", - "arguments": "[--session session-id] [task-id] \\\"requirements\\\"|file.md [--interactive]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/replan.md" - }, - { - "name": "review-fix", - "command": "/workflow:review-fix", - "description": "Automated fixing of code review findings with AI-powered planning and coordinated execution. Uses intelligent grouping, multi-stage timeline coordination, and test-driven verification.", - "arguments": " [--resume] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-fix.md" - }, - { - "name": "review-module-cycle", - "command": "/workflow:review-module-cycle", - "description": "Independent multi-dimensional code review for specified modules/files. Analyzes specific code paths across 7 dimensions with hybrid parallel-iterative execution, independent of workflow sessions.", - "arguments": " [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-module-cycle.md" - }, - { - "name": "review-session-cycle", - "command": "/workflow:review-session-cycle", - "description": "Session-based comprehensive multi-dimensional code review. Analyzes git changes from workflow session across 7 dimensions with hybrid parallel-iterative execution, aggregates findings, and performs focused deep-dives on critical issues until quality gates met.", - "arguments": "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-session-cycle.md" - }, - { - "name": "review", - "command": "/workflow:review", - "description": "Post-implementation review with specialized types (security/architecture/action-items/quality) using analysis agents and Gemini", - "arguments": "[--type=security|architecture|action-items|quality] [--archived] [optional: session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review.md" - }, - { - "name": "tdd-plan", - "command": "/workflow:tdd-plan", - "description": "TDD workflow planning with Red-Green-Refactor task chain generation, test-first development structure, and cycle tracking", - "arguments": "\\\"feature description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-plan.md" - }, - { - "name": "tdd-verify", - "command": "/workflow:tdd-verify", - "description": "Verify TDD workflow compliance against Red-Green-Refactor cycles, generate quality report with coverage analysis", - "arguments": "[optional: WFS-session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-verify.md" - }, - { - "name": "test-cycle-execute", - "command": "/workflow:test-cycle-execute", - "description": "Execute test-fix workflow with dynamic task generation and iterative fix cycles until test pass rate >= 95% or max iterations reached. Uses @cli-planning-agent for failure analysis and task generation.", - "arguments": "[--resume-session=\\\"session-id\\\"] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-cycle-execute.md" - }, - { - "name": "test-fix-gen", - "command": "/workflow:test-fix-gen", - "description": "Create test-fix workflow session from session ID, description, or file path with test strategy generation and task planning", - "arguments": "(source-session-id | \\\"feature description\\\" | /path/to/file.md)", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-fix-gen.md" - }, - { - "name": "test-gen", - "command": "/workflow:test-gen", - "description": "Create independent test-fix workflow session from completed implementation session, analyzes code to generate test tasks", - "arguments": "source-session-id", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-gen.md" - } - ], - "brainstorm": [ - { - "name": "api-designer", - "command": "/workflow:brainstorm:api-designer", - "description": "Generate or update api-designer/analysis.md addressing guidance-specification discussion points for API design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/api-designer.md" - }, - { - "name": "artifacts", - "command": "/workflow:brainstorm:artifacts", - "description": "Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis", - "arguments": "topic or challenge description [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/artifacts.md" - }, - { - "name": "auto-parallel", - "command": "/workflow:brainstorm:auto-parallel", - "description": "Parallel brainstorming automation with dynamic role selection and concurrent execution across multiple perspectives", - "arguments": "topic or challenge description\" [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/auto-parallel.md" - }, - { - "name": "data-architect", - "command": "/workflow:brainstorm:data-architect", - "description": "Generate or update data-architect/analysis.md addressing guidance-specification discussion points for data architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/data-architect.md" - }, - { - "name": "product-manager", - "command": "/workflow:brainstorm:product-manager", - "description": "Generate or update product-manager/analysis.md addressing guidance-specification discussion points for product management perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-manager.md" - }, - { - "name": "product-owner", - "command": "/workflow:brainstorm:product-owner", - "description": "Generate or update product-owner/analysis.md addressing guidance-specification discussion points for product ownership perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-owner.md" - }, - { - "name": "scrum-master", - "command": "/workflow:brainstorm:scrum-master", - "description": "Generate or update scrum-master/analysis.md addressing guidance-specification discussion points for Agile process perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/scrum-master.md" - }, - { - "name": "subject-matter-expert", - "command": "/workflow:brainstorm:subject-matter-expert", - "description": "Generate or update subject-matter-expert/analysis.md addressing guidance-specification discussion points for domain expertise perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/subject-matter-expert.md" - }, - { - "name": "synthesis", - "command": "/workflow:brainstorm:synthesis", - "description": "Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/synthesis.md" - }, - { - "name": "system-architect", - "command": "/workflow:brainstorm:system-architect", - "description": "Generate or update system-architect/analysis.md addressing guidance-specification discussion points for system architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/system-architect.md" - }, - { - "name": "ui-designer", - "command": "/workflow:brainstorm:ui-designer", - "description": "Generate or update ui-designer/analysis.md addressing guidance-specification discussion points for UI design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ui-designer.md" - }, - { - "name": "ux-expert", - "command": "/workflow:brainstorm:ux-expert", - "description": "Generate or update ux-expert/analysis.md addressing guidance-specification discussion points for UX perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ux-expert.md" - } - ], - "session": [ - { - "name": "complete", - "command": "/workflow:session:complete", - "description": "Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/complete.md" - }, - { - "name": "list", - "command": "/workflow:session:list", - "description": "List all workflow sessions with status filtering, shows session metadata and progress information", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/workflow/session/list.md" - }, - { - "name": "resume", - "command": "/workflow:session:resume", - "description": "Resume the most recently paused workflow session with automatic session discovery and status update", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/resume.md" - }, - { - "name": "solidify", - "command": "/workflow:session:solidify", - "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", - "arguments": "[--type ] [--category ] \\\"rule or insight\\", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/solidify.md" - }, - { - "name": "start", - "command": "/workflow:session:start", - "description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection", - "arguments": "[--type ] [--auto|--new] [optional: task description for new session]", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/start.md" - } - ], - "tools": [ - { - "name": "conflict-resolution", - "command": "/workflow:tools:conflict-resolution", - "description": "Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen", - "arguments": "--session WFS-session-id --context path/to/context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/conflict-resolution.md" - }, - { - "name": "gather", - "command": "/workflow:tools:gather", - "description": "Intelligently collect project context using context-search-agent based on task description, packages into standardized JSON", - "arguments": "--session WFS-session-id \\\"task description\\", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/context-gather.md" - }, - { - "name": "task-generate-agent", - "command": "/workflow:tools:task-generate-agent", - "description": "Generate implementation plan documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) using action-planning-agent - produces planning artifacts, does NOT execute code implementation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-agent.md" - }, - { - "name": "task-generate-tdd", - "command": "/workflow:tools:task-generate-tdd", - "description": "Autonomous TDD task generation using action-planning-agent with Red-Green-Refactor cycles, test-first structure, and cycle validation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-tdd.md" - }, - { - "name": "tdd-coverage-analysis", - "command": "/workflow:tools:tdd-coverage-analysis", - "description": "Analyze test coverage and TDD cycle execution with Red-Green-Refactor compliance verification", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/tdd-coverage-analysis.md" - }, - { - "name": "test-concept-enhanced", - "command": "/workflow:tools:test-concept-enhanced", - "description": "Coordinate test analysis workflow using cli-execution-agent to generate test strategy via Gemini", - "arguments": "--session WFS-test-session-id --context path/to/test-context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-concept-enhanced.md" - }, - { - "name": "test-context-gather", - "command": "/workflow:tools:test-context-gather", - "description": "Collect test coverage context using test-context-search-agent and package into standardized test-context JSON", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-context-gather.md" - }, - { - "name": "test-task-generate", - "command": "/workflow:tools:test-task-generate", - "description": "Generate test planning documents (IMPL_PLAN.md, test task JSONs, TODO_LIST.md) using action-planning-agent - produces test planning artifacts, does NOT execute tests", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-task-generate.md" - } - ], - "ui-design": [ - { - "name": "animation-extract", - "command": "/workflow:ui-design:animation-extract", - "description": "Extract animation and transition patterns from prompt inference and image references for design system documentation", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--focus \"\"] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/animation-extract.md" - }, - { - "name": "workflow:ui-design:codify-style", - "command": "/workflow:ui-design:codify-style", - "description": "Orchestrator to extract styles from code and generate shareable reference package with preview (automatic file discovery)", - "arguments": " [--package-name ] [--output-dir ] [--overwrite]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/codify-style.md" - }, - { - "name": "design-sync", - "command": "/workflow:ui-design:design-sync", - "description": "Synchronize finalized design system references to brainstorming artifacts, preparing them for /workflow:plan consumption", - "arguments": "--session [--selected-prototypes \"\"]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/design-sync.md" - }, - { - "name": "explore-auto", - "command": "/workflow:ui-design:explore-auto", - "description": "Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection", - "arguments": "[--input \"\"] [--targets \"\"] [--target-type \"page|component\"] [--session ] [--style-variants ] [--layout-variants ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/explore-auto.md" - }, - { - "name": "generate", - "command": "/workflow:ui-design:generate", - "description": "Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation", - "arguments": "[--design-id ] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/generate.md" - }, - { - "name": "imitate-auto", - "command": "/workflow:ui-design:imitate-auto", - "description": "UI design workflow with direct code/image input for design token extraction and prototype generation", - "arguments": "[--input \"\"] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/imitate-auto.md" - }, - { - "name": "workflow:ui-design:import-from-code", - "command": "/workflow:ui-design:import-from-code", - "description": "Import design system from code files (CSS/JS/HTML/SCSS) with automatic file discovery and parallel agent analysis", - "arguments": "[--design-id ] [--session ] [--source ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/import-from-code.md" - }, - { - "name": "layout-extract", - "command": "/workflow:ui-design:layout-extract", - "description": "Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--targets \"\"] [--variants ] [--device-type ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/layout-extract.md" - }, - { - "name": "workflow:ui-design:reference-page-generator", - "command": "/workflow:ui-design:reference-page-generator", - "description": "Generate multi-component reference pages and documentation from design run extraction", - "arguments": "[--design-run ] [--package-name ] [--output-dir ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/reference-page-generator.md" - }, - { - "name": "style-extract", - "command": "/workflow:ui-design:style-extract", - "description": "Extract design style from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--variants ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/style-extract.md" - } - ] - } -} \ No newline at end of file diff --git a/.claude/skills/ccw-help/index/by-use-case.json b/.claude/skills/ccw-help/index/by-use-case.json deleted file mode 100644 index 1d90555e..00000000 --- a/.claude/skills/ccw-help/index/by-use-case.json +++ /dev/null @@ -1,896 +0,0 @@ -{ - "general": [ - { - "name": "cli-init", - "command": "/cli:cli-init", - "description": "Generate .gemini/ and .qwen/ config directories with settings.json and ignore files based on workspace technology detection", - "arguments": "[--tool gemini|qwen|all] [--output path] [--preview]", - "category": "cli", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/cli/cli-init.md" - }, - { - "name": "enhance-prompt", - "command": "/enhance-prompt", - "description": "Enhanced prompt transformation using session memory and intent analysis with --enhance flag detection", - "arguments": "user input to enhance", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/enhance-prompt.md" - }, - { - "name": "issue:discover", - "command": "/issue:discover", - "description": "Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives.", - "arguments": " [--perspectives=bug,ux,...] [--external]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/discover.md" - }, - { - "name": "new", - "command": "/issue:new", - "description": "Create structured issue from GitHub URL or text description", - "arguments": " [--priority 1-5]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/new.md" - }, - { - "name": "queue", - "command": "/issue:queue", - "description": "Form execution queue from bound solutions using issue-queue-agent (solution-level)", - "arguments": "[--rebuild] [--issue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/issue/queue.md" - }, - { - "name": "compact", - "command": "/memory:compact", - "description": "Compact current session memory into structured text for session recovery, extracting objective/plan/files/decisions/constraints/state, and save via MCP core_memory tool", - "arguments": "[optional: session description]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/compact.md" - }, - { - "name": "load", - "command": "/memory:load", - "description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context", - "arguments": "[--tool gemini|qwen] \\\"task context description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load.md" - }, - { - "name": "tech-research-rules", - "command": "/memory:tech-research-rules", - "description": "3-phase orchestrator: extract tech stack → Exa research → generate path-conditional rules (auto-loaded by Claude Code)", - "arguments": "[session-id | tech-stack-name] [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/tech-research-rules.md" - }, - { - "name": "update-full", - "command": "/memory:update-full", - "description": "Update all CLAUDE.md files using layer-based execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[--tool gemini|qwen|codex] [--path ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-full.md" - }, - { - "name": "update-related", - "command": "/memory:update-related", - "description": "Update CLAUDE.md for git-changed modules using batched agent execution (4 modules/agent) with gemini→qwen→codex fallback, <15 modules uses direct execution", - "arguments": "[--tool gemini|qwen|codex]", - "category": "memory", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/memory/update-related.md" - }, - { - "name": "version", - "command": "/version", - "description": "Display Claude Code version information and check for updates", - "arguments": "", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/version.md" - }, - { - "name": "artifacts", - "command": "/workflow:brainstorm:artifacts", - "description": "Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis", - "arguments": "topic or challenge description [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/artifacts.md" - }, - { - "name": "auto-parallel", - "command": "/workflow:brainstorm:auto-parallel", - "description": "Parallel brainstorming automation with dynamic role selection and concurrent execution across multiple perspectives", - "arguments": "topic or challenge description\" [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/auto-parallel.md" - }, - { - "name": "data-architect", - "command": "/workflow:brainstorm:data-architect", - "description": "Generate or update data-architect/analysis.md addressing guidance-specification discussion points for data architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/data-architect.md" - }, - { - "name": "product-manager", - "command": "/workflow:brainstorm:product-manager", - "description": "Generate or update product-manager/analysis.md addressing guidance-specification discussion points for product management perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-manager.md" - }, - { - "name": "product-owner", - "command": "/workflow:brainstorm:product-owner", - "description": "Generate or update product-owner/analysis.md addressing guidance-specification discussion points for product ownership perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/product-owner.md" - }, - { - "name": "scrum-master", - "command": "/workflow:brainstorm:scrum-master", - "description": "Generate or update scrum-master/analysis.md addressing guidance-specification discussion points for Agile process perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/scrum-master.md" - }, - { - "name": "subject-matter-expert", - "command": "/workflow:brainstorm:subject-matter-expert", - "description": "Generate or update subject-matter-expert/analysis.md addressing guidance-specification discussion points for domain expertise perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/subject-matter-expert.md" - }, - { - "name": "synthesis", - "command": "/workflow:brainstorm:synthesis", - "description": "Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/brainstorm/synthesis.md" - }, - { - "name": "system-architect", - "command": "/workflow:brainstorm:system-architect", - "description": "Generate or update system-architect/analysis.md addressing guidance-specification discussion points for system architecture perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/system-architect.md" - }, - { - "name": "ux-expert", - "command": "/workflow:brainstorm:ux-expert", - "description": "Generate or update ux-expert/analysis.md addressing guidance-specification discussion points for UX perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ux-expert.md" - }, - { - "name": "clean", - "command": "/workflow:clean", - "description": "Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution", - "arguments": "[--dry-run] [\\\"focus area\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/clean.md" - }, - { - "name": "debug", - "command": "/workflow:debug", - "description": "Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved", - "arguments": "\\\"bug description or error message\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/debug.md" - }, - { - "name": "init", - "command": "/workflow:init", - "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", - "arguments": "[--regenerate]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/init.md" - }, - { - "name": "lite-fix", - "command": "/workflow:lite-fix", - "description": "Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents", - "arguments": "[--hotfix] \\\"bug description or issue reference\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-fix.md" - }, - { - "name": "list", - "command": "/workflow:session:list", - "description": "List all workflow sessions with status filtering, shows session metadata and progress information", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/workflow/session/list.md" - }, - { - "name": "solidify", - "command": "/workflow:session:solidify", - "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", - "arguments": "[--type ] [--category ] \\\"rule or insight\\", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/solidify.md" - }, - { - "name": "start", - "command": "/workflow:session:start", - "description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection", - "arguments": "[--type ] [--auto|--new] [optional: task description for new session]", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/start.md" - }, - { - "name": "conflict-resolution", - "command": "/workflow:tools:conflict-resolution", - "description": "Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen", - "arguments": "--session WFS-session-id --context path/to/context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/conflict-resolution.md" - }, - { - "name": "gather", - "command": "/workflow:tools:gather", - "description": "Intelligently collect project context using context-search-agent based on task description, packages into standardized JSON", - "arguments": "--session WFS-session-id \\\"task description\\", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/context-gather.md" - }, - { - "name": "animation-extract", - "command": "/workflow:ui-design:animation-extract", - "description": "Extract animation and transition patterns from prompt inference and image references for design system documentation", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--focus \"\"] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/animation-extract.md" - }, - { - "name": "explore-auto", - "command": "/workflow:ui-design:explore-auto", - "description": "Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection", - "arguments": "[--input \"\"] [--targets \"\"] [--target-type \"page|component\"] [--session ] [--style-variants ] [--layout-variants ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/explore-auto.md" - }, - { - "name": "imitate-auto", - "command": "/workflow:ui-design:imitate-auto", - "description": "UI design workflow with direct code/image input for design token extraction and prototype generation", - "arguments": "[--input \"\"] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/imitate-auto.md" - }, - { - "name": "layout-extract", - "command": "/workflow:ui-design:layout-extract", - "description": "Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--targets \"\"] [--variants ] [--device-type ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/layout-extract.md" - }, - { - "name": "style-extract", - "command": "/workflow:ui-design:style-extract", - "description": "Extract design style from reference images or text prompts using Claude analysis with variant generation or refinement mode", - "arguments": "[--design-id ] [--session ] [--images \"\"] [--prompt \"\"] [--variants ] [--interactive] [--refine]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/style-extract.md" - } - ], - "implementation": [ - { - "name": "execute", - "command": "/issue:execute", - "description": "Execute queue with codex using DAG-based parallel orchestration (solution-level)", - "arguments": "[--worktree] [--queue ]", - "category": "issue", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/issue/execute.md" - }, - { - "name": "create", - "command": "/task:create", - "description": "Generate task JSON from natural language description with automatic file pattern detection, scope inference, and dependency analysis", - "arguments": "\\\"task title\\", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/create.md" - }, - { - "name": "execute", - "command": "/task:execute", - "description": "Execute task JSON using appropriate agent (@doc-generator/@implementation-agent/@test-agent) with pre-analysis context loading and status tracking", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/task/execute.md" - }, - { - "name": "execute", - "command": "/workflow:execute", - "description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking", - "arguments": "[--resume-session=\\\"session-id\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/execute.md" - }, - { - "name": "lite-execute", - "command": "/workflow:lite-execute", - "description": "Execute tasks based on in-memory plan, prompt description, or file content", - "arguments": "[--in-memory] [\\\"task description\\\"|file-path]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-execute.md" - }, - { - "name": "test-cycle-execute", - "command": "/workflow:test-cycle-execute", - "description": "Execute test-fix workflow with dynamic task generation and iterative fix cycles until test pass rate >= 95% or max iterations reached. Uses @cli-planning-agent for failure analysis and task generation.", - "arguments": "[--resume-session=\\\"session-id\\\"] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-cycle-execute.md" - }, - { - "name": "task-generate-agent", - "command": "/workflow:tools:task-generate-agent", - "description": "Generate implementation plan documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) using action-planning-agent - produces planning artifacts, does NOT execute code implementation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-agent.md" - }, - { - "name": "task-generate-tdd", - "command": "/workflow:tools:task-generate-tdd", - "description": "Autonomous TDD task generation using action-planning-agent with Red-Green-Refactor cycles, test-first structure, and cycle validation", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/task-generate-tdd.md" - }, - { - "name": "test-task-generate", - "command": "/workflow:tools:test-task-generate", - "description": "Generate test planning documents (IMPL_PLAN.md, test task JSONs, TODO_LIST.md) using action-planning-agent - produces test planning artifacts, does NOT execute tests", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-task-generate.md" - }, - { - "name": "generate", - "command": "/workflow:ui-design:generate", - "description": "Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation", - "arguments": "[--design-id ] [--session ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/generate.md" - } - ], - "planning": [ - { - "name": "plan", - "command": "/issue:plan", - "description": "Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)", - "arguments": "--all-pending [,,...] [--batch-size 3] ", - "category": "issue", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/issue/plan.md" - }, - { - "name": "breakdown", - "command": "/task:breakdown", - "description": "Decompose complex task into subtasks with dependency mapping, creates child task JSONs with parent references and execution order", - "arguments": "task-id", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/breakdown.md" - }, - { - "name": "replan", - "command": "/task:replan", - "description": "Update task JSON with new requirements or batch-update multiple tasks from verification report, tracks changes in task-changes.json", - "arguments": "task-id [\\\"text\\\"|file.md] | --batch [verification-report.md]", - "category": "task", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/task/replan.md" - }, - { - "name": "action-plan-verify", - "command": "/workflow:action-plan-verify", - "description": "Perform non-destructive cross-artifact consistency analysis between IMPL_PLAN.md and task JSONs with quality gate validation", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/action-plan-verify.md" - }, - { - "name": "api-designer", - "command": "/workflow:brainstorm:api-designer", - "description": "Generate or update api-designer/analysis.md addressing guidance-specification discussion points for API design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/api-designer.md" - }, - { - "name": "ui-designer", - "command": "/workflow:brainstorm:ui-designer", - "description": "Generate or update ui-designer/analysis.md addressing guidance-specification discussion points for UI design perspective", - "arguments": "optional topic - uses existing framework if available", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/ui-designer.md" - }, - { - "name": "lite-plan", - "command": "/workflow:lite-plan", - "description": "Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation", - "arguments": "[-e|--explore] \\\"task description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-plan.md" - }, - { - "name": "plan", - "command": "/workflow:plan", - "description": "5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs", - "arguments": "\\\"text description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/plan.md" - }, - { - "name": "replan", - "command": "/workflow:replan", - "description": "Interactive workflow replanning with session-level artifact updates and boundary clarification through guided questioning", - "arguments": "[--session session-id] [task-id] \\\"requirements\\\"|file.md [--interactive]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/replan.md" - }, - { - "name": "tdd-plan", - "command": "/workflow:tdd-plan", - "description": "TDD workflow planning with Red-Green-Refactor task chain generation, test-first development structure, and cycle tracking", - "arguments": "\\\"feature description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-plan.md" - }, - { - "name": "workflow:ui-design:codify-style", - "command": "/workflow:ui-design:codify-style", - "description": "Orchestrator to extract styles from code and generate shareable reference package with preview (automatic file discovery)", - "arguments": " [--package-name ] [--output-dir ] [--overwrite]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/codify-style.md" - }, - { - "name": "design-sync", - "command": "/workflow:ui-design:design-sync", - "description": "Synchronize finalized design system references to brainstorming artifacts, preparing them for /workflow:plan consumption", - "arguments": "--session [--selected-prototypes \"\"]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/design-sync.md" - }, - { - "name": "workflow:ui-design:import-from-code", - "command": "/workflow:ui-design:import-from-code", - "description": "Import design system from code files (CSS/JS/HTML/SCSS) with automatic file discovery and parallel agent analysis", - "arguments": "[--design-id ] [--session ] [--source ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/import-from-code.md" - }, - { - "name": "workflow:ui-design:reference-page-generator", - "command": "/workflow:ui-design:reference-page-generator", - "description": "Generate multi-component reference pages and documentation from design run extraction", - "arguments": "[--design-run ] [--package-name ] [--output-dir ]", - "category": "workflow", - "subcategory": "ui-design", - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/ui-design/reference-page-generator.md" - } - ], - "documentation": [ - { - "name": "code-map-memory", - "command": "/memory:code-map-memory", - "description": "3-phase orchestrator: parse feature keyword → cli-explore-agent analyzes (Deep Scan dual-source) → orchestrator generates Mermaid docs + SKILL package (skips phase 2 if exists)", - "arguments": "\\\"feature-keyword\\\" [--regenerate] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/code-map-memory.md" - }, - { - "name": "docs-full-cli", - "command": "/memory:docs-full-cli", - "description": "Generate full project documentation using CLI execution (Layer 3→1) with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <20 modules uses direct parallel", - "arguments": "[path] [--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-full-cli.md" - }, - { - "name": "docs-related-cli", - "command": "/memory:docs-related-cli", - "description": "Generate/update documentation for git-changed modules using CLI execution with batched agents (4 modules/agent) and gemini→qwen→codex fallback, <15 modules uses direct parallel", - "arguments": "[--tool ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs-related-cli.md" - }, - { - "name": "docs", - "command": "/memory:docs", - "description": "Plan documentation workflow with dynamic grouping (≤10 docs/task), generates IMPL tasks for parallel module trees, README, ARCHITECTURE, and HTTP API docs", - "arguments": "[path] [--tool ] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs.md" - }, - { - "name": "load-skill-memory", - "command": "/memory:load-skill-memory", - "description": "Activate SKILL package (auto-detect from paths/keywords or manual) and intelligently load documentation based on task intent keywords", - "arguments": "[skill_name] \\\"task intent description\\", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/load-skill-memory.md" - }, - { - "name": "skill-memory", - "command": "/memory:skill-memory", - "description": "4-phase autonomous orchestrator: check docs → /memory:docs planning → /workflow:execute → generate SKILL.md with progressive loading index (skips phases 2-3 if docs exist)", - "arguments": "[path] [--tool ] [--regenerate] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/skill-memory.md" - }, - { - "name": "style-skill-memory", - "command": "/memory:style-skill-memory", - "description": "Generate SKILL memory package from style reference for easy loading and consistent design system usage", - "arguments": "[package-name] [--regenerate]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/style-skill-memory.md" - }, - { - "name": "swagger-docs", - "command": "/memory:swagger-docs", - "description": "Generate complete Swagger/OpenAPI documentation following RESTful standards with global security, API details, error codes, and validation tests", - "arguments": "[path] [--tool ] [--format ] [--version ] [--lang ]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/swagger-docs.md" - }, - { - "name": "workflow-skill-memory", - "command": "/memory:workflow-skill-memory", - "description": "Process WFS-* archived sessions using universal-executor agents with Gemini analysis to generate workflow-progress SKILL package (sessions-timeline, lessons, conflicts)", - "arguments": "session | all", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/workflow-skill-memory.md" - } - ], - "analysis": [ - { - "name": "review-fix", - "command": "/workflow:review-fix", - "description": "Automated fixing of code review findings with AI-powered planning and coordinated execution. Uses intelligent grouping, multi-stage timeline coordination, and test-driven verification.", - "arguments": " [--resume] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-fix.md" - }, - { - "name": "review-module-cycle", - "command": "/workflow:review-module-cycle", - "description": "Independent multi-dimensional code review for specified modules/files. Analyzes specific code paths across 7 dimensions with hybrid parallel-iterative execution, independent of workflow sessions.", - "arguments": " [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-module-cycle.md" - }, - { - "name": "review", - "command": "/workflow:review", - "description": "Post-implementation review with specialized types (security/architecture/action-items/quality) using analysis agents and Gemini", - "arguments": "[--type=security|architecture|action-items|quality] [--archived] [optional: session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "analysis", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review.md" - } - ], - "session-management": [ - { - "name": "review-session-cycle", - "command": "/workflow:review-session-cycle", - "description": "Session-based comprehensive multi-dimensional code review. Analyzes git changes from workflow session across 7 dimensions with hybrid parallel-iterative execution, aggregates findings, and performs focused deep-dives on critical issues until quality gates met.", - "arguments": "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-session-cycle.md" - }, - { - "name": "complete", - "command": "/workflow:session:complete", - "description": "Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/complete.md" - }, - { - "name": "resume", - "command": "/workflow:session:resume", - "description": "Resume the most recently paused workflow session with automatic session discovery and status update", - "arguments": "", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/resume.md" - } - ], - "testing": [ - { - "name": "tdd-verify", - "command": "/workflow:tdd-verify", - "description": "Verify TDD workflow compliance against Red-Green-Refactor cycles, generate quality report with coverage analysis", - "arguments": "[optional: WFS-session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tdd-verify.md" - }, - { - "name": "test-fix-gen", - "command": "/workflow:test-fix-gen", - "description": "Create test-fix workflow session from session ID, description, or file path with test strategy generation and task planning", - "arguments": "(source-session-id | \\\"feature description\\\" | /path/to/file.md)", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-fix-gen.md" - }, - { - "name": "test-gen", - "command": "/workflow:test-gen", - "description": "Create independent test-fix workflow session from completed implementation session, analyzes code to generate test tasks", - "arguments": "source-session-id", - "category": "workflow", - "subcategory": null, - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/test-gen.md" - }, - { - "name": "tdd-coverage-analysis", - "command": "/workflow:tools:tdd-coverage-analysis", - "description": "Analyze test coverage and TDD cycle execution with Red-Green-Refactor compliance verification", - "arguments": "--session WFS-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Advanced", - "source": "../../../commands/workflow/tools/tdd-coverage-analysis.md" - }, - { - "name": "test-concept-enhanced", - "command": "/workflow:tools:test-concept-enhanced", - "description": "Coordinate test analysis workflow using cli-execution-agent to generate test strategy via Gemini", - "arguments": "--session WFS-test-session-id --context path/to/test-context-package.json", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-concept-enhanced.md" - }, - { - "name": "test-context-gather", - "command": "/workflow:tools:test-context-gather", - "description": "Collect test coverage context using test-context-search-agent and package into standardized test-context JSON", - "arguments": "--session WFS-test-session-id", - "category": "workflow", - "subcategory": "tools", - "usage_scenario": "testing", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/tools/test-context-gather.md" - } - ] -} \ No newline at end of file diff --git a/.claude/skills/ccw-help/index/command-relationships.json b/.claude/skills/ccw-help/index/command-relationships.json deleted file mode 100644 index f2b73af8..00000000 --- a/.claude/skills/ccw-help/index/command-relationships.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "workflow:plan": { - "calls_internally": [ - "workflow:session:start", - "workflow:tools:context-gather", - "workflow:tools:conflict-resolution", - "workflow:tools:task-generate-agent" - ], - "next_steps": [ - "workflow:action-plan-verify", - "workflow:status", - "workflow:execute" - ], - "alternatives": [ - "workflow:tdd-plan" - ], - "prerequisites": [] - }, - "workflow:tdd-plan": { - "calls_internally": [ - "workflow:session:start", - "workflow:tools:context-gather", - "workflow:tools:task-generate-tdd" - ], - "next_steps": [ - "workflow:tdd-verify", - "workflow:status", - "workflow:execute" - ], - "alternatives": [ - "workflow:plan" - ], - "prerequisites": [] - }, - "workflow:execute": { - "prerequisites": [ - "workflow:plan", - "workflow:tdd-plan" - ], - "related": [ - "workflow:status", - "workflow:resume" - ], - "next_steps": [ - "workflow:review", - "workflow:tdd-verify" - ] - }, - "workflow:action-plan-verify": { - "prerequisites": [ - "workflow:plan" - ], - "next_steps": [ - "workflow:execute" - ], - "related": [ - "workflow:status" - ] - }, - "workflow:tdd-verify": { - "prerequisites": [ - "workflow:execute" - ], - "related": [ - "workflow:tools:tdd-coverage-analysis" - ] - }, - "workflow:session:start": { - "next_steps": [ - "workflow:plan", - "workflow:execute" - ], - "related": [ - "workflow:session:list", - "workflow:session:resume" - ] - }, - "workflow:session:resume": { - "alternatives": [ - "workflow:resume" - ], - "related": [ - "workflow:session:list", - "workflow:status" - ] - }, - "workflow:lite-plan": { - "calls_internally": [ - "workflow:lite-execute" - ], - "next_steps": [ - "workflow:lite-execute", - "workflow:status" - ], - "alternatives": [ - "workflow:plan" - ], - "prerequisites": [] - }, - "workflow:lite-fix": { - "next_steps": [ - "workflow:lite-execute", - "workflow:status" - ], - "alternatives": [ - "workflow:lite-plan" - ], - "related": [ - "workflow:test-cycle-execute" - ] - }, - "workflow:lite-execute": { - "prerequisites": [ - "workflow:lite-plan", - "workflow:lite-fix" - ], - "related": [ - "workflow:execute", - "workflow:status" - ] - }, - "workflow:review-session-cycle": { - "prerequisites": [ - "workflow:execute" - ], - "next_steps": [ - "workflow:review-fix" - ], - "related": [ - "workflow:review-module-cycle" - ] - }, - "workflow:review-fix": { - "prerequisites": [ - "workflow:review-module-cycle", - "workflow:review-session-cycle" - ], - "related": [ - "workflow:test-cycle-execute" - ] - }, - "memory:docs": { - "calls_internally": [ - "workflow:session:start", - "workflow:tools:context-gather" - ], - "next_steps": [ - "workflow:execute" - ] - }, - "memory:skill-memory": { - "next_steps": [ - "workflow:plan", - "cli:analyze" - ], - "related": [ - "memory:load-skill-memory" - ] - } -} \ No newline at end of file diff --git a/.claude/skills/ccw-help/index/essential-commands.json b/.claude/skills/ccw-help/index/essential-commands.json deleted file mode 100644 index 991cb2f9..00000000 --- a/.claude/skills/ccw-help/index/essential-commands.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - { - "name": "lite-plan", - "command": "/workflow:lite-plan", - "description": "Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation", - "arguments": "[-e|--explore] \\\"task description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-plan.md" - }, - { - "name": "lite-fix", - "command": "/workflow:lite-fix", - "description": "Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents", - "arguments": "[--hotfix] \\\"bug description or issue reference\\", - "category": "workflow", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/lite-fix.md" - }, - { - "name": "plan", - "command": "/workflow:plan", - "description": "5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs", - "arguments": "\\\"text description\\\"|file.md", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/plan.md" - }, - { - "name": "execute", - "command": "/workflow:execute", - "description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking", - "arguments": "[--resume-session=\\\"session-id\\\"]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "implementation", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/execute.md" - }, - { - "name": "start", - "command": "/workflow:session:start", - "description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection", - "arguments": "[--type ] [--auto|--new] [optional: task description for new session]", - "category": "workflow", - "subcategory": "session", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/session/start.md" - }, - { - "name": "review-session-cycle", - "command": "/workflow:review-session-cycle", - "description": "Session-based comprehensive multi-dimensional code review. Analyzes git changes from workflow session across 7 dimensions with hybrid parallel-iterative execution, aggregates findings, and performs focused deep-dives on critical issues until quality gates met.", - "arguments": "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "session-management", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/review-session-cycle.md" - }, - { - "name": "docs", - "command": "/memory:docs", - "description": "Plan documentation workflow with dynamic grouping (≤10 docs/task), generates IMPL tasks for parallel module trees, README, ARCHITECTURE, and HTTP API docs", - "arguments": "[path] [--tool ] [--mode ] [--cli-execute]", - "category": "memory", - "subcategory": null, - "usage_scenario": "documentation", - "difficulty": "Intermediate", - "source": "../../../commands/memory/docs.md" - }, - { - "name": "artifacts", - "command": "/workflow:brainstorm:artifacts", - "description": "Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis", - "arguments": "topic or challenge description [--count N]", - "category": "workflow", - "subcategory": "brainstorm", - "usage_scenario": "general", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/brainstorm/artifacts.md" - }, - { - "name": "action-plan-verify", - "command": "/workflow:action-plan-verify", - "description": "Perform non-destructive cross-artifact consistency analysis between IMPL_PLAN.md and task JSONs with quality gate validation", - "arguments": "[optional: --session session-id]", - "category": "workflow", - "subcategory": null, - "usage_scenario": "planning", - "difficulty": "Intermediate", - "source": "../../../commands/workflow/action-plan-verify.md" - }, - { - "name": "version", - "command": "/version", - "description": "Display Claude Code version information and check for updates", - "arguments": "", - "category": "general", - "subcategory": null, - "usage_scenario": "general", - "difficulty": "Beginner", - "source": "../../../commands/version.md" - } -] \ No newline at end of file diff --git a/.claude/skills/ccw/SKILL.md b/.claude/skills/ccw/SKILL.md index d537638a..76f4afd2 100644 --- a/.claude/skills/ccw/SKILL.md +++ b/.claude/skills/ccw/SKILL.md @@ -1,469 +1,352 @@ --- name: ccw -description: Stateless workflow orchestrator that automatically selects and executes the optimal workflow combination based on task intent. Supports rapid (lite-plan+execute), full (brainstorm+plan+execute), coupled (plan+execute), bugfix (lite-fix), and issue (multi-point fixes) workflows. Triggers on "ccw", "workflow", "自动工作流", "智能调度". -allowed-tools: Task(*), SlashCommand(*), AskUserQuestion(*), Read(*), Bash(*), Grep(*) +description: Stateless workflow orchestrator. Auto-selects optimal workflow based on task intent. Triggers "ccw", "workflow". +allowed-tools: Task(*), SlashCommand(*), AskUserQuestion(*), Read(*), Bash(*), Grep(*), TodoWrite(*) --- # CCW - Claude Code Workflow Orchestrator -无状态工作流协调器,根据任务意图自动选择并执行最优工作流组合。 +无状态工作流协调器,根据任务意图自动选择最优工作流。 -## Architecture Overview +## Architecture ``` ┌─────────────────────────────────────────────────────────────────┐ -│ CCW Orchestrator (Stateless + Requirement Analysis) │ +│ CCW Orchestrator (CLI-Enhanced + Requirement Analysis) │ ├─────────────────────────────────────────────────────────────────┤ -│ │ -│ Input Analysis & Requirement Extraction │ -│ ├─ Intent Classification (bugfix/feature/refactor/issue/...) │ -│ ├─ Complexity Assessment (low/medium/high) │ -│ ├─ Dimension Extraction (WHAT/WHERE/WHY/HOW) │ -│ ├─ Clarity Scoring (0-3) with auto-clarification │ -│ └─ Constraint Extraction (time/scope/quality) │ -│ │ -│ Workflow Selection (Decision Tree) │ -│ ├─ 🐛 Bug? → lite-fix / lite-fix --hotfix │ -│ ├─ ❓ Unclear? → clarify → brainstorm → plan → execute │ -│ ├─ ⚡ Simple? → lite-plan → lite-execute │ -│ ├─ 🔧 Complex? → plan → execute │ -│ ├─ 📋 Issue? → discover → plan → queue → execute │ -│ └─ 🎨 UI? → ui-design → plan → execute │ -│ │ -│ Execution Dispatch │ -│ └─ SlashCommand("/workflow:xxx") or Task(agent) │ -│ │ +│ Phase 1 │ Input Analysis (rule-based, fast path) │ +│ Phase 1.5 │ CLI Classification (semantic, smart path) │ +│ Phase 1.75 │ Requirement Clarification (clarity < 2) │ +│ Phase 2 │ Chain Selection (intent → workflow) │ +│ Phase 2.5 │ CLI Action Planning (high complexity) │ +│ Phase 3 │ User Confirmation (optional) │ +│ Phase 4 │ TODO Tracking Setup │ +│ Phase 5 │ Execution Loop │ └─────────────────────────────────────────────────────────────────┘ ``` -## Workflow Combinations (组合技) - -### 1. Rapid (快速迭代) ⚡ -**Pattern**: 多模型协作分析 + 直接执行 -**Commands**: `/workflow:lite-plan` → `/workflow:lite-execute` -**When to use**: -- 明确知道做什么和怎么做 -- 单一功能或小型改动 -- 快速原型验证 - -### 2. Full (完整流程) 📋 -**Pattern**: 分析 + 头脑风暴 + 规划 + 执行 -**Commands**: `/workflow:brainstorm:auto-parallel` → `/workflow:plan` → `/workflow:execute` -**When to use**: -- 不确定产品方向或技术方案 -- 需要多角色视角分析 -- 复杂新功能开发 - -### 3. Coupled (复杂耦合) 🔗 -**Pattern**: 完整规划 + 验证 + 执行 -**Commands**: `/workflow:plan` → `/workflow:action-plan-verify` → `/workflow:execute` -**When to use**: -- 跨模块依赖 -- 架构级变更 -- 团队协作项目 - -### 4. Bugfix (缺陷修复) 🐛 -**Pattern**: 智能诊断 + 修复 -**Commands**: `/workflow:lite-fix` or `/workflow:lite-fix --hotfix` -**When to use**: -- 任何有明确症状的Bug -- 生产事故紧急修复 -- 根因不清楚需要诊断 - -### 5. Issue (长时间多点修复) 📌 -**Pattern**: 发现 + 创建 + 规划 + 队列 + 批量执行 -**Commands**: -- 完整链: `/issue:discover` → `/issue:new` → `/issue:plan` → `/issue:queue` → `/issue:execute` -- 快速链: `/issue:plan` → `/issue:queue` → `/issue:execute` -- 提示发现: `/issue:discover-by-prompt` → `/issue:plan` → `/issue:queue` → `/issue:execute` -**When to use**: -- 多个相关问题需要批量处理 -- 长时间跨度的修复任务 -- 需要优先级排序和冲突解决 -- 安全审计、技术债务清理、GitHub Issues 批量导入 - -### 6. UI-First (设计驱动) 🎨 -**Pattern**: UI设计 + 规划 + 执行 -**Commands**: `/workflow:ui-design:*` → `/workflow:plan` → `/workflow:execute` -**When to use**: -- 前端功能开发 -- 需要视觉参考 -- 设计系统集成 - ## Intent Classification -```javascript -function classifyIntent(input) { - const text = input.toLowerCase() - - // Priority 1: Bug keywords - if (/\b(fix|bug|error|issue|crash|broken|fail|wrong|incorrect)\b/.test(text)) { - if (/\b(hotfix|urgent|production|critical|emergency)\b/.test(text)) { - return { type: 'bugfix', mode: 'hotfix', workflow: 'lite-fix --hotfix' } - } - return { type: 'bugfix', mode: 'standard', workflow: 'lite-fix' } - } - - // Priority 2: Issue batch keywords - if (/\b(issues?|batch|queue|多个|批量)\b/.test(text) && /\b(fix|resolve|处理)\b/.test(text)) { - return { type: 'issue', workflow: 'issue:plan → issue:queue → issue:execute' } - } - - // Priority 3: Uncertainty keywords → Full workflow - if (/\b(不确定|不知道|explore|研究|分析一下|怎么做|what if|should i|探索)\b/.test(text)) { - return { type: 'exploration', workflow: 'brainstorm → plan → execute' } - } - - // Priority 4: UI/Design keywords - if (/\b(ui|界面|design|设计|component|组件|style|样式|layout|布局)\b/.test(text)) { - return { type: 'ui', workflow: 'ui-design → plan → execute' } - } - - // Priority 5: Complexity assessment for remaining - const complexity = assessComplexity(text) - - if (complexity === 'high') { - return { type: 'feature', complexity: 'high', workflow: 'plan → verify → execute' } - } - - if (complexity === 'medium') { - return { type: 'feature', complexity: 'medium', workflow: 'lite-plan → lite-execute' } - } - - return { type: 'feature', complexity: 'low', workflow: 'lite-plan → lite-execute' } -} +### Priority Order +| Priority | Intent | Patterns | Flow | +|----------|--------|----------|------| +| 1 | bugfix/hotfix | `urgent,production,critical` + bug | `bugfix.hotfix` | +| 1 | bugfix | `fix,bug,error,crash,fail` | `bugfix.standard` | +| 2 | issue batch | `issues,batch` + `fix,resolve` | `issue` | +| 3 | exploration | `不确定,explore,研究,what if` | `full` | +| 3 | multi-perspective | `多视角,权衡,比较方案,cross-verify` | `multi-cli-plan` | +| 4 | quick-task | `快速,简单,small,quick` + feature | `lite-lite-lite` | +| 5 | ui design | `ui,design,component,style` | `ui` | +| 6 | tdd | `tdd,test-driven,先写测试` | `tdd` | +| 7 | review | `review,审查,code review` | `review-fix` | +| 8 | documentation | `文档,docs,readme` | `docs` | +| 99 | feature | complexity-based | `rapid`/`coupled` | + +### Complexity Assessment + +```javascript function assessComplexity(text) { let score = 0 - - // Architecture keywords - if (/\b(refactor|重构|migrate|迁移|architect|架构|system|系统)\b/.test(text)) score += 2 - - // Multi-module keywords - if (/\b(multiple|多个|across|跨|all|所有|entire|整个)\b/.test(text)) score += 2 - - // Integration keywords - if (/\b(integrate|集成|connect|连接|api|database|数据库)\b/.test(text)) score += 1 - - // Security/Performance keywords - if (/\b(security|安全|performance|性能|scale|扩展)\b/.test(text)) score += 1 - - if (score >= 4) return 'high' - if (score >= 2) return 'medium' - return 'low' + if (/refactor|重构|migrate|迁移|architect|架构|system|系统/.test(text)) score += 2 + if (/multiple|多个|across|跨|all|所有|entire|整个/.test(text)) score += 2 + if (/integrate|集成|api|database|数据库/.test(text)) score += 1 + if (/security|安全|performance|性能|scale|扩展/.test(text)) score += 1 + return score >= 4 ? 'high' : score >= 2 ? 'medium' : 'low' } ``` -## Execution Flow +| Complexity | Flow | +|------------|------| +| high | `coupled` (plan → verify → execute) | +| medium/low | `rapid` (lite-plan → lite-execute) | -### Phase 1: Input Analysis +### Dimension Extraction (WHAT/WHERE/WHY/HOW) + +从用户输入提取四个维度,用于需求澄清和工作流选择: + +| 维度 | 提取内容 | 示例模式 | +|------|----------|----------| +| **WHAT** | action + target | `创建/修复/重构/优化/分析` + 目标对象 | +| **WHERE** | scope + paths | `file/module/system` + 文件路径 | +| **WHY** | goal + motivation | `为了.../因为.../目的是...` | +| **HOW** | constraints + preferences | `必须.../不要.../应该...` | + +**Clarity Score** (0-3): +- +0.5: 有明确 action +- +0.5: 有具体 target +- +0.5: 有文件路径 +- +0.5: scope 不是 unknown +- +0.5: 有明确 goal +- +0.5: 有约束条件 +- -0.5: 包含不确定词 (`不知道/maybe/怎么`) + +### Requirement Clarification + +当 `clarity_score < 2` 时触发需求澄清: ```javascript -// Parse user input -const input = userInput.trim() +if (dimensions.clarity_score < 2) { + const questions = generateClarificationQuestions(dimensions) + // 生成问题:目标是什么? 范围是什么? 有什么约束? + AskUserQuestion({ questions }) +} +``` -// Check for explicit workflow request +**澄清问题类型**: +- 目标不明确 → "你想要对什么进行操作?" +- 范围不明确 → "操作的范围是什么?" +- 目的不明确 → "这个操作的主要目标是什么?" +- 复杂操作 → "有什么特殊要求或限制?" + +## TODO Tracking Protocol + +### CRITICAL: Append-Only Rule + +CCW 创建的 Todo **必须附加到现有列表**,不能覆盖用户的其他 Todo。 + +### Implementation + +```javascript +// 1. 使用 CCW 前缀隔离工作流 todo +const prefix = `CCW:${flowName}` + +// 2. 创建新 todo 时使用前缀格式 +TodoWrite({ + todos: [ + ...existingNonCCWTodos, // 保留用户的 todo + { content: `${prefix}: [1/N] /command:step1`, status: "in_progress", activeForm: "..." }, + { content: `${prefix}: [2/N] /command:step2`, status: "pending", activeForm: "..." } + ] +}) + +// 3. 更新状态时只修改匹配前缀的 todo +``` + +### Todo Format + +``` +CCW:{flow}: [{N}/{Total}] /command:name +``` + +### Visual Example + +``` +✓ CCW:rapid: [1/2] /workflow:lite-plan +→ CCW:rapid: [2/2] /workflow:lite-execute + 用户自己的 todo(保留不动) +``` + +### Status Management + +- 开始工作流:创建所有步骤 todo,第一步 `in_progress` +- 完成步骤:当前步骤 `completed`,下一步 `in_progress` +- 工作流结束:所有 CCW todo 标记 `completed` + +## Execution Flow + +```javascript +// 1. Check explicit command if (input.startsWith('/workflow:') || input.startsWith('/issue:')) { - // User explicitly requested a workflow, pass through SlashCommand(input) return } -// Classify intent -const intent = classifyIntent(input) +// 2. Classify intent +const intent = classifyIntent(input) // See command.json intent_rules -console.log(` -## Intent Analysis +// 3. Select flow +const flow = selectFlow(intent) // See command.json flows -**Input**: ${input.substring(0, 100)}... -**Classification**: ${intent.type} -**Complexity**: ${intent.complexity || 'N/A'} -**Recommended Workflow**: ${intent.workflow} -`) -``` +// 4. Create todos with CCW prefix +createWorkflowTodos(flow) -### Phase 2: User Confirmation (Optional) - -```javascript -// For high-complexity or ambiguous intents, confirm with user -if (intent.complexity === 'high' || intent.type === 'exploration') { - const confirmation = AskUserQuestion({ - questions: [{ - question: `Recommended: ${intent.workflow}. Proceed?`, - header: "Workflow", - multiSelect: false, - options: [ - { label: `${intent.workflow} (Recommended)`, description: "Use recommended workflow" }, - { label: "Rapid (lite-plan)", description: "Quick iteration" }, - { label: "Full (brainstorm+plan)", description: "Complete exploration" }, - { label: "Manual", description: "I'll specify the commands" } - ] - }] - }) - - // Adjust workflow based on user selection - intent.workflow = mapSelectionToWorkflow(confirmation) -} -``` - -### Phase 3: Workflow Dispatch - -```javascript -switch (intent.workflow) { - case 'lite-fix': - SlashCommand('/workflow:lite-fix', args: input) - break - - case 'lite-fix --hotfix': - SlashCommand('/workflow:lite-fix --hotfix', args: input) - break - - case 'lite-plan → lite-execute': - SlashCommand('/workflow:lite-plan', args: input) - // lite-plan will automatically dispatch to lite-execute - break - - case 'plan → verify → execute': - SlashCommand('/workflow:plan', args: input) - // After plan, prompt for verify and execute - break - - case 'brainstorm → plan → execute': - SlashCommand('/workflow:brainstorm:auto-parallel', args: input) - // After brainstorm, continue with plan - break - - case 'issue:plan → issue:queue → issue:execute': - SlashCommand('/issue:plan', args: input) - // Issue workflow handles queue and execute - break - - case 'ui-design → plan → execute': - // Determine UI design subcommand - if (hasReference(input)) { - SlashCommand('/workflow:ui-design:imitate-auto', args: input) - } else { - SlashCommand('/workflow:ui-design:explore-auto', args: input) - } - break -} +// 5. Dispatch first command +SlashCommand(flow.steps[0].command, args: input) ``` ## CLI Tool Integration -CCW **隐式调用** CLI 工具以获得三大优势: +CCW 在特定条件下自动注入 CLI 调用: -### 1. Token 效率 (Context Efficiency) +| Condition | CLI Inject | +|-----------|------------| +| 大量代码上下文 (≥50k chars) | `gemini --mode analysis` | +| 高复杂度任务 | `gemini --mode analysis` | +| Bug 诊断 | `gemini --mode analysis` | +| 多任务执行 (≥3 tasks) | `codex --mode write` | -CLI 工具在单独进程中运行,可以处理大量代码上下文而不消耗主会话 token: +### CLI Enhancement Phases -| 场景 | 触发条件 | 自动注入 | -|------|----------|----------| -| 大量代码上下文 | 文件读取 ≥ 50k 字符 | `gemini --mode analysis` | -| 多模块分析 | 涉及 ≥ 5 个模块 | `gemini --mode analysis` | -| 代码审查 | review 步骤 | `gemini --mode analysis` | +**Phase 1.5: CLI-Assisted Classification** -### 2. 多模型视角 (Multi-Model Perspectives) +当规则匹配不明确时,使用 CLI 辅助分类: -不同模型有不同优势,CCW 根据任务类型自动选择: +| 触发条件 | 说明 | +|----------|------| +| matchCount < 2 | 多个意图模式匹配 | +| complexity = high | 高复杂度任务 | +| input > 100 chars | 长输入需要语义理解 | -| Tool | 核心优势 | 最佳场景 | 触发关键词 | -|------|----------|----------|------------| -| Gemini | 超长上下文、深度分析、架构理解、执行流追踪 | 代码库理解、架构评估、根因分析 | "分析", "理解", "设计", "架构", "诊断" | -| Qwen | 代码模式识别、多维度分析 | Gemini备选、第二视角验证 | "评估", "对比", "验证" | -| Codex | 精确代码生成、自主执行、数学推理 | 功能实现、重构、测试 | "实现", "重构", "修复", "生成", "测试" | +**Phase 2.5: CLI-Assisted Action Planning** -### 3. 增强能力 (Enhanced Capabilities) +高复杂度任务的工作流优化: -#### Debug 能力增强 -``` -触发条件: intent === 'bugfix' AND root_cause_unclear -自动注入: gemini --mode analysis (执行流追踪) -用途: 假设驱动调试、状态机错误诊断、并发问题排查 -``` +| 触发条件 | 说明 | +|----------|------| +| complexity = high | 高复杂度任务 | +| steps >= 3 | 多步骤工作流 | +| input > 200 chars | 复杂需求描述 | -#### 规划能力增强 -``` -触发条件: complexity === 'high' OR intent === 'exploration' -自动注入: gemini --mode analysis (架构分析) -用途: 复杂任务先用CLI分析获取多模型视角 -``` +CLI 可返回建议:`use_default` | `modify` (调整步骤) | `upgrade` (升级工作流) -### 隐式注入规则 (Implicit Injection Rules) +## Continuation Commands -CCW 在以下条件自动注入 CLI 调用(无需用户显式请求): +工作流执行中的用户控制命令: -```javascript -const implicitRules = { - // 上下文收集:大量代码使用CLI可节省主会话token - context_gathering: { - trigger: 'file_read >= 50k chars OR module_count >= 5', - inject: 'gemini --mode analysis' - }, - - // 规划前分析:复杂任务先用CLI分析 - pre_planning_analysis: { - trigger: 'complexity === "high" OR intent === "exploration"', - inject: 'gemini --mode analysis' - }, - - // 调试诊断:利用Gemini的执行流追踪能力 - debug_diagnosis: { - trigger: 'intent === "bugfix" AND root_cause_unclear', - inject: 'gemini --mode analysis' - }, - - // 代码审查:用CLI减少token占用 - code_review: { - trigger: 'step === "review"', - inject: 'gemini --mode analysis' - }, - - // 多任务执行:用Codex自主完成 - implementation: { - trigger: 'step === "execute" AND task_count >= 3', - inject: 'codex --mode write' - } -} -``` - -### 用户语义触发 (Semantic Tool Assignment) - -```javascript -// 用户可以通过自然语言指定工具偏好 -const toolHints = { - gemini: /用\s*gemini|gemini\s*分析|让\s*gemini|深度分析|架构理解/i, - qwen: /用\s*qwen|qwen\s*评估|让\s*qwen|第二视角/i, - codex: /用\s*codex|codex\s*实现|让\s*codex|自主完成|批量修改/i -} - -function detectToolPreference(input) { - for (const [tool, pattern] of Object.entries(toolHints)) { - if (pattern.test(input)) return tool - } - return null // Auto-select based on task type -} -``` - -### 独立 CLI 工作流 (Standalone CLI Workflows) - -直接调用 CLI 进行特定任务: - -| Workflow | 命令 | 用途 | -|----------|------|------| -| CLI Analysis | `ccw cli --tool gemini` | 大型代码库快速理解、架构评估 | -| CLI Implement | `ccw cli --tool codex` | 明确需求的自主实现 | -| CLI Debug | `ccw cli --tool gemini` | 复杂bug根因分析、执行流追踪 | - -## Index Files (Dynamic Coordination) - -CCW 使用索引文件实现智能命令协调: - -| Index | Purpose | -|-------|---------| -| [index/command-capabilities.json](index/command-capabilities.json) | 命令能力分类(explore, plan, execute, test, review...) | -| [index/workflow-chains.json](index/workflow-chains.json) | 预定义工作流链(rapid, full, coupled, bugfix, issue, tdd, ui...) | - -### 能力分类 - -``` -capabilities: -├── explore - 代码探索、上下文收集 -├── brainstorm - 多角色分析、方案探索 -├── plan - 任务规划、分解 -├── verify - 计划验证、质量检查 -├── execute - 任务执行、代码实现 -├── bugfix - Bug诊断、修复 -├── test - 测试生成、执行 -├── review - 代码审查、质量分析 -├── issue - 批量问题管理 -├── ui-design - UI设计、原型 -├── memory - 文档、知识管理 -├── session - 会话管理 -└── debug - 调试、问题排查 -``` - -## TODO Tracking Integration - -CCW 自动使用 TodoWrite 跟踪工作流执行进度: - -```javascript -// 工作流启动时自动创建 TODO 列表 -TodoWrite({ - todos: [ - { content: "CCW: Rapid Iteration (2 steps)", status: "in_progress", activeForm: "Running workflow" }, - { content: "[1/2] /workflow:lite-plan", status: "in_progress", activeForm: "Executing lite-plan" }, - { content: "[2/2] /workflow:lite-execute", status: "pending", activeForm: "Executing lite-execute" } - ] -}) - -// 每个步骤完成后自动更新状态 -// 支持暂停、继续、跳过操作 -``` - -**进度可视化**: -``` -✓ CCW: Rapid Iteration (2 steps) -✓ [1/2] /workflow:lite-plan -→ [2/2] /workflow:lite-execute -``` - -**控制命令**: -| Input | Action | -|-------|--------| -| `continue` | 执行下一步 | +| 命令 | 作用 | +|------|------| +| `continue` | 继续执行下一步 | | `skip` | 跳过当前步骤 | -| `abort` | 停止工作流 | -| `/workflow:*` | 执行指定命令 | +| `abort` | 终止工作流 | +| `/workflow:*` | 切换到指定命令 | +| 自然语言 | 重新分析意图 | -## Reference Documents +## Workflow Flow Details -| Document | Purpose | -|----------|---------| -| [phases/orchestrator.md](phases/orchestrator.md) | 编排器决策逻辑 + 澄清流程 + TODO 跟踪 | -| [phases/actions/rapid.md](phases/actions/rapid.md) | 快速迭代组合 | -| [phases/actions/full.md](phases/actions/full.md) | 完整流程组合 | -| [phases/actions/coupled.md](phases/actions/coupled.md) | 复杂耦合组合 | -| [phases/actions/bugfix.md](phases/actions/bugfix.md) | 缺陷修复组合 | -| [phases/actions/issue.md](phases/actions/issue.md) | Issue工作流组合 (完整链路) | -| [specs/intent-classification.md](specs/intent-classification.md) | 意图分类规范 | -| [specs/requirement-analysis.md](specs/requirement-analysis.md) | 需求分析规范 (NEW) | -| [specs/output-templates.md](specs/output-templates.md) | 输出格式模板 (NEW) | -| [WORKFLOW_DECISION_GUIDE.md](/WORKFLOW_DECISION_GUIDE.md) | 工作流决策指南 | +### Issue Workflow (两阶段生命周期) -## Examples +Issue 工作流设计为两阶段生命周期,支持在项目迭代过程中积累问题并集中解决。 + +**Phase 1: Accumulation (积累阶段)** +- 触发:任务完成后的 review、代码审查发现、测试失败 +- 活动:需求扩展、bug 分析、测试覆盖、安全审查 +- 命令:`/issue:discover`, `/issue:discover-by-prompt`, `/issue:new` + +**Phase 2: Batch Resolution (批量解决阶段)** +- 触发:积累足够 issue 后的集中处理 +- 流程:plan → queue → execute +- 命令:`/issue:plan --all-pending` → `/issue:queue` → `/issue:execute` -### Example 1: Bug Fix ``` -User: 用户登录失败,返回 401 错误 -CCW: Intent=bugfix, Workflow=lite-fix -→ /workflow:lite-fix "用户登录失败,返回 401 错误" +任务完成 → discover → 积累 issue → ... → plan all → queue → parallel execute + ↑ ↓ + └────── 迭代循环 ───────┘ ``` -### Example 2: New Feature (Simple) +### lite-lite-lite vs multi-cli-plan + +| 维度 | lite-lite-lite | multi-cli-plan | +|------|---------------|----------------| +| **产物** | 无文件 | IMPL_PLAN.md + plan.json + synthesis.json | +| **状态** | 无状态 | 持久化 session | +| **CLI选择** | 自动分析任务类型选择 | 配置驱动 | +| **迭代** | 通过 AskUser | 多轮收敛 | +| **执行** | 直接执行 | 通过 lite-execute | +| **适用** | 快速修复、简单功能 | 复杂多步骤实现 | + +**选择指南**: +- 任务清晰、改动范围小 → `lite-lite-lite` +- 需要多视角分析、复杂架构 → `multi-cli-plan` + +### multi-cli-plan vs lite-plan + +| 维度 | multi-cli-plan | lite-plan | +|------|---------------|-----------| +| **上下文** | ACE 语义搜索 | 手动文件模式 | +| **分析** | 多 CLI 交叉验证 | 单次规划 | +| **迭代** | 多轮直到收敛 | 单轮 | +| **置信度** | 高 (共识驱动) | 中 (单一视角) | +| **适用** | 需要多视角的复杂任务 | 直接明确的实现 | + +**选择指南**: +- 需求明确、路径清晰 → `lite-plan` +- 需要权衡、多方案比较 → `multi-cli-plan` + +## Artifact Flow Protocol + +工作流产出的自动流转机制,支持不同格式产出间的意图提取和完成度判断。 + +### 产出格式 + +| 命令 | 产出位置 | 格式 | 关键字段 | +|------|----------|------|----------| +| `/workflow:lite-plan` | memory://plan | structured_plan | tasks, files, dependencies | +| `/workflow:plan` | .workflow/{session}/IMPL_PLAN.md | markdown_plan | phases, tasks, risks | +| `/workflow:execute` | execution_log.json | execution_report | completed_tasks, errors | +| `/workflow:test-cycle-execute` | test_results.json | test_report | pass_rate, failures, coverage | +| `/workflow:review-session-cycle` | review_report.md | review_report | findings, severity_counts | + +### 意图提取 (Intent Extraction) + +流转到下一步时,自动提取关键信息: + ``` -User: 添加用户头像上传功能 -CCW: Intent=feature, Complexity=low, Workflow=lite-plan→lite-execute -→ /workflow:lite-plan "添加用户头像上传功能" +plan → execute: + 提取: tasks (未完成), priority_order, files_to_modify, context_summary + +execute → test: + 提取: modified_files, test_scope (推断), pending_verification + +test → fix: + 条件: pass_rate < 0.95 + 提取: failures, error_messages, affected_files, suggested_fixes + +review → fix: + 条件: critical > 0 OR high > 3 + 提取: findings (critical/high), fix_priority, affected_files ``` -### Example 3: Complex Refactoring +### 完成度判断 + +**Test 完成度路由**: ``` -User: 重构整个认证模块,迁移到 OAuth2 -CCW: Intent=feature, Complexity=high, Workflow=plan→verify→execute -→ /workflow:plan "重构整个认证模块,迁移到 OAuth2" +pass_rate >= 0.95 AND coverage >= 0.80 → complete +pass_rate >= 0.95 AND coverage < 0.80 → add_more_tests +pass_rate >= 0.80 → fix_failures_then_continue +pass_rate < 0.80 → major_fix_required ``` -### Example 4: Exploration +**Review 完成度路由**: ``` -User: 我想优化系统性能,但不知道从哪入手 -CCW: Intent=exploration, Workflow=brainstorm→plan→execute -→ /workflow:brainstorm:auto-parallel "探索系统性能优化方向" +critical == 0 AND high <= 3 → complete_or_optional_fix +critical > 0 → mandatory_fix +high > 3 → recommended_fix ``` -### Example 5: Multi-Model Collaboration +### 流转决策模式 + +**plan_execute_test**: ``` -User: 用 gemini 分析现有架构,然后让 codex 实现优化 -CCW: Detects tool preferences, executes in sequence -→ Gemini CLI (analysis) → Codex CLI (implementation) +plan → execute → test + ↓ (if test fail) + extract_failures → fix → test (max 3 iterations) + ↓ (if still fail) + manual_intervention ``` + +**iterative_improvement**: +``` +execute → test → fix → test → ... + loop until: pass_rate >= 0.95 OR iterations >= 3 +``` + +### 使用示例 + +```javascript +// 执行完成后,根据产出决定下一步 +const result = await execute(plan) + +// 提取意图流转到测试 +const testContext = extractIntent('execute_to_test', result) +// testContext = { modified_files, test_scope, pending_verification } + +// 测试完成后,根据完成度决定路由 +const testResult = await test(testContext) +const nextStep = evaluateCompletion('test', testResult) +// nextStep = 'fix_failures_then_continue' if pass_rate = 0.85 +``` + +## Reference + +- [command.json](command.json) - 命令元数据、Flow 定义、意图规则、Artifact Flow diff --git a/.claude/skills/ccw/command.json b/.claude/skills/ccw/command.json new file mode 100644 index 00000000..f1903e66 --- /dev/null +++ b/.claude/skills/ccw/command.json @@ -0,0 +1,547 @@ +{ + "_metadata": { + "version": "2.0.0", + "description": "Unified CCW command index with capabilities, flows, and intent rules" + }, + + "capabilities": { + "explore": { + "description": "Codebase exploration and context gathering", + "commands": ["/workflow:init", "/workflow:tools:gather", "/memory:load"], + "agents": ["cli-explore-agent", "context-search-agent"] + }, + "brainstorm": { + "description": "Multi-perspective analysis and ideation", + "commands": ["/workflow:brainstorm:auto-parallel", "/workflow:brainstorm:artifacts", "/workflow:brainstorm:synthesis"], + "roles": ["product-manager", "system-architect", "ux-expert", "data-architect", "api-designer"] + }, + "plan": { + "description": "Task planning and decomposition", + "commands": ["/workflow:lite-plan", "/workflow:plan", "/workflow:tdd-plan", "/task:create", "/task:breakdown"], + "agents": ["cli-lite-planning-agent", "action-planning-agent"] + }, + "verify": { + "description": "Plan and quality verification", + "commands": ["/workflow:action-plan-verify", "/workflow:tdd-verify"] + }, + "execute": { + "description": "Task execution and implementation", + "commands": ["/workflow:lite-execute", "/workflow:execute", "/task:execute"], + "agents": ["code-developer", "cli-execution-agent", "universal-executor"] + }, + "bugfix": { + "description": "Bug diagnosis and fixing", + "commands": ["/workflow:lite-fix"], + "agents": ["code-developer"] + }, + "test": { + "description": "Test generation and execution", + "commands": ["/workflow:test-gen", "/workflow:test-fix-gen", "/workflow:test-cycle-execute"], + "agents": ["test-fix-agent"] + }, + "review": { + "description": "Code review and quality analysis", + "commands": ["/workflow:review-session-cycle", "/workflow:review-module-cycle", "/workflow:review", "/workflow:review-fix"] + }, + "issue": { + "description": "Issue lifecycle management - discover, accumulate, batch resolve", + "commands": ["/issue:new", "/issue:discover", "/issue:discover-by-prompt", "/issue:plan", "/issue:queue", "/issue:execute", "/issue:manage"], + "agents": ["issue-plan-agent", "issue-queue-agent", "cli-explore-agent"], + "lifecycle": { + "accumulation": { + "description": "任务完成后进行需求扩展、bug分析、测试发现", + "triggers": ["post-task review", "code review findings", "test failures"], + "commands": ["/issue:discover", "/issue:discover-by-prompt", "/issue:new"] + }, + "batch_resolution": { + "description": "积累的issue集中规划和并行执行", + "flow": ["plan", "queue", "execute"], + "commands": ["/issue:plan --all-pending", "/issue:queue", "/issue:execute"] + } + } + }, + "ui-design": { + "description": "UI design and prototyping", + "commands": ["/workflow:ui-design:explore-auto", "/workflow:ui-design:imitate-auto", "/workflow:ui-design:design-sync"], + "agents": ["ui-design-agent"] + }, + "memory": { + "description": "Documentation and knowledge management", + "commands": ["/memory:docs", "/memory:update-related", "/memory:update-full", "/memory:skill-memory"], + "agents": ["doc-generator", "memory-bridge"] + } + }, + + "flows": { + "rapid": { + "name": "Rapid Iteration", + "description": "多模型协作分析 + 直接执行", + "complexity": ["low", "medium"], + "steps": [ + { "command": "/workflow:lite-plan", "optional": false, "auto_continue": true }, + { "command": "/workflow:lite-execute", "optional": false } + ], + "cli_hints": { + "explore_phase": { "tool": "gemini", "mode": "analysis", "trigger": "needs_exploration" }, + "execution": { "tool": "codex", "mode": "write", "trigger": "complexity >= medium" } + }, + "estimated_time": "15-45 min" + }, + "full": { + "name": "Full Exploration", + "description": "头脑风暴 + 规划 + 执行", + "complexity": ["medium", "high"], + "steps": [ + { "command": "/workflow:brainstorm:auto-parallel", "optional": false, "confirm_before": true }, + { "command": "/workflow:plan", "optional": false }, + { "command": "/workflow:action-plan-verify", "optional": true, "auto_continue": true }, + { "command": "/workflow:execute", "optional": false } + ], + "cli_hints": { + "role_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true }, + "execution": { "tool": "codex", "mode": "write", "trigger": "task_count >= 3" } + }, + "estimated_time": "1-3 hours" + }, + "coupled": { + "name": "Coupled Planning", + "description": "完整规划 + 验证 + 执行", + "complexity": ["high"], + "steps": [ + { "command": "/workflow:plan", "optional": false }, + { "command": "/workflow:action-plan-verify", "optional": false, "auto_continue": true }, + { "command": "/workflow:execute", "optional": false }, + { "command": "/workflow:review", "optional": true } + ], + "cli_hints": { + "pre_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "always" }, + "execution": { "tool": "codex", "mode": "write", "trigger": "always" } + }, + "estimated_time": "2-4 hours" + }, + "bugfix": { + "name": "Bug Fix", + "description": "智能诊断 + 修复", + "complexity": ["low", "medium"], + "variants": { + "standard": [{ "command": "/workflow:lite-fix", "optional": false }], + "hotfix": [{ "command": "/workflow:lite-fix --hotfix", "optional": false }] + }, + "cli_hints": { + "diagnosis": { "tool": "gemini", "mode": "analysis", "trigger": "always" }, + "fix": { "tool": "codex", "mode": "write", "trigger": "severity >= medium" } + }, + "estimated_time": "10-30 min" + }, + "issue": { + "name": "Issue Lifecycle", + "description": "发现积累 → 批量规划 → 队列优化 → 并行执行", + "complexity": ["medium", "high"], + "phases": { + "accumulation": { + "description": "项目迭代中持续发现和积累issue", + "commands": ["/issue:discover", "/issue:new"], + "trigger": "post-task, code-review, test-failure" + }, + "resolution": { + "description": "集中规划和执行积累的issue", + "steps": [ + { "command": "/issue:plan --all-pending", "optional": false }, + { "command": "/issue:queue", "optional": false }, + { "command": "/issue:execute", "optional": false } + ] + } + }, + "cli_hints": { + "discovery": { "tool": "gemini", "mode": "analysis", "trigger": "perspective_analysis", "parallel": true }, + "solution_generation": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true }, + "batch_execution": { "tool": "codex", "mode": "write", "trigger": "always" } + }, + "estimated_time": "1-4 hours" + }, + "lite-lite-lite": { + "name": "Ultra-Lite Multi-CLI", + "description": "零文件 + 自动CLI选择 + 语义描述 + 直接执行", + "complexity": ["low", "medium"], + "steps": [ + { "phase": "clarify", "description": "需求澄清 (AskUser if needed)" }, + { "phase": "auto-select", "description": "任务分析 → 自动选择CLI组合" }, + { "phase": "multi-cli", "description": "并行多CLI分析" }, + { "phase": "decision", "description": "展示结果 → AskUser决策" }, + { "phase": "execute", "description": "直接执行 (无中间文件)" } + ], + "vs_multi_cli_plan": { + "artifacts": "None vs IMPL_PLAN.md + plan.json + synthesis.json", + "session": "Stateless vs Persistent", + "cli_selection": "Auto-select based on task analysis vs Config-driven", + "iteration": "Via AskUser vs Via rounds/synthesis", + "execution": "Direct vs Via lite-execute", + "best_for": "Quick fixes, simple features vs Complex multi-step implementations" + }, + "cli_hints": { + "analysis": { "tool": "auto", "mode": "analysis", "parallel": true }, + "execution": { "tool": "auto", "mode": "write" } + }, + "estimated_time": "10-30 min" + }, + "multi-cli-plan": { + "name": "Multi-CLI Collaborative Planning", + "description": "ACE上下文 + 多CLI协作分析 + 迭代收敛 + 计划生成", + "complexity": ["medium", "high"], + "steps": [ + { "command": "/workflow:multi-cli-plan", "optional": false, "phases": [ + "context_gathering: ACE语义搜索", + "multi_cli_discussion: cli-discuss-agent多轮分析", + "present_options: 展示解决方案", + "user_decision: 用户选择", + "plan_generation: cli-lite-planning-agent生成计划" + ]}, + { "command": "/workflow:lite-execute", "optional": false } + ], + "vs_lite_plan": { + "context": "ACE semantic search vs Manual file patterns", + "analysis": "Multi-CLI cross-verification vs Single-pass planning", + "iteration": "Multiple rounds until convergence vs Single round", + "confidence": "High (consensus-based) vs Medium (single perspective)", + "best_for": "Complex tasks needing multiple perspectives vs Straightforward implementations" + }, + "agents": ["cli-discuss-agent", "cli-lite-planning-agent"], + "cli_hints": { + "discussion": { "tools": ["gemini", "codex", "claude"], "mode": "analysis", "parallel": true }, + "planning": { "tool": "gemini", "mode": "analysis" } + }, + "output": ".workflow/.multi-cli-plan/{session-id}/", + "estimated_time": "30-90 min" + }, + "tdd": { + "name": "Test-Driven Development", + "description": "TDD规划 + 执行 + 验证", + "complexity": ["medium", "high"], + "steps": [ + { "command": "/workflow:tdd-plan", "optional": false }, + { "command": "/workflow:execute", "optional": false }, + { "command": "/workflow:tdd-verify", "optional": false } + ], + "cli_hints": { + "test_strategy": { "tool": "gemini", "mode": "analysis", "trigger": "always" }, + "red_green_refactor": { "tool": "codex", "mode": "write", "trigger": "always" } + }, + "estimated_time": "1-3 hours" + }, + "ui": { + "name": "UI-First Development", + "description": "UI设计 + 规划 + 执行", + "complexity": ["medium", "high"], + "variants": { + "explore": [ + { "command": "/workflow:ui-design:explore-auto", "optional": false }, + { "command": "/workflow:ui-design:design-sync", "optional": false, "auto_continue": true }, + { "command": "/workflow:plan", "optional": false }, + { "command": "/workflow:execute", "optional": false } + ], + "imitate": [ + { "command": "/workflow:ui-design:imitate-auto", "optional": false }, + { "command": "/workflow:ui-design:design-sync", "optional": false, "auto_continue": true }, + { "command": "/workflow:plan", "optional": false }, + { "command": "/workflow:execute", "optional": false } + ] + }, + "estimated_time": "2-4 hours" + }, + "review-fix": { + "name": "Review and Fix", + "description": "多维审查 + 自动修复", + "complexity": ["medium"], + "steps": [ + { "command": "/workflow:review-session-cycle", "optional": false }, + { "command": "/workflow:review-fix", "optional": true } + ], + "cli_hints": { + "multi_dimension_review": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true }, + "auto_fix": { "tool": "codex", "mode": "write", "trigger": "findings_count >= 3" } + }, + "estimated_time": "30-90 min" + }, + "docs": { + "name": "Documentation", + "description": "批量文档生成", + "complexity": ["low", "medium"], + "variants": { + "incremental": [{ "command": "/memory:update-related", "optional": false }], + "full": [ + { "command": "/memory:docs", "optional": false }, + { "command": "/workflow:execute", "optional": false } + ] + }, + "estimated_time": "15-60 min" + } + }, + + "intent_rules": { + "bugfix": { + "priority": 1, + "variants": { + "hotfix": { + "patterns": ["hotfix", "urgent", "production", "critical", "emergency", "紧急", "生产环境", "线上"], + "flow": "bugfix.hotfix" + }, + "standard": { + "patterns": ["fix", "bug", "error", "issue", "crash", "broken", "fail", "wrong", "修复", "错误", "崩溃"], + "flow": "bugfix.standard" + } + } + }, + "issue_batch": { + "priority": 2, + "patterns": { + "batch": ["issues", "batch", "queue", "多个", "批量"], + "action": ["fix", "resolve", "处理", "解决"] + }, + "require_both": true, + "flow": "issue" + }, + "exploration": { + "priority": 3, + "patterns": ["不确定", "不知道", "explore", "研究", "分析一下", "怎么做", "what if", "探索"], + "flow": "full" + }, + "ui_design": { + "priority": 4, + "patterns": ["ui", "界面", "design", "设计", "component", "组件", "style", "样式", "layout", "布局"], + "variants": { + "imitate": { "triggers": ["参考", "模仿", "像", "类似"], "flow": "ui.imitate" }, + "explore": { "triggers": [], "flow": "ui.explore" } + } + }, + "tdd": { + "priority": 5, + "patterns": ["tdd", "test-driven", "测试驱动", "先写测试", "test first"], + "flow": "tdd" + }, + "review": { + "priority": 6, + "patterns": ["review", "审查", "检查代码", "code review", "质量检查"], + "flow": "review-fix" + }, + "documentation": { + "priority": 7, + "patterns": ["文档", "documentation", "docs", "readme"], + "variants": { + "incremental": { "triggers": ["更新", "增量"], "flow": "docs.incremental" }, + "full": { "triggers": ["全部", "完整"], "flow": "docs.full" } + } + }, + "feature": { + "priority": 99, + "complexity_map": { + "high": "coupled", + "medium": "rapid", + "low": "rapid" + } + } + }, + + "complexity_indicators": { + "high": { + "threshold": 4, + "patterns": { + "architecture": { "keywords": ["refactor", "重构", "migrate", "迁移", "architect", "架构", "system", "系统"], "weight": 2 }, + "multi_module": { "keywords": ["multiple", "多个", "across", "跨", "all", "所有", "entire", "整个"], "weight": 2 }, + "integration": { "keywords": ["integrate", "集成", "api", "database", "数据库"], "weight": 1 }, + "quality": { "keywords": ["security", "安全", "performance", "性能", "scale", "扩展"], "weight": 1 } + } + }, + "medium": { "threshold": 2 }, + "low": { "threshold": 0 } + }, + + "cli_tools": { + "gemini": { + "strengths": ["超长上下文", "深度分析", "架构理解", "执行流追踪"], + "triggers": ["分析", "理解", "设计", "架构", "诊断"], + "mode": "analysis" + }, + "qwen": { + "strengths": ["代码模式识别", "多维度分析"], + "triggers": ["评估", "对比", "验证"], + "mode": "analysis" + }, + "codex": { + "strengths": ["精确代码生成", "自主执行"], + "triggers": ["实现", "重构", "修复", "生成"], + "mode": "write" + } + }, + + "cli_injection_rules": { + "context_gathering": { "trigger": "file_read >= 50k OR module_count >= 5", "inject": "gemini --mode analysis" }, + "pre_planning_analysis": { "trigger": "complexity === high", "inject": "gemini --mode analysis" }, + "debug_diagnosis": { "trigger": "intent === bugfix AND root_cause_unclear", "inject": "gemini --mode analysis" }, + "code_review": { "trigger": "step === review", "inject": "gemini --mode analysis" }, + "implementation": { "trigger": "step === execute AND task_count >= 3", "inject": "codex --mode write" } + }, + + "artifact_flow": { + "_description": "定义工作流产出的格式、意图提取和流转规则", + + "outputs": { + "/workflow:lite-plan": { + "artifact": "memory://plan", + "format": "structured_plan", + "fields": ["tasks", "files", "dependencies", "approach"] + }, + "/workflow:plan": { + "artifact": ".workflow/{session}/IMPL_PLAN.md", + "format": "markdown_plan", + "fields": ["phases", "tasks", "dependencies", "risks", "test_strategy"] + }, + "/workflow:multi-cli-plan": { + "artifact": ".workflow/.multi-cli-plan/{session}/", + "format": "multi_file", + "files": ["IMPL_PLAN.md", "plan.json", "synthesis.json"], + "fields": ["consensus", "divergences", "recommended_approach", "tasks"] + }, + "/workflow:lite-execute": { + "artifact": "git_changes", + "format": "code_diff", + "fields": ["modified_files", "added_files", "deleted_files", "build_status"] + }, + "/workflow:execute": { + "artifact": ".workflow/{session}/execution_log.json", + "format": "execution_report", + "fields": ["completed_tasks", "pending_tasks", "errors", "warnings"] + }, + "/workflow:test-cycle-execute": { + "artifact": ".workflow/{session}/test_results.json", + "format": "test_report", + "fields": ["pass_rate", "failures", "coverage", "duration"] + }, + "/workflow:review-session-cycle": { + "artifact": ".workflow/{session}/review_report.md", + "format": "review_report", + "fields": ["findings", "severity_counts", "recommendations"] + }, + "/workflow:lite-fix": { + "artifact": "git_changes", + "format": "fix_report", + "fields": ["root_cause", "fix_applied", "files_modified", "verification_status"] + } + }, + + "intent_extraction": { + "plan_to_execute": { + "from": ["lite-plan", "plan", "multi-cli-plan"], + "to": ["lite-execute", "execute"], + "extract": { + "tasks": "$.tasks[] | filter(status != 'completed')", + "priority_order": "$.tasks | sort_by(priority)", + "files_to_modify": "$.tasks[].files | flatten | unique", + "dependencies": "$.dependencies", + "context_summary": "$.approach OR $.recommended_approach" + } + }, + "execute_to_test": { + "from": ["lite-execute", "execute"], + "to": ["test-cycle-execute", "test-fix-gen"], + "extract": { + "modified_files": "$.modified_files", + "test_scope": "infer_from($.modified_files)", + "build_status": "$.build_status", + "pending_verification": "$.completed_tasks | needs_test" + } + }, + "test_to_fix": { + "from": ["test-cycle-execute"], + "to": ["lite-fix", "review-fix"], + "condition": "$.pass_rate < 0.95", + "extract": { + "failures": "$.failures", + "error_messages": "$.failures[].message", + "affected_files": "$.failures[].file", + "suggested_fixes": "$.failures[].suggested_fix" + } + }, + "review_to_fix": { + "from": ["review-session-cycle", "review-module-cycle"], + "to": ["review-fix"], + "condition": "$.severity_counts.critical > 0 OR $.severity_counts.high > 3", + "extract": { + "findings": "$.findings | filter(severity in ['critical', 'high'])", + "fix_priority": "$.findings | group_by(category) | sort_by(severity)", + "affected_files": "$.findings[].file | unique" + } + } + }, + + "completion_criteria": { + "plan": { + "required": ["has_tasks", "has_files"], + "optional": ["has_tests", "no_blocking_risks"], + "threshold": 0.8, + "routing": { + "complete": "proceed_to_execute", + "incomplete": "clarify_requirements" + } + }, + "execute": { + "required": ["all_tasks_attempted", "no_critical_errors"], + "optional": ["build_passes", "lint_passes"], + "threshold": 1.0, + "routing": { + "complete": "proceed_to_test_or_review", + "partial": "continue_execution", + "failed": "diagnose_and_retry" + } + }, + "test": { + "metrics": { + "pass_rate": { "target": 0.95, "minimum": 0.80 }, + "coverage": { "target": 0.80, "minimum": 0.60 } + }, + "routing": { + "pass_rate >= 0.95 AND coverage >= 0.80": "complete", + "pass_rate >= 0.95 AND coverage < 0.80": "add_more_tests", + "pass_rate >= 0.80": "fix_failures_then_continue", + "pass_rate < 0.80": "major_fix_required" + } + }, + "review": { + "metrics": { + "critical_findings": { "target": 0, "maximum": 0 }, + "high_findings": { "target": 0, "maximum": 3 } + }, + "routing": { + "critical == 0 AND high <= 3": "complete_or_optional_fix", + "critical > 0": "mandatory_fix", + "high > 3": "recommended_fix" + } + } + }, + + "flow_decisions": { + "_description": "根据产出完成度决定下一步", + "patterns": { + "plan_execute_test": { + "sequence": ["plan", "execute", "test"], + "on_test_fail": { + "action": "extract_failures_and_fix", + "max_iterations": 3, + "fallback": "manual_intervention" + } + }, + "plan_execute_review": { + "sequence": ["plan", "execute", "review"], + "on_review_issues": { + "action": "prioritize_and_fix", + "auto_fix_threshold": "severity < high" + } + }, + "iterative_improvement": { + "sequence": ["execute", "test", "fix"], + "loop_until": "pass_rate >= 0.95 OR iterations >= 3", + "on_loop_exit": "report_status" + } + } + } + } +} diff --git a/.claude/skills/ccw/index/command-capabilities.json b/.claude/skills/ccw/index/command-capabilities.json deleted file mode 100644 index e8247956..00000000 --- a/.claude/skills/ccw/index/command-capabilities.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "_metadata": { - "version": "1.0.0", - "generated": "2026-01-03", - "description": "CCW command capability index for intelligent workflow coordination" - }, - "capabilities": { - "explore": { - "description": "Codebase exploration and context gathering", - "commands": [ - { "command": "/workflow:init", "weight": 1.0, "tags": ["project-setup", "context"] }, - { "command": "/workflow:tools:gather", "weight": 0.9, "tags": ["context", "analysis"] }, - { "command": "/memory:load", "weight": 0.8, "tags": ["context", "memory"] } - ], - "agents": ["cli-explore-agent", "context-search-agent"] - }, - "brainstorm": { - "description": "Multi-perspective analysis and ideation", - "commands": [ - { "command": "/workflow:brainstorm:auto-parallel", "weight": 1.0, "tags": ["exploration", "multi-role"] }, - { "command": "/workflow:brainstorm:artifacts", "weight": 0.9, "tags": ["clarification", "guidance"] }, - { "command": "/workflow:brainstorm:synthesis", "weight": 0.8, "tags": ["consolidation", "refinement"] } - ], - "roles": ["product-manager", "system-architect", "ux-expert", "data-architect", "api-designer"] - }, - "plan": { - "description": "Task planning and decomposition", - "commands": [ - { "command": "/workflow:lite-plan", "weight": 1.0, "complexity": "low-medium", "tags": ["fast", "interactive"] }, - { "command": "/workflow:plan", "weight": 0.9, "complexity": "medium-high", "tags": ["comprehensive", "persistent"] }, - { "command": "/workflow:tdd-plan", "weight": 0.7, "complexity": "medium-high", "tags": ["test-first", "quality"] }, - { "command": "/task:create", "weight": 0.6, "tags": ["single-task", "manual"] }, - { "command": "/task:breakdown", "weight": 0.5, "tags": ["decomposition", "subtasks"] } - ], - "agents": ["cli-lite-planning-agent", "action-planning-agent"] - }, - "verify": { - "description": "Plan and quality verification", - "commands": [ - { "command": "/workflow:action-plan-verify", "weight": 1.0, "tags": ["plan-quality", "consistency"] }, - { "command": "/workflow:tdd-verify", "weight": 0.8, "tags": ["tdd-compliance", "coverage"] } - ] - }, - "execute": { - "description": "Task execution and implementation", - "commands": [ - { "command": "/workflow:lite-execute", "weight": 1.0, "complexity": "low-medium", "tags": ["fast", "agent-or-cli"] }, - { "command": "/workflow:execute", "weight": 0.9, "complexity": "medium-high", "tags": ["dag-parallel", "comprehensive"] }, - { "command": "/task:execute", "weight": 0.7, "tags": ["single-task"] } - ], - "agents": ["code-developer", "cli-execution-agent", "universal-executor"] - }, - "bugfix": { - "description": "Bug diagnosis and fixing", - "commands": [ - { "command": "/workflow:lite-fix", "weight": 1.0, "tags": ["diagnosis", "fix", "standard"] }, - { "command": "/workflow:lite-fix --hotfix", "weight": 0.9, "tags": ["emergency", "production", "fast"] } - ], - "agents": ["code-developer"] - }, - "test": { - "description": "Test generation and execution", - "commands": [ - { "command": "/workflow:test-gen", "weight": 1.0, "tags": ["post-implementation", "coverage"] }, - { "command": "/workflow:test-fix-gen", "weight": 0.9, "tags": ["from-description", "flexible"] }, - { "command": "/workflow:test-cycle-execute", "weight": 0.8, "tags": ["iterative", "fix-cycle"] } - ], - "agents": ["test-fix-agent"] - }, - "review": { - "description": "Code review and quality analysis", - "commands": [ - { "command": "/workflow:review-session-cycle", "weight": 1.0, "tags": ["session-based", "comprehensive"] }, - { "command": "/workflow:review-module-cycle", "weight": 0.9, "tags": ["module-based", "targeted"] }, - { "command": "/workflow:review", "weight": 0.8, "tags": ["single-pass", "type-specific"] }, - { "command": "/workflow:review-fix", "weight": 0.7, "tags": ["auto-fix", "findings"] } - ] - }, - "issue": { - "description": "Batch issue management", - "commands": [ - { "command": "/issue:new", "weight": 1.0, "tags": ["create", "import"] }, - { "command": "/issue:discover", "weight": 0.9, "tags": ["find", "analyze"] }, - { "command": "/issue:plan", "weight": 0.8, "tags": ["solutions", "planning"] }, - { "command": "/issue:queue", "weight": 0.7, "tags": ["prioritize", "order"] }, - { "command": "/issue:execute", "weight": 0.6, "tags": ["batch-execute", "dag"] } - ], - "agents": ["issue-plan-agent", "issue-queue-agent"] - }, - "ui-design": { - "description": "UI design and prototyping", - "commands": [ - { "command": "/workflow:ui-design:explore-auto", "weight": 1.0, "tags": ["from-scratch", "variants"] }, - { "command": "/workflow:ui-design:imitate-auto", "weight": 0.9, "tags": ["reference-based", "copy"] }, - { "command": "/workflow:ui-design:design-sync", "weight": 0.7, "tags": ["sync", "finalize"] }, - { "command": "/workflow:ui-design:generate", "weight": 0.6, "tags": ["assemble", "prototype"] } - ], - "agents": ["ui-design-agent"] - }, - "memory": { - "description": "Documentation and knowledge management", - "commands": [ - { "command": "/memory:docs", "weight": 1.0, "tags": ["generate", "planning"] }, - { "command": "/memory:update-related", "weight": 0.9, "tags": ["incremental", "git-based"] }, - { "command": "/memory:update-full", "weight": 0.8, "tags": ["comprehensive", "all-modules"] }, - { "command": "/memory:skill-memory", "weight": 0.7, "tags": ["package", "reusable"] } - ], - "agents": ["doc-generator", "memory-bridge"] - }, - "session": { - "description": "Workflow session management", - "commands": [ - { "command": "/workflow:session:start", "weight": 1.0, "tags": ["init", "discover"] }, - { "command": "/workflow:session:list", "weight": 0.9, "tags": ["view", "status"] }, - { "command": "/workflow:session:resume", "weight": 0.8, "tags": ["continue", "restore"] }, - { "command": "/workflow:session:complete", "weight": 0.7, "tags": ["finish", "archive"] } - ] - }, - "debug": { - "description": "Debugging and problem solving", - "commands": [ - { "command": "/workflow:debug", "weight": 1.0, "tags": ["hypothesis", "iterative"] }, - { "command": "/workflow:clean", "weight": 0.6, "tags": ["cleanup", "artifacts"] } - ] - } - } -} diff --git a/.claude/skills/ccw/index/intent-rules.json b/.claude/skills/ccw/index/intent-rules.json deleted file mode 100644 index a71b2d7f..00000000 --- a/.claude/skills/ccw/index/intent-rules.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "_metadata": { - "version": "1.0.0", - "description": "Externalized intent classification rules for CCW orchestrator" - }, - "intent_patterns": { - "bugfix": { - "priority": 1, - "description": "Bug修复意图", - "variants": { - "hotfix": { - "patterns": ["hotfix", "urgent", "production", "critical", "emergency", "紧急", "生产环境", "线上"], - "workflow": "lite-fix --hotfix" - }, - "standard": { - "patterns": ["fix", "bug", "error", "issue", "crash", "broken", "fail", "wrong", "incorrect", "修复", "错误", "崩溃", "失败"], - "workflow": "lite-fix" - } - } - }, - "issue_batch": { - "priority": 2, - "description": "批量Issue处理意图", - "patterns": { - "batch_keywords": ["issues", "issue", "batch", "queue", "多个", "批量", "一批"], - "action_keywords": ["fix", "resolve", "处理", "解决", "修复"] - }, - "require_both": true, - "workflow": "issue:plan → issue:queue → issue:execute" - }, - "exploration": { - "priority": 3, - "description": "探索/不确定意图", - "patterns": ["不确定", "不知道", "explore", "研究", "分析一下", "怎么做", "what if", "should i", "探索", "可能", "或许", "建议"], - "workflow": "brainstorm → plan → execute" - }, - "ui_design": { - "priority": 4, - "description": "UI/设计意图", - "patterns": ["ui", "界面", "design", "设计", "component", "组件", "style", "样式", "layout", "布局", "前端", "frontend", "页面"], - "variants": { - "imitate": { - "triggers": ["参考", "模仿", "像", "类似", "reference", "like"], - "workflow": "ui-design:imitate-auto → plan → execute" - }, - "explore": { - "triggers": [], - "workflow": "ui-design:explore-auto → plan → execute" - } - } - }, - "tdd": { - "priority": 5, - "description": "测试驱动开发意图", - "patterns": ["tdd", "test-driven", "测试驱动", "先写测试", "red-green", "test first"], - "workflow": "tdd-plan → execute → tdd-verify" - }, - "review": { - "priority": 6, - "description": "代码审查意图", - "patterns": ["review", "审查", "检查代码", "code review", "质量检查", "安全审查"], - "workflow": "review-session-cycle → review-fix" - }, - "documentation": { - "priority": 7, - "description": "文档生成意图", - "patterns": ["文档", "documentation", "docs", "readme", "注释", "api doc", "说明"], - "variants": { - "incremental": { - "triggers": ["更新", "增量", "相关"], - "workflow": "memory:update-related" - }, - "full": { - "triggers": ["全部", "完整", "所有"], - "workflow": "memory:docs → execute" - } - } - } - }, - "complexity_indicators": { - "high": { - "score_threshold": 4, - "patterns": { - "architecture": { - "keywords": ["refactor", "重构", "migrate", "迁移", "architect", "架构", "system", "系统"], - "weight": 2 - }, - "multi_module": { - "keywords": ["multiple", "多个", "across", "跨", "all", "所有", "entire", "整个"], - "weight": 2 - }, - "integration": { - "keywords": ["integrate", "集成", "connect", "连接", "api", "database", "数据库"], - "weight": 1 - }, - "quality": { - "keywords": ["security", "安全", "performance", "性能", "scale", "扩展", "优化"], - "weight": 1 - } - }, - "workflow": "plan → verify → execute" - }, - "medium": { - "score_threshold": 2, - "workflow": "lite-plan → lite-execute" - }, - "low": { - "score_threshold": 0, - "workflow": "lite-plan → lite-execute" - } - }, - "cli_tool_triggers": { - "gemini": { - "explicit": ["用 gemini", "gemini 分析", "让 gemini", "用gemini"], - "semantic": ["深度分析", "架构理解", "执行流追踪", "根因分析"] - }, - "qwen": { - "explicit": ["用 qwen", "qwen 评估", "让 qwen", "用qwen"], - "semantic": ["第二视角", "对比验证", "模式识别"] - }, - "codex": { - "explicit": ["用 codex", "codex 实现", "让 codex", "用codex"], - "semantic": ["自主完成", "批量修改", "自动实现"] - } - }, - "fallback_rules": { - "no_match": { - "default_workflow": "lite-plan → lite-execute", - "use_complexity_assessment": true - }, - "ambiguous": { - "action": "ask_user", - "message": "检测到多个可能意图,请确认工作流选择" - } - }, - "cli_classification": { - "_doc": "CLI辅助意图分类配置:对模糊或复杂输入使用Gemini进行语义理解", - "enabled": true, - "trigger_conditions": { - "low_confidence_threshold": 0.6, - "min_input_length": 100, - "low_match_count": 2, - "complexity_trigger": "high", - "ambiguous_patterns": ["不确定", "可能", "或者", "建议", "最好", "maybe", "perhaps", "should i", "what if", "or"] - }, - "default_tool": "gemini", - "fallback_tool": "qwen", - "timeout_ms": 60000, - "cache_similar_inputs": true, - "max_retries": 2 - }, - "cli_action_planning": { - "_doc": "CLI辅助行动规划配置:对高复杂度任务使用CLI规划最优执行策略", - "enabled": true, - "trigger_conditions": { - "complexity_threshold": "high", - "step_count_threshold": 3, - "multi_module_detected": true - }, - "default_tool": "gemini", - "timeout_ms": 60000, - "allow_step_modification": true, - "risk_assessment": true - } -} diff --git a/.claude/skills/ccw/index/workflow-chains.json b/.claude/skills/ccw/index/workflow-chains.json deleted file mode 100644 index 3d25ec50..00000000 --- a/.claude/skills/ccw/index/workflow-chains.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "_metadata": { - "version": "1.1.0", - "description": "Predefined workflow chains with CLI tool integration for CCW orchestration" - }, - "cli_tools": { - "_doc": "CLI工具是CCW的核心能力,在合适时机自动调用以获得:1)较少token获取大量上下文 2)引入不同模型视角 3)增强debug和规划能力", - "gemini": { - "strengths": ["超长上下文", "深度分析", "架构理解", "执行流追踪"], - "triggers": ["分析", "理解", "设计", "架构", "评估", "诊断"], - "mode": "analysis", - "token_efficiency": "high", - "use_when": [ - "需要理解大型代码库结构", - "执行流追踪和数据流分析", - "架构设计和技术方案评估", - "复杂问题诊断(root cause analysis)" - ] - }, - "qwen": { - "strengths": ["超长上下文", "代码模式识别", "多维度分析"], - "triggers": ["评估", "对比", "验证"], - "mode": "analysis", - "token_efficiency": "high", - "use_when": [ - "Gemini 不可用时作为备选", - "需要第二视角验证分析结果", - "代码模式识别和重复检测" - ] - }, - "codex": { - "strengths": ["精确代码生成", "自主执行", "数学推理"], - "triggers": ["实现", "重构", "修复", "生成", "测试"], - "mode": "write", - "token_efficiency": "medium", - "use_when": [ - "需要自主完成多步骤代码修改", - "复杂重构和迁移任务", - "测试生成和修复循环" - ] - } - }, - "cli_injection_rules": { - "_doc": "隐式规则:在特定条件下自动注入CLI调用", - "context_gathering": { - "trigger": "file_read >= 50k chars OR module_count >= 5", - "inject": "gemini --mode analysis", - "reason": "大量代码上下文使用CLI可节省主会话token" - }, - "pre_planning_analysis": { - "trigger": "complexity === 'high' OR intent === 'exploration'", - "inject": "gemini --mode analysis", - "reason": "复杂任务先用CLI分析获取多模型视角" - }, - "debug_diagnosis": { - "trigger": "intent === 'bugfix' AND root_cause_unclear", - "inject": "gemini --mode analysis", - "reason": "深度诊断利用Gemini的执行流追踪能力" - }, - "code_review": { - "trigger": "step === 'review'", - "inject": "gemini --mode analysis", - "reason": "代码审查用CLI减少token占用" - }, - "implementation": { - "trigger": "step === 'execute' AND task_count >= 3", - "inject": "codex --mode write", - "reason": "多任务执行用Codex自主完成" - } - }, - "chains": { - "rapid": { - "name": "Rapid Iteration", - "description": "多模型协作分析 + 直接执行", - "complexity": ["low", "medium"], - "steps": [ - { - "command": "/workflow:lite-plan", - "optional": false, - "auto_continue": true, - "cli_hint": { - "explore_phase": { "tool": "gemini", "mode": "analysis", "trigger": "needs_exploration" }, - "planning_phase": { "tool": "gemini", "mode": "analysis", "trigger": "complexity >= medium" } - } - }, - { - "command": "/workflow:lite-execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "execution": { "tool": "codex", "mode": "write", "trigger": "user_selects_codex OR complexity >= medium" }, - "review": { "tool": "gemini", "mode": "analysis", "trigger": "user_selects_review" } - } - } - ], - "total_steps": 2, - "estimated_time": "15-45 min" - }, - "full": { - "name": "Full Exploration", - "description": "多模型深度分析 + 头脑风暴 + 规划 + 执行", - "complexity": ["medium", "high"], - "steps": [ - { - "command": "/workflow:brainstorm:auto-parallel", - "optional": false, - "confirm_before": true, - "cli_hint": { - "role_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true } - } - }, - { - "command": "/workflow:plan", - "optional": false, - "auto_continue": false, - "cli_hint": { - "context_gather": { "tool": "gemini", "mode": "analysis", "trigger": "always" }, - "task_generation": { "tool": "gemini", "mode": "analysis", "trigger": "always" } - } - }, - { "command": "/workflow:action-plan-verify", "optional": true, "auto_continue": true }, - { - "command": "/workflow:execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "execution": { "tool": "codex", "mode": "write", "trigger": "task_count >= 3" } - } - } - ], - "total_steps": 4, - "estimated_time": "1-3 hours" - }, - "coupled": { - "name": "Coupled Planning", - "description": "CLI深度分析 + 完整规划 + 验证 + 执行", - "complexity": ["high"], - "steps": [ - { - "command": "/workflow:plan", - "optional": false, - "auto_continue": false, - "cli_hint": { - "pre_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "always", "purpose": "架构理解和依赖分析" }, - "conflict_detection": { "tool": "gemini", "mode": "analysis", "trigger": "always" } - } - }, - { "command": "/workflow:action-plan-verify", "optional": false, "auto_continue": true }, - { - "command": "/workflow:execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "execution": { "tool": "codex", "mode": "write", "trigger": "always", "purpose": "自主多任务执行" } - } - }, - { - "command": "/workflow:review", - "optional": true, - "auto_continue": false, - "cli_hint": { - "review": { "tool": "gemini", "mode": "analysis", "trigger": "always" } - } - } - ], - "total_steps": 4, - "estimated_time": "2-4 hours" - }, - "bugfix": { - "name": "Bug Fix", - "description": "CLI诊断 + 智能修复", - "complexity": ["low", "medium"], - "variants": { - "standard": { - "steps": [ - { - "command": "/workflow:lite-fix", - "optional": false, - "auto_continue": true, - "cli_hint": { - "diagnosis": { "tool": "gemini", "mode": "analysis", "trigger": "always", "purpose": "根因分析和执行流追踪" }, - "fix": { "tool": "codex", "mode": "write", "trigger": "severity >= medium" } - } - } - ] - }, - "hotfix": { - "steps": [ - { - "command": "/workflow:lite-fix --hotfix", - "optional": false, - "auto_continue": true, - "cli_hint": { - "quick_diagnosis": { "tool": "gemini", "mode": "analysis", "trigger": "always", "timeout": "60s" } - } - } - ] - } - }, - "total_steps": 1, - "estimated_time": "10-30 min" - }, - "issue": { - "name": "Issue Batch", - "description": "CLI批量分析 + 队列优化 + 并行执行", - "complexity": ["medium", "high"], - "steps": [ - { - "command": "/issue:plan", - "optional": false, - "auto_continue": false, - "cli_hint": { - "solution_generation": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true } - } - }, - { - "command": "/issue:queue", - "optional": false, - "auto_continue": false, - "cli_hint": { - "conflict_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "issue_count >= 3" } - } - }, - { - "command": "/issue:execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "batch_execution": { "tool": "codex", "mode": "write", "trigger": "always", "purpose": "DAG并行执行" } - } - } - ], - "total_steps": 3, - "estimated_time": "1-4 hours" - }, - "tdd": { - "name": "Test-Driven Development", - "description": "TDD规划 + 执行 + CLI验证", - "complexity": ["medium", "high"], - "steps": [ - { - "command": "/workflow:tdd-plan", - "optional": false, - "auto_continue": false, - "cli_hint": { - "test_strategy": { "tool": "gemini", "mode": "analysis", "trigger": "always" } - } - }, - { - "command": "/workflow:execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "red_green_refactor": { "tool": "codex", "mode": "write", "trigger": "always" } - } - }, - { - "command": "/workflow:tdd-verify", - "optional": false, - "auto_continue": false, - "cli_hint": { - "coverage_analysis": { "tool": "gemini", "mode": "analysis", "trigger": "always" } - } - } - ], - "total_steps": 3, - "estimated_time": "1-3 hours" - }, - "ui": { - "name": "UI-First Development", - "description": "UI设计 + 规划 + 执行", - "complexity": ["medium", "high"], - "variants": { - "explore": { - "steps": [ - { "command": "/workflow:ui-design:explore-auto", "optional": false, "auto_continue": false }, - { "command": "/workflow:ui-design:design-sync", "optional": false, "auto_continue": true }, - { "command": "/workflow:plan", "optional": false, "auto_continue": false }, - { "command": "/workflow:execute", "optional": false, "auto_continue": false } - ] - }, - "imitate": { - "steps": [ - { "command": "/workflow:ui-design:imitate-auto", "optional": false, "auto_continue": false }, - { "command": "/workflow:ui-design:design-sync", "optional": false, "auto_continue": true }, - { "command": "/workflow:plan", "optional": false, "auto_continue": false }, - { "command": "/workflow:execute", "optional": false, "auto_continue": false } - ] - } - }, - "total_steps": 4, - "estimated_time": "2-4 hours" - }, - "review-fix": { - "name": "Review and Fix", - "description": "CLI多维审查 + 自动修复", - "complexity": ["medium"], - "steps": [ - { - "command": "/workflow:review-session-cycle", - "optional": false, - "auto_continue": false, - "cli_hint": { - "multi_dimension_review": { "tool": "gemini", "mode": "analysis", "trigger": "always", "parallel": true } - } - }, - { - "command": "/workflow:review-fix", - "optional": true, - "auto_continue": false, - "cli_hint": { - "auto_fix": { "tool": "codex", "mode": "write", "trigger": "findings_count >= 3" } - } - } - ], - "total_steps": 2, - "estimated_time": "30-90 min" - }, - "docs": { - "name": "Documentation", - "description": "CLI批量文档生成", - "complexity": ["low", "medium"], - "variants": { - "incremental": { - "steps": [ - { - "command": "/memory:update-related", - "optional": false, - "auto_continue": false, - "cli_hint": { - "doc_generation": { "tool": "gemini", "mode": "write", "trigger": "module_count >= 5" } - } - } - ] - }, - "full": { - "steps": [ - { "command": "/memory:docs", "optional": false, "auto_continue": false }, - { - "command": "/workflow:execute", - "optional": false, - "auto_continue": false, - "cli_hint": { - "batch_doc": { "tool": "gemini", "mode": "write", "trigger": "always" } - } - } - ] - } - }, - "total_steps": 2, - "estimated_time": "15-60 min" - }, - "cli-analysis": { - "name": "CLI Direct Analysis", - "description": "直接CLI分析,获取多模型视角,节省主会话token", - "complexity": ["low", "medium", "high"], - "standalone": true, - "steps": [ - { - "command": "ccw cli", - "tool": "gemini", - "mode": "analysis", - "optional": false, - "auto_continue": false - } - ], - "use_cases": [ - "大型代码库快速理解", - "执行流追踪和数据流分析", - "架构评估和技术方案对比", - "性能瓶颈诊断" - ], - "total_steps": 1, - "estimated_time": "5-15 min" - }, - "cli-implement": { - "name": "CLI Direct Implementation", - "description": "直接Codex实现,自主完成多步骤任务", - "complexity": ["medium", "high"], - "standalone": true, - "steps": [ - { - "command": "ccw cli", - "tool": "codex", - "mode": "write", - "optional": false, - "auto_continue": false - } - ], - "use_cases": [ - "明确需求的功能实现", - "代码重构和迁移", - "测试生成", - "批量代码修改" - ], - "total_steps": 1, - "estimated_time": "15-60 min" - }, - "cli-debug": { - "name": "CLI Debug Session", - "description": "CLI调试会话,利用Gemini深度诊断能力", - "complexity": ["medium", "high"], - "standalone": true, - "steps": [ - { - "command": "ccw cli", - "tool": "gemini", - "mode": "analysis", - "purpose": "hypothesis-driven debugging", - "optional": false, - "auto_continue": false - } - ], - "use_cases": [ - "复杂bug根因分析", - "执行流异常追踪", - "状态机错误诊断", - "并发问题排查" - ], - "total_steps": 1, - "estimated_time": "10-30 min" - } - }, - "chain_selection_rules": { - "intent_mapping": { - "bugfix": ["bugfix"], - "feature_simple": ["rapid"], - "feature_unclear": ["full"], - "feature_complex": ["coupled"], - "issue_batch": ["issue"], - "test_driven": ["tdd"], - "ui_design": ["ui"], - "code_review": ["review-fix"], - "documentation": ["docs"], - "analysis_only": ["cli-analysis"], - "implement_only": ["cli-implement"], - "debug": ["cli-debug", "bugfix"] - }, - "complexity_fallback": { - "low": "rapid", - "medium": "coupled", - "high": "full" - }, - "cli_preference_rules": { - "_doc": "用户语义触发CLI工具选择", - "gemini_triggers": ["用 gemini", "gemini 分析", "让 gemini", "深度分析", "架构理解"], - "qwen_triggers": ["用 qwen", "qwen 评估", "让 qwen", "第二视角"], - "codex_triggers": ["用 codex", "codex 实现", "让 codex", "自主完成", "批量修改"] - } - } -} diff --git a/.claude/skills/ccw/phases/actions/bugfix.md b/.claude/skills/ccw/phases/actions/bugfix.md deleted file mode 100644 index 7d8b2858..00000000 --- a/.claude/skills/ccw/phases/actions/bugfix.md +++ /dev/null @@ -1,218 +0,0 @@ -# Action: Bugfix Workflow - -缺陷修复工作流:智能诊断 + 影响评估 + 修复 - -## Pattern - -``` -lite-fix [--hotfix] -``` - -## Trigger Conditions - -- Keywords: "fix", "bug", "error", "crash", "broken", "fail", "修复", "报错" -- Problem symptoms described -- Error messages present - -## Execution Flow - -### Standard Mode - -```mermaid -sequenceDiagram - participant U as User - participant O as CCW Orchestrator - participant LF as lite-fix - participant CLI as CLI Tools - - U->>O: Bug description - O->>O: Classify: bugfix (standard) - O->>LF: /workflow:lite-fix "bug" - - Note over LF: Phase 1: Diagnosis - LF->>CLI: Root cause analysis (Gemini) - CLI-->>LF: diagnosis.json - - Note over LF: Phase 2: Impact Assessment - LF->>LF: Risk scoring (0-10) - LF->>LF: Severity classification - LF-->>U: Impact report - - Note over LF: Phase 3: Fix Strategy - LF->>LF: Generate fix options - LF-->>U: Present strategies - U->>LF: Select strategy - - Note over LF: Phase 4: Verification Plan - LF->>LF: Generate test plan - LF-->>U: Verification approach - - Note over LF: Phase 5: Confirmation - LF->>U: Execution method? - U->>LF: Confirm - - Note over LF: Phase 6: Execute - LF->>CLI: Execute fix (Agent/Codex) - CLI-->>LF: Results - LF-->>U: Fix complete -``` - -### Hotfix Mode - -```mermaid -sequenceDiagram - participant U as User - participant O as CCW Orchestrator - participant LF as lite-fix - participant CLI as CLI Tools - - U->>O: Urgent bug + "hotfix" - O->>O: Classify: bugfix (hotfix) - O->>LF: /workflow:lite-fix --hotfix "bug" - - Note over LF: Minimal Diagnosis - LF->>CLI: Quick root cause - CLI-->>LF: Known issue? - - Note over LF: Surgical Fix - LF->>LF: Single optimal fix - LF-->>U: Quick confirmation - U->>LF: Proceed - - Note over LF: Smoke Test - LF->>CLI: Minimal verification - CLI-->>LF: Pass/Fail - - Note over LF: Follow-up Generation - LF->>LF: Generate follow-up tasks - LF-->>U: Fix deployed + follow-ups created -``` - -## When to Use - -### Standard Mode (/workflow:lite-fix) -✅ **Use for**: -- 已知症状的 Bug -- 本地化修复(1-5 文件) -- 非紧急问题 -- 需要完整诊断 - -### Hotfix Mode (/workflow:lite-fix --hotfix) -✅ **Use for**: -- 生产事故 -- 紧急修复 -- 明确的单点故障 -- 时间敏感 - -❌ **Don't use** (for either mode): -- 需要架构变更 → `/workflow:plan --mode bugfix` -- 多个相关问题 → `/issue:plan` - -## Severity Classification - -| Score | Severity | Response | Verification | -|-------|----------|----------|--------------| -| 8-10 | Critical | Immediate | Smoke test only | -| 6-7.9 | High | Fast track | Integration tests | -| 4-5.9 | Medium | Normal | Full test suite | -| 0-3.9 | Low | Scheduled | Comprehensive | - -## Configuration - -```javascript -const bugfixConfig = { - standard: { - diagnosis: { - tool: 'gemini', - depth: 'comprehensive', - timeout: 300000 // 5 min - }, - impact: { - riskThreshold: 6.0, // High risk threshold - autoEscalate: true - }, - verification: { - levels: ['smoke', 'integration', 'full'], - autoSelect: true // Based on severity - } - }, - - hotfix: { - diagnosis: { - tool: 'gemini', - depth: 'minimal', - timeout: 60000 // 1 min - }, - fix: { - strategy: 'single', // Single optimal fix - surgical: true - }, - followup: { - generate: true, - types: ['comprehensive-fix', 'post-mortem'] - } - } -} -``` - -## Example Invocations - -```bash -# Standard bug fix -ccw "用户头像上传失败,返回 413 错误" -→ lite-fix -→ Diagnosis: File size limit in nginx -→ Impact: 6.5 (High) -→ Fix: Update nginx config + add client validation -→ Verify: Integration test - -# Production hotfix -ccw "紧急:支付网关返回 5xx 错误,影响所有用户" -→ lite-fix --hotfix -→ Quick diagnosis: API key expired -→ Surgical fix: Rotate key -→ Smoke test: Payment flow -→ Follow-ups: Key rotation automation, monitoring alert - -# Unknown root cause -ccw "购物车随机丢失商品,原因不明" -→ lite-fix -→ Deep diagnosis (auto) -→ Root cause: Race condition in concurrent updates -→ Fix: Add optimistic locking -→ Verify: Concurrent test suite -``` - -## Output Artifacts - -``` -.workflow/.lite-fix/{bug-slug}-{timestamp}/ -├── diagnosis.json # Root cause analysis -├── impact.json # Risk assessment -├── fix-plan.json # Fix strategy -├── task.json # Enhanced task for execution -└── followup.json # Follow-up tasks (hotfix only) -``` - -## Follow-up Tasks (Hotfix Mode) - -```json -{ - "followups": [ - { - "id": "FOLLOWUP-001", - "type": "comprehensive-fix", - "title": "Complete fix for payment gateway issue", - "due": "3 days", - "description": "Implement full solution with proper error handling" - }, - { - "id": "FOLLOWUP-002", - "type": "post-mortem", - "title": "Post-mortem analysis", - "due": "1 week", - "description": "Document incident and prevention measures" - } - ] -} -``` diff --git a/.claude/skills/ccw/phases/actions/coupled.md b/.claude/skills/ccw/phases/actions/coupled.md deleted file mode 100644 index a49b25bc..00000000 --- a/.claude/skills/ccw/phases/actions/coupled.md +++ /dev/null @@ -1,194 +0,0 @@ -# Action: Coupled Workflow - -复杂耦合工作流:完整规划 + 验证 + 执行 - -## Pattern - -``` -plan → action-plan-verify → execute -``` - -## Trigger Conditions - -- Complexity: High -- Keywords: "refactor", "重构", "migrate", "迁移", "architect", "架构" -- Cross-module changes -- System-level modifications - -## Execution Flow - -```mermaid -sequenceDiagram - participant U as User - participant O as CCW Orchestrator - participant PL as plan - participant VF as verify - participant EX as execute - participant RV as review - - U->>O: Complex task - O->>O: Classify: coupled (high complexity) - - Note over PL: Phase 1: Comprehensive Planning - O->>PL: /workflow:plan - PL->>PL: Multi-phase planning - PL->>PL: Generate IMPL_PLAN.md - PL->>PL: Generate task JSONs - PL-->>U: Present plan - - Note over VF: Phase 2: Verification - U->>VF: /workflow:action-plan-verify - VF->>VF: Cross-artifact consistency - VF->>VF: Dependency validation - VF->>VF: Quality gate checks - VF-->>U: Verification report - - alt Verification failed - U->>PL: Replan with issues - else Verification passed - Note over EX: Phase 3: Execution - U->>EX: /workflow:execute - EX->>EX: DAG-based parallel execution - EX-->>U: Execution complete - end - - Note over RV: Phase 4: Review - U->>RV: /workflow:review - RV-->>U: Review findings -``` - -## When to Use - -✅ **Ideal scenarios**: -- 大规模重构 -- 架构迁移 -- 跨模块功能开发 -- 技术栈升级 -- 团队协作项目 - -❌ **Avoid when**: -- 简单的局部修改 -- 时间紧迫 -- 独立的小功能 - -## Verification Checks - -| Check | Description | Severity | -|-------|-------------|----------| -| Dependency Cycles | 检测循环依赖 | Critical | -| Missing Tasks | 计划与实际不符 | High | -| File Conflicts | 多任务修改同文件 | Medium | -| Coverage Gaps | 未覆盖的需求 | Medium | - -## Configuration - -```javascript -const coupledConfig = { - plan: { - phases: 5, // Full 5-phase planning - taskGeneration: 'action-planning-agent', - outputFormat: { - implPlan: '.workflow/plans/IMPL_PLAN.md', - taskJsons: '.workflow/tasks/IMPL-*.json' - } - }, - - verify: { - required: true, // Always verify before execute - autoReplan: false, // Manual replan on failure - qualityGates: ['no-cycles', 'no-conflicts', 'complete-coverage'] - }, - - execute: { - dagParallel: true, - checkpointInterval: 3, // Checkpoint every 3 tasks - rollbackOnFailure: true - }, - - review: { - types: ['architecture', 'security'], - required: true - } -} -``` - -## Task JSON Structure - -```json -{ - "id": "IMPL-001", - "title": "重构认证模块核心逻辑", - "scope": "src/auth/**", - "action": "refactor", - "depends_on": [], - "modification_points": [ - { - "file": "src/auth/service.ts", - "target": "AuthService", - "change": "Extract OAuth2 logic" - } - ], - "acceptance": [ - "所有现有测试通过", - "OAuth2 流程可用" - ] -} -``` - -## Example Invocations - -```bash -# Architecture refactoring -ccw "重构整个认证模块,从 session 迁移到 JWT" -→ plan (5 phases) -→ verify -→ execute - -# System migration -ccw "将数据库从 MySQL 迁移到 PostgreSQL" -→ plan (migration strategy) -→ verify (data integrity checks) -→ execute (staged migration) - -# Cross-module feature -ccw "实现跨服务的分布式事务支持" -→ plan (architectural design) -→ verify (consistency checks) -→ execute (incremental rollout) -``` - -## Output Artifacts - -``` -.workflow/ -├── plans/ -│ └── IMPL_PLAN.md # Comprehensive plan -├── tasks/ -│ ├── IMPL-001.json -│ ├── IMPL-002.json -│ └── ... -├── verify/ -│ └── verification-report.md # Verification results -└── reviews/ - └── {review-type}.md # Review findings -``` - -## Replan Flow - -When verification fails: - -```javascript -if (verificationResult.status === 'failed') { - console.log(` -## Verification Failed - -**Issues found**: -${verificationResult.issues.map(i => `- ${i.severity}: ${i.message}`).join('\n')} - -**Options**: -1. /workflow:replan - Address issues and regenerate plan -2. /workflow:plan --force - Proceed despite issues (not recommended) -3. Review issues manually and fix plan files -`) -} -``` diff --git a/.claude/skills/ccw/phases/actions/docs.md b/.claude/skills/ccw/phases/actions/docs.md deleted file mode 100644 index 98c86744..00000000 --- a/.claude/skills/ccw/phases/actions/docs.md +++ /dev/null @@ -1,93 +0,0 @@ -# Documentation Workflow Action - -## Pattern -``` -memory:docs → execute (full) -memory:update-related (incremental) -``` - -## Trigger Conditions - -- 关键词: "文档", "documentation", "docs", "readme", "注释" -- 变体触发: - - `incremental`: "更新", "增量", "相关" - - `full`: "全部", "完整", "所有" - -## Variants - -### Full Documentation -```mermaid -graph TD - A[User Input] --> B[memory:docs] - B --> C[项目结构分析] - C --> D[模块分组 ≤10/task] - D --> E[execute: 并行生成] - E --> F[README.md] - E --> G[ARCHITECTURE.md] - E --> H[API Docs] - E --> I[Module CLAUDE.md] -``` - -### Incremental Update -```mermaid -graph TD - A[Git Changes] --> B[memory:update-related] - B --> C[变更模块检测] - C --> D[相关文档定位] - D --> E[增量更新] -``` - -## Configuration - -| 参数 | 默认值 | 说明 | -|------|--------|------| -| batch_size | 4 | 每agent处理模块数 | -| format | markdown | 输出格式 | -| include_api | true | 生成API文档 | -| include_diagrams | true | 生成Mermaid图 | - -## CLI Integration - -| 阶段 | CLI Hint | 用途 | -|------|----------|------| -| memory:docs | `gemini --mode analysis` | 项目结构分析 | -| execute | `gemini --mode write` | 文档生成 | -| update-related | `gemini --mode write` | 增量更新 | - -## Slash Commands - -```bash -/memory:docs # 规划全量文档生成 -/memory:docs-full-cli # CLI执行全量文档 -/memory:docs-related-cli # CLI执行增量文档 -/memory:update-related # 更新变更相关文档 -/memory:update-full # 更新所有CLAUDE.md -``` - -## Output Structure - -``` -project/ -├── README.md # 项目概览 -├── ARCHITECTURE.md # 架构文档 -├── docs/ -│ └── api/ # API文档 -└── src/ - └── module/ - └── CLAUDE.md # 模块文档 -``` - -## When to Use - -- 新项目初始化文档 -- 大版本发布前文档更新 -- 代码变更后同步文档 -- API文档生成 - -## Risk Assessment - -| 风险 | 缓解措施 | -|------|----------| -| 文档与代码不同步 | git hook集成 | -| 生成内容过于冗长 | batch_size控制 | -| 遗漏重要模块 | 全量扫描验证 | diff --git a/.claude/skills/ccw/phases/actions/full.md b/.claude/skills/ccw/phases/actions/full.md deleted file mode 100644 index b234ba90..00000000 --- a/.claude/skills/ccw/phases/actions/full.md +++ /dev/null @@ -1,154 +0,0 @@ -# Action: Full Workflow - -完整探索工作流:分析 + 头脑风暴 + 规划 + 执行 - -## Pattern - -``` -brainstorm:auto-parallel → plan → [verify] → execute -``` - -## Trigger Conditions - -- Intent: Exploration (uncertainty detected) -- Keywords: "不确定", "不知道", "explore", "怎么做", "what if" -- No clear implementation path - -## Execution Flow - -```mermaid -sequenceDiagram - participant U as User - participant O as CCW Orchestrator - participant BS as brainstorm - participant PL as plan - participant VF as verify - participant EX as execute - - U->>O: Unclear task - O->>O: Classify: full - - Note over BS: Phase 1: Brainstorm - O->>BS: /workflow:brainstorm:auto-parallel - BS->>BS: Multi-role parallel analysis - BS->>BS: Synthesis & recommendations - BS-->>U: Present options - U->>BS: Select direction - - Note over PL: Phase 2: Plan - BS->>PL: /workflow:plan - PL->>PL: Generate IMPL_PLAN.md - PL->>PL: Generate task JSONs - PL-->>U: Review plan - - Note over VF: Phase 3: Verify (optional) - U->>VF: /workflow:action-plan-verify - VF->>VF: Cross-artifact consistency - VF-->>U: Verification report - - Note over EX: Phase 4: Execute - U->>EX: /workflow:execute - EX->>EX: DAG-based parallel execution - EX-->>U: Execution complete -``` - -## When to Use - -✅ **Ideal scenarios**: -- 产品方向探索 -- 技术选型评估 -- 架构设计决策 -- 复杂功能规划 -- 需要多角色视角 - -❌ **Avoid when**: -- 任务明确简单 -- 时间紧迫 -- 已有成熟方案 - -## Brainstorm Roles - -| Role | Focus | Typical Questions | -|------|-------|-------------------| -| Product Manager | 用户价值、市场定位 | "用户痛点是什么?" | -| System Architect | 技术方案、架构设计 | "如何保证可扩展性?" | -| UX Expert | 用户体验、交互设计 | "用户流程是否顺畅?" | -| Security Expert | 安全风险、合规要求 | "有哪些安全隐患?" | -| Data Architect | 数据模型、存储方案 | "数据如何组织?" | - -## Configuration - -```javascript -const fullConfig = { - brainstorm: { - defaultRoles: ['product-manager', 'system-architect', 'ux-expert'], - maxRoles: 5, - synthesis: true // Always generate synthesis - }, - - plan: { - verifyBeforeExecute: true, // Recommend verification - taskFormat: 'json' // Generate task JSONs - }, - - execute: { - dagParallel: true, // DAG-based parallel execution - testGeneration: 'optional' // Suggest test-gen after - } -} -``` - -## Continuation Points - -After each phase, CCW can continue to the next: - -```javascript -// After brainstorm completes -console.log(` -## Brainstorm Complete - -**Next steps**: -1. /workflow:plan "基于头脑风暴结果规划实施" -2. Or refine: /workflow:brainstorm:synthesis -`) - -// After plan completes -console.log(` -## Plan Complete - -**Next steps**: -1. /workflow:action-plan-verify (recommended) -2. /workflow:execute (直接执行) -`) -``` - -## Example Invocations - -```bash -# Product exploration -ccw "我想做一个团队协作工具,但不确定具体方向" -→ brainstorm:auto-parallel (5 roles) -→ plan -→ execute - -# Technical exploration -ccw "如何设计一个高可用的消息队列系统?" -→ brainstorm:auto-parallel (system-architect, data-architect) -→ plan -→ verify -→ execute -``` - -## Output Artifacts - -``` -.workflow/ -├── brainstorm/ -│ ├── {session}/ -│ │ ├── role-{role}.md -│ │ └── synthesis.md -├── plans/ -│ └── IMPL_PLAN.md -└── tasks/ - └── IMPL-*.json -``` diff --git a/.claude/skills/ccw/phases/actions/issue.md b/.claude/skills/ccw/phases/actions/issue.md deleted file mode 100644 index bb18d9b2..00000000 --- a/.claude/skills/ccw/phases/actions/issue.md +++ /dev/null @@ -1,335 +0,0 @@ -# Action: Issue Workflow - -Issue 批量处理工作流:发现 → 创建 → 规划 → 队列 → 批量执行 - -## Complete Workflow Pattern - -``` -┌─────────────────────────────────────────────────────────────────┐ -│ Issue Workflow - Complete Chain │ -├─────────────────────────────────────────────────────────────────┤ -│ │ -│ Discovery Phase (Optional) │ -│ ├─ /issue:discover - 多视角问题发现 │ -│ └─ /issue:discover-by-prompt - 基于提示的迭代发现 │ -│ │ -│ Creation Phase │ -│ └─ /issue:new - 创建结构化 Issue │ -│ │ -│ Planning Phase │ -│ └─ /issue:plan - 生成解决方案 │ -│ │ -│ Queue Phase │ -│ └─ /issue:queue - 冲突分析 + 队列构建 │ -│ │ -│ Execution Phase │ -│ └─ /issue:execute - DAG 并行执行 │ -│ │ -└─────────────────────────────────────────────────────────────────┘ -``` - -## Workflow Patterns - -### Pattern 1: Full Discovery Flow -``` -/issue:discover → /issue:new → /issue:plan → /issue:queue → /issue:execute -``` -**Use when**: 不知道有什么问题,需要全面发现 - -### Pattern 2: Prompt-Driven Discovery -``` -/issue:discover-by-prompt → /issue:plan → /issue:queue → /issue:execute -``` -**Use when**: 有特定方向的问题探索 - -### Pattern 3: Direct Planning (Default) -``` -/issue:plan → /issue:queue → /issue:execute -``` -**Use when**: 已有明确的 Issue 列表 - -### Pattern 4: GitHub Import -``` -/issue:new (GitHub URL) → /issue:plan → /issue:queue → /issue:execute -``` -**Use when**: 从 GitHub Issues 导入 - -## Command Reference - -### /issue:discover -多视角问题发现,支持 8 种视角的并行探索。 - -**视角列表**: -| Perspective | Description | Agent Type | -|-------------|-------------|------------| -| bug | 功能缺陷和错误 | CLI explore | -| ux | 用户体验问题 | CLI explore | -| test | 测试覆盖缺口 | CLI explore | -| quality | 代码质量问题 | CLI explore | -| security | 安全漏洞 | CLI explore + Exa | -| performance | 性能瓶颈 | CLI explore | -| maintainability | 可维护性问题 | CLI explore | -| best-practices | 最佳实践偏离 | CLI explore + Exa | - -**输出**: `.workflow/issues/discoveries/` 下的发现报告 - -**调用方式**: -```bash -/issue:discover # 全视角发现 -/issue:discover --perspectives security,performance # 指定视角 -``` - -### /issue:discover-by-prompt -基于用户提示的智能发现,使用 Gemini 规划迭代探索策略。 - -**核心能力**: -- ACE 语义搜索上下文收集 -- 跨模块比较(如 API 契约一致性) -- 多轮迭代探索直到收敛 - -**调用方式**: -```bash -/issue:discover-by-prompt "检查前端后端API契约一致性" -``` - -### /issue:new -从 GitHub URL 或文本描述创建结构化 Issue。 - -**清晰度检测** (0-3分): -| Score | Level | Action | -|-------|-------|--------| -| 0 | 无法理解 | 必须澄清 | -| 1 | 基本理解 | 建议澄清 | -| 2 | 清晰 | 直接创建 | -| 3 | 详细 | 直接创建 | - -**调用方式**: -```bash -/issue:new https://github.com/user/repo/issues/123 # GitHub 导入 -/issue:new "登录页面在移动端显示异常" # 文本创建 -``` - -**输出**: `.workflow/issues/issues.jsonl` 追加新 Issue - -### /issue:plan -为每个 Issue 生成解决方案,使用 `issue-plan-agent`。 - -**核心流程**: -1. 加载未规划的 Issues -2. ACE 上下文探索 -3. 生成 1-3 个解决方案/Issue -4. 用户选择绑定方案 - -**调用方式**: -```bash -/issue:plan # 规划所有未绑定 Issue -/issue:plan --issue ISS-001 # 规划特定 Issue -``` - -**输出**: `.workflow/issues/solutions/ISS-xxx.jsonl` - -### /issue:queue -解决方案级别的队列构建,冲突分析,DAG 生成。 - -**使用 Agent**: `issue-queue-agent` - -**冲突检测类型**: -| Type | Description | Severity | Resolution | -|------|-------------|----------|------------| -| file | 同文件修改 | Low | Sequential | -| api | API 签名变更 | Medium | Dependency ordering | -| data | 数据结构冲突 | High | User decision | -| dependency | 包依赖冲突 | Medium | Version negotiation | -| architecture | 架构方向冲突 | Critical | User decision | - -**DAG 结构**: -``` -execution_groups: -├── P1: Parallel (independent solutions) -├── S1: Sequential (depends on P1) -└── P2: Parallel (depends on S1) -``` - -**调用方式**: -```bash -/issue:queue # 构建队列 -/issue:queue --dry-run # 预览冲突分析 -``` - -**输出**: `.workflow/issues/queues/QUE-xxx.json` - -### /issue:execute -DAG 并行执行编排器,单 worktree 策略。 - -**Executor 选项**: -| Executor | Best For | Mode | -|----------|----------|------| -| codex (recommended) | 代码实现 | Autonomous | -| gemini | 复杂分析 | Analysis first | -| agent | 灵活控制 | Supervised | - -**执行策略**: -- 单 worktree 用于整个队列 -- 按 solution 粒度分发 -- 自动处理依赖顺序 -- 支持断点续传 - -**调用方式**: -```bash -/issue:execute # 执行当前队列 -/issue:execute --queue QUE-xxx # 执行特定队列 -/issue:execute --resume # 恢复中断的执行 -``` - -## Trigger Conditions - -CCW 自动识别以下关键词触发 Issue 工作流: - -```javascript -const issuePatterns = { - // Batch processing - batch: /issues?|batch|queue|多个|批量|一批/i, - - // Action requirement - action: /fix|resolve|处理|修复|解决/i, - - // Discovery - discover: /discover|find|发现|检查|扫描|audit/i, - - // GitHub specific - github: /github\.com\/.*\/issues/i -} - -// Trigger when: batch + action OR discover OR github -``` - -## Issue Lifecycle - -``` -┌───────┐ ┌────────┐ ┌────────┐ ┌───────────┐ ┌───────────┐ -│ draft │ ──▶ │ planned│ ──▶ │ queued │ ──▶ │ executing │ ──▶ │ completed │ -└───────┘ └────────┘ └────────┘ └───────────┘ └───────────┘ - │ │ - ▼ ▼ - ┌─────────┐ ┌─────────┐ - │ skipped │ │ on-hold │ - └─────────┘ └─────────┘ -``` - -## Configuration - -```javascript -const issueConfig = { - discover: { - perspectives: ['bug', 'ux', 'test', 'quality', 'security', 'performance', 'maintainability', 'best-practices'], - parallelExploration: true, - exaIntegration: ['security', 'best-practices'] - }, - - create: { - clarityThreshold: 2, // Minimum clarity score to proceed - autoClarify: true, // Prompt for missing info - githubPublish: 'ask' // ask | always | never - }, - - plan: { - solutionsPerIssue: 3, // Generate up to 3 solutions - autoSelect: false, // User must bind solution - planningAgent: 'issue-plan-agent' - }, - - queue: { - conflictAnalysis: true, - priorityCalculation: true, - clarifyThreshold: 'high', // Ask user for high-severity conflicts - queueAgent: 'issue-queue-agent' - }, - - execute: { - dagParallel: true, - executionLevel: 'solution', - executor: 'codex', - resumable: true - } -} -``` - -## Output Structure - -``` -.workflow/issues/ -├── issues.jsonl # All issues (append-only) -├── discoveries/ -│ ├── DIS-xxx.json # Discovery session -│ └── reports/ -│ ├── security.md -│ └── performance.md -├── solutions/ -│ ├── ISS-001.jsonl # Solutions for ISS-001 -│ └── ISS-002.jsonl -├── queues/ -│ ├── index.json # Queue index -│ └── QUE-xxx.json # Queue details -└── execution/ - └── {queue-id}/ - ├── progress.json - ├── logs/ - └── results/ -``` - -## Example Invocations - -```bash -# Complete discovery flow -ccw "全面检查代码库问题并批量修复" -→ /issue:discover (全视角) -→ /issue:new (创建发现的问题) -→ /issue:plan (生成方案) -→ /issue:queue (构建队列) -→ /issue:execute (批量执行) - -# Security audit -ccw "安全审计并修复所有漏洞" -→ /issue:discover --perspectives security -→ /issue:plan -→ /issue:queue -→ /issue:execute - -# GitHub batch processing -ccw "处理所有 label:bug 的 GitHub Issues" -→ /issue:new (批量导入) -→ /issue:plan -→ /issue:queue -→ /issue:execute - -# Tech debt cleanup -ccw "清理技术债务" -→ /issue:discover --perspectives quality,maintainability -→ /issue:plan -→ /issue:queue -→ /issue:execute -``` - -## Integration with CCW Orchestrator - -在 orchestrator.md 中的集成点: - -```javascript -// Intent classification -if (matchesIssuePattern(input)) { - // Determine entry point - if (hasDiscoveryIntent(input)) { - if (hasPromptDirection(input)) { - return { workflow: 'issue:discover-by-prompt → issue:plan → issue:queue → issue:execute' } - } - return { workflow: 'issue:discover → issue:plan → issue:queue → issue:execute' } - } - - if (hasGitHubUrl(input)) { - return { workflow: 'issue:new → issue:plan → issue:queue → issue:execute' } - } - - // Default: direct planning - return { workflow: 'issue:plan → issue:queue → issue:execute' } -} -``` diff --git a/.claude/skills/ccw/phases/actions/rapid.md b/.claude/skills/ccw/phases/actions/rapid.md deleted file mode 100644 index 60bfdc8a..00000000 --- a/.claude/skills/ccw/phases/actions/rapid.md +++ /dev/null @@ -1,104 +0,0 @@ -# Action: Rapid Workflow - -快速迭代工作流组合:多模型协作分析 + 直接执行 - -## Pattern - -``` -lite-plan → lite-execute -``` - -## Trigger Conditions - -- Complexity: Low to Medium -- Intent: Feature development -- Context: Clear requirements, known implementation path -- No uncertainty keywords - -## Execution Flow - -```mermaid -sequenceDiagram - participant U as User - participant O as CCW Orchestrator - participant LP as lite-plan - participant LE as lite-execute - participant CLI as CLI Tools - - U->>O: Task description - O->>O: Classify: rapid - O->>LP: /workflow:lite-plan "task" - - LP->>LP: Complexity assessment - LP->>CLI: Parallel explorations (if needed) - CLI-->>LP: Exploration results - LP->>LP: Generate plan.json - LP->>U: Display plan, ask confirmation - U->>LP: Confirm + select execution method - - LP->>LE: /workflow:lite-execute --in-memory - LE->>CLI: Execute tasks (Agent/Codex) - CLI-->>LE: Results - LE->>LE: Optional code review - LE-->>U: Execution complete -``` - -## When to Use - -✅ **Ideal scenarios**: -- 添加单一功能(如用户头像上传) -- 修改现有功能(如更新表单验证) -- 小型重构(如抽取公共方法) -- 添加测试用例 -- 文档更新 - -❌ **Avoid when**: -- 不确定实现方案 -- 跨多个模块 -- 需要架构决策 -- 有复杂依赖关系 - -## Configuration - -```javascript -const rapidConfig = { - explorationThreshold: { - // Force exploration if task mentions specific files - forceExplore: /\b(file|文件|module|模块|class|类)\s*[::]?\s*\w+/i, - // Skip exploration for simple tasks - skipExplore: /\b(add|添加|create|创建)\s+(comment|注释|log|日志)/i - }, - - defaultExecution: 'Agent', // Agent for low complexity - - codeReview: { - default: 'Skip', // Skip review for simple tasks - threshold: 'medium' // Enable for medium+ complexity - } -} -``` - -## Example Invocations - -```bash -# Simple feature -ccw "添加用户退出登录按钮" -→ lite-plan → lite-execute (Agent) - -# With exploration -ccw "优化 AuthService 的 token 刷新逻辑" -→ lite-plan -e → lite-execute (Agent, Gemini review) - -# Medium complexity -ccw "实现用户偏好设置的本地存储" -→ lite-plan -e → lite-execute (Codex) -``` - -## Output Artifacts - -``` -.workflow/.lite-plan/{task-slug}-{date}/ -├── exploration-*.json # If exploration was triggered -├── explorations-manifest.json -└── plan.json # Implementation plan -``` diff --git a/.claude/skills/ccw/phases/actions/review-fix.md b/.claude/skills/ccw/phases/actions/review-fix.md deleted file mode 100644 index 2b39d503..00000000 --- a/.claude/skills/ccw/phases/actions/review-fix.md +++ /dev/null @@ -1,84 +0,0 @@ -# Review-Fix Workflow Action - -## Pattern -``` -review-session-cycle → review-fix -``` - -## Trigger Conditions - -- 关键词: "review", "审查", "检查代码", "code review", "质量检查" -- 场景: PR审查、代码质量提升、安全审计 - -## Execution Flow - -```mermaid -graph TD - A[User Input] --> B[review-session-cycle] - B --> C{7维度分析} - C --> D[Security] - C --> E[Performance] - C --> F[Maintainability] - C --> G[Architecture] - C --> H[Code Style] - C --> I[Test Coverage] - C --> J[Documentation] - D & E & F & G & H & I & J --> K[Findings Aggregation] - K --> L{Quality Gate} - L -->|Pass| M[Report Only] - L -->|Fail| N[review-fix] - N --> O[Auto Fix] - O --> P[Re-verify] -``` - -## Configuration - -| 参数 | 默认值 | 说明 | -|------|--------|------| -| dimensions | all | 审查维度(security,performance,etc.) | -| quality_gate | 80 | 质量门槛分数 | -| auto_fix | true | 自动修复发现的问题 | -| severity_threshold | medium | 最低关注级别 | - -## CLI Integration - -| 阶段 | CLI Hint | 用途 | -|------|----------|------| -| review-session-cycle | `gemini --mode analysis` | 多维度深度分析 | -| review-fix | `codex --mode write` | 自动修复问题 | - -## Slash Commands - -```bash -/workflow:review-session-cycle # 会话级代码审查 -/workflow:review-module-cycle # 模块级代码审查 -/workflow:review-fix # 自动修复审查发现 -/workflow:review --type security # 专项安全审查 -``` - -## Review Dimensions - -| 维度 | 检查点 | -|------|--------| -| Security | 注入、XSS、敏感数据暴露 | -| Performance | N+1查询、内存泄漏、算法复杂度 | -| Maintainability | 代码重复、复杂度、命名 | -| Architecture | 依赖方向、层级违规、耦合度 | -| Code Style | 格式、约定、一致性 | -| Test Coverage | 覆盖率、边界用例 | -| Documentation | 注释、API文档、README | - -## When to Use - -- PR合并前审查 -- 重构后质量验证 -- 安全合规审计 -- 技术债务评估 - -## Risk Assessment - -| 风险 | 缓解措施 | -|------|----------| -| 误报过多 | severity_threshold过滤 | -| 修复引入新问题 | re-verify循环 | -| 审查不全面 | 7维度覆盖 | diff --git a/.claude/skills/ccw/phases/actions/tdd.md b/.claude/skills/ccw/phases/actions/tdd.md deleted file mode 100644 index 916a7b7f..00000000 --- a/.claude/skills/ccw/phases/actions/tdd.md +++ /dev/null @@ -1,66 +0,0 @@ -# TDD Workflow Action - -## Pattern -``` -tdd-plan → execute → tdd-verify -``` - -## Trigger Conditions - -- 关键词: "tdd", "test-driven", "测试驱动", "先写测试", "red-green" -- 场景: 需要高质量代码保证、关键业务逻辑、回归风险高 - -## Execution Flow - -```mermaid -graph TD - A[User Input] --> B[tdd-plan] - B --> C{生成测试任务链} - C --> D[Red Phase: 写失败测试] - D --> E[execute: 实现代码] - E --> F[Green Phase: 测试通过] - F --> G{需要重构?} - G -->|Yes| H[Refactor Phase] - H --> F - G -->|No| I[tdd-verify] - I --> J[质量报告] -``` - -## Configuration - -| 参数 | 默认值 | 说明 | -|------|--------|------| -| coverage_target | 80% | 目标覆盖率 | -| cycle_limit | 10 | 最大Red-Green-Refactor循环 | -| strict_mode | false | 严格模式(必须先红后绿) | - -## CLI Integration - -| 阶段 | CLI Hint | 用途 | -|------|----------|------| -| tdd-plan | `gemini --mode analysis` | 分析测试策略 | -| execute | `codex --mode write` | 实现代码 | -| tdd-verify | `gemini --mode analysis` | 验证TDD合规性 | - -## Slash Commands - -```bash -/workflow:tdd-plan # 生成TDD任务链 -/workflow:execute # 执行Red-Green-Refactor -/workflow:tdd-verify # 验证TDD合规性+覆盖率 -``` - -## When to Use - -- 核心业务逻辑开发 -- 需要高测试覆盖率的模块 -- 重构现有代码时确保不破坏功能 -- 团队要求TDD实践 - -## Risk Assessment - -| 风险 | 缓解措施 | -|------|----------| -| 测试粒度不当 | tdd-plan阶段评估测试边界 | -| 过度测试 | 聚焦行为而非实现 | -| 循环过多 | cycle_limit限制 | diff --git a/.claude/skills/ccw/phases/actions/ui.md b/.claude/skills/ccw/phases/actions/ui.md deleted file mode 100644 index cae2c990..00000000 --- a/.claude/skills/ccw/phases/actions/ui.md +++ /dev/null @@ -1,79 +0,0 @@ -# UI Design Workflow Action - -## Pattern -``` -ui-design:[explore|imitate]-auto → design-sync → plan → execute -``` - -## Trigger Conditions - -- 关键词: "ui", "界面", "design", "组件", "样式", "布局", "前端" -- 变体触发: - - `imitate`: "参考", "模仿", "像", "类似" - - `explore`: 无特定参考时默认 - -## Variants - -### Explore (探索式设计) -```mermaid -graph TD - A[User Input] --> B[ui-design:explore-auto] - B --> C[设计系统分析] - C --> D[组件结构规划] - D --> E[design-sync] - E --> F[plan] - F --> G[execute] -``` - -### Imitate (参考式设计) -```mermaid -graph TD - A[User Input + Reference] --> B[ui-design:imitate-auto] - B --> C[参考分析] - C --> D[风格提取] - D --> E[design-sync] - E --> F[plan] - F --> G[execute] -``` - -## Configuration - -| 参数 | 默认值 | 说明 | -|------|--------|------| -| design_system | auto | 设计系统(auto/tailwind/mui/custom) | -| responsive | true | 响应式设计 | -| accessibility | true | 无障碍支持 | - -## CLI Integration - -| 阶段 | CLI Hint | 用途 | -|------|----------|------| -| explore/imitate | `gemini --mode analysis` | 设计分析、风格提取 | -| design-sync | - | 设计决策与代码库同步 | -| plan | - | 内置规划 | -| execute | `codex --mode write` | 组件实现 | - -## Slash Commands - -```bash -/workflow:ui-design:explore-auto # 探索式UI设计 -/workflow:ui-design:imitate-auto # 参考式UI设计 -/workflow:ui-design:design-sync # 设计与代码同步(关键步骤) -/workflow:ui-design:style-extract # 提取现有样式 -/workflow:ui-design:codify-style # 样式代码化 -``` - -## When to Use - -- 新页面/组件开发 -- UI重构或现代化 -- 设计系统建立 -- 参考其他产品设计 - -## Risk Assessment - -| 风险 | 缓解措施 | -|------|----------| -| 设计不一致 | style-extract确保复用 | -| 响应式问题 | 多断点验证 | -| 可访问性缺失 | a11y检查集成 | diff --git a/.claude/skills/ccw/phases/orchestrator.md b/.claude/skills/ccw/phases/orchestrator.md deleted file mode 100644 index c886c83e..00000000 --- a/.claude/skills/ccw/phases/orchestrator.md +++ /dev/null @@ -1,689 +0,0 @@ -# CCW Orchestrator - -无状态编排器:分析输入 → 选择工作流链 → TODO 跟踪执行 - -## Architecture - -``` -┌────────────────────────────────────────────────────────────────┐ -│ CCW Orchestrator (CLI-Enhanced + Requirement Analysis) │ -├────────────────────────────────────────────────────────────────┤ -│ Phase 1 │ Input Analysis (rule-based, fast path) │ -│ Phase 1.5 │ CLI Classification (semantic, smart path) │ -│ Phase 1.75│ Requirement Clarification (clarity < 2) │ -│ Phase 2 │ Chain Selection (intent → workflow) │ -│ Phase 2.5 │ CLI Action Planning (high complexity) │ -│ Phase 3 │ User Confirmation (optional) │ -│ Phase 4 │ TODO Tracking Setup │ -│ Phase 5 │ Execution Loop │ -└────────────────────────────────────────────────────────────────┘ -``` - -**References**: -- [specs/requirement-analysis.md](../specs/requirement-analysis.md) - Dimension extraction & clarity scoring -- [specs/output-templates.md](../specs/output-templates.md) - Standardized output templates - -## CLI Enhancement Config - -| Feature | Trigger | Default Tool | -|---------|---------|--------------| -| Classification | matchCount < 2 OR complexity = high OR input > 100 chars | gemini | -| Action Planning | complexity = high OR steps >= 3 OR input > 200 chars | gemini | - -Settings in `index/intent-rules.json`. Fallback: gemini → qwen → rule-based. - ---- - -## Core Helpers - -```javascript -// === Pattern Matching === -const matchesAny = (text, patterns) => - Array.isArray(patterns) && patterns.some(p => text.toLowerCase().includes(p.toLowerCase())) - -// === CLI Execution Helper === -async function executeCli(prompt, config, purpose) { - const tool = config.default_tool || 'gemini' - const timeout = config.timeout_ms || 60000 - - try { - const escaped = prompt.replace(/"/g, '\\"').replace(/\n/g, '\\n') - const result = Bash({ - command: `ccw cli -p "${escaped}" --tool ${tool} --mode analysis`, - run_in_background: false, - timeout - }) - - const jsonMatch = result.match(/\{[\s\S]*\}/) - if (!jsonMatch) throw new Error('No JSON in CLI response') - return JSON.parse(jsonMatch[0]) - } catch (error) { - console.log(`> CLI ${purpose} failed: ${error.message}, falling back`) - return null - } -} - -// === TODO Tracking Helpers === -function updateTodos(todos, updates) { - TodoWrite({ todos: todos.map((t, i) => updates[i] ? { ...t, ...updates[i] } : t) }) -} - -function formatDuration(ms) { return (ms / 1000).toFixed(1) } -function timestamp() { return new Date().toLocaleTimeString() } -``` - ---- - -## Phase 1: Input Analysis - -```javascript -const intentRules = JSON.parse(Read('.claude/skills/ccw/index/intent-rules.json')) -const chains = JSON.parse(Read('.claude/skills/ccw/index/workflow-chains.json')) - -function analyzeInput(userInput) { - const input = userInput.trim() - - // Explicit command passthrough - if (input.match(/^\/(?:workflow|issue|memory|task):/)) { - return { type: 'explicit', command: input, passthrough: true } - } - - return { - type: 'natural', - text: input, - intent: classifyIntent(input, intentRules.intent_patterns), - complexity: assessComplexity(input, intentRules.complexity_indicators), - toolPreference: detectToolPreference(input, intentRules.cli_tool_triggers), - passthrough: false - } -} - -function classifyIntent(text, patterns) { - const sorted = Object.entries(patterns).sort((a, b) => a[1].priority - b[1].priority) - - for (const [intentType, config] of sorted) { - // Handle variants (bugfix, ui, docs) - if (config.variants) { - for (const [variant, vc] of Object.entries(config.variants)) { - const vPatterns = vc.patterns || vc.triggers || [] - if (matchesAny(text, vPatterns)) { - if (intentType === 'bugfix') { - if (matchesAny(text, config.variants.standard?.patterns || [])) - return { type: intentType, variant, workflow: vc.workflow } - } else { - return { type: intentType, variant, workflow: vc.workflow } - } - } - } - if (config.variants.standard && matchesAny(text, config.variants.standard.patterns)) - return { type: intentType, variant: 'standard', workflow: config.variants.standard.workflow } - } - - // Simple patterns - if (config.patterns && !config.require_both && matchesAny(text, config.patterns)) - return { type: intentType, workflow: config.workflow } - - // Dual-pattern (issue_batch) - if (config.require_both && config.patterns) { - if (matchesAny(text, config.patterns.batch_keywords) && matchesAny(text, config.patterns.action_keywords)) - return { type: intentType, workflow: config.workflow } - } - } - return { type: 'feature' } -} - -function assessComplexity(text, indicators) { - let score = 0 - for (const [level, config] of Object.entries(indicators)) { - if (config.patterns) { - for (const [, pc] of Object.entries(config.patterns)) { - if (matchesAny(text, pc.keywords)) score += pc.weight || 1 - } - } - } - if (score >= indicators.high.score_threshold) return 'high' - if (score >= indicators.medium.score_threshold) return 'medium' - return 'low' -} - -function detectToolPreference(text, triggers) { - for (const [tool, config] of Object.entries(triggers)) { - if (matchesAny(text, config.explicit) || matchesAny(text, config.semantic)) return tool - } - return null -} - -function calculateMatchCount(text, patterns) { - let count = 0 - for (const [, config] of Object.entries(patterns)) { - if (config.variants) { - for (const [, vc] of Object.entries(config.variants)) { - if (matchesAny(text, vc.patterns || vc.triggers || [])) count++ - } - } - if (config.patterns && !config.require_both && matchesAny(text, config.patterns)) count++ - } - return count -} -``` - ---- - -## Dimension Extraction (WHAT/WHERE/WHY/HOW) - -```javascript -const PATTERNS = { - actions: { - create: /创建|新增|添加|实现|生成|create|add|implement|generate/i, - fix: /修复|修正|解决|fix|repair|resolve|debug/i, - refactor: /重构|优化结构|重写|refactor|restructure|rewrite/i, - optimize: /优化|提升|改进|性能|optimize|improve|enhance|performance/i, - analyze: /分析|理解|探索|研究|analyze|understand|explore|research/i, - review: /审查|检查|评估|review|check|assess|audit/i - }, - files: /(\S+\.(ts|js|py|md|json|yaml|yml|tsx|jsx|vue|css|scss))/g, - modules: /(src\/\S+|lib\/\S+|packages\/\S+|components\/\S+)/g, - dirs: /(\/[\w\-\.\/]+)/g, - systemScope: /全局|全部|整个|all|entire|whole|系统/i, - goal: /(?:为了|因为|目的是|to|for|because)\s+([^,,。]+)/i, - motivation: /(?:需要|想要|希望|want|need|should)\s+([^,,。]+)/i, - must: /(?:必须|一定要|需要|must|required)\s+([^,,。]+)/i, - mustNot: /(?:不要|禁止|不能|避免|must not|don't|avoid)\s+([^,,。]+)/i, - prefer: /(?:应该|最好|建议|should|prefer)\s+([^,,。]+)/i, - unclear: /不知道|不确定|maybe|可能|how to|怎么/i, - helpRequest: /帮我|help me|请问/i -} - -function extractDimensions(input) { - // WHAT - let action = null - for (const [key, pattern] of Object.entries(PATTERNS.actions)) { - if (pattern.test(input)) { action = key; break } - } - const targetMatch = input.match(/(?:对|in|for|the)\s+([^\s,,。]+)/i) - - // WHERE - const files = [...input.matchAll(PATTERNS.files)].map(m => m[1]) - const modules = [...input.matchAll(PATTERNS.modules)].map(m => m[1]) - const dirs = [...input.matchAll(PATTERNS.dirs)].map(m => m[1]) - const paths = [...new Set([...files, ...modules, ...dirs])] - const scope = files.length > 0 ? 'file' : modules.length > 0 ? 'module' : PATTERNS.systemScope.test(input) ? 'system' : 'unknown' - - // WHY - const goalMatch = input.match(PATTERNS.goal) - const motivationMatch = input.match(PATTERNS.motivation) - - // HOW - const constraints = [] - const mustMatch = input.match(PATTERNS.must) - const mustNotMatch = input.match(PATTERNS.mustNot) - if (mustMatch) constraints.push(mustMatch[1].trim()) - if (mustNotMatch) constraints.push('NOT: ' + mustNotMatch[1].trim()) - const prefMatch = input.match(PATTERNS.prefer) - const preferences = prefMatch ? [prefMatch[1].trim()] : null - - return { - what: { action, target: targetMatch?.[1] || null, description: input.substring(0, 100) }, - where: { scope, paths: paths.length > 0 ? paths : null, patterns: null }, - why: { goal: goalMatch?.[1]?.trim() || null, motivation: motivationMatch?.[1]?.trim() || null, success_criteria: null }, - how: { constraints: constraints.length > 0 ? constraints : null, preferences, approach: null }, - clarity_score: 0, - missing_dimensions: [] - } -} - -function calculateClarityScore(input, d) { - let score = 0 - if (d.what.action) score += 0.5 - if (d.what.target) score += 0.5 - if (d.where.paths?.length > 0) score += 0.5 - if (d.where.scope !== 'unknown') score += 0.5 - if (d.why.goal) score += 0.5 - if (d.how.constraints?.length > 0) score += 0.5 - if (PATTERNS.unclear.test(input)) score -= 0.5 - if (PATTERNS.helpRequest.test(input)) score -= 0.5 - return Math.max(0, Math.min(3, Math.round(score))) -} - -function identifyMissing(d) { - const missing = [] - if (!d.what.target) missing.push('what.target') - if (d.where.scope === 'unknown') missing.push('where.scope') - return missing -} -``` - ---- - -## Phase 1.5: CLI-Assisted Classification - -```javascript -async function cliAssistedClassification(input, ruleBasedResult, intentRules) { - const cfg = intentRules.cli_classification - if (!cfg?.enabled) return { ...ruleBasedResult, source: 'rules', matchCount: 0 } - - const matchCount = calculateMatchCount(input, intentRules.intent_patterns) - const triggers = cfg.trigger_conditions - const shouldUseCli = matchCount < triggers.low_match_count || - ruleBasedResult.complexity === triggers.complexity_trigger || - input.length > triggers.min_input_length || - matchesAny(input, triggers.ambiguous_patterns) - - if (!shouldUseCli) return { ...ruleBasedResult, source: 'rules', matchCount } - - console.log('### CLI-Assisted Intent Classification\n') - - const prompt = ` -PURPOSE: Classify user request intent and recommend optimal workflow -TASK: Analyze semantic meaning, classify intent, assess complexity, recommend workflow -MODE: analysis -USER REQUEST: ${input} -EXPECTED: JSON { intent: { type, variant?, confidence, reasoning }, complexity: { level, factors, confidence }, recommended_workflow: { chain_id, reasoning }, tool_preference?: { suggested, reasoning } } -RULES: Output ONLY valid JSON. Types: bugfix|feature|exploration|ui|issue|tdd|review|docs. Chains: rapid|full|coupled|bugfix|issue|tdd|ui|review-fix|docs` - - const parsed = await executeCli(prompt, cfg, 'classification') - if (!parsed) return { ...ruleBasedResult, source: 'rules', matchCount } - - console.log(`**CLI Result**: ${parsed.intent.type}${parsed.intent.variant ? ` (${parsed.intent.variant})` : ''} | ${parsed.complexity.level} | ${(parsed.intent.confidence * 100).toFixed(0)}% confidence`) - - return { - type: 'natural', text: input, - intent: { type: parsed.intent.type, variant: parsed.intent.variant, workflow: parsed.recommended_workflow.chain_id }, - complexity: parsed.complexity.level, - toolPreference: parsed.tool_preference?.suggested || ruleBasedResult.toolPreference, - confidence: parsed.intent.confidence, - source: 'cli', cliReasoning: parsed.intent.reasoning, passthrough: false - } -} -``` - ---- - -## Phase 1.75: Requirement Clarification - -```javascript -async function clarifyRequirement(analysis, dimensions) { - if (dimensions.clarity_score >= 2 || analysis.passthrough) - return { needsClarification: false, dimensions } - - console.log('### Requirement Clarification\n') - console.log(`**Clarity**: ${dimensions.clarity_score}/3 | WHAT: ${dimensions.what.action || '?'} | WHERE: ${dimensions.where.scope} | WHY: ${dimensions.why.goal || '?'}`) - - const questions = generateClarificationQuestions(dimensions) - if (questions.length === 0) return { needsClarification: false, dimensions } - - const responses = AskUserQuestion({ questions: questions.slice(0, 4) }) - const refined = refineDimensions(dimensions, responses) - refined.clarity_score = Math.min(3, dimensions.clarity_score + 1) - - return { needsClarification: false, dimensions: refined } -} - -function generateClarificationQuestions(d) { - const Q = [] - - if (!d.what.target) Q.push({ - question: "你想要对什么进行操作?", header: "目标", multiSelect: false, - options: [ - { label: "特定文件", description: "修改特定的文件或代码" }, - { label: "功能模块", description: "处理整个功能模块" }, - { label: "系统级", description: "架构或系统级变更" }, - { label: "让我指定", description: "我会提供具体说明" } - ] - }) - - if (d.where.scope === 'unknown' && !d.where.paths?.length) Q.push({ - question: "操作的范围是什么?", header: "范围", multiSelect: false, - options: [ - { label: "自动发现", description: "分析代码库后推荐相关位置" }, - { label: "当前目录", description: "只在当前工作目录" }, - { label: "全项目", description: "整个项目范围" }, - { label: "让我指定", description: "我会提供具体路径" } - ] - }) - - if (!d.why.goal && d.what.action !== 'analyze') Q.push({ - question: "这个操作的主要目标是什么?", header: "目标类型", multiSelect: false, - options: [ - { label: "修复问题", description: "解决已知的Bug或错误" }, - { label: "新增功能", description: "添加新的能力或特性" }, - { label: "改进质量", description: "提升性能、可维护性" }, - { label: "代码审查", description: "检查和评估代码" } - ] - }) - - if (d.what.action === 'refactor' || d.what.action === 'create') Q.push({ - question: "有什么特殊要求或限制?", header: "约束", multiSelect: true, - options: [ - { label: "保持兼容", description: "不破坏现有功能" }, - { label: "最小改动", description: "尽量少修改文件" }, - { label: "包含测试", description: "需要添加测试" }, - { label: "无特殊要求", description: "按最佳实践处理" } - ] - }) - - return Q -} - -function refineDimensions(d, responses) { - const r = { ...d, what: { ...d.what }, where: { ...d.where }, why: { ...d.why }, how: { ...d.how } } - - const scopeMap = { '特定文件': 'file', '功能模块': 'module', '系统级': 'system', '全项目': 'system', '当前目录': 'module' } - const goalMap = { '修复问题': 'fix bug', '新增功能': 'add feature', '改进质量': 'improve quality', '代码审查': 'code review' } - - if (responses['目标'] && scopeMap[responses['目标']]) r.where.scope = scopeMap[responses['目标']] - if (responses['范围'] && scopeMap[responses['范围']]) r.where.scope = scopeMap[responses['范围']] - if (responses['目标类型'] && goalMap[responses['目标类型']]) r.why.goal = goalMap[responses['目标类型']] - if (responses['约束']) { - const c = Array.isArray(responses['约束']) ? responses['约束'] : [responses['约束']] - r.how.constraints = c.filter(x => x !== '无特殊要求') - } - - r.missing_dimensions = identifyMissing(r) - return r -} -``` - ---- - -## Phase 2: Chain Selection - -```javascript -function selectChain(analysis) { - const { intent, complexity } = analysis - const chainMap = { - bugfix: 'bugfix', issue_batch: 'issue', exploration: 'full', ui_design: 'ui', - tdd: 'tdd', review: 'review-fix', documentation: 'docs', feature: null - } - - let chainId = chainMap[intent.type] || chains.chain_selection_rules.complexity_fallback[complexity] - const chain = chains.chains[chainId] - let steps = chain.steps - - if (chain.variants) { - const variant = intent.variant || Object.keys(chain.variants)[0] - steps = chain.variants[variant].steps - } - - return { id: chainId, name: chain.name, description: chain.description, steps, complexity: chain.complexity, estimated_time: chain.estimated_time } -} -``` - ---- - -## Phase 2.5: CLI-Assisted Action Planning - -```javascript -async function cliAssistedPlanning(analysis, selectedChain, intentRules) { - const cfg = intentRules.cli_action_planning - if (!cfg?.enabled) return { useDefaultChain: true, chain: selectedChain } - - const triggers = cfg.trigger_conditions - const shouldUseCli = analysis.complexity === triggers.complexity_threshold || - selectedChain.steps.length >= triggers.step_count_threshold || - (analysis.text?.length > 200) - - if (!shouldUseCli) return { useDefaultChain: true, chain: selectedChain } - - console.log('### CLI-Assisted Action Planning\n') - - const prompt = ` -PURPOSE: Plan optimal workflow execution strategy -CONTEXT: Intent=${analysis.intent.type}, Complexity=${analysis.complexity}, Chain=${selectedChain.name}, Steps=${selectedChain.steps.map(s => s.command).join(',')} -USER REQUEST: ${analysis.text?.substring(0, 200) || 'N/A'} -EXPECTED: JSON { recommendation: "use_default|modify|upgrade", modified_steps?: [], cli_injections?: [], reasoning, risks?: [], suggestions?: [] } -RULES: Output ONLY valid JSON. If no modifications needed, use "use_default".` - - const parsed = await executeCli(prompt, cfg, 'planning') - if (!parsed) return { useDefaultChain: true, chain: selectedChain, source: 'default' } - - console.log(`**Planning**: ${parsed.recommendation}${parsed.reasoning ? ` - ${parsed.reasoning}` : ''}`) - - if (parsed.recommendation === 'modify' && parsed.modified_steps?.length > 0 && cfg.allow_step_modification) { - return { - useDefaultChain: false, - chain: { ...selectedChain, steps: parsed.modified_steps }, - reasoning: parsed.reasoning, risks: parsed.risks, cliInjections: parsed.cli_injections, source: 'cli-planned' - } - } - - return { useDefaultChain: true, chain: selectedChain, suggestions: parsed.suggestions, risks: parsed.risks, source: 'cli-reviewed' } -} -``` - ---- - -## Phase 3: User Confirmation - -```javascript -function confirmChain(selectedChain, analysis) { - if (selectedChain.steps.length <= 2 && analysis.complexity === 'low') return selectedChain - - console.log(`\n## CCW Workflow: ${selectedChain.name}\n**Intent**: ${analysis.intent.type} | **Complexity**: ${analysis.complexity}\n**Steps**: ${selectedChain.steps.map((s, i) => `${i + 1}. ${s.command}`).join(' → ')}`) - - const response = AskUserQuestion({ - questions: [{ - question: `Proceed with ${selectedChain.name}?`, header: "Confirm", multiSelect: false, - options: [ - { label: "Proceed", description: `Execute ${selectedChain.steps.length} steps` }, - { label: "Rapid", description: "Use lite-plan → lite-execute" }, - { label: "Full", description: "Use brainstorm → plan → execute" }, - { label: "Manual", description: "Specify commands manually" } - ] - }] - }) - - if (response.Confirm === 'Rapid') return selectChain({ intent: { type: 'feature' }, complexity: 'low' }) - if (response.Confirm === 'Full') return chains.chains['full'] - if (response.Confirm === 'Manual') return null - return selectedChain -} -``` - ---- - -## Phase 4: TODO Tracking Setup - -```javascript -function setupTodoTracking(chain, analysis) { - const todos = [ - { content: `CCW: ${chain.name} (${chain.steps.length} steps)`, status: 'in_progress', activeForm: `Running ${chain.name} workflow` }, - ...chain.steps.map((step, i) => ({ - content: `[${i + 1}/${chain.steps.length}] ${step.command}`, - status: i === 0 ? 'in_progress' : 'pending', - activeForm: `Executing ${step.command}` - })) - ] - TodoWrite({ todos }) - return { chain, currentStep: 0, todos } -} - -function trackCommandDispatch(command) { - const name = command.split(' ')[0] - const todos = [ - { content: `CCW: Direct Command Dispatch`, status: 'in_progress', activeForm: `Dispatching ${name}` }, - { content: `[${timestamp()}] ${command}`, status: 'in_progress', activeForm: `Executing ${name}` } - ] - TodoWrite({ todos }) - return { command, startTime: Date.now(), todos } -} - -function markCommandResult(tracking, success, error) { - const duration = formatDuration(Date.now() - tracking.startTime) - const name = tracking.command.split(' ')[0] - const icon = success ? '✓' : '✗' - const suffix = success ? `(${duration}s)` : `(failed: ${error})` - - TodoWrite({ todos: [ - { content: `CCW: Direct Command Dispatch`, status: 'completed', activeForm: success ? `Completed ${name}` : 'Failed' }, - { content: `${icon} ${tracking.command} ${suffix}`, status: 'completed', activeForm: success ? `Completed ${name}` : 'Failed' } - ]}) -} -``` - ---- - -## Phase 5: Execution Loop - -```javascript -async function executeChain(execution, analysis) { - const { chain, todos } = execution - let step = 0 - const timings = [] - - while (step < chain.steps.length) { - const s = chain.steps[step] - const start = Date.now() - - // Update TODO: current step in_progress - const updated = todos.map((t, i) => { - if (i === 0) return { ...t, status: 'in_progress' } - if (i === step + 1) return { ...t, status: 'in_progress', content: `[${step + 1}/${chain.steps.length}] ${s.command} (started ${timestamp()})` } - if (i <= step) { - const tm = timings[i - 1] - return { ...t, status: 'completed', content: tm === 'skipped' ? `⊘ ${t.content}` : `✓ [${i}/${chain.steps.length}] ${chain.steps[i-1].command} (${tm}s)` } - } - return { ...t, status: 'pending' } - }) - TodoWrite({ todos: updated }) - - console.log(`\n### Step ${step + 1}/${chain.steps.length}: ${s.command}`) - - // Confirmation if required - if (s.confirm_before) { - const r = AskUserQuestion({ - questions: [{ question: `Execute ${s.command}?`, header: "Step", multiSelect: false, - options: [{ label: "Execute", description: "Run" }, { label: "Skip", description: "Skip" }, { label: "Abort", description: "Stop" }] }] - }) - if (r.Step === 'Skip') { timings.push('skipped'); step++; continue } - if (r.Step === 'Abort') break - } - - // Execute - try { - SlashCommand(s.command, { args: analysis.text }) - const duration = formatDuration(Date.now() - start) - timings.push(duration) - updated[step + 1] = { ...updated[step + 1], status: 'completed', content: `✓ [${step + 1}/${chain.steps.length}] ${s.command} (${duration}s)` } - TodoWrite({ todos: updated }) - console.log(`> Completed (${duration}s)`) - } catch (error) { - updated[step + 1] = { ...updated[step + 1], status: 'completed', content: `✗ [${step + 1}/${chain.steps.length}] ${s.command} (failed)` } - TodoWrite({ todos: updated }) - console.log(`> Failed: ${error.message}`) - - const r = AskUserQuestion({ - questions: [{ question: `Step failed. Proceed?`, header: "Error", multiSelect: false, - options: [{ label: "Retry", description: "Retry" }, { label: "Skip", description: "Skip" }, { label: "Abort", description: "Stop" }] }] - }) - if (r.Error === 'Retry') continue - if (r.Error === 'Abort') break - } - - step++ - - // Check auto_continue - if (!s.auto_continue && step < chain.steps.length) { - console.log(`\nPaused. Next: ${chain.steps[step].command}. Type "continue" to proceed.`) - break - } - } - - // Final status - if (step >= chain.steps.length) { - const total = timings.filter(t => t !== 'skipped').reduce((sum, t) => sum + parseFloat(t), 0).toFixed(1) - const final = todos.map((t, i) => { - if (i === 0) return { ...t, status: 'completed', content: `✓ CCW: ${chain.name} completed (${total}s)`, activeForm: 'Complete' } - const tm = timings[i - 1] - return { ...t, status: 'completed', content: tm === 'skipped' ? `⊘ [${i}/${chain.steps.length}] ${chain.steps[i-1].command}` : `✓ [${i}/${chain.steps.length}] ${chain.steps[i-1].command} (${tm}s)` } - }) - TodoWrite({ todos: final }) - console.log(`\n✓ ${chain.name} completed (${chain.steps.length} steps, ${total}s)`) - } - - return { completed: step, total: chain.steps.length, timings } -} -``` - ---- - -## Main Orchestration Entry - -```javascript -async function ccwOrchestrate(userInput) { - console.log('## CCW Orchestrator\n') - - // Phase 1: Input Analysis - const ruleBasedAnalysis = analyzeInput(userInput) - - // Handle passthrough commands - if (ruleBasedAnalysis.passthrough) { - console.log(`Direct: ${ruleBasedAnalysis.command}`) - const tracking = trackCommandDispatch(ruleBasedAnalysis.command) - try { - const result = SlashCommand(ruleBasedAnalysis.command) - markCommandResult(tracking, true) - return result - } catch (error) { - markCommandResult(tracking, false, error.message) - throw error - } - } - - // Phase 1.5: CLI Classification - const analysis = await cliAssistedClassification(userInput, ruleBasedAnalysis, intentRules) - - // Extract dimensions - const dimensions = extractDimensions(userInput) - dimensions.clarity_score = calculateClarityScore(userInput, dimensions) - dimensions.missing_dimensions = identifyMissing(dimensions) - - console.log(`### Classification\n**Source**: ${analysis.source} | **Intent**: ${analysis.intent.type}${analysis.intent.variant ? ` (${analysis.intent.variant})` : ''} | **Complexity**: ${analysis.complexity} | **Clarity**: ${dimensions.clarity_score}/3`) - - // Phase 1.75: Clarification - const { dimensions: refined } = await clarifyRequirement(analysis, dimensions) - analysis.dimensions = refined - - // Phase 2: Chain Selection - const selectedChain = selectChain(analysis) - - // Phase 2.5: CLI Planning - const { chain: optimizedChain, source: planSource, reasoning, risks } = await cliAssistedPlanning(analysis, selectedChain, intentRules) - if (planSource?.includes('cli')) console.log(`### Planning\n${reasoning || ''}${risks?.length ? ` | Risks: ${risks.join(', ')}` : ''}`) - - // Phase 3: Confirm - const confirmedChain = confirmChain(optimizedChain, analysis) - if (!confirmedChain) { console.log('Manual mode. Specify commands directly.'); return } - - // Phase 4: Setup TODO - const execution = setupTodoTracking(confirmedChain, analysis) - - // Phase 5: Execute - return await executeChain(execution, analysis) -} -``` - ---- - -## Decision Matrix - -| Intent | Complexity | Chain | Steps | -|--------|------------|-------|-------| -| bugfix | * | bugfix | lite-fix | -| issue | * | issue | plan → queue → execute | -| exploration | * | full | brainstorm → plan → execute | -| ui | * | ui | ui-design → sync → plan → execute | -| tdd | * | tdd | tdd-plan → execute → tdd-verify | -| review | * | review-fix | review-session-cycle → review-fix | -| docs | low/medium+ | docs | update-related / docs → execute | -| feature | low/medium/high | rapid/coupled/full | lite-plan / plan → verify / brainstorm | - -## Continuation Commands - -| Input | Action | -|-------|--------| -| `continue` | Next step | -| `skip` | Skip current | -| `abort` | Stop workflow | -| `/workflow:*` | Specific command | -| Natural language | Re-analyze | diff --git a/.claude/skills/ccw/specs/intent-classification.md b/.claude/skills/ccw/specs/intent-classification.md deleted file mode 100644 index dc470257..00000000 --- a/.claude/skills/ccw/specs/intent-classification.md +++ /dev/null @@ -1,336 +0,0 @@ -# Intent Classification Specification - -CCW 意图分类规范:定义如何从用户输入识别任务意图并选择最优工作流。 - -## Classification Hierarchy - -``` -Intent Classification -├── Priority 1: Explicit Commands -│ └── /workflow:*, /issue:*, /memory:*, /task:* -├── Priority 2: Bug Keywords -│ ├── Hotfix: urgent + bug keywords -│ └── Standard: bug keywords only -├── Priority 3: Issue Batch -│ └── Multiple + fix keywords -├── Priority 4: Exploration -│ └── Uncertainty keywords -├── Priority 5: UI/Design -│ └── Visual/component keywords -└── Priority 6: Complexity Fallback - ├── High → Coupled - ├── Medium → Rapid - └── Low → Rapid -``` - -## Keyword Patterns - -### Bug Detection - -```javascript -const BUG_PATTERNS = { - core: /\b(fix|bug|error|issue|crash|broken|fail|wrong|incorrect|修复|报错|错误|问题|异常|崩溃|失败)\b/i, - - urgency: /\b(hotfix|urgent|production|critical|emergency|asap|immediately|紧急|生产|线上|马上|立即)\b/i, - - symptoms: /\b(not working|doesn't work|can't|cannot|won't|stopped|stopped working|无法|不能|不工作)\b/i, - - errors: /\b(\d{3}\s*error|exception|stack\s*trace|undefined|null\s*pointer|timeout)\b/i -} - -function detectBug(text) { - const isBug = BUG_PATTERNS.core.test(text) || BUG_PATTERNS.symptoms.test(text) - const isUrgent = BUG_PATTERNS.urgency.test(text) - const hasError = BUG_PATTERNS.errors.test(text) - - if (!isBug && !hasError) return null - - return { - type: 'bugfix', - mode: isUrgent ? 'hotfix' : 'standard', - confidence: (isBug && hasError) ? 'high' : 'medium' - } -} -``` - -### Issue Batch Detection - -```javascript -const ISSUE_PATTERNS = { - batch: /\b(issues?|batch|queue|multiple|several|all|多个|批量|一系列|所有|这些)\b/i, - action: /\b(fix|resolve|handle|process|处理|解决|修复)\b/i, - source: /\b(github|jira|linear|backlog|todo|待办)\b/i -} - -function detectIssueBatch(text) { - const hasBatch = ISSUE_PATTERNS.batch.test(text) - const hasAction = ISSUE_PATTERNS.action.test(text) - const hasSource = ISSUE_PATTERNS.source.test(text) - - if (hasBatch && hasAction) { - return { - type: 'issue', - confidence: hasSource ? 'high' : 'medium' - } - } - return null -} -``` - -### Exploration Detection - -```javascript -const EXPLORATION_PATTERNS = { - uncertainty: /\b(不确定|不知道|not sure|unsure|how to|怎么|如何|what if|should i|could i|是否应该)\b/i, - - exploration: /\b(explore|research|investigate|分析|研究|调研|评估|探索|了解)\b/i, - - options: /\b(options|alternatives|approaches|方案|选择|方向|可能性)\b/i, - - questions: /\b(what|which|how|why|什么|哪个|怎样|为什么)\b.*\?/i -} - -function detectExploration(text) { - const hasUncertainty = EXPLORATION_PATTERNS.uncertainty.test(text) - const hasExploration = EXPLORATION_PATTERNS.exploration.test(text) - const hasOptions = EXPLORATION_PATTERNS.options.test(text) - const hasQuestion = EXPLORATION_PATTERNS.questions.test(text) - - const score = [hasUncertainty, hasExploration, hasOptions, hasQuestion].filter(Boolean).length - - if (score >= 2 || hasUncertainty) { - return { - type: 'exploration', - confidence: score >= 3 ? 'high' : 'medium' - } - } - return null -} -``` - -### UI/Design Detection - -```javascript -const UI_PATTERNS = { - components: /\b(ui|界面|component|组件|button|按钮|form|表单|modal|弹窗|dialog|对话框)\b/i, - - design: /\b(design|设计|style|样式|layout|布局|theme|主题|color|颜色)\b/i, - - visual: /\b(visual|视觉|animation|动画|responsive|响应式|mobile|移动端)\b/i, - - frontend: /\b(frontend|前端|react|vue|angular|css|html|page|页面)\b/i -} - -function detectUI(text) { - const hasComponents = UI_PATTERNS.components.test(text) - const hasDesign = UI_PATTERNS.design.test(text) - const hasVisual = UI_PATTERNS.visual.test(text) - const hasFrontend = UI_PATTERNS.frontend.test(text) - - const score = [hasComponents, hasDesign, hasVisual, hasFrontend].filter(Boolean).length - - if (score >= 2) { - return { - type: 'ui', - hasReference: /参考|reference|based on|像|like|模仿|imitate/.test(text), - confidence: score >= 3 ? 'high' : 'medium' - } - } - return null -} -``` - -## Complexity Assessment - -### Indicators - -```javascript -const COMPLEXITY_INDICATORS = { - high: { - patterns: [ - /\b(refactor|重构|restructure|重新组织)\b/i, - /\b(migrate|迁移|upgrade|升级|convert|转换)\b/i, - /\b(architect|架构|system|系统|infrastructure|基础设施)\b/i, - /\b(entire|整个|complete|完整|all\s+modules?|所有模块)\b/i, - /\b(security|安全|scale|扩展|performance\s+critical|性能关键)\b/i, - /\b(distributed|分布式|microservice|微服务|cluster|集群)\b/i - ], - weight: 2 - }, - - medium: { - patterns: [ - /\b(integrate|集成|connect|连接|link|链接)\b/i, - /\b(api|database|数据库|service|服务|endpoint|接口)\b/i, - /\b(test|测试|validate|验证|coverage|覆盖)\b/i, - /\b(multiple\s+files?|多个文件|several\s+components?|几个组件)\b/i, - /\b(authentication|认证|authorization|授权)\b/i - ], - weight: 1 - }, - - low: { - patterns: [ - /\b(add|添加|create|创建|simple|简单)\b/i, - /\b(update|更新|modify|修改|change|改变)\b/i, - /\b(single|单个|one|一个|small|小)\b/i, - /\b(comment|注释|log|日志|print|打印)\b/i - ], - weight: -1 - } -} - -function assessComplexity(text) { - let score = 0 - - for (const [level, config] of Object.entries(COMPLEXITY_INDICATORS)) { - for (const pattern of config.patterns) { - if (pattern.test(text)) { - score += config.weight - } - } - } - - // File count indicator - const fileMatches = text.match(/\b\d+\s*(files?|文件)/i) - if (fileMatches) { - const count = parseInt(fileMatches[0]) - if (count > 10) score += 2 - else if (count > 5) score += 1 - } - - // Module count indicator - const moduleMatches = text.match(/\b\d+\s*(modules?|模块)/i) - if (moduleMatches) { - const count = parseInt(moduleMatches[0]) - if (count > 3) score += 2 - else if (count > 1) score += 1 - } - - if (score >= 4) return 'high' - if (score >= 2) return 'medium' - return 'low' -} -``` - -## Workflow Selection Matrix - -| Intent | Complexity | Workflow | Commands | -|--------|------------|----------|----------| -| bugfix (hotfix) | * | bugfix | `lite-fix --hotfix` | -| bugfix (standard) | * | bugfix | `lite-fix` | -| issue | * | issue | `issue:plan → queue → execute` | -| exploration | * | full | `brainstorm → plan → execute` | -| ui (reference) | * | ui | `ui-design:imitate-auto → plan` | -| ui (explore) | * | ui | `ui-design:explore-auto → plan` | -| feature | high | coupled | `plan → verify → execute` | -| feature | medium | rapid | `lite-plan → lite-execute` | -| feature | low | rapid | `lite-plan → lite-execute` | - -## Confidence Levels - -| Level | Description | Action | -|-------|-------------|--------| -| **high** | Multiple strong indicators match | Direct dispatch | -| **medium** | Some indicators match | Confirm with user | -| **low** | Fallback classification | Always confirm | - -## Tool Preference Detection - -```javascript -const TOOL_PREFERENCES = { - gemini: { - pattern: /用\s*gemini|gemini\s*(分析|理解|设计)|让\s*gemini/i, - capability: 'analysis' - }, - qwen: { - pattern: /用\s*qwen|qwen\s*(分析|评估)|让\s*qwen/i, - capability: 'analysis' - }, - codex: { - pattern: /用\s*codex|codex\s*(实现|重构|修复)|让\s*codex/i, - capability: 'implementation' - } -} - -function detectToolPreference(text) { - for (const [tool, config] of Object.entries(TOOL_PREFERENCES)) { - if (config.pattern.test(text)) { - return { tool, capability: config.capability } - } - } - return null -} -``` - -## Multi-Tool Collaboration Detection - -```javascript -const COLLABORATION_PATTERNS = { - sequential: /先.*(分析|理解).*然后.*(实现|重构)|分析.*后.*实现/i, - parallel: /(同时|并行).*(分析|实现)|一边.*一边/i, - hybrid: /(分析|设计).*和.*(实现|测试).*分开/i -} - -function detectCollaboration(text) { - if (COLLABORATION_PATTERNS.sequential.test(text)) { - return { mode: 'sequential', description: 'Analysis first, then implementation' } - } - if (COLLABORATION_PATTERNS.parallel.test(text)) { - return { mode: 'parallel', description: 'Concurrent analysis and implementation' } - } - if (COLLABORATION_PATTERNS.hybrid.test(text)) { - return { mode: 'hybrid', description: 'Mixed parallel and sequential' } - } - return null -} -``` - -## Classification Pipeline - -```javascript -function classify(userInput) { - const text = userInput.trim() - - // Step 1: Check explicit commands - if (/^\/(?:workflow|issue|memory|task):/.test(text)) { - return { type: 'explicit', command: text } - } - - // Step 2: Priority-based classification - const bugResult = detectBug(text) - if (bugResult) return bugResult - - const issueResult = detectIssueBatch(text) - if (issueResult) return issueResult - - const explorationResult = detectExploration(text) - if (explorationResult) return explorationResult - - const uiResult = detectUI(text) - if (uiResult) return uiResult - - // Step 3: Complexity-based fallback - const complexity = assessComplexity(text) - return { - type: 'feature', - complexity, - workflow: complexity === 'high' ? 'coupled' : 'rapid', - confidence: 'low' - } -} -``` - -## Examples - -### Input → Classification - -| Input | Classification | Workflow | -|-------|----------------|----------| -| "用户登录失败,401错误" | bugfix/standard | lite-fix | -| "紧急:支付网关挂了" | bugfix/hotfix | lite-fix --hotfix | -| "批量处理这些 GitHub issues" | issue | issue:plan → queue | -| "不确定要怎么设计缓存系统" | exploration | brainstorm → plan | -| "添加一个深色模式切换按钮" | ui | ui-design → plan | -| "重构整个认证模块" | feature/high | plan → verify | -| "添加用户头像功能" | feature/low | lite-plan | diff --git a/.claude/skills/ccw/specs/output-templates.md b/.claude/skills/ccw/specs/output-templates.md deleted file mode 100644 index c019752c..00000000 --- a/.claude/skills/ccw/specs/output-templates.md +++ /dev/null @@ -1,258 +0,0 @@ -# Output Templates Specification - -CCW 标准输出格式模板,确保一致的用户体验。 - -## Template Categories - -| Category | Usage | Key Elements | -|----------|-------|--------------| -| Classification | Intent/complexity output | Intent, Complexity, Source | -| Planning | Chain selection output | Chain, Steps, Estimated time | -| Clarification | User interaction | Questions, Options, Context | -| Execution | Progress updates | Step, Status, Progress bar | -| Summary | Final results | Completed, Duration, Artifacts | - -## Classification Output Template - -```markdown -### Classification Summary - -- **Source**: [Rule-Based|CLI-Assisted] ([confidence]% confidence) -- **Intent**: [intent_type] ([variant]) -- **Complexity**: [low|medium|high] -- **Reasoning**: [brief explanation] - -**Recommended Workflow**: [chain_name] -``` - -### Example - -```markdown -### Classification Summary - -- **Source**: CLI-Assisted (85% confidence) -- **Intent**: feature (implementation) -- **Complexity**: medium -- **Reasoning**: Request involves creating new functionality with moderate scope - -**Recommended Workflow**: lite-plan → lite-execute -``` - -## Requirement Analysis Template - -```markdown -### Requirement Analysis - -**Input**: [truncated user input...] - -| Dimension | Value | Status | -|-----------|-------|--------| -| WHAT | [action] [target] | ✓ extracted | -| WHERE | [scope]: [paths] | ✓ extracted | -| WHY | [goal] | ⚠ inferred | -| HOW | [constraints] | ✗ missing | - -**Clarity Score**: [score]/3 ([level]) -**Action**: [proceed|clarify|confirm] -``` - -## Planning Output Template - -```markdown -### Workflow Planning - -**Selected Chain**: [chain_name] ([chain_id]) -**Description**: [chain_description] -**Complexity**: [chain_complexity] -**Estimated Time**: [estimated_time] - -**Execution Steps**: -| # | Command | Auto | Description | -|---|---------|------|-------------| -| 1 | [command] | [Y/N] | [step description] | -| 2 | [command] | [Y/N] | [step description] | - -**Risks**: [identified risks or "None identified"] -**Suggestions**: [optimization suggestions or "N/A"] -``` - -## Clarification Output Template - -```markdown -### Clarification Needed - -Your request needs more detail. Please help me understand: - -**Missing Information**: -- [ ] [dimension]: [what's needed] - -**Questions**: -[AskUserQuestion widget renders here] -``` - -## Execution Progress Template - -```markdown -### Execution Progress - -**Workflow**: [chain_name] -**Status**: [step N of M] - -[████████░░░░░░░░] 50% (2/4 steps) - -**Current Step**: [current command] -**Completed**: -- ✓ [step 1 command] -- ✓ [step 2 command] - -**Pending**: -- ○ [step 3 command] -- ○ [step 4 command] -``` - -## Summary Output Template - -```markdown -### Workflow Complete - -**Chain**: [chain_name] -**Duration**: [elapsed time] -**Steps**: [completed]/[total] - -**Results**: -| Step | Status | Notes | -|------|--------|-------| -| [command] | ✓ | [result notes] | - -**Artifacts Generated**: -- [artifact path] - -**Next Actions** (optional): -- [suggested follow-up] -``` - -## Error Output Template - -```markdown -### Workflow Error - -**Step**: [failed step command] -**Error**: [error message] - -**Possible Causes**: -- [cause 1] -- [cause 2] - -**Suggested Actions**: -1. [action 1] -2. [action 2] - -Type `retry` to retry or `abort` to stop. -``` - -## Issue Workflow Templates - -### Issue Discovery Output - -```markdown -### Issue Discovery - -**Perspectives Analyzed**: [list of perspectives] -**Issues Found**: [count] - -| ID | Type | Severity | Location | Description | -|----|------|----------|----------|-------------| -| [ISS-xxx] | [type] | [severity] | [file:line] | [brief] | - -**Recommended Next Step**: `/issue:new` or `/issue:plan` -``` - -### Issue Queue Output - -```markdown -### Execution Queue - -**Queue ID**: [QUE-xxx] -**Total Solutions**: [count] -**Execution Groups**: [count] - -**Queue Structure**: -``` -[P1] Parallel Group (2 solutions) - ├─ SOL-001: [description] - └─ SOL-002: [description] - ↓ -[S1] Sequential (depends on P1) - └─ SOL-003: [description] -``` - -**Conflicts Detected**: [count] ([severity level]) -``` - -### Issue Execution Progress - -```markdown -### Issue Execution - -**Queue**: [QUE-xxx] -**Progress**: [completed]/[total] solutions - -[████████░░░░░░░░] 50% - -**Current Group**: [P1|S1|...] -**Executing**: [SOL-xxx] - [description] - -**Completed**: -- ✓ SOL-001: [result] -- ✓ SOL-002: [result] - -**ETA**: [estimated time remaining] -``` - -## Implementation Guide - -```javascript -// Template rendering function -function renderTemplate(templateType, data) { - const templates = { - classification: renderClassification, - requirement: renderRequirement, - planning: renderPlanning, - clarification: renderClarification, - execution: renderExecution, - summary: renderSummary, - error: renderError - } - - return templates[templateType](data) -} - -// Example: Classification template -function renderClassification(data) { - return `### Classification Summary - -- **Source**: ${data.source} ${data.confidence ? `(${Math.round(data.confidence * 100)}% confidence)` : ''} -- **Intent**: ${data.intent.type}${data.intent.variant ? ` (${data.intent.variant})` : ''} -- **Complexity**: ${data.complexity} -${data.reasoning ? `- **Reasoning**: ${data.reasoning}` : ''} - -**Recommended Workflow**: ${data.workflow}` -} - -// Progress bar helper -function renderProgressBar(completed, total, width = 16) { - const filled = Math.round((completed / total) * width) - const empty = width - filled - const percentage = Math.round((completed / total) * 100) - return `[${'█'.repeat(filled)}${'░'.repeat(empty)}] ${percentage}% (${completed}/${total})` -} -``` - -## Consistency Rules - -1. **Headers**: Always use `###` for section headers -2. **Tables**: Use markdown tables for structured data -3. **Status Icons**: ✓ (done), ○ (pending), ⚠ (warning), ✗ (error) -4. **Progress**: Always show percentage and fraction -5. **Timing**: Show elapsed time in human-readable format -6. **Paths**: Show relative paths when possible diff --git a/.claude/skills/ccw/specs/requirement-analysis.md b/.claude/skills/ccw/specs/requirement-analysis.md deleted file mode 100644 index 1399a19c..00000000 --- a/.claude/skills/ccw/specs/requirement-analysis.md +++ /dev/null @@ -1,237 +0,0 @@ -# Requirement Analysis Specification - -结构化需求分析规范:将用户输入分解为可操作的维度。 - -## Overview - -``` -┌─────────────────────────────────────────────────────────────────┐ -│ Requirement Analysis Pipeline │ -├─────────────────────────────────────────────────────────────────┤ -│ │ -│ Step 1: Clarity Assessment │ -│ ├─ Score: 0-3 (0=模糊, 1=基本, 2=清晰, 3=详细) │ -│ ├─ Missing dimensions detection │ -│ └─ Trigger clarification if score < 2 │ -│ │ -│ Step 2: Dimension Extraction │ -│ ├─ WHAT: 要做什么 (功能/修复/优化) │ -│ ├─ WHERE: 在哪里做 (文件/模块/系统) │ -│ ├─ WHY: 为什么做 (目标/动机) │ -│ ├─ HOW: 怎么做 (约束/偏好) │ -│ └─ WHEN: 时间/优先级约束 │ -│ │ -│ Step 3: Validation │ -│ ├─ Check dimension completeness │ -│ ├─ Detect conflicts │ -│ └─ Generate structured requirement object │ -│ │ -└─────────────────────────────────────────────────────────────────┘ -``` - -## Clarity Scoring - -| Score | Level | Description | Action | -|-------|-------|-------------|--------| -| 0 | 模糊 | 无法理解用户意图 | 必须澄清 | -| 1 | 基本 | 知道做什么,缺少细节 | 建议澄清 | -| 2 | 清晰 | 意图和范围明确 | 可直接执行 | -| 3 | 详细 | 所有维度都已指定 | 直接执行 | - -### Clarity Indicators - -```javascript -const clarityIndicators = { - // Score +1 for each present - positive: [ - /具体|specific|明确/i, // Explicit intent - /在\s*[\w\/]+\s*(文件|模块|目录)/i, // Location specified - /使用|用|采用|通过/i, // Method specified - /因为|为了|目的是/i, // Reason given - /不要|避免|禁止/i, // Constraints given - ], - - // Score -1 for each present - negative: [ - /不知道|不确定|maybe|可能/i, // Uncertainty - /怎么办|如何|what should/i, // Seeking guidance - /帮我|help me/i, // Generic help - ] -} -``` - -## Dimension Schema - -```typescript -interface RequirementDimensions { - // WHAT dimension - what: { - action: 'create' | 'fix' | 'refactor' | 'optimize' | 'analyze' | 'review'; - target: string; // What to act on - description: string; // Brief description - }; - - // WHERE dimension - where: { - scope: 'file' | 'module' | 'system' | 'unknown'; - paths?: string[]; // Specific paths mentioned - patterns?: string[]; // File patterns mentioned - }; - - // WHY dimension - why: { - goal?: string; // End goal - motivation?: string; // Why now - success_criteria?: string; // How to know done - }; - - // HOW dimension - how: { - constraints?: string[]; // Must/Must not - preferences?: string[]; // Should/Should not - approach?: string; // Suggested approach - }; - - // Metadata - clarity_score: 0 | 1 | 2 | 3; - missing_dimensions: string[]; - confidence: number; // 0.0 - 1.0 -} -``` - -## Extraction Rules - -### WHAT Extraction - -```javascript -const whatPatterns = { - create: /创建|新增|添加|实现|生成|create|add|implement|generate/i, - fix: /修复|修正|解决|fix|repair|resolve|debug/i, - refactor: /重构|优化结构|重写|refactor|restructure|rewrite/i, - optimize: /优化|提升|改进|性能|optimize|improve|enhance|performance/i, - analyze: /分析|理解|探索|研究|analyze|understand|explore|research/i, - review: /审查|检查|评估|review|check|assess|audit/i -} -``` - -### WHERE Extraction - -```javascript -const wherePatterns = { - file: /(\S+\.(ts|js|py|md|json|yaml|yml))/g, - module: /(src\/\S+|lib\/\S+|packages\/\S+)/g, - directory: /(\/[\w\-\.\/]+)/g -} -``` - -### Constraint Extraction - -```javascript -const constraintPatterns = { - must: /必须|一定要|需要|must|required|need to/i, - must_not: /不要|禁止|不能|避免|must not|don't|avoid/i, - should: /应该|最好|建议|should|prefer|recommend/i, - should_not: /不应该|不建议|尽量不|should not|better not/i -} -``` - -## Clarification Flow - -当 clarity_score < 2 时触发澄清流程: - -```javascript -function generateClarificationQuestions(dimensions) { - const questions = [] - - if (!dimensions.what.target) { - questions.push({ - question: "你想要对什么进行操作?", - header: "目标", - options: [ - { label: "文件/代码", description: "修改特定文件或代码" }, - { label: "功能/模块", description: "处理整个功能模块" }, - { label: "系统/架构", description: "系统级变更" } - ] - }) - } - - if (!dimensions.where.paths?.length && dimensions.where.scope === 'unknown') { - questions.push({ - question: "你想在哪里进行这个操作?", - header: "位置", - options: [ - { label: "让我指定", description: "我会提供具体路径" }, - { label: "自动发现", description: "分析代码库后推荐" }, - { label: "全局", description: "整个项目范围" } - ] - }) - } - - if (!dimensions.why.goal) { - questions.push({ - question: "这个操作的目标是什么?", - header: "目标", - options: [ - { label: "修复问题", description: "解决已知Bug或错误" }, - { label: "新增功能", description: "添加新的能力" }, - { label: "改进质量", description: "提升性能/可维护性" }, - { label: "其他", description: "其他目标" } - ] - }) - } - - return questions -} -``` - -## Integration with Orchestrator - -```javascript -// In orchestrator.md Phase 1: Input Analysis -function analyzeRequirement(userInput) { - // Step 1: Extract dimensions - const dimensions = extractDimensions(userInput) - - // Step 2: Calculate clarity score - dimensions.clarity_score = calculateClarityScore(userInput, dimensions) - - // Step 3: Identify missing dimensions - dimensions.missing_dimensions = identifyMissing(dimensions) - - return dimensions -} - -// In Phase 1.5: After CLI Classification -function shouldClarify(dimensions, intent) { - // Clarify if: - // 1. Clarity score < 2 - // 2. High complexity with missing dimensions - // 3. Ambiguous intent - return ( - dimensions.clarity_score < 2 || - (intent.complexity === 'high' && dimensions.missing_dimensions.length > 0) - ) -} -``` - -## Output Format - -分析完成后输出结构化需求摘要: - -```markdown -### Requirement Analysis - -**Input**: [Original user input] - -**Dimensions**: -| Dimension | Value | Source | -|-----------|-------|--------| -| WHAT | [action] [target] | extracted/inferred | -| WHERE | [scope]: [paths] | extracted/unknown | -| WHY | [goal] | extracted/missing | -| HOW | [constraints] | extracted/none | - -**Clarity**: [score]/3 - [level description] -**Missing**: [list of missing dimensions] -**Action**: [proceed/clarify/confirm] -``` diff --git a/ccw/src/templates/dashboard-css/04-lite-tasks.css b/ccw/src/templates/dashboard-css/04-lite-tasks.css index 87032d6f..efbe533f 100644 --- a/ccw/src/templates/dashboard-css/04-lite-tasks.css +++ b/ccw/src/templates/dashboard-css/04-lite-tasks.css @@ -2877,3 +2877,747 @@ overflow-x: auto; } +/* =================================== + Multi-CLI Right Toolbar + =================================== */ + +/* Container with toolbar layout */ +.multi-cli-detail-with-toolbar { + display: flex; + position: relative; + gap: 0; +} + +.multi-cli-main-content { + flex: 1; + min-width: 0; + transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +.multi-cli-detail-with-toolbar.toolbar-expanded .multi-cli-main-content { + margin-right: 320px; +} + +/* Toolbar Container */ +.multi-cli-toolbar { + position: fixed; + top: 80px; + right: 0; + bottom: 0; + width: 320px; + background: hsl(var(--card)); + border-left: 1px solid hsl(var(--border)); + display: flex; + flex-direction: column; + z-index: 50; + transform: translateX(calc(100% - 48px)); + transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); + box-shadow: -4px 0 16px rgb(0 0 0 / 0.1); +} + +.multi-cli-toolbar.expanded { + transform: translateX(0); +} + +.multi-cli-toolbar.collapsed { + transform: translateX(calc(100% - 48px)); +} + +/* Toggle Button */ +.toolbar-toggle-btn { + position: absolute; + left: 0; + top: 50%; + transform: translate(-50%, -50%); + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + background: hsl(var(--card)); + border: 1px solid hsl(var(--border)); + border-radius: 50%; + cursor: pointer; + z-index: 51; + transition: all 0.2s ease; + box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); +} + +.toolbar-toggle-btn:hover { + background: hsl(var(--primary)); + border-color: hsl(var(--primary)); + color: hsl(var(--primary-foreground)); + transform: translate(-50%, -50%) scale(1.1); +} + +.toolbar-toggle-btn i { + color: hsl(var(--muted-foreground)); + transition: color 0.2s ease; +} + +.toolbar-toggle-btn:hover i { + color: hsl(var(--primary-foreground)); +} + +/* Toolbar Content */ +.toolbar-content { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + padding: 0; + opacity: 0; + transition: opacity 0.2s ease 0.1s; +} + +.multi-cli-toolbar.expanded .toolbar-content { + opacity: 1; +} + +.multi-cli-toolbar.collapsed .toolbar-content { + opacity: 0; + pointer-events: none; +} + +/* Toolbar Header */ +.toolbar-header { + padding: 1rem; + border-bottom: 1px solid hsl(var(--border)); + background: hsl(var(--muted) / 0.3); +} + +.toolbar-title { + display: flex; + align-items: center; + gap: 0.5rem; + margin: 0; + font-size: 0.9rem; + font-weight: 600; + color: hsl(var(--foreground)); +} + +.toolbar-title i { + color: hsl(var(--primary)); +} + +.toolbar-count { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.5rem; + height: 1.5rem; + padding: 0 0.375rem; + background: hsl(var(--primary) / 0.15); + color: hsl(var(--primary)); + border-radius: 0.75rem; + font-size: 0.75rem; + font-weight: 600; + margin-left: auto; +} + +/* Toolbar Actions */ +.toolbar-actions { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.75rem 1rem; + border-bottom: 1px solid hsl(var(--border)); +} + +.toolbar-action-btn { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + background: hsl(var(--muted)); + border: 1px solid hsl(var(--border)); + border-radius: 0.375rem; + cursor: pointer; + transition: all 0.15s ease; +} + +.toolbar-action-btn i { + color: hsl(var(--muted-foreground)); +} + +.toolbar-action-btn:hover { + background: hsl(var(--primary) / 0.1); + border-color: hsl(var(--primary) / 0.3); +} + +.toolbar-action-btn:hover i { + color: hsl(var(--primary)); +} + +/* Toolbar Task List */ +.toolbar-task-list { + flex: 1; + overflow-y: auto; + padding: 0.5rem; + scrollbar-width: thin; +} + +.toolbar-task-list::-webkit-scrollbar { + width: 6px; +} + +.toolbar-task-list::-webkit-scrollbar-track { + background: transparent; +} + +.toolbar-task-list::-webkit-scrollbar-thumb { + background: hsl(var(--border)); + border-radius: 3px; +} + +.toolbar-task-item { + display: flex; + align-items: flex-start; + gap: 0.625rem; + padding: 0.625rem 0.75rem; + background: hsl(var(--muted) / 0.3); + border: 1px solid hsl(var(--border)); + border-radius: 0.5rem; + margin-bottom: 0.375rem; + cursor: pointer; + transition: all 0.2s ease; +} + +.toolbar-task-item:hover { + background: hsl(var(--primary) / 0.08); + border-color: hsl(var(--primary) / 0.3); + transform: translateX(-2px); +} + +.toolbar-task-item:active { + transform: translateX(-2px) scale(0.98); +} + +.toolbar-task-num { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.5rem; + height: 1.5rem; + background: hsl(var(--primary)); + color: hsl(var(--primary-foreground)); + border-radius: 0.25rem; + font-size: 0.7rem; + font-weight: 600; + flex-shrink: 0; +} + +.toolbar-task-info { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 0.25rem; +} + +.toolbar-task-title { + font-size: 0.8rem; + font-weight: 500; + color: hsl(var(--foreground)); + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.toolbar-task-scope { + font-size: 0.7rem; + color: hsl(var(--muted-foreground)); + font-family: var(--font-mono); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +/* Toolbar Empty State */ +.toolbar-empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 2rem 1rem; + color: hsl(var(--muted-foreground)); + text-align: center; + gap: 0.75rem; +} + +.toolbar-empty i { + color: hsl(var(--muted-foreground) / 0.5); +} + +.toolbar-empty span { + font-size: 0.8rem; +} + +/* Toolbar Session Info */ +.toolbar-session-info { + padding: 0.75rem 1rem; + border-top: 1px solid hsl(var(--border)); + background: hsl(var(--muted) / 0.2); + margin-top: auto; +} + +.toolbar-info-item { + display: flex; + flex-direction: column; + gap: 0.25rem; + margin-bottom: 0.5rem; +} + +.toolbar-info-item:last-child { + margin-bottom: 0; +} + +.toolbar-info-label { + font-size: 0.65rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.025em; + color: hsl(var(--muted-foreground)); +} + +.toolbar-info-value { + font-size: 0.75rem; + color: hsl(var(--foreground)); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.toolbar-info-value.toolbar-summary { + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + white-space: normal; + line-height: 1.4; +} + +/* Task Highlight Animation */ +.fix-task-summary-item.toolbar-highlight { + animation: toolbarHighlightPulse 2s ease-out; +} + +@keyframes toolbarHighlightPulse { + 0% { + box-shadow: 0 0 0 0 hsl(var(--primary)); + } + 20% { + box-shadow: 0 0 0 4px hsl(var(--primary) / 0.4); + border-color: hsl(var(--primary)); + } + 100% { + box-shadow: 0 0 0 0 hsl(var(--primary) / 0); + border-color: hsl(var(--border)); + } +} + +/* Responsive adjustments */ +@media (max-width: 1024px) { + .multi-cli-toolbar { + width: 280px; + } +} + +@media (max-width: 768px) { + .multi-cli-toolbar { + width: 100%; + top: auto; + bottom: 0; + height: 50vh; + transform: translateY(calc(100% - 48px)); + border-left: none; + border-top: 1px solid hsl(var(--border)); + border-radius: 1rem 1rem 0 0; + } + + .multi-cli-toolbar.expanded { + transform: translateY(0); + } + + .multi-cli-toolbar.collapsed { + transform: translateY(calc(100% - 48px)); + } + + .toolbar-toggle-btn { + left: 50%; + top: 0; + transform: translate(-50%, -50%); + } + + .toolbar-toggle-btn:hover { + transform: translate(-50%, -50%) scale(1.1); + } +} + +/* ========== Discussion Section Styles ========== */ +.multi-cli-discussion-section { + padding: 1rem; +} + +.discussion-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 1rem; + padding-bottom: 0.75rem; + border-bottom: 1px solid hsl(var(--border) / 0.5); +} + +.discussion-title { + font-size: 1.125rem; + font-weight: 600; + color: hsl(var(--foreground)); + margin: 0; +} + +.discussion-status { + font-size: 0.75rem; + padding: 0.25rem 0.5rem; + border-radius: 4px; + text-transform: capitalize; +} + +.discussion-status.converged { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); } +.discussion-status.analyzing { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); } + +.discussion-round { + margin-bottom: 0.75rem; + border: 1px solid hsl(var(--border)); + border-radius: 8px; + overflow: hidden; + background: hsl(var(--card)); +} + +.discussion-round-header { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.75rem 1rem; + background: hsl(var(--muted) / 0.3); + cursor: pointer; + transition: background-color 0.2s; +} + +.discussion-round-header:hover { + background: hsl(var(--muted) / 0.5); +} + +.round-title-group { + display: flex; + align-items: center; + gap: 0.5rem; + flex: 1; +} + +.round-badge { + font-size: 0.75rem; + font-weight: 600; + padding: 0.125rem 0.5rem; + background: hsl(var(--primary)); + color: hsl(var(--primary-foreground)); + border-radius: 4px; +} + +.round-timestamp { + font-size: 0.75rem; + color: hsl(var(--muted-foreground)); +} + +.round-indicators { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.convergence-badge { + font-size: 0.7rem; + padding: 0.125rem 0.375rem; + background: hsl(var(--success) / 0.15); + color: hsl(var(--success)); + border-radius: 4px; +} + +.recommendation-badge { + font-size: 0.7rem; + padding: 0.125rem 0.375rem; + border-radius: 4px; + text-transform: capitalize; +} + +.recommendation-badge.converged { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); } +.recommendation-badge.continue { background: hsl(var(--info) / 0.15); color: hsl(var(--info)); } +.recommendation-badge.user_input_needed { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); } + +.discussion-round-content { + padding: 1rem; + border-top: 1px solid hsl(var(--border) / 0.5); +} + +.round-section-title { + font-size: 0.8rem; + font-weight: 600; + color: hsl(var(--muted-foreground)); + margin: 0.75rem 0 0.5rem; + display: flex; + align-items: center; + gap: 0.375rem; +} + +.round-section-title:first-child { + margin-top: 0; +} + +.agent-badges { + display: flex; + flex-wrap: wrap; + gap: 0.375rem; +} + +.agent-badge { + font-size: 0.7rem; + padding: 0.125rem 0.5rem; + background: hsl(var(--accent)); + color: hsl(var(--accent-foreground)); + border-radius: 999px; +} + +.solution-cards-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 0.75rem; + margin-top: 0.5rem; +} + +.solution-mini-card { + border: 1px solid hsl(var(--border)); + border-radius: 6px; + padding: 0.75rem; + background: hsl(var(--background)); +} + +.solution-mini-header { + display: flex; + align-items: center; + gap: 0.5rem; + margin-bottom: 0.5rem; +} + +.solution-mini-title { + font-size: 0.8rem; + font-weight: 500; + flex: 1; +} + +.solution-mini-source { + font-size: 0.65rem; + color: hsl(var(--muted-foreground)); +} + +.solution-mini-description { + font-size: 0.75rem; + color: hsl(var(--muted-foreground)); + line-height: 1.4; +} + +/* Discussion Round Expand/Collapse */ +.discussion-round.collapsed .discussion-round-content { + display: none; +} + +.discussion-round-header .expand-icon { + transition: transform 0.2s; +} + +.discussion-round.collapsed .discussion-round-header .expand-icon { + transform: rotate(-90deg); +} + +/* ========== Association Section Styles ========== */ +.association-section { + margin-bottom: 1.5rem; +} + +.association-section-title { + font-size: 0.9rem; + font-weight: 600; + color: hsl(var(--foreground)); + margin-bottom: 0.75rem; + display: flex; + align-items: center; + gap: 0.375rem; +} + +.association-section-title i { + color: hsl(var(--primary)); +} + +.association-cards-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 1rem; +} + +.association-card { + border: 1px solid hsl(var(--border)); + border-radius: 8px; + padding: 1rem; + background: hsl(var(--card)); + transition: box-shadow 0.2s, border-color 0.2s; +} + +.association-card:hover { + box-shadow: 0 4px 12px hsl(var(--foreground) / 0.08); + border-color: hsl(var(--border)); +} + +.association-card .card-header { + display: flex; + align-items: center; + gap: 0.5rem; + margin-bottom: 0.75rem; +} + +.association-card .card-number { + width: 1.5rem; + height: 1.5rem; + border-radius: 50%; + background: hsl(var(--primary)); + color: hsl(var(--primary-foreground)); + display: flex; + align-items: center; + justify-content: center; + font-size: 0.75rem; + font-weight: 600; + flex-shrink: 0; +} + +.association-card .card-title { + font-weight: 500; + flex: 1; + font-size: 0.9rem; +} + +.association-card .card-metrics { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 0.5rem; + margin-bottom: 0.75rem; +} + +.association-card .metric { + text-align: center; +} + +.association-card .metric-label { + display: block; + font-size: 0.65rem; + color: hsl(var(--muted-foreground)); + margin-bottom: 0.125rem; +} + +.association-card .metric-value { + font-size: 0.85rem; + font-weight: 600; +} + +.association-card .metric-value.effort-low { color: hsl(var(--success)); } +.association-card .metric-value.effort-medium { color: hsl(var(--warning)); } +.association-card .metric-value.effort-high { color: hsl(var(--error)); } + +.association-card .metric-value.risk-low { color: hsl(var(--success)); } +.association-card .metric-value.risk-medium { color: hsl(var(--warning)); } +.association-card .metric-value.risk-high { color: hsl(var(--error)); } + +.association-card .card-section-title { + font-size: 0.75rem; + font-weight: 600; + color: hsl(var(--muted-foreground)); + margin: 0.75rem 0 0.375rem; +} + +.dependency-list, .consensus-list { + list-style: none; + padding: 0; + margin: 0.5rem 0 0 0; +} + +.dependency-item, .consensus-item { + display: flex; + align-items: flex-start; + gap: 0.5rem; + padding: 0.375rem 0; + font-size: 0.8rem; + border-bottom: 1px solid hsl(var(--border) / 0.3); +} + +.dependency-item:last-child, .consensus-item:last-child { + border-bottom: none; +} + +.dep-type { + font-size: 0.65rem; + padding: 0.125rem 0.375rem; + border-radius: 4px; + text-transform: uppercase; + flex-shrink: 0; +} + +.dep-type.internal { background: hsl(var(--info) / 0.15); color: hsl(var(--info)); } +.dep-type.external { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); } + +.dep-name { + flex: 1; + word-break: break-word; +} + +.consensus-icon { + color: hsl(var(--success)); + flex-shrink: 0; +} + +.consensus-text { + flex: 1; + line-height: 1.4; +} + +/* Association Empty State */ +.association-empty { + text-align: center; + padding: 2rem; + color: hsl(var(--muted-foreground)); +} + +.association-empty i { + font-size: 2rem; + margin-bottom: 0.5rem; + opacity: 0.5; +} + +.association-empty p { + margin: 0; + font-size: 0.875rem; +} + +/* Discussion/Association Responsive */ +@media (max-width: 768px) { + .association-cards-grid { + grid-template-columns: 1fr; + } + + .solution-cards-grid { + grid-template-columns: 1fr; + } + + .association-card .card-metrics { + grid-template-columns: repeat(3, 1fr); + } +} + diff --git a/ccw/src/templates/dashboard-js/i18n.js b/ccw/src/templates/dashboard-js/i18n.js index 5ea39135..0502a211 100644 --- a/ccw/src/templates/dashboard-js/i18n.js +++ b/ccw/src/templates/dashboard-js/i18n.js @@ -1220,6 +1220,8 @@ const i18n = { 'multiCli.tab.decision': 'Decision', 'multiCli.tab.timeline': 'Timeline', 'multiCli.tab.rounds': 'Rounds', + 'multiCli.tab.discussion': 'Discussion', + 'multiCli.tab.association': 'Association', 'multiCli.scope': 'Scope', 'multiCli.scope.included': 'Included', 'multiCli.scope.excluded': 'Excluded', @@ -1262,6 +1264,24 @@ const i18n = { 'multiCli.empty.decisionText': 'No decision has been made for this discussion yet.', 'multiCli.empty.timeline': 'No Timeline Events', 'multiCli.empty.timelineText': 'No decision timeline available for this session.', + 'multiCli.empty.association': 'No Association Data', + 'multiCli.empty.associationText': 'No context package or related files available for this session.', + 'multiCli.round': 'Round', + 'multiCli.solutionSummary': 'Solution Summary', + 'multiCli.feasibility': 'Feasibility', + 'multiCli.effort': 'Effort', + 'multiCli.risk': 'Risk', + 'multiCli.consensus': 'Consensus', + 'multiCli.resolvedConflicts': 'Resolved Conflicts', + + // Toolbar + 'multiCli.toolbar.title': 'Task Navigator', + 'multiCli.toolbar.tasks': 'Tasks', + 'multiCli.toolbar.refresh': 'Refresh', + 'multiCli.toolbar.exportJson': 'Export JSON', + 'multiCli.toolbar.viewRaw': 'View Raw Data', + 'multiCli.toolbar.noTasks': 'No tasks available', + 'multiCli.toolbar.scrollToTask': 'Click to scroll to task', // Modals 'modal.contentPreview': 'Content Preview', @@ -3440,6 +3460,8 @@ const i18n = { 'multiCli.tab.decision': '决策', 'multiCli.tab.timeline': '时间线', 'multiCli.tab.rounds': '轮次', + 'multiCli.tab.discussion': '讨论', + 'multiCli.tab.association': '关联', 'multiCli.scope': '范围', 'multiCli.scope.included': '包含', 'multiCli.scope.excluded': '排除', @@ -3482,6 +3504,24 @@ const i18n = { 'multiCli.empty.decisionText': '此讨论尚未做出决策。', 'multiCli.empty.timeline': '无时间线事件', 'multiCli.empty.timelineText': '此会话无可用的决策时间线。', + 'multiCli.empty.association': '无关联数据', + 'multiCli.empty.associationText': '此会话无可用的上下文包或相关文件。', + 'multiCli.round': '轮次', + 'multiCli.solutionSummary': '方案摘要', + 'multiCli.feasibility': '可行性', + 'multiCli.effort': '工作量', + 'multiCli.risk': '风险', + 'multiCli.consensus': '共识', + 'multiCli.resolvedConflicts': '已解决冲突', + + // Toolbar + 'multiCli.toolbar.title': '任务导航', + 'multiCli.toolbar.tasks': '任务列表', + 'multiCli.toolbar.refresh': '刷新', + 'multiCli.toolbar.exportJson': '导出JSON', + 'multiCli.toolbar.viewRaw': '查看原始数据', + 'multiCli.toolbar.noTasks': '暂无任务', + 'multiCli.toolbar.scrollToTask': '点击定位到任务', // Modals 'modal.contentPreview': '内容预览', diff --git a/ccw/src/templates/dashboard-js/views/api-settings.js b/ccw/src/templates/dashboard-js/views/api-settings.js index 2585d898..388c56f2 100644 --- a/ccw/src/templates/dashboard-js/views/api-settings.js +++ b/ccw/src/templates/dashboard-js/views/api-settings.js @@ -216,6 +216,11 @@ async function saveCliSettingsEndpoint(data) { const result = await response.json(); showRefreshToast(t('apiSettings.settingsSaved'), 'success'); + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-wrapper-endpoints'); + } + // Refresh data and re-render await loadCliSettings(true); renderCliSettingsList(); @@ -250,6 +255,11 @@ async function deleteCliSettingsEndpoint(endpointId) { showRefreshToast(t('apiSettings.settingsDeleted'), 'success'); + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-wrapper-endpoints'); + } + // Refresh data and re-render await loadCliSettings(true); selectedCliSettingsId = null; @@ -635,6 +645,11 @@ async function saveProvider() { const result = await response.json(); showRefreshToast(t('apiSettings.providerSaved'), 'success'); + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-litellm-endpoints'); + } + closeProviderModal(); // Force refresh data after saving apiSettingsData = null; @@ -660,6 +675,12 @@ async function deleteProvider(providerId) { if (!response.ok) throw new Error('Failed to delete provider'); showRefreshToast(t('apiSettings.providerDeleted'), 'success'); + + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-litellm-endpoints'); + } + // Force refresh data after deleting apiSettingsData = null; await renderApiSettings(); @@ -998,6 +1019,11 @@ async function saveEndpoint() { const result = await response.json(); showRefreshToast(t('apiSettings.endpointSaved'), 'success'); + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-litellm-endpoints'); + } + closeEndpointModal(); // Force refresh data after saving apiSettingsData = null; @@ -1023,6 +1049,12 @@ async function deleteEndpoint(endpointId) { if (!response.ok) throw new Error('Failed to delete endpoint'); showRefreshToast(t('apiSettings.endpointDeleted'), 'success'); + + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-litellm-endpoints'); + } + // Force refresh data after deleting apiSettingsData = null; await renderApiSettings(); diff --git a/ccw/src/templates/dashboard-js/views/cli-manager.js b/ccw/src/templates/dashboard-js/views/cli-manager.js index fae4e824..02e49bd5 100644 --- a/ccw/src/templates/dashboard-js/views/cli-manager.js +++ b/ccw/src/templates/dashboard-js/views/cli-manager.js @@ -395,6 +395,10 @@ async function updateCliToolConfig(tool, updates) { } if (data.success && cliToolConfig && cliToolConfig.tools) { cliToolConfig.tools[tool] = data.config; + // Invalidate cache to ensure fresh data on page refresh + if (window.cacheManager) { + window.cacheManager.invalidate('cli-config'); + } } return data; } catch (err) { diff --git a/ccw/src/templates/dashboard-js/views/lite-tasks.js b/ccw/src/templates/dashboard-js/views/lite-tasks.js index 5470d865..ba149f83 100644 --- a/ccw/src/templates/dashboard-js/views/lite-tasks.js +++ b/ccw/src/templates/dashboard-js/views/lite-tasks.js @@ -347,6 +347,9 @@ function extractTimelineFromSynthesis(synthesis) { return timeline; } +// Track multi-cli toolbar state +let isMultiCliToolbarExpanded = false; + /** * Show multi-cli detail page with tabs */ @@ -368,70 +371,71 @@ function showMultiCliDetailPage(sessionKey) { const status = latestSynthesis.status || session.status || 'analyzing'; container.innerHTML = ` -
- -
- -
-

${escapeHtml(session.id)}

-
- multi-cli-plan - ${escapeHtml(status)} +
+ +
+ +
+ +
+

${escapeHtml(session.id)}

+
+ multi-cli-plan + ${escapeHtml(status)} +
-
- -
-
- ${t('detail.created') || 'Created'} - ${formatDate(metadata.timestamp || session.createdAt)} + +
+
+ ${t('detail.created') || 'Created'} + ${formatDate(metadata.timestamp || session.createdAt)} +
+
+ ${t('multiCli.roundCount') || 'Rounds'} + ${roundCount} +
+
+ ${t('multiCli.topic') || 'Topic'} + ${escapeHtml(topicTitle)} +
-
- ${t('multiCli.roundCount') || 'Rounds'} - ${roundCount} + + +
+ + +
-
- ${t('multiCli.topic') || 'Topic'} - ${escapeHtml(topicTitle)} + + +
+ ${renderMultiCliPlanningTab(session)}
- -
- - - - - - -
- - -
- ${renderMultiCliTopicTab(session)} +
+ ${renderMultiCliToolbar(session)} +
`; @@ -443,6 +447,216 @@ function showMultiCliDetailPage(sessionKey) { }, 50); } +/** + * Toggle multi-cli toolbar expanded/collapsed state + */ +function toggleMultiCliToolbar() { + isMultiCliToolbarExpanded = !isMultiCliToolbarExpanded; + const toolbar = document.getElementById('multiCliToolbar'); + const toggleBtn = toolbar?.querySelector('.toolbar-toggle-btn i'); + + if (toolbar) { + toolbar.classList.toggle('expanded', isMultiCliToolbarExpanded); + toolbar.classList.toggle('collapsed', !isMultiCliToolbarExpanded); + + // Update icon + if (toggleBtn) { + toggleBtn.setAttribute('data-lucide', isMultiCliToolbarExpanded ? 'panel-right-close' : 'panel-right-open'); + if (typeof lucide !== 'undefined') lucide.createIcons(); + } + } +} + +/** + * Render the multi-cli toolbar content + */ +function renderMultiCliToolbar(session) { + const plan = session.plan; + const tasks = plan?.tasks || []; + const taskCount = tasks.length; + + let toolbarHtml = ` +
+

+ + ${t('multiCli.toolbar.tasks') || 'Tasks'} + ${taskCount} +

+
+ `; + + // Quick Actions + toolbarHtml += ` +
+ + + +
+ `; + + // Task List + if (tasks.length > 0) { + toolbarHtml += ` +
+ ${tasks.map((task, idx) => { + const taskTitle = task.title || task.summary || `Task ${idx + 1}`; + const taskScope = task.scope || ''; + const taskId = `task-${idx}`; + + return ` +
+ #${idx + 1} +
+ ${escapeHtml(taskTitle)} + ${taskScope ? `${escapeHtml(taskScope)}` : ''} +
+
+ `; + }).join('')} +
+ `; + } else { + toolbarHtml += ` +
+ + ${t('multiCli.toolbar.noTasks') || 'No tasks available'} +
+ `; + } + + // Session Info + toolbarHtml += ` +
+
+ ${t('multiCli.toolbar.sessionId') || 'Session'} + ${escapeHtml(session.id)} +
+ ${plan?.summary ? ` +
+ ${t('multiCli.toolbar.summary') || 'Summary'} + ${escapeHtml(plan.summary)} +
+ ` : ''} +
+ `; + + return toolbarHtml; +} + +/** + * Scroll to a specific task in the planning tab + */ +function scrollToMultiCliTask(taskIdx) { + // Switch to planning tab if not active + const planningTab = document.querySelector('.detail-tab[data-tab="planning"]'); + if (planningTab && !planningTab.classList.contains('active')) { + switchMultiCliDetailTab('planning'); + // Wait for tab content to render + setTimeout(() => scrollToTaskElement(taskIdx), 100); + } else { + scrollToTaskElement(taskIdx); + } +} + +/** + * Scroll to task element in the DOM + */ +function scrollToTaskElement(taskIdx) { + const taskItems = document.querySelectorAll('.fix-task-summary-item'); + if (taskItems[taskIdx]) { + taskItems[taskIdx].scrollIntoView({ behavior: 'smooth', block: 'center' }); + // Highlight the task briefly + taskItems[taskIdx].classList.add('toolbar-highlight'); + setTimeout(() => { + taskItems[taskIdx].classList.remove('toolbar-highlight'); + }, 2000); + // Expand the collapsible if collapsed + const header = taskItems[taskIdx].querySelector('.collapsible-header'); + const content = taskItems[taskIdx].querySelector('.collapsible-content'); + if (header && content && content.classList.contains('collapsed')) { + header.click(); + } + } +} + +/** + * Refresh the toolbar content + */ +function refreshMultiCliToolbar() { + const session = liteTaskDataStore[currentSessionDetailKey]; + if (!session) return; + + const toolbarContent = document.querySelector('.toolbar-content'); + if (toolbarContent) { + toolbarContent.innerHTML = renderMultiCliToolbar(session); + if (typeof lucide !== 'undefined') lucide.createIcons(); + } +} + +/** + * Export plan.json content + */ +function exportMultiCliPlanJson() { + const session = liteTaskDataStore[currentSessionDetailKey]; + if (!session || !session.plan) { + if (typeof showRefreshToast === 'function') { + showRefreshToast(t('multiCli.toolbar.noPlan') || 'No plan data available', 'warning'); + } + return; + } + + const jsonStr = JSON.stringify(session.plan, null, 2); + const blob = new Blob([jsonStr], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `plan-${session.id}.json`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + + if (typeof showRefreshToast === 'function') { + showRefreshToast(t('multiCli.toolbar.exported') || 'Plan exported successfully', 'success'); + } +} + +/** + * View raw session JSON in modal + */ +function viewMultiCliRawJson() { + const session = liteTaskDataStore[currentSessionDetailKey]; + if (!session) return; + + // Reuse existing JSON modal pattern + const overlay = document.createElement('div'); + overlay.className = 'json-modal-overlay active'; + overlay.innerHTML = ` +
+
+
+ ${escapeHtml(session.id)} + ${t('multiCli.toolbar.rawData') || 'Raw Session Data'} +
+ +
+
+
${escapeHtml(JSON.stringify(session, null, 2))}
+
+ +
+ `; + document.body.appendChild(overlay); +} + /** * Switch between multi-cli detail tabs */ @@ -458,23 +672,14 @@ function switchMultiCliDetailTab(tabName) { const contentArea = document.getElementById('multiCliDetailTabContent'); switch (tabName) { - case 'topic': - contentArea.innerHTML = renderMultiCliTopicTab(session); - break; - case 'files': - contentArea.innerHTML = renderMultiCliFilesTab(session); - break; case 'planning': contentArea.innerHTML = renderMultiCliPlanningTab(session); break; - case 'decision': - contentArea.innerHTML = renderMultiCliDecisionTab(session); + case 'discussion': + contentArea.innerHTML = renderMultiCliDiscussionSection(session); break; - case 'timeline': - contentArea.innerHTML = renderMultiCliTimelineTab(session); - break; - case 'rounds': - contentArea.innerHTML = renderMultiCliRoundsTab(session); + case 'association': + contentArea.innerHTML = renderMultiCliAssociationSection(session); break; } @@ -695,75 +900,147 @@ function renderFileTreeNodes(nodes, depth = 0) { } /** - * Render Planning tab - * Shows: functional, nonFunctional requirements, acceptanceCriteria + * Render Planning tab - displays session.plan (plan.json content) + * Reuses renderLitePlanTab style with Summary, Approach, Focus Paths, Metadata, and Tasks */ function renderMultiCliPlanningTab(session) { - // Use helper to extract planning from synthesis data structure - const planning = extractPlanningFromSynthesis(session.latestSynthesis); + const plan = session.plan; - if (!planning || (!planning.functional?.length && !planning.acceptanceCriteria?.length)) { + if (!plan) { return `
-
+
${t('multiCli.empty.planning') || 'No Planning Data'}
-
${t('multiCli.empty.planningText') || 'No planning requirements available for this session.'}
+
${t('multiCli.empty.planningText') || 'No plan.json found for this session.'}
`; } - const functional = planning.functional || []; - const nonFunctional = planning.nonFunctional || []; - const acceptanceCriteria = planning.acceptanceCriteria || []; + return ` +
+ + ${plan.summary ? ` +
+

Summary

+

${escapeHtml(plan.summary)}

+
+ ` : ''} - let sections = []; + + ${plan.root_cause ? ` +
+

Root Cause

+

${escapeHtml(plan.root_cause)}

+
+ ` : ''} - // Functional Requirements - if (functional.length) { - sections.push(` -
-

${t('multiCli.functional') || 'Functional Requirements'} (${functional.length})

-
- ${functional.map(req => renderRequirementItem(req)).join('')} + + ${plan.strategy ? ` +
+

Fix Strategy

+

${escapeHtml(plan.strategy)}

+
+ ` : ''} + + + ${plan.approach ? ` +
+

Approach

+

${escapeHtml(plan.approach)}

+
+ ` : ''} + + + ${plan.user_requirements ? ` +
+

User Requirements

+

${escapeHtml(plan.user_requirements)}

+
+ ` : ''} + + + ${plan.focus_paths?.length ? ` +
+

Focus Paths

+
+ ${plan.focus_paths.map(p => `${escapeHtml(p)}`).join('')} +
+
+ ` : ''} + + +
+

Metadata

+
+ ${plan.severity ? `
Severity: ${escapeHtml(plan.severity)}
` : ''} + ${plan.risk_level ? `
Risk Level: ${escapeHtml(plan.risk_level)}
` : ''} + ${plan.estimated_time ? `
Estimated Time: ${escapeHtml(plan.estimated_time)}
` : ''} + ${plan.complexity ? `
Complexity: ${escapeHtml(plan.complexity)}
` : ''} + ${plan.recommended_execution ? `
Execution: ${escapeHtml(plan.recommended_execution)}
` : ''}
- `); - } - // Non-Functional Requirements - if (nonFunctional.length) { - sections.push(` -
-

${t('multiCli.nonFunctional') || 'Non-Functional Requirements'} (${nonFunctional.length})

-
- ${nonFunctional.map(req => renderRequirementItem(req)).join('')} + + ${plan.tasks?.length ? ` +
+

Tasks (${plan.tasks.length})

+
+ ${plan.tasks.map((task, idx) => ` +
+
+ + #${idx + 1} + ${escapeHtml(task.title || task.summary || 'Untitled')} + ${task.scope ? `${escapeHtml(task.scope)}` : ''} +
+ +
+ `).join('')} +
+
+ ` : ''} + + +
+
+ + +
+
- `); - } - - // Acceptance Criteria - if (acceptanceCriteria.length) { - sections.push(` -
-

${t('multiCli.acceptanceCriteria') || 'Acceptance Criteria'} (${acceptanceCriteria.length})

-
- ${acceptanceCriteria.map(ac => ` -
- - ${escapeHtml(ac.id || '')} - ${escapeHtml(getI18nText(ac.description))} -
- `).join('')} -
-
- `); - } - - return sections.length ? `
${sections.join('')}
` : ` -
-
-
${t('multiCli.empty.planning') || 'No Planning Data'}
`; } @@ -1298,6 +1575,312 @@ async function loadMultiCliRound(sessionKey, roundNum) { contentArea.innerHTML = `
${t('multiCli.noRoundData') || 'No data for this round.'}
`; } +/** + * Render Discussion Section (combines Topic, Rounds, Decision) + * Uses accordion layout to display discussion rounds + */ +function renderMultiCliDiscussionSection(session) { + const rounds = session.rounds || []; + const metadata = session.metadata || {}; + const totalRounds = metadata.roundId || rounds.length || 1; + const topic = session.discussionTopic || session.latestSynthesis?.discussionTopic || {}; + + // If no rounds, show topic summary and current synthesis + if (!rounds.length) { + const title = getI18nText(topic.title) || 'Discussion Topic'; + const description = getI18nText(topic.description) || ''; + const status = topic.status || session.status || 'analyzing'; + + return ` +
+
+

${escapeHtml(title)}

+ ${escapeHtml(status)} +
+ ${description ? `

${escapeHtml(description)}

` : ''} +
+ +

${t('multiCli.singleRoundInfo') || 'This is a single-round discussion. View Planning tab for execution details.'}

+
+
+ `; + } + + // Render accordion for multiple rounds + const accordionItems = rounds.map((round, idx) => { + const roundNum = idx + 1; + const isLatest = roundNum === totalRounds; + const roundMeta = round.metadata || {}; + const convergence = round._internal?.convergence || round.convergence || {}; + const recommendation = convergence.recommendation || 'continue'; + const score = convergence.score !== undefined ? Math.round(convergence.score * 100) : null; + const solutions = round.solutions || []; + const agents = roundMeta.contributingAgents || []; + + return ` +
+
+ ${isLatest ? '▼' : '►'} +
+ ${t('multiCli.round') || 'Round'} ${roundNum} + ${formatDate(roundMeta.timestamp)} +
+
+ ${score !== null ? `${score}%` : ''} + ${escapeHtml(recommendation)} +
+
+
+ + ${round.discussionTopic ? ` +
+

${t('multiCli.topic') || 'Topic'}

+

${escapeHtml(getI18nText(round.discussionTopic.title || round.discussionTopic))}

+
+ ` : ''} + + + ${agents.length ? ` +
+

${t('multiCli.contributors') || 'Contributors'}

+
+ ${agents.map(agent => `${escapeHtml(agent.name || agent.id || agent)}`).join('')} +
+
+ ` : ''} + + + ${solutions.length ? ` +
+

${t('multiCli.solutions') || 'Solutions'} (${solutions.length})

+
+ ${solutions.map((sol, sidx) => ` +
+
+ ${sidx + 1} + ${escapeHtml(sol.name || 'Solution ' + (sidx + 1))} +
+
+ ${Math.round((sol.feasibility || 0) * 100)}% + ${escapeHtml(sol.effort || 'M')} + ${escapeHtml(sol.risk || 'M')} +
+ ${sol.summary ? `

${escapeHtml(getI18nText(sol.summary).substring(0, 100))}${getI18nText(sol.summary).length > 100 ? '...' : ''}

` : ''} +
+ `).join('')} +
+
+ ` : ''} + + + ${convergence.reasoning || round.decision ? ` +
+

${t('multiCli.decision') || 'Decision'}

+

${escapeHtml(convergence.reasoning || round.decision || '')}

+
+ ` : ''} +
+
+ `; + }).join(''); + + return ` +
+
+

${escapeHtml(getI18nText(topic.title) || 'Discussion')}

+ ${totalRounds} ${t('multiCli.tab.rounds') || 'Rounds'} +
+
+ ${accordionItems} +
+
+ `; +} + +/** + * Render Association Section (context-package key fields) + * Shows solution summary, dependencies, consensus + */ +function renderMultiCliAssociationSection(session) { + const contextPkg = session.contextPackage || session.context_package || session.latestSynthesis?.context_package || {}; + const solutions = contextPkg.solutions || session.latestSynthesis?.solutions || []; + const dependencies = contextPkg.dependencies || {}; + const consensus = contextPkg.consensus || session.latestSynthesis?._internal?.cross_verification || {}; + const relatedFiles = extractFilesFromSynthesis(session.latestSynthesis); + + // Check if we have any content to display + const hasSolutions = solutions.length > 0; + const hasDependencies = dependencies.internal?.length || dependencies.external?.length; + const hasConsensus = consensus.agreements?.length || consensus.resolved_conflicts?.length || consensus.disagreements?.length; + const hasFiles = relatedFiles?.fileTree?.length || relatedFiles?.impactSummary?.length; + + if (!hasSolutions && !hasDependencies && !hasConsensus && !hasFiles) { + return ` +
+
+
${t('multiCli.empty.association') || 'No Association Data'}
+
${t('multiCli.empty.associationText') || 'No context package or related files available for this session.'}
+
+ `; + } + + let sections = []; + + // Solution Summary Cards + if (hasSolutions) { + sections.push(` +
+

+ + ${t('multiCli.solutionSummary') || 'Solution Summary'} +

+
+ ${solutions.map((sol, idx) => ` +
+
+ ${idx + 1} + ${escapeHtml(sol.name || 'Solution ' + (idx + 1))} +
+
+
+ ${t('multiCli.feasibility') || 'Feasibility'} + ${Math.round((sol.feasibility || 0) * 100)}% +
+
+ ${t('multiCli.effort') || 'Effort'} + ${escapeHtml(sol.effort || 'medium')} +
+
+ ${t('multiCli.risk') || 'Risk'} + ${escapeHtml(sol.risk || 'medium')} +
+
+ ${sol.summary ? `

${escapeHtml(getI18nText(sol.summary))}

` : ''} +
+ `).join('')} +
+
+ `); + } + + // Dependencies Card + if (hasDependencies) { + sections.push(` +
+

+ + ${t('multiCli.dependencies') || 'Dependencies'} +

+
+ ${dependencies.internal?.length ? ` +
+
+ + ${t('multiCli.internalDeps') || 'Internal'} + ${dependencies.internal.length} +
+
    + ${dependencies.internal.map(dep => `
  • ${escapeHtml(getI18nText(dep))}
  • `).join('')} +
+
+ ` : ''} + ${dependencies.external?.length ? ` +
+
+ + ${t('multiCli.externalDeps') || 'External'} + ${dependencies.external.length} +
+
    + ${dependencies.external.map(dep => `
  • ${escapeHtml(getI18nText(dep))}
  • `).join('')} +
+
+ ` : ''} +
+
+ `); + } + + // Consensus Card + if (hasConsensus) { + sections.push(` +
+

+ + ${t('multiCli.consensus') || 'Consensus'} +

+
+ ${consensus.agreements?.length ? ` +
+
+ + ${t('multiCli.agreements') || 'Agreements'} + ${consensus.agreements.length} +
+
    + ${consensus.agreements.map(item => `
  • ${escapeHtml(item)}
  • `).join('')} +
+
+ ` : ''} + ${(consensus.resolved_conflicts?.length || consensus.disagreements?.length) ? ` +
+
+ + ${t('multiCli.resolvedConflicts') || 'Resolved Conflicts'} + ${(consensus.resolved_conflicts || consensus.disagreements || []).length} +
+
    + ${(consensus.resolved_conflicts || consensus.disagreements || []).map(item => `
  • ${escapeHtml(item)}
  • `).join('')} +
+
+ ` : ''} +
+
+ `); + } + + // Related Files (from existing Files tab logic) + if (hasFiles) { + sections.push(` +
+

+ + ${t('multiCli.tab.files') || 'Related Files'} +

+
+ ${relatedFiles.fileTree?.length ? ` +
+ ${relatedFiles.fileTree.slice(0, 10).map(file => ` +
+ + ${escapeHtml(typeof file === 'string' ? file : file.path || file.name)} +
+ `).join('')} + ${relatedFiles.fileTree.length > 10 ? ` +
+${relatedFiles.fileTree.length - 10} ${t('common.more') || 'more'}
+ ` : ''} +
+ ` : ''} + ${relatedFiles.impactSummary?.length ? ` +
+
${t('multiCli.impactSummary') || 'Impact Summary'}
+
    + ${relatedFiles.impactSummary.slice(0, 5).map(item => `
  • ${escapeHtml(getI18nText(item))}
  • `).join('')} +
+
+ ` : ''} +
+
+ `); + } + + return ` +
+ ${sections.join('')} +
+ `; +} + // Lite Task Detail Page function showLiteTaskDetailPage(sessionKey) { const session = liteTaskDataStore[sessionKey]; diff --git a/package.json b/package.json index 6060c0df..4fe2fb08 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "ccw/bin/", "ccw/dist/", "ccw/src/", + "ccw/scripts/", ".claude/agents/", ".claude/commands/", ".claude/output-styles/",