Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATG-looping

Atomic Task Graph (ATG) agent skills — graph-driven planning, execution, and autonomous looping, distilled from the paper Atomic Task Graph: A Unified Framework for Agentic Planning and Execution (Zhang et al.). Ready to drop into Claude Code (or any harness that reads Agent Skills-format SKILL.md files).

Skills

Skill Source Use when
atomic-task-graph Atomic Task Graph: A Unified Framework for Agentic Planning and Execution (Zhang et al.) Planning/executing complex multi-step tasks with tool dependencies, mid-task failure recovery, or parallelizable branches
atomic-task-graph-loop Companion to the above Running ATG as an autonomous/recurring loop (/loop, scheduled sessions) with resumable state-file-driven execution

Installation

Copy a skill into your user-level skills directory:

cp -r skills/atomic-task-graph ~/.claude/skills/

Or into a project:

cp -r skills/atomic-task-graph <project>/.claude/skills/

New sessions pick it up automatically.

How to use

Think of it as: atomic-task-graph is the method, atomic-task-graph-loop is the engine that keeps the method running over time.

Scenario 1: One-shot task in a normal session (base skill only)

Give Claude a complex multi-step task in a regular conversation:

"Analyze our Q1 sales data across all regions, compare with last year, generate charts, and produce a PDF report."

Because the skill's description matches (multi-step, tool dependencies, parallelizable branches), Claude invokes atomic-task-graph and follows its four stages in that session:

  1. Compile — decompose the request into a DAG of atomic steps, each a single tool call, recording what each step consumes and produces
  2. Thought experiment — sanity-check the graph before touching anything (missing steps? wrong tools? broken dependencies?)
  3. Execute — run steps in dependency order, independent branches in parallel (e.g., fetch this year's and last year's data simultaneously)
  4. Repair — if a step fails, fix only that branch instead of replanning everything

You can also invoke it explicitly: "Use the atomic-task-graph skill to plan this." Everything lives in the conversation — if the session dies mid-task, the plan dies with it. That's the gap the loop skill fills.

Scenario 2: Long-running or autonomous task (both skills)

For work too big for one sitting — a large migration, an overnight research job, anything that should survive interruptions:

"Use atomic-task-graph-loop to migrate all 40 API endpoints to the new auth middleware."

or on a recurring cadence:

/loop continue the ATG loop for the endpoint migration

What happens:

  • First iteration: the loop skill pulls in the base skill (declared as required background), runs compile + thought experiment once, and writes the validated graph to .atg/graph.json in your project — every node with its tool, dependencies, and pending status.
  • Every following iteration: Claude reads the state file, finds nodes whose dependencies are all done, executes them (independent ones in parallel via subagents, each seeing only its own inputs), and writes results back immediately. Progress is reported in one line: ATG: 7/12 done, 2 ready, 1 repaired.
  • On failure: repair happens in the state file — only the broken subgraph is rewritten; completed nodes are frozen and never redone.
  • On completion: all nodes done → it synthesizes the final output and stops the loop itself.

The payoff of the combination

The state file is the whole point. Kill the session, come back tomorrow, say "continue the ATG loop" — Claude reads .atg/graph.json and resumes exactly where it stopped, losing at most the nodes that were in flight. Without the loop skill, an interrupted 30-step task restarts from zero; with it, an interruption costs one step.

Rule of thumb: task fits in one session → base skill alone. Task spans sessions, runs on /loop, or must survive crashes → ask for the loop skill and let it drive. You never need to invoke both by name — the loop skill references the base skill and Claude loads it automatically.

Safety valve: the loop stops and escalates if the same subgraph fails repair three times, so a stuck loop won't silently burn tokens overnight — it waits with a report of what's blocked.

How this was built

See the build log for the decisions behind these skills — why the loop is a separate skill rather than a flag, why the "common mistakes" sections carry most of the weight, and how the repair budget and licensing split were settled.

What's in a skill

Each skill is a single SKILL.md with YAML frontmatter (name, description — the description defines the triggering conditions) followed by a condensed, actionable version of the paper's method: core pattern, step-by-step workflow, quick-reference tables, and common mistakes. Papers are linked, not vendored.

License

MIT — see LICENSE. The Atomic Task Graph method is the work of Zhang et al. (arXiv:2607.01942); this repository is an independent implementation as agent skills.

About

Atomic Task Graph (ATG) agent skills — graph-driven planning, execution, and looping for Claude Code, distilled from arXiv:2607.01942

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors