---
name: "plan-and-solve-decomposition"
description: "Decompose large, complex engineering goals into subtasks before executing single steps."
metadata:
  author: "Wang et al."
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create execution plan"
  - "decompose large task"
  - "plan and solve engineering request"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Plan-and-Solve Hierarchical Task Decomposition

Separates the planning phase from the execution phase: generating a dependency-ordered directed acyclic graph (DAG) of subtasks, tracking completion state, and dynamically replanning on failures.

## When to Invoke
Invoke this skill whenever you need to:
- create execution plan
- decompose large task
- plan and solve engineering request

## Execution SOP & Rules
1. Always draft the complete numbered plan before modifying any workspace files.
2. Order subtasks based on strict dependency requirements (e.g. schema migration before API handler).
3. Check off completed items incrementally as progress is made.
4. If a subtask fails or hits a blocker, pause to revise the remaining steps rather than blindly forging ahead.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
