workflow-lite-plan-execute
Planning Workflow
Lite Plan produces an implementation plan and an executionContext, then hands off to Lite Execute for task execution.
Key Design Principles
- Shared Execution: Lite Plan produces
executionContextconsumed by Phase 2 (Lite Execute) - Progressive Phase Loading: Only load phase docs when about to execute
- Auto-Continue: After the plan is confirmed ("Allow"), automatically load execution phase
- Default Auto Mode: When
--yes, skip confirmations and auto-approve the plan
Auto Mode
When --yes or -y:
- Auto-approve plan and use default execution settings
- Skip non-critical clarifications; still ask minimal clarifications if required for safety/correctness
Usage (Pseudo)
This section describes the skill input shape; actual invocation depends on the host runtime.
$workflow-lite-plan-execute <task description>
$workflow-lite-plan-execute [FLAGS] "<task description or file path>"
# Flags
-y, --yes Skip confirmations (auto mode)
-e, --explore Force exploration phase
Examples:
$workflow-lite-plan-execute "Implement JWT authentication"
$workflow-lite-plan-execute -y "Add user profile page"
$workflow-lite-plan-execute -e "Refactor payment module"
$workflow-lite-plan-execute "docs/todo.md"
Implementation sketch: 编排器内部使用
Skill(skill="workflow-lite-plan-execute", args="...")接口调用,此为伪代码示意,非命令行语法。
Phase Reference Documents (Read On Demand)
| Phase | Document | Purpose |
|---|---|---|
| 1 | phases/01-lite-plan.md |
Lightweight planning with exploration, clarification, plan generation, and confirmation |
| 2 | phases/02-lite-execute.md |
Shared execution engine: task grouping, batch execution, optional code review |
Orchestrator Logic
// Flag parsing
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const forceExplore = $ARGUMENTS.includes('--explore') || $ARGUMENTS.includes('-e')
// Task extraction rule:
// - Strip known flags: -y/--yes, -e/--explore
// - Remaining args are joined as the task description
// - Treat it as a file path ONLY if (a) exactly one arg remains AND (b) the path exists
function extractTaskDescription(args) {
const knownFlags = new Set(['--yes', '-y', '--explore', '-e'])
const rest = args.filter(a => !knownFlags.has(a))
if (rest.length === 1 && file_exists(rest[0])) return rest[0]
return rest.join(' ').trim()
}
const taskDescription = extractTaskDescription($ARGUMENTS)
// Phase 1: Lite Plan
Read('phases/01-lite-plan.md')
// Execute planning phase...
// Gate: only continue when confirmed (or --yes)
if (executionContext?.userSelection?.confirmation !== 'Allow' && !autoYes) {
// Stop: user cancelled or requested modifications
return
}
// Phase 2: Lite Execute
Read('phases/02-lite-execute.md')
// Execute execution phase with executionContext from Phase 1
executionContext Contract (High Level)
executionContext is the only contract between Phase 1 and Phase 2.
Required (minimum) fields:
{
projectRoot: string, // 项目根目录绝对路径 (git rev-parse --show-toplevel || pwd)
planObject: { summary, approach, tasks, complexity, estimated_time, recommended_execution },
originalUserInput: string,
executionMethod: "Agent" | "Codex" | "Auto",
codeReviewTool: "Skip" | "Gemini Review" | "Codex Review" | "Agent Review" | string,
userSelection: { confirmation: "Allow" | "Modify" | "Cancel" }
}
Recommended fields:
explorationsContext,clarificationContext,executorAssignments, andsession(artifacts folder + paths)
TodoWrite Pattern
Initialization:
[
{"content": "Lite Plan - Planning", "status": "in_progress", "activeForm": "Planning"},
{"content": "Execution (Phase 2)", "status": "pending", "activeForm": "Executing tasks"}
]
After planning completes:
[
{"content": "Lite Plan - Planning", "status": "completed", "activeForm": "Planning"},
{"content": "Execution (Phase 2)", "status": "in_progress", "activeForm": "Executing tasks"}
]
Core Rules
- Planning phase NEVER modifies project code - it may write planning artifacts, but all implementation is delegated to Phase 2
- Phase 2 runs only after confirmation - execute only when confirmation is "Allow" (or
--yesauto mode) - executionContext is the contract between planning and execution phases
- Progressive loading: Read phase doc only when about to execute
- File-path detection: Treat input as a file path only if the path exists; do not infer from file extensions
- Explicit lifecycle: Always
close_agentafterwaitcompletes
Error Handling
| Error | Resolution |
|---|---|
| Planning phase failure | Display error, offer retry |
| executionContext missing | Error: planning phase did not produce context |
| Phase file not found | Error with file path for debugging |
Related Skills
- Full planning workflow:
../workflow-plan-execute/SKILL.md - Brainstorming:
../workflow-brainstorm-auto-parallel/SKILL.md
More from catlog22/claude-code-workflow
skill-generator
Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on "create skill", "new skill", "skill generator".
127review-code
Multi-dimensional code review with structured reports. Analyzes correctness, readability, performance, security, testing, and architecture. Triggers on "review code", "code review", "审查代码", "代码审查".
102skill-tuning
Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug".
71compact
Compact current session memory into structured text for session recovery. Supports custom descriptions and tagging.
71issue-manage
Interactive issue management with menu-driven CRUD operations. Use when managing issues, viewing issue status, editing issue fields, performing bulk operations, or viewing issue history. Triggers on "manage issue", "list issues", "edit issue", "delete issue", "bulk update", "issue dashboard", "issue history", "completed issues".
71ccw-help
CCW command help system. Search, browse, recommend commands, skills, teams. Triggers "ccw-help", "ccw-issue".
70