home / skills / catlog22 / claude-code-workflow / workflow-multi-cli-plan
This skill orchestrates multi-CLI planning and execution by routing to plan or execution modes with enhanced prompts for context-aware results.
npx playbooks add skill catlog22/claude-code-workflow --skill workflow-multi-cli-planReview the files below or copy the command above to add this skill to your agents.
---
name: workflow-multi-cli-plan
description: Multi-CLI collaborative planning and execution skill - route to multi-cli-plan or lite-execute with prompt enhancement. Triggers on "workflow:multi-cli-plan", "workflow:lite-execute".
allowed-tools: Skill, Task, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep, mcp__ace-tool__search_context
---
# 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
```javascript
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](phases/01-multi-cli-plan.md) | Multi-CLI collaborative planning (ACE context → discussion → plan → execute) |
| `workflow:lite-execute` | execute | [phases/02-lite-execute.md](phases/02-lite-execute.md) | Standalone execution (in-memory / prompt / file) |
## Interactive Preference Collection
Before dispatching, collect workflow preferences via AskUserQuestion:
```javascript
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:
```javascript
// Step 1: Check for project context files
const hasProjectTech = fileExists('.workflow/project-tech.json')
const hasProjectGuidelines = fileExists('.workflow/project-guidelines.json')
// Step 2: Log available context
if (hasProjectTech) {
console.log('Project tech context available: .workflow/project-tech.json')
}
if (hasProjectGuidelines) {
console.log('Project guidelines available: .workflow/project-guidelines.json')
}
// 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
}
```
## 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 |
|-------|----------|---------|
| 1 | [phases/01-multi-cli-plan.md](phases/01-multi-cli-plan.md) | Complete multi-CLI planning pipeline: ACE context, iterative discussion, options, user decision, plan generation, handoff |
| 2 | [phases/02-lite-execute.md](phases/02-lite-execute.md) | Complete execution engine: input modes, task grouping, batch execution, code review |
This skill provides a unified multi-CLI collaborative planning and execution capability that routes between a full planning pipeline and a lightweight execution engine. It collects workflow preferences, enhances prompts with project context, and dispatches to the appropriate phase for plan generation or execution. The skill supports coordinated multi-agent CLI orchestration and can run in interactive or auto (no-confirm) modes.
The skill detects mode from the trigger (workflow:multi-cli-plan → plan, workflow:lite-execute → execute), collects user preferences, augments the prompt with available project context files, and then dispatches to the matching phase document. In plan mode it runs a multi-step planning pipeline that produces a handoff into the execution phase; in execute mode it runs a standalone execution pipeline that performs input detection, task grouping, batch execution, and review. Workflow preferences (autoYes) are passed into phases so execution can respect interactive vs automated flows.
How does the skill choose plan vs execute?
The trigger name decides the mode: workflow:multi-cli-plan launches planning; workflow:lite-execute launches standalone execution.
How do I skip confirmations?
During preference collection choose Auto mode. The workflowPreferences.autoYes flag is passed into phases to skip interactive confirmations.
What project files improve prompt enhancement?
Place project context in .workflow/project-tech.json and project guidelines in .workflow/project-guidelines.json to enrich generated plans.