workflow-lite-plan
npx skills add https://github.com/catlog22/claude-code-workflow --skill workflow-lite-plan
Agent 安装分布
Skill 文档
Workflow Lite-Plan
Unified lightweight planning and execution skill. Routes to lite-plan (planning pipeline) 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 â
ââââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââ
â
âââââââââââââ¼ââââââââââââ
â â
âââââââââââââ âââââââââââââ
â lite-plan â âlite-executeâ
â Phase 1 â â Phase 2 â
â Plan+Exec ââdirectââââ Standalone â
âââââââââââââ âââââââââââââ
Compact Recovery (Phase Persistence)
Multi-phase execution (lite-plan â lite-execute) spans long conversations that trigger context compression. 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.
Mode Detection & Routing
const args = $ARGUMENTS
const mode = detectMode()
function detectMode() {
if (skillName === 'workflow:lite-execute') return 'execute'
return 'plan' // default: workflow-lite-plan
}
Routing Table:
| Trigger | Mode | Phase Document | Description |
|---|---|---|---|
workflow-lite-plan |
plan | phases/01-lite-plan.md | Full planning pipeline (explore â plan â confirm â 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, forceExplore: false }
} else if (mode === 'plan') {
const prefResponse = AskUserQuestion({
questions: [
{
question: "æ¯å¦è·³è¿ææç¡®è®¤æ¥éª¤ï¼èªå¨æ¨¡å¼ï¼ï¼",
header: "Auto Mode",
multiSelect: false,
options: [
{ label: "Interactive (Recommended)", description: "äº¤äºæ¨¡å¼ï¼å
å«ç¡®è®¤æ¥éª¤" },
{ label: "Auto", description: "è·³è¿ææç¡®è®¤ï¼èªå¨æ§è¡" }
]
},
{
question: "æ¯å¦å¼ºå¶æ§è¡ä»£ç æ¢ç´¢é¶æ®µï¼",
header: "Exploration",
multiSelect: false,
options: [
{ label: "Auto-detect (Recommended)", description: "æºè½å¤ææ¯å¦éè¦æ¢ç´¢" },
{ label: "Force explore", description: "å¼ºå¶æ§è¡ä»£ç æ¢ç´¢" }
]
}
]
})
workflowPreferences = {
autoYes: prefResponse.autoMode === 'Auto',
forceExplore: prefResponse.exploration === 'Force explore'
}
} else if (mode !== 'plan') {
// Execute mode (standalone, not in-memory)
const prefResponse = AskUserQuestion({
questions: [
{
question: "æ¯å¦è·³è¿ææç¡®è®¤æ¥éª¤ï¼èªå¨æ¨¡å¼ï¼ï¼",
header: "Auto Mode",
multiSelect: false,
options: [
{ label: "Interactive (Recommended)", description: "äº¤äºæ¨¡å¼ï¼å
å«ç¡®è®¤æ¥éª¤" },
{ label: "Auto", description: "è·³è¿ææç¡®è®¤ï¼èªå¨æ§è¡" }
]
}
]
})
workflowPreferences = {
autoYes: prefResponse.autoMode === 'Auto',
forceExplore: false
}
}
workflowPreferences is passed to phase execution as context variable, referenced as workflowPreferences.autoYes and workflowPreferences.forceExplore 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-lite-plan.md and execute
} else {
// Read phases/02-lite-execute.md and execute
}
Execution Flow
Plan Mode
1. Collect preferences via AskUserQuestion (autoYes, forceExplore)
2. Enhance prompt with project context availability
3. Read phases/01-lite-plan.md
4. Execute lite-plan pipeline (Phase 1-5 within the phase doc)
5. lite-plan Phase 5 directly reads and executes Phase 2 (lite-execute) with executionContext
Execute Mode
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, force explore) are collected interactively via AskUserQuestion before dispatching to phases.
Plan mode: Task description provided as arguments â interactive preference collection â 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-lite-plan.md | Complete planning pipeline: exploration, clarification, planning, confirmation, 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")æ¢å¤