agentleFS
pfeffpfeff/claude-skills/skills/goal-tree/SKILL.md

goal-tree

Skill3 starsChanged 3 months agoMITView on GitHub

Orchestrate multi-task projects as hierarchical goal trees. Use when a project spans multiple tasks, repos, or sessions and needs coordinated decomposition, parallel dispatch, and synthesis. Sits above task-workflow — feeds work into workspaces, does not replace them.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use scripted paths for infrastructure: create-node-workspace.sh for workspaces, create-tmuxp-session.sh for sessions.

    line 82
  2. Distinctive:

    Plan before implementing: Every task gets planning-workflow or a PLAN.md before code changes.

    line 93
  3. Very specific:

    Recognize dispatch signals: When the operator says "dispatch a workspace", "create a workspace for this", or similar during conversation, …

    line 94
  4. Distinctive:

    No coordinator schema change is needed — layer is derived from parent_id chain and children presence.

    line 122
  5. Distinctive:

    Worktree isolation: Every task gets a node workspace with repo worktrees on a per-node branch.

    line 134
  6. Very specific:

    Create node workspaces via scripts/create-node-workspace.sh

    line 164
  7. Very specific:

    Prefer scripts over pipelines: Before composing jq/python pipelines, check if a script above already provides the data.

    line 232

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Goal Tree Workflow

Orchestrates multi-task projects as hierarchical goal trees. Decomposes a user's objective into goals and tasks, dispatches work via workspace sessions, and synthesizes results into PRs.

Hard Rules

These apply in ALL modes (coordinator-backed or bootstrap). Do not violate these regardless of context pressure. The three principles are generative — derive behavior from them rather than memorizing specific restrictions.

Isolation

Work happens in worktrees via scripts. Source repos and shared state are never modified directly.

  • Source repos (~/src/github/) stay on main. Create a worktree via create-node-workspace.sh before editing any repo file. Repo paths in project CLAUDE.md are SOURCE locations, not working directories.
  • Use scripted paths for infrastructure: create-node-workspace.sh for workspaces, create-tmuxp-session.sh for sessions. No raw git worktree add or tmux new-session.
  • Batch work into scripts. Each major phase should be one script execution, not a long chain of individual shell commands.

Phase Gates

Think → confirm → act. Each phase has appropriate tools. Do not bleed across phase boundaries.

  • Strategic phases are text-only. During OODA orient/propose, next-cycle conversation, spec refinement, or any discussion about what to do: no tool calls, no file edits, no implementation. If the user mentions a tactical item during strategy, capture it as a proposed node — do not act on it. Transition to execution only after direction is confirmed.
  • Conversation is incremental. During strategic phases, advance through dialogue — don't accumulate context into summary structures. If you're about to present a "summary so far" or "proposed frame," ask: could I advance with one question instead? Summaries close; questions advance. Prefer advancing.
  • The tree is the only path to execution. When direction is confirmed, the next step is always to register nodes in the coordinator — never to start implementing directly. New work → proposed nodes → coordinator registration → dispatch pipeline. There is no shortcut from conversation to implementation that bypasses the tree.
  • Conversation before decomposition, decomposition before execution. Confirm the spec before decomposing. Get tree approval before creating files, issues, or directories.
  • Plan before implementing. Every task gets planning-workflow or a PLAN.md before code changes. Do not jump from reading code to writing code.
  • Recognize dispatch signals. When the operator says "dispatch a workspace", "create a workspace for this", or similar during conversation, load operations/discuss-dispatch.md and follow its lifecycle. After workspace creation, the main thread writes ONLY to DESIGN.md — no implementation.

Flow

Ready work dispatches immediately, in parallel. Minimize blocking. Be decisive during execution.

  • Independent nodes dispatch as parallel workspace sessions. Sequential dispatch of independent nodes is a protocol violation.
  • Dispatch ready nodes immediately. Conversation about node B does NOT block dispatching node A if A's spec is clear and dependencies are met.
  • During execution, propose and act — checkpoints belong at phase boundaries (spec confirmation, tree approval, dispatch rounds), not after every thought. State assumptions and proceed; the user will redirect if needed.
  • Auto-continue the OODA loop. When ready nodes are exhausted in an open-ended project, immediately run operations/next-cycle.md. Do not stop and ask "what next?"
  • Risk ordering is a tie-break, not a gate. When several ready nodes could dispatch in the same round and their relative order is a free choice, list/dispatch the reversible or low-blast-radius ones ahead of irreversible or high-blast-radius ones (destructive infra changes, state migrations, anything that can't be cleanly rolled back via git). This only orders nodes within the round — every ready node still dispatches immediately per the rule above; it is never a reason to hold one back pending another's review.

Layer Model

The goal tree encodes layer ownership via structure. See references/layer-model.md for the full reference.

StructureLayerRole
Tree rootL2Objective — what the project delivers
Non-leaf node (any depth)L1Decomposition — cycles, phases, sub-goals that organize L0 work
Leaf node (any depth)L0Task — dispatched to a workspace session, produces a PR

Key rule: leaf-vs-non-leaf determines the layer, not absolute depth. Depth encodes L1 decomposition granularity.

  • L2 owns the objective, evaluates L1 cycle outcomes
  • L1 owns decomposition and dispatch, evaluates L0 task outputs (spec-driven evaluation)
  • L0 owns implementation within a workspace session, follows task-workflow

No coordinator schema change is needed — layer is derived from parent_id chain and children presence.

Core Concepts

Goal Tree: Hierarchical decomposition of an objective into goals (decomposable) and tasks (implementable leaves). Persisted via the coordinator API.

Coordinator as backend: The coord CLI (scripts/coord) is the interface. Reads and writes go through it. Env: COORDINATOR_URL (default http://localhost:4000), COORDINATOR_TOKEN (required).

Bootstrap mode: When the coordinator is unavailable OR the host opts into the bootstrap backend (GOAL_TREE_BACKEND=work), use GOAL.md + TodoWrite for task tracking. All other conventions still apply — worktrees, scripted sessions, parallel dispatch via workspace sessions. Once the coordinator is running (coordinator-backed hosts), register the remaining tree and switch to the normal loop.

Environment detection: Operations should check the environment before selecting a backend. Use scripts/detect-env.sh which outputs "work" (bootstrap → GOAL.md) or "personal" (coordinator). See lib/env-detection.md for details.

Worktree isolation: Every task gets a node workspace with repo worktrees on a per-node branch. Source repos are never modified directly.

OODA loop: Sessions follow Observe → Orient → Decide → Act. Resume and status operations use OODA preambles — narrative summaries of capability/performance/gaps rather than raw data dumps. During Quick Observe (next-cycle.md), check $PROJECT_DIR/.active-nodes for dispatched nodes awaiting completion — look for merged PRs, inbox messages, or dead tmux sessions. See operations/discuss-dispatch.md step 5 for detection logic.

Commands

CommandWhenOperation
/project:startNew projectoperations/start-project.md
/project:resumeAfter interruptionoperations/resume-project.md (OODA preamble → execute)
/project:statusSituational awarenessoperations/status.md (observe only)
/project:orientStrategic alignmentoperations/orient.md (map to strategy)
/project:finishAll nodes completeoperations/synthesize.md
/project:closeTear down workspaceoperations/close-project.md
/project:nextContinue OODA loopoperations/next-cycle.md
/dispatch-taskDispatch node to workspaceoperations/dispatch-task-cmd.md
/goal-treeLoad skill contextContext loader (no canned action)

Legacy aliases: /start-project, /resume-project, /finish-project, /close-project still work.

Execution Flow

Start: Load operations/start-project.md — conversation → spec confirmation → decomposition → approval → coordinator registration (or bootstrap) → execution.

Resume: Load operations/resume-project.md — OODA preamble (observe state, orient to strategy) → conversation → execute-tree loop.

Execute (coordinator mode): Load operations/execute-tree.md — loop: select ready nodes → dispatch decisions → create workspace sessions → monitor via tmux → collect results → update coordinator → repeat.

Execute (bootstrap mode): TodoWrite tracks tasks. The dispatch pipeline still applies:

  1. Identify independent tasks (no unmet dependencies)
  2. Create node workspaces via scripts/create-node-workspace.sh
  3. Dispatch independent tasks as parallel workspace sessions (use operations/dispatch-node.md for workspace creation and tmux startup)
  4. Monitor sessions, commit results, advance to next batch
  5. Once coordinator is available, register tree and switch modes

Bootstrap mode is NOT an excuse for serial dispatch. Use parallel workspace sessions even without the coordinator.

Dispatch strategy (per-node):

  • Clear spec (any complexity) → Workspace session
  • Needs conversation first → Discuss-dispatch (conversation → workspace session)
  • Needs human judgment → Escalate

Operations Reference

Load on-demand as needed:

OperationPurpose
start-project.mdEntry: conversation → guardian issue → tree registration
execute-tree.mdMain orchestration loop with fan-out
dispatch-decision.mdPer-node strategy selection
dispatch-node.mdExecute chosen strategy (workspace session/escalate)
dispatch-task-cmd.mdUser-facing node dispatch (GOAL.md → workspace)
select-ready.mdQuery coordinator for ready nodes
parse-goal.mdQuery coordinator → structured tree
update-goal.mdUpdate node status/results
branch-management.mdWorktree and branch isolation
resume-project.mdOODA preamble → execution loop
next-cycle.mdLightweight OODA iteration (in-session continuation)
status.mdObserve: capability/performance/gap narrative
orient.mdMap observations to strategy, surface drift
synthesize.mdMerge, PR, report
close-project.mdTear down and archive
discuss-dispatch.mdInteractive dispatch: conversation → workspace → incremental DESIGN.md → handoff

References

ReferencePurpose
references/layer-model.mdDepth-to-layer mapping, layer responsibilities, derivation from coordinator data
references/node-lifecycle.mdState machine, completion rules, dependency resolution
references/goal-document.mdGOAL.md format (bootstrap mode)
references/goal-md-format.mdGOAL.md parsing specification
references/workflow-vs-goal-tree.mdWhen to reach for a native Workflow (bounded in-session fan-out) vs. goal-tree / L{N} (durable multi-session orchestration)
references/reformulation-direction.mdProvisional reformulation direction — dispatch-when-ripe (planner/dispatcher), driving moves to the durable driver, rename pending. No behavior change.
docs/native-vs-homebrew-boundary.md (repo root)Native↔homebrew KEEP/ADOPT map, Workflow↔goal-tree routing rule, and /goal usage (D1–D9)
docs/rollout-capture-discipline.md (repo root)Finish gate (DDD step 5b), Obsidian capture discipline, and regression-gate (cutover) criteria for the rollout

Scripts

Called by operations — use these instead of raw commands:

ScriptPurpose
scripts/create-node-workspace.shCreate node workspace with repo worktrees
scripts/coordCLI client for coordinator API
scripts/merge-node-branch.shMerge node branch into integration
scripts/synthesize-node.shCommit + merge all repos in a node
scripts/check-workspace-state.shReport clean/dirty/missing per worktree
scripts/workspace-status.shEnhanced status with branch and last commit info
scripts/workspace-pr-status.shPR and branch status across workspace repos
scripts/coord-query.shFormatted coord queries (pending-nodes, node-status, etc.)
scripts/cleanup-worktrees.shRemove all node workspace worktrees
scripts/cleanup-sessions.shKill project tmux sessions
scripts/close-project.shClose and archive a project
scripts/discuss-dispatch.shAtomic setup: coord node + workspace + DESIGN.md + .active-nodes
scripts/patch-finish-metrics.shPatch finish.jsonl with evaluation.json metrics after L1 evaluation

Prefer scripts over pipelines: Before composing jq/python pipelines, check if a script above already provides the data. See docs/reference/command-simplification.md for common patterns and alternatives.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.