home / skills / catlog22 / claude-code-workflow / workflow-lite-plan

workflow-lite-plan skill

/.claude/skills/workflow-lite-plan

This skill routes to lite-plan or lite-execute with prompt enhancement, enabling streamlined planning and execution for multi-agent workflows.

npx playbooks add skill catlog22/claude-code-workflow --skill workflow-lite-plan

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
6.0 KB
---
name: workflow-lite-plan
description: Lightweight planning and execution skill - route to lite-plan or lite-execute with prompt enhancement. Triggers on "workflow:lite-plan", "workflow:lite-execute".
allowed-tools: Skill, Task, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep
---

# 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 │
     └───────────┘           └───────────┘
```

## Mode Detection & Routing

```javascript
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](phases/01-lite-plan.md) | Full planning pipeline (explore → plan → confirm → 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: "跳过所有确认,自动执行" }
        ]
      },
      {
        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 {
  // 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:

```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-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 |
|-------|----------|---------|
| 1 | [phases/01-lite-plan.md](phases/01-lite-plan.md) | Complete planning pipeline: exploration, clarification, planning, confirmation, handoff |
| 2 | [phases/02-lite-execute.md](phases/02-lite-execute.md) | Complete execution engine: input modes, task grouping, batch execution, code review |

Overview

This skill provides a lightweight planning and execution router that chooses between a planning pipeline (lite-plan) and a standalone execution engine (lite-execute). It enhances prompts with project context and collects simple workflow preferences to adapt planning or execution behavior. The skill is trigger-driven and designed for fast, interactive orchestration of multi-step tasks.

How this skill works

On invocation the skill detects mode from the trigger name and collects user preferences via a short interactive questionnaire (auto mode, force exploration). It inspects project context files (e.g., project-tech.json and project-guidelines.json) and enhances the prompt context before dispatching to the appropriate phase document. In plan mode it runs the multi-step planning pipeline and can hand off directly into execution; in execute mode it runs the execution pipeline for given inputs.

When to use it

  • You need a fast, guided planning run that can optionally jump into execution.
  • You want a lightweight execution engine for scripts, in-memory tasks, or file-based actions.
  • You require prompt enhancement using local project context before issuing tasks to agents.
  • You want an interactive option to skip confirmations and run automatically.
  • You need a routing layer that picks plan vs execute based on trigger or CLI intent.

Best practices

  • Prepare simple project context files (.workflow/project-tech.json and .workflow/project-guidelines.json) to improve prompt augmentation.
  • Prefer interactive default for complex tasks; enable auto mode for repeatable, low-risk runs.
  • Use forceExplore only when unfamiliar code or risky changes require prior discovery.
  • Provide clear task descriptions or file paths when invoking execute mode to speed input detection.
  • Pass workflowPreferences through phases to keep behavior consistent across planning and execution.

Example use cases

  • Create a multi-step development plan from a high-level task and optionally execute the resulting steps automatically.
  • Run a batch execution of automated fixes or refactors using the standalone execution pipeline with minimal confirmations.
  • Enhance agent prompts with project-specific guidelines before running code changes or tests.
  • Switch to auto mode for CI tasks that need unattended execution and to interactive mode for manual review.
  • Force a code exploration phase when onboarding to a new repository to gather context before proposing changes.

FAQ

How does the skill decide plan vs execute?

The trigger name determines mode: workflow:lite-plan defaults to planning; workflow:lite-execute switches to standalone execution.

What preferences are collected?

A short questionnaire captures auto mode (skip confirmations) and whether to force a code exploration phase; execute mode collects only auto mode.