# Goal Decomposition & Planning Agent

> A planning agent that decomposes a goal into an ordered, dependency-mapped subtask plan, gating irreversible steps. It plans and validates; it never auto-executes.

- **Category:** Task Orchestration
- **Difficulty:** Advanced
- **Setup time:** 45 min
- **Stacks:** Claude, LangGraph, OpenAI
- **Version:** 2.0.0 (updated 2026-06-21)
- **Source:** https://agent-kits.com/kit/goal-decomposer

## Overview

Turns a high-level goal into an ordered subtask plan with dependencies and the tool/owner each step needs.

Marks irreversible, destructive, or external steps as approval-gated — and never executes them itself.

Flags ambiguous or underspecified goals and asks focused questions instead of inventing scope.

Defensive: it plans and validates, surfaces assumptions and risks, and leaves execution and risky steps to humans.

## When to use it

- You want a high-level goal broken into a clear, ordered, dependency-aware plan.
- You're orchestrating multi-step agent or team workflows and want approval gates on risky steps.
- You want assumptions and missing information surfaced before work begins.
- You need a legible plan a human can validate rather than an agent that just runs off.

## When not to use it

- You want it to execute the plan autonomously — it's a planner, and risky steps are gated by design.
- Your goal is a single trivial step that needs no decomposition.
- You can't provide enough context for it to plan without inventing scope (it will ask instead).
- You need it to make irreversible changes without human approval.

## Architecture

- **Goal intake & clarity check** — Receives the high-level goal and assesses whether it's specified enough to plan, or whether it needs clarification before proceeding.
- **Decomposition engine** — Breaks the goal into concrete, ordered subtasks grounded in what was actually asked, without inventing scope.
- **Dependency mapper** — Maps prerequisites and ordering between subtasks and checks for circular or impossible dependencies.
- **Risk & reversibility assessor** — Evaluates each step's blast radius and reversibility, identifying destructive, external, spending, or production-changing actions.
- **Approval-gate layer** — A deterministic layer forces requires_approval on every irreversible/consequential step so it can never be marked auto-runnable.
- **Plan validator** — Checks the whole plan for missing prerequisites, blockers, and steps that can't succeed with available info, and flags them.
- **Plan output** — Emits a legible plan with assumptions, risks, and gated steps for a human or execution layer to run — never executing itself.

## Files in this bundle

- `system-prompt.md` — the agent's system prompt
- `tools.json` — tool/function definitions the agent expects
- `workflow.md` — step-by-step run loop
- `.env.example` — environment variables to fill in
- `kit.json` — full structured metadata
- `starters/` — minimal starter snippets
- `LICENSE` — Apache-2.0 (code, configuration, and schema)
- `LICENSE-CONTENT` — CC BY 4.0 (specification text and documentation)
- `NOTICE` — attribution and trademark notice
- `run.py` — **runnable demo**: real agent loop with mock tools (`pip install anthropic`, set `ANTHROPIC_API_KEY`, `python run.py`)
- `agentaz.json` / `agentaz.schema.json` — AgentAz™ governance spec + schema

## Implementation notes

- Keep the agent execution-free by design: it emits plans, and a separate layer (with its own approvals) runs them. Conflating planning and execution is where autonomous agents cause damage.
- Force requires_approval on every irreversible/destructive/external/spending/production step in a deterministic layer; never let the model mark such a step auto-runnable.
- On ambiguous goals, ask rather than assume — inventing scope is how a planner quietly turns a vague request into a dangerous plan.
- Make assumptions explicit in the output so a human can catch a wrong one before it propagates through the plan.
- Validate for missing prerequisites and dependency cycles; an unvalidated plan that can't actually run wastes execution and erodes trust.
- Where a destructive step is genuinely needed, restructure the plan to add safety steps (confirm, back up) ahead of it rather than just flagging it.
- A cheaper model can draft the decomposition; reserve the strong model for risk assessment, gating, and validation.

## Variations

- **Basic — Goal-to-plan outliner:** Decomposes a goal into an ordered subtask list with dependencies and surfaced assumptions for a human to run. No risk gating.
- **Advanced — Risk-gated planner:** Adds per-step risk and reversibility assessment, mandatory approval gates on irreversible steps, plan validation, and clarification on ambiguous goals.
- **Enterprise — Orchestration planning layer:** Adds a tools/owners capability catalog, hand-off to an execution layer with enforced human approvals, plan templates, and audit of plans and approvals at scale.

## FAQ

**Does it execute the plan?**

No. It is a planner: it produces an ordered, validated plan for a human or a separate execution layer to run. It never executes steps itself, and irreversible steps can't run without explicit human approval.

**How does it handle dangerous steps?**

Every destructive, irreversible, external-facing, spending, or production-changing step is marked approval-required and can never be flagged auto-runnable. Where such a step is needed, it also adds safety steps (confirm, back up) ahead of it.

**What does it do with a vague goal?**

It refuses to invent scope. It marks the goal as needing clarification and asks focused questions that actually determine the plan and its risk, rather than producing a speculative or unsafe plan.

**Will it add requirements I didn't ask for?**

No. It decomposes only what the goal states and surfaces any assumptions it had to make explicitly, so you can correct a wrong assumption before the plan is acted on.

**Does it check that the plan is actually runnable?**

Yes. It validates for missing prerequisites, circular dependencies, and steps that can't succeed with available information, and flags those issues instead of emitting a broken plan.

**Can it feed an execution system?**

Yes. It outputs a structured plan with gated steps that an execution layer can consume, running ungated steps and pausing for human approval on the gated ones.


---

© 2026 AgentKits · www.agent-kits.com

**Open source.** Code, configuration, and the AgentAz™ schema are licensed under
**Apache-2.0**; specification text and documentation under **CC BY 4.0** (with
attribution to AgentKits, link to https://www.agent-kits.com). See LICENSE, LICENSE-CONTENT,
and NOTICE in this bundle. "AgentAz" and "AgentKits" are trademarks of AgentKits.

**Flagship reference blueprint.** View the source, AgentAz™ spec, and frozen v1.0 schema
in the public registry: https://github.com/agent-kits/agentaz
Original: https://agent-kits.com/kit/goal-decomposer
