# Setup guide — Goal Decomposition & Planning Agent

## 1. Install and connect (optional execution layer)

Install the planner; connect an execution layer only if you want it to hand off approved plans.

```
pipx install goal-decomposer-agent
goal-decomposer-agent connect --executor none   # planner-only by default
goal-decomposer-agent doctor
```

## 2. Configure gating rules

Define what always requires approval. Enforced deterministically, not by the model.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
EXECUTE=false               # this agent plans only
ALWAYS_GATE: ["delete", "send_external", "payment", "prod_change", "irreversible"]
ASK_WHEN_AMBIGUOUS=true
```

## 3. Define your tools/owners catalog

Tell it what tools or owners steps can be assigned to.

```
# capabilities.yml
tools: [search, draft_doc, run_query_readonly]
owners: [data_team, eng, marketing]
irreversible_markers: [delete, deploy, send_to_customers, charge]
```

## 4. Plan a goal

Generate a plan and review gates, assumptions, and validation.

```
goal-decomposer-agent plan --goal 'Migrate analytics to the new warehouse' --explain
# prints ordered subtasks, dependencies, gated steps, risks, validation
```

## 5. Wire into orchestration

Feed approved, validated plans to your execution layer; gated steps wait for human approval.

```
# goal -> plan -> human approves gated steps -> executor runs ungated/approved steps
```
