workflow-multi-cli-plan
npx skills add https://github.com/catlog22/claude-code-workflow --skill workflow-multi-cli-plan
Agent 安装分布
Skill 文档
Workflow Multi-CLI Plan
Unified multi-CLI collaborative planning and execution skill. Routes to multi-cli-plan (ACE context + multi-CLI discussion + plan generation) or lite-execute (execution engine) based on trigger, with prompt enhancement for both modes.
Architecture Overview
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â SKILL.md (Router + Prompt Enhancement) â
â â Detect mode â Enhance prompt â Dispatch to phase â
ââââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââ
â
âââââââââââââ¼ââââââââââââ
â â
ââââââââââââââââ âââââââââââââ
âmulti-cli-planâ âlite-executeâ
â Phase 1 â â Phase 2 â
â Plan+Exec ââhandoffââ Standalone â
ââââââââââââââââ âââââââââââââ
Mode Detection & Routing
const args = $ARGUMENTS
const mode = detectMode()
function detectMode() {
if (skillName === 'workflow:lite-execute') return 'execute'
return 'plan' // default: workflow:multi-cli-plan
}
Routing Table:
| Trigger | Mode | Phase Document | Description |
|---|---|---|---|
workflow:multi-cli-plan |
plan | phases/01-multi-cli-plan.md | Multi-CLI collaborative planning (ACE context â discussion â plan â execute) |
workflow:lite-execute |
execute | phases/02-lite-execute.md | Standalone execution (in-memory / prompt / file) |
Interactive Preference Collection
Before dispatching, collect workflow preferences via AskUserQuestion:
// â
ç»ä¸ auto mode æ£æµï¼-y/--yes ä» $ARGUMENTS æ ccw ä¼ æ
const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS)
if (autoYes) {
// èªå¨æ¨¡å¼ï¼è·³è¿ææè¯¢é®ï¼ä½¿ç¨é»è®¤å¼
workflowPreferences = { autoYes: true }
} else if (mode === 'plan') {
const prefResponse = AskUserQuestion({
questions: [
{
question: "æ¯å¦è·³è¿ææç¡®è®¤æ¥éª¤ï¼èªå¨æ¨¡å¼ï¼ï¼",
header: "Auto Mode",
multiSelect: false,
options: [
{ label: "Interactive (Recommended)", description: "äº¤äºæ¨¡å¼ï¼å
å«ç¡®è®¤æ¥éª¤" },
{ label: "Auto", description: "è·³è¿ææç¡®è®¤ï¼èªå¨æ§è¡" }
]
}
]
})
workflowPreferences = {
autoYes: prefResponse.autoMode === 'Auto'
}
} else {
// Execute mode
const prefResponse = AskUserQuestion({
questions: [
{
question: "æ¯å¦è·³è¿ææç¡®è®¤æ¥éª¤ï¼èªå¨æ¨¡å¼ï¼ï¼",
header: "Auto Mode",
multiSelect: false,
options: [
{ label: "Interactive (Recommended)", description: "äº¤äºæ¨¡å¼ï¼å
å«ç¡®è®¤æ¥éª¤" },
{ label: "Auto", description: "è·³è¿ææç¡®è®¤ï¼èªå¨æ§è¡" }
]
}
]
})
workflowPreferences = {
autoYes: prefResponse.autoMode === 'Auto'
}
}
workflowPreferences is passed to phase execution as context variable, referenced as workflowPreferences.autoYes within phases.
Prompt Enhancement
After collecting preferences, enhance context and dispatch:
// Step 1: Load project context via ccw spec
Bash('ccw spec load --category planning')
// Step 2: Log available context
console.log('Project context loaded via: ccw spec load --category planning')
// Step 3: Dispatch to phase (workflowPreferences available as context)
if (mode === 'plan') {
// Read phases/01-multi-cli-plan.md and execute
} else {
// Read phases/02-lite-execute.md and execute
}
Compact Recovery (Phase Persistence)
Multi-phase execution (multi-cli-plan â lite-execute) spans long conversations. Uses åéä¿é©: TodoWrite è·è¸ª active phase ä¿æ¤å ¶ä¸è¢«å缩ï¼sentinel ä½ä¸ºå åºã
â ï¸ COMPACT DIRECTIVE: Context compression MUST check TodoWrite phase status. The phase currently marked
in_progressis the active execution phase â preserve its FULL content. Only compress phases markedcompletedorpending.
Execution Flow
Plan Mode (workflow:multi-cli-plan)
1. Collect preferences via AskUserQuestion (autoYes)
2. Enhance prompt with project context availability
3. Read phases/01-multi-cli-plan.md
4. Execute multi-cli-plan pipeline (Phase 1-5 within the phase doc)
5. Phase 5 directly reads and executes Phase 2 (lite-execute) with executionContext
Execute Mode (workflow:lite-execute)
1. Collect preferences via AskUserQuestion (autoYes)
2. Enhance prompt with project context availability
3. Read phases/02-lite-execute.md
4. Execute lite-execute pipeline (input detection â execution â review)
Usage
Plan mode and execute mode are triggered by skill name routing (see Mode Detection). Workflow preferences (auto mode) are collected interactively via AskUserQuestion before dispatching to phases.
Plan mode: Task description provided as arguments â interactive preference collection â multi-CLI planning pipeline Execute mode: Task description, file path, or in-memory context â interactive preference collection â execution pipeline
Phase Reference Documents
| Phase | Document | Purpose | Compact |
|---|---|---|---|
| 1 | phases/01-multi-cli-plan.md | Complete multi-CLI planning pipeline: ACE context, iterative discussion, options, user decision, plan generation, handoff | TodoWrite é©±å¨ |
| 2 | phases/02-lite-execute.md | Complete execution engine: input modes, task grouping, batch execution, code review | TodoWrite é©±å¨ + ð sentinel |
Compact Rules:
- TodoWrite
in_progressâ ä¿ç宿´å 容ï¼ç¦æ¢å缩 - TodoWrite
completedâ å¯å缩为æè¦ - ð sentinel fallback â Phase 2 å
å« compact sentinelï¼è¥ compact åä»
å sentinel èæ å®æ´ Step åè®®ï¼å¿
é¡»ç«å³
Read("phases/02-lite-execute.md")æ¢å¤