mcpField
W
workflow-lite-plan

workflow-lite-plan

github.com/catlog22エージェントワークフロー2.1k60 回インストール19 週間前に更新
リポジトリ

workflow-lite-plan について

workflow-lite-planは、タスクの説明から構造化された実装計画を作るプランニングスキルです。探索と要件確認の後に計画を確定して実行フローへ引き継ぎます。探索記録やタスクファイルを生成しますが、自身ではコードを実行しません。

主な機能

  1. 01複数の観点からコードベースを探索
  2. 02調査結果の集約と要件確認
  3. 03構造化された計画とタスクファイルの生成
  4. 04確定した計画を実行フローへ引き継ぎ
  5. 05自動確認モード

活用シーン

  1. 01機能開発前の実装計画作成
  2. 02複数モジュールにまたがるタスクのコード探索
  3. 03未確定の要件の確認
  4. 04確定した計画を実行ワークフローへ渡す

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/catlog22/claude-code-workflow --skill workflow-lite-plan

インストール後、Claude Code で/workflow-lite-planを入力して読み込まれたか確認します。

詳細

計画パイプライン:調査 → 明確化 → 計画 → 確認 → workflow-lite-execute への引き継ぎ。 調査結果、構造化された計画(plan.json)、独立したタスクファイル(.task/TASK-*.json)を生成し、実装のために workflow-lite-execute へ引き継ぎます。

1. コンテキストの分離

重要: analyze-with-file または brainstorm-with-file から呼び出された場合、前のセッションは完了済みであり、そのすべてのフェーズの指示も終了済みです。それらを参照してはなりません。このドキュメントで定義されている LP-Phase 1-5 のみを実行してください。フェーズ番号は、以前のワークフローとは独立しています。

2. 入力

<task-description>         Task description or path to .md file (required)
フラグ説明
-y, --yes自動モード:確認を省略し、計画を自動確定し、実行方法を自動選択し、レビューを省略します(計画から実行までのワークフロー全体)
--force-exploreタスクに事前分析がある場合でも、コード調査を強制します

注記:ワークフローの設定(autoYes、forceExplore)はスキルの開始時に初期化する必要があります。呼び出し元から指定されていない場合、スキルはユーザーにワークフローモードの選択を求めます。

3. 出力アーティファクト

アーティファクト説明
exploration-{angle}.json角度ごとの調査結果(複雑さに応じて1~4ファイル)
explorations-manifest.jsonすべての調査ファイルのインデックス
planning-context.md根拠となるパスと統合された理解
plan.jsontask_ids[] を含む計画の概要(plan-overview-base-schema.json)
.task/TASK-*.json独立したタスクファイル(タスクごとに1つ)

出力ディレクトリ:.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/

エージェントの使用:すべての複雑さに対して cli-lite-planning-agent

スキーマ参照:~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json

4. フェーズの概要

フェーズ主なアクション出力
LP-0workflowPreferences を初期化autoYes、forceExplore
LP-1複雑さを評価 → cli-explore-agents を並列実行(1~4)exploration-*.json + manifest
LP-2clarification_needs を集約・重複排除 → AskUserQuestion を複数ラウンド実行clarificationContext(メモリ内)
LP-3cli-lite-planning-agentplan.json + .task/TASK-*.json
LP-4計画を表示 → AskUserQuestion(確認 + 実行 + レビュー)userSelection
LP-5executionContext を構築 → Skill("workflow-lite-execute")引き継ぎ(Mode 1)

5. LP-Phase 0:ワークフロー設定の初期化

if (typeof workflowPreferences === 'undefined' || workflowPreferences === null) {
  workflowPreferences = {
    autoYes: false,      // false: show LP-Phase 2/4 prompts | true (-y): skip all prompts
    forceExplore: false
  }
}

6. LP-Phase 1:複数の観点によるインテリジェントな調査

セッション設定(必須):

const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
const priorHeader = task_description.match(/^## Prior (?:Analysis|Brainstorm) \((.+?)\)/m)
const taskSlug = (priorHeader ? priorHeader[1] : task_description).toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40).replace(/^-+|-+$/g, '')
const dateStr = getUtc8ISOString().substring(0, 10)
const sessionId = `${taskSlug}-${dateStr}`
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)

TodoWrite テンプレート(初期状態 — 以降のフェーズでステータスを順次更新):

// Pattern: set phases[0..N-1].status="completed", phases[N].status="in_progress"
// Only full block shown here; subsequent updates follow same structure with status changes
TodoWrite({ todos: [
  { content: `LP-Phase 1: Exploration [${complexity}] ${selectedAngles.length} angles`, status: "in_progress", activeForm: `Exploring: ${selectedAngles.join(', ')}` },
  { content: "LP-Phase 2: Clarification", status: "pending" },
  { content: "LP-Phase 3: Planning [cli-lite-planning-agent]", status: "pending" },
  { content: "LP-Phase 4: Confirmation", status: "pending" },
  { content: "LP-Phase 5: Execution", status: "pending" }
]})

調査の判断ロジック:

const hasPriorAnalysis = /##\s*Prior Analysis/i.test(task_description)
const hasHandoffSpec = /```json:handoff-spec/i.test(task_description)

// Parse structured handoff from analyze-with-file or brainstorm-with-file (if present)
let handoffSpec = null
if (hasHandoffSpec) {
  const specMatch = task_description.match(/```json:handoff-spec\s*\n([\s\S]*?)\n```/)
  if (specMatch) {
    handoffSpec = JSON.parse(specMatch[1])
    // handoffSpec contains: { source, session_id, session_folder, summary,
    //   implementation_scope[], code_anchors[], key_files[], key_findings[], decision_context[],
    //   exploration_artifacts: { exploration_codebase, explorations, perspectives, research, deep_dives[] } }
    // implementation_scope[]: { objective, rationale, priority, target_files[], acceptance_criteria[], change_summary }
    console.log(`[Handoff] From ${handoffSpec.source} session ${handoffSpec.session_id}`)
    console.log(`[Handoff] ${handoffSpec.implementation_scope.length} scoped items with acceptance criteria`)

    // Enrich task_description with handoff context for downstream planning agent
    // These fields were previously produced but unused — now injected into planning context
    if (handoffSpec.summary) {
      task_description += `\n\n## Analysis Summary\n${handoffSpec.summary}`
    }
    if (handoffSpec.key_findings?.length > 0) {
      task_description += `\n\n## Key Findings\n${handoffSpec.key_findings.map((f, i) =>
        `${i+1}. ${f.point || f} (${f.confidence || 'medium'})`).join('\n')}`
    }
    if (handoffSpec.decision_context?.length > 0) {
      task_description += `\n\n## Decision Context\n${handoffSpec.decision_context.map(d =>
        `- **${d.decision || d}**: ${d.reason || ''}`).join('\n')}`
    }
    if (handoffSpec.code_anchors?.length > 0) {
      task_description += `\n\n## Code Anchors\n${handoffSpec.code_anchors.slice(0, 10).map(a =>
        `- \`${a.file}:${a.lines}\`: ${a.significance}`).join('\n')}`
    }
  }
}

// Brainstorm handoff has no code_anchors/key_files — needs exploration for implementation context
const isBrainstormSource = handoffSpec?.source === 'brainstorm-with-file'
const isAnalysisSource = handoffSpec?.source === 'analyze-with-file'

needsExploration = workflowPreferences.forceExplore ? true
  : isBrainstormSource ? true  // brainstorm explore is lightweight, lite-plan needs deeper exploration
  : (hasPriorAnalysis || isAnalysisSource) ? false
  : (task.mentions_specific_files ||
     task.requires_codebase_context ||
     task.needs_architecture_understanding ||
     task.modifies_existing_code)

if (!needsExploration) {
  // Bridge: Build manifest from analyze session's exploration artifacts
  if (isAnalysisSource && handoffSpec?.exploration_artifacts) {
    const artifacts = handoffSpec.exploration_artifacts
    const explorationEntries = []
    let idx = 1
    const artifactMapping = [
      { key: 'exploration_codebase', angle: 'codebase-discovery' },
      { key: 'explorations', angle: 'analysis-findings' },
      { key: 'perspectives', angle: 'multi-perspective' },
      { key: 'research', angle: 'external-research' }
    ]
    artifactMapping.forEach(({ key, angle }) => {
      if (artifacts[key] && file_exists(artifacts[key])) {
        explorationEntries.push({
          angle, file: artifacts[key].split('/').pop(),
          path: artifacts[key], source_schema: 'analyze', index: idx++
        })
      }
    })
    if (artifacts.deep_dives?.length > 0) {
      artifacts.deep_dives.forEach(divePath => {
        if (file_exists(divePath)) {
          const name = divePath.match(/explorations\/(.+)\.json$/)?.[1] || `deep-dive-${idx}`
          explorationEntries.push({
            angle: name, file: `${name}.json`,
            path: divePath, source_schema: 'analyze', index: idx++
          })
        }
      })
    }
    if (explorationEntries.length > 0) {
      Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify({
        session_id: sessionId, task_description, timestamp: getUtc8ISOString(),
        complexity, exploration_count: explorationEntries.length,
        source: 'analyze-with-file', source_session: handoffSpec.session_id,
        explorations: explorationEntries
      }, null, 2))
      console.log(`[Analyze Bridge] ${explorationEntries.length} artifacts from ${handoffSpec.session_id}`)
    }
  }
  // If no manifest built; LP-Phase 3 loads with safe fallback
  proceed_to_next_phase()
}

コンテキストの保護:ファイルの読み込みが 50k 文字以上の場合は needsExploration=true を強制します(cli-explore-agent に委任)

複雑さの評価:

const complexity = analyzeTaskComplexity(task_description)
// 'Low': single file, single function, zero cross-module impact (fix typo, rename var, adjust constant)
// 'Medium': multiple files OR integration point OR new pattern (add endpoint, implement feature, refactor)
// 'High': cross-module, architectural, systemic (new subsystem, migration, security overhaul)
// Default bias: uncertain between Low/Medium → choose Medium

const ANGLE_PRESETS = {
  architecture: ['architecture', 'dependencies', 'modularity', 'integration-points'],
  security: ['security', 'auth-patterns', 'dataflow', 'validation'],
  performance: ['performance', 'bottlenecks', 'caching', 'data-access'],
  bugfix: ['error-handling', 'dataflow', 'state-management', 'edge-cases'],
  feature: ['patterns', 'integration-points', 'testing', 'dependencies']
}

function selectAngles(taskDescription, count) {
  const text = taskDescription.toLowerCase()
  let preset = 'feature'
  if (/refactor|architect|restructure|modular/.test(text)) preset = 'architecture'
  else if (/security|auth|permission|access/.test(text)) preset = 'security'
  else if (/performance|slow|optimi|cache/.test(text)) preset = 'performance'
  else if (/fix|bug|error|issue|broken/.test(text)) preset = 'bugfix'
  return ANGLE_PRESETS[preset].slice(0, count)
}

const selectedAngles = selectAngles(task_description, complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1))

console.log(`Exploration Plan: ${complexity} | ${selectedAngles.join(', ')} | cli-lite-planning-agent`)

並列調査の開始:

重要:run_in_background: true を使用してはなりません — 計画の前に調査結果が必須です。

const explorationTasks = selectedAngles.map((angle, index) =>
  Task(
    subagent_type="cli-explore-agent",
    run_in_background=false,
    description=`Explore: ${angle}`,
    prompt=`
## Task Objective
Execute **${angle}** exploration for task planning context.

## Output Location
**Session Folder**: ${sessionFolder}
**Output File**: ${sessionFolder}/exploration-${angle}.json

## Assigned Context
- **Exploration Angle**: ${angle}
- **Task Description**: ${task_description}
- **Exploration Index**: ${index + 1} of ${selectedAngles.length}

## Exploration Strategy (${angle} focus)

**Step 1: Structural Scan** (Bash)
- get_modules_by_depth.sh → identify modules related to ${angle}
- find/rg → locate files relevant to ${angle} aspect
- Analyze imports/dependencies from ${angle} perspective

**Step 2: Semantic Analysis** (Gemini CLI)
- How does existing code handle ${angle} concerns?
- What patterns are used for ${angle}?
- Where would new code integrate from ${angle} viewpoint?

**Step 3: Write Output**
- Consolidate ${angle} findings into JSON
- Identify ${angle}-specific clarification needs

## Expected Output
**Schema**: explore-json-schema.json (auto-loaded by agent)
- All fields scoped to ${angle} perspective
- Ensure rationale is specific and >10 chars (not generic)
- Include file:line locations in integration_points
- _metadata.exploration_angle: "${angle}"

## Success Criteria
- [ ] get_modules_by_depth.sh executed
- [ ] At least 3 relevant files with specific rationale (>10 chars) + role classification
- [ ] Patterns are actionable (code examples, not generic advice)
- [ ] Integration points include file:line locations
- [ ] Constraints are project-specific to ${angle}
- [ ] JSON follows schema; clarification_needs includes options + recommended
- [ ] Files with relevance >= 0.7 have key_code array + topic_relation

## Execution
**Write**: \`${sessionFolder}/exploration-${angle}.json\`
**Return**: 2-3 sentence summary of ${angle} findings
`
  )
)
// Execute all exploration tasks in parallel

自動検出とマニフェストの構築:

const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json" -type f`)
  .split('\n').filter(f => f.trim())

const explorationManifest = {
  session_id: sessionId,
  task_description: task_description,
  timestamp: getUtc8ISOString(),
  complexity: complexity,
  exploration_count: explorationFiles.length,
  explorations: explorationFiles.map(file => {
    const data = JSON.parse(Read(file))
    return {
      angle: data._metadata.exploration_angle,
      file: path.basename(file),
      path: file,
      index: data._metadata.exploration_index
    }
  })
}

Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify(explorationManifest, null, 2))
console.log(`Exploration complete: ${explorationManifest.explorations.map(e => e.angle).join(', ')}`)

// TodoWrite:Phase 1 → completed、Phase 2 → in_progress

出力:exploration-{angle}.json(1~4ファイル)+ explorations-manifest.json

7. LP-Phase 2:明確化(任意、複数ラウンド)

省略条件:調査がない場合、またはすべての調査で clarification_needs が空の場合

重要:AskUserQuestion で1回に質問できるのは最大4つです。すべての明確化事項を確認し終えるまで、複数ラウンドを必ず実行してください。

const manifest = file_exists(`${sessionFolder}/explorations-manifest.json`)
  ? JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
  : { exploration_count: 0, explorations: [] }
const explorations = manifest.explorations.map(exp => ({
  angle: exp.angle,
  data: JSON.parse(Read(exp.path))
}))

// Aggregate from all explorations
const allClarifications = []
explorations.forEach(exp => {
  if (exp.data.clarification_needs?.length > 0) {
    exp.data.clarification_needs.forEach(need => {
      allClarifications.push({ ...need, source_angle: exp.angle })
    })
  }
})

// Intelligent dedup: merge similar intent across angles, combine options
const dedupedClarifications = intelligentMerge(allClarifications)

if (workflowPreferences.autoYes) {
  console.log(`[Auto] Skipping ${dedupedClarifications.length} clarification questions`)
} else if (dedupedClarifications.length > 0) {
  const BATCH_SIZE = 4
  const totalRounds = Math.ceil(dedupedClarifications.length / BATCH_SIZE)

  for (let i = 0; i < dedupedClarifications.length; i += BATCH_SIZE) {
    const batch = dedupedClarifications.slice(i, i + BATCH_SIZE)
    const currentRound = Math.floor(i / BATCH_SIZE) + 1
    console.log(`### Clarification Round ${currentRound}/${totalRounds}`)

    AskUserQuestion({
      questions: batch.map(need => ({
        question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
        header: need.source_angle.substring(0, 12),
        multiSelect: false,
        options: need.options.map((opt, index) => ({
          label: need.recommended === index ? `${opt} ★` : opt,
          description: need.recommended === index ? `Recommended` : `Use ${opt}`
        }))
      }))
    })
    // Store batch responses in clarificationContext before next round
  }
}

出力:clarificationContext(メモリ内)

8. LP-Phase 3:計画

重要:LP-Phase 3 は計画のみを行います — コードを実行してはなりません。すべての実行は LP-Phase 5 で workflow-lite-execute を通じて行われます。

実行担当の割り当て(計画の生成後):

// Priority: 1. User explicit ("用 gemini 分析..." → gemini) | 2. Default → agent
const executorAssignments = {}  // { taskId: { executor: 'gemini'|'codex'|'agent', reason } }
const taskFiles = Glob(`${sessionFolder}/.task/TASK-*.json`)
taskFiles.forEach(taskPath => {
  const task = JSON.parse(Read(taskPath))
  executorAssignments[task.id] = { executor: '...', reason: '...' }
})

cli-lite-planning-agent の呼び出し:

Task(
  subagent_type="cli-lite-planning-agent",
  run_in_background=false,
  description="Generate detailed implementation plan",
  prompt=`
Generate implementation plan and write plan.json.

## Output Location
**Session Folder**: ${sessionFolder}
**Output Files**:
- ${sessionFolder}/planning-context.md (evidence + understanding)
- ${sessionFolder}/plan.json (plan overview — NO embedded tasks[])
- ${sessionFolder}/.task/TASK-*.json (independent task files, one per task)

## Project Context (MANDATORY)
Execute: ccw spec load --category planning
**CRITICAL**: All generated tasks MUST comply with constraints in specs/*.md

## Task Description
${task_description}

## Multi-Angle Exploration Context

${manifest.explorations.length > 0
  ? manifest.explorations.map(exp => `### Exploration: ${exp.angle} (${exp.file})
Path: ${exp.path}
Read this file for detailed ${exp.angle} analysis.`).join('\n\n') + `

Total: ${manifest.exploration_count} | Angles: ${manifest.explorations.map(e => e.angle).join(', ')}
Manifest: ${sessionFolder}/explorations-manifest.json`
  : `No exploration files. Task Description contains "## Prior Analysis" — use as primary planning context.`}

## Structured Handoff Spec (from ${handoffSpec?.source || 'upstream workflow'})
${handoffSpec ? `
**Source**: ${handoffSpec.source} session ${handoffSpec.session_id}
**CRITICAL**: Use implementation_scope as PRIMARY input for task generation.
${isBrainstormSource ? '**NOTE**: Brainstorm source — code_anchors/key_files are empty. Use exploration results as primary file context.' : ''}
Each scope item maps to one or more tasks. Acceptance criteria become convergence.criteria.

${JSON.stringify(handoffSpec.implementation_scope, null, 2)}

**Code Anchors** (implementation targets):
${JSON.stringify(handoffSpec.code_anchors?.slice(0, 8), null, 2)}

**Key Findings** (context):
${JSON.stringify(handoffSpec.key_findings?.slice(0, 5), null, 2)}

**Task Generation Rules when handoffSpec present**:
1. Each implementation_scope item → 1 task (group only if tightly coupled)
2. scope.acceptance_criteria[] → task.convergence.criteria[]
3. scope.target_files[] → task.files[] with change from scope.change_summary
4. scope.objective → task.title, scope.rationale → task.description context
5. scope.priority → task ordering (high first)
` : 'No structured handoff spec — use task description and explorations as input.'}

## User Clarifications
${JSON.stringify(clarificationContext) || "None"}

## Complexity Level
${complexity}

## Requirements
- _metadata.exploration_angles: ${JSON.stringify(manifest.explorations.map(e => e.angle))}
- Two-layer output: plan.json (task_ids[], NO tasks[]) + .task/TASK-*.json
- Field names: files[].change (not modification_points), convergence.criteria (not acceptance)

## Task Grouping Rules
1. **Group by feature**: All changes for one feature = one task (even if 3-5 files)
2. **Group by context**: Related functional changes can be grouped together
3. **Minimize agent count**: Group simple unrelated tasks to reduce overhead
4. **Avoid file-per-task**: Do NOT create separate tasks for each file
5. **Substantial tasks**: Each task = 15-60 minutes of work
6. **True dependencies only**: depends_on only when Task B needs Task A's output
7. **Prefer parallel**: Most tasks should be independent

## Execution
1. ccw spec load → 2. Read ALL exploration files → 3. Synthesize + generate
4. Write: planning-context.md, .task/TASK-*.json, plan.json (task_ids[], NO tasks[])
5. Return brief completion summary
`
)

出力:${sessionFolder}/plan.json

// TodoWrite:Phase 3 → completed、Phase 4 → in_progress

## 9. LP-Phase 4: タスクの確認と実行方法の選択

表示プラン:

const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))
const tasks = (plan.task_ids || []).map(id => JSON.parse(Read(`${sessionFolder}/.task/${id}.json`)))

console.log(`
## Implementation Plan
**Summary**: ${plan.summary}
**Approach**: ${plan.approach}
**Tasks** (${tasks.length}):
${tasks.map((t, i) => `${i+1}. ${t.title} (${t.scope || t.files?.[0]?.path || ''})`).join('\n')}
**Complexity**: ${plan.complexity} | **Time**: ${plan.estimated_time} | **Recommended**: ${plan.recommended_execution}
`)

確認の収集:

let userSelection

if (workflowPreferences.autoYes) {
  console.log(`[Auto] Allow & Execute | Auto | Skip + Skip`)
  userSelection = { confirmation: "Allow", execution_method: "Auto", code_review_tool: "Skip", convergence_review_tool: "Skip" }
} else {
  // "Other" in Execution allows specifying CLI tools from ~/.claude/cli-tools.json
  userSelection = AskUserQuestion({
    questions: [
      {
        question: `Confirm plan and authorize execution? (${tasks.length} tasks, ${plan.complexity})`,
        header: "Confirm",
        multiSelect: false,
        options: [
          { label: "Allow & Execute", description: "Approve plan and begin execution immediately (no further prompts)" },
          { label: "Modify", description: "Adjust before execution" },
          { label: "Cancel", description: "Abort workflow" }
        ]
      },
      {
        question: "Execution method:",
        header: "Execution",
        multiSelect: false,
        options: [
          { label: "Agent", description: "@code-developer agent" },
          { label: "Codex", description: "codex CLI tool" },
          { label: "Auto", description: `Auto: ${plan.complexity === 'Low' ? 'Agent' : 'Codex'}` }
        ]
      },
      {
        question: "Code review after execution? (runs in workflow-lite-execute)",
        header: "Code Review",
        multiSelect: false,
        options: [
          { label: "Gemini Review", description: "Gemini CLI: git diff quality review" },
          { label: "Codex Review", description: "Codex CLI: prompt-based code quality review (--mode analysis)" },
          { label: "Agent Review", description: "@code-reviewer agent" },
          { label: "Skip", description: "No code review" }
        ]
      },
      {
        question: "Convergence review in workflow-lite-test-review phase?",
        header: "Convergence Review",
        multiSelect: false,
        options: [
          { label: "Agent", description: "Agent: verify convergence criteria against implementation" },
          { label: "Gemini", description: "Gemini CLI: convergence verification" },
          { label: "Codex", description: "Codex CLI: convergence verification" },
          { label: "Skip", description: "Skip convergence review, run tests only" }
        ]
      }
    ]
  })
}

// TodoWrite: Phase 4 → completed [${userSelection.execution_method} | CR:${userSelection.code_review_tool} | CVR:${userSelection.convergence_review_tool}], Phase 5 → in_progress

10. LP-Phase 5: 実行への引き継ぎ

重要:lite-plan はコードを直接実行しません。すべての実行は workflow-lite-execute を通じて行います。

executionContext の構築:

const manifest = file_exists(`${sessionFolder}/explorations-manifest.json`)
  ? JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
  : { exploration_count: 0, explorations: [] }
const explorations = {}
manifest.explorations.forEach(exp => {
  if (file_exists(exp.path)) explorations[exp.angle] = JSON.parse(Read(exp.path))
})

const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))

executionContext = {
  planObject: plan,
  taskFiles: (plan.task_ids || []).map(id => ({ id, path: `${sessionFolder}/.task/${id}.json` })),
  explorationsContext: explorations,
  explorationAngles: manifest.explorations.map(e => e.angle),
  explorationManifest: manifest,
  clarificationContext: clarificationContext || null,
  executionMethod: userSelection.execution_method,
  codeReviewTool: userSelection.code_review_tool,
  convergenceReviewTool: userSelection.convergence_review_tool,
  originalUserInput: task_description,
  executorAssignments: executorAssignments,  // { taskId: { executor, reason } } — overrides executionMethod
  session: {
    id: sessionId,
    folder: sessionFolder,
    artifacts: {
      explorations: manifest.explorations.map(exp => ({ angle: exp.angle, path: exp.path })),
      explorations_manifest: `${sessionFolder}/explorations-manifest.json`,
      plan: `${sessionFolder}/plan.json`,
      task_dir: `${sessionFolder}/.task`
    }
  }
}

引き継ぎ:

if (!workflowPreferences.autoYes) {
  console.log(`Handing off to execution engine. No further prompts.`)
}

// TodoWrite: Phase 5 → completed, add LE-Phase 1 → in_progress
const taskCount = (plan.task_ids || []).length
TodoWrite({ todos: [
  { content: "LP-Phase 1: Exploration", status: "completed" },
  { content: "LP-Phase 2: Clarification", status: "completed" },
  { content: "LP-Phase 3: Planning", status: "completed" },
  { content: `LP-Phase 4: Confirmed [${userSelection.execution_method} | CR:${userSelection.code_review_tool} | CVR:${userSelection.convergence_review_tool}]`, status: "completed" },
  { content: `LP-Phase 5: Handoff → workflow-lite-execute`, status: "completed" },
  { content: `LE-Phase 1: Task Loading [${taskCount} tasks]`, status: "in_progress", activeForm: "Loading tasks" }
]})

Skill("workflow-lite-execute")
// executionContext passed as global variable (Mode 1: In-Memory Plan)

11. セッションフォルダーの構成

.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/
├── exploration-{angle}.json (1-4)   # Per-angle exploration
├── explorations-manifest.json        # Exploration index
├── planning-context.md               # Evidence paths + understanding
├── plan.json                         # Plan overview (task_ids[])
├── code-review.md                    # Generated by workflow-lite-execute Step 4
├── test-checklist.json               # Generated by workflow-lite-test-review
├── test-review.md                    # Generated by workflow-lite-test-review
└── .task/
    ├── TASK-001.json
    ├── TASK-002.json
    └── ...

チェーン:lite-plan → workflow-lite-execute → workflow-lite-test-review

lite-plan (LP-Phase 1-5)
  └─ Skill("workflow-lite-execute")     ← executionContext (global)
       ├─ Step 1-3: Task Execution
       ├─ Step 4: Code Review (quality/correctness/security)
       └─ Step 5: Skill("workflow-lite-test-review")  ← testReviewContext (global)
            ├─ TR-Phase 1: Detect test framework
            ├─ TR-Phase 2: Convergence verification (plan criteria)
            ├─ TR-Phase 3-4: Run tests + Auto-fix
            └─ TR-Phase 5: Report + Sync specs

12. エラー処理

エラー解決方法
探索エージェントの失敗探索をスキップし、タスクの説明のみで続行します
計画エージェントの失敗複雑さを下げて再試行するか、タスクを分割するよう提案します
明確化のタイムアウト探索結果をそのまま使用します
確認のタイムアウトコンテキストを保存し、再開手順を表示します
変更ループが 3 回を超えるタスクを分割するか、/workflow-plan を使用するよう提案します

<auto_mode> workflowPreferences.autoYes === true の場合(計画から実行までのワークフロー全体):

  • 明確化:スキップ | 計画の確認:承認して実行 | 実行:自動 | レビュー:スキップ

自動モードでは、1 回の確認で計画から実行までのワークフロー全体を承認できます。以降のプロンプトは表示されません。 </auto_mode>

<success_criteria>

  • ワークフロー設定(autoYes、forceExplore)が LP-Phase 0 で初期化されている
  • 複雑さが評価され、適切な探索の観点が選択されている
  • run_in_background=false で並列探索エージェントが起動されている
  • 自動検出されたファイルから探索マニフェストが作成されている
  • 明確化が必要な項目が集約・重複排除され、4 件ずつ提示されている
  • cli-lite-planning-agent によって計画が生成されている
  • 計画の出力が 2 層構造になっている:plan.json(task_ids[])+ .task/TASK-*.json
  • ユーザーの確認が収集されている(または自動モードで自動承認されている)
  • すべての成果物とセッション参照を含む executionContext が完全に構築されている
  • executionContext とともに Skill("workflow-lite-execute") を通じて workflow-lite-execute に引き継がれている
  • 計画フェーズではコードを実行しない。すべての実行は workflow-lite-execute に委ねられている </success_criteria>

コメント