long-running-agent
Skill10 starsChanged 7 months agoMITView on GitHub
Convert a planning doc or spec into a phase-based task structure for autonomous multi-session execution. Asks whether the agent should run in orchestrator mode (self-verifies and continues across phase boundaries) or phase-checkpoint mode (stops at each phase for human verification), then generates the right claude-prompt.md and claude-task.json. Built on the patterns from Anthropic's effective-harnesses-for-long-running-agents engineering blog.
We split this skill into the rules it gives an agent
8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Before doing anything, fetch and read this blog post for the core patterns:
- Very specific: line 44
If the user has the spec inline in chat or pointed at a file path, read it.
- Very specific: line 87
Before generating files, ask the user how autonomous the agent should be using AskUserQuestion.
- Distinctive: line 89
Use this exact question structure:
- Distinctive: line 106
If the user picks Other and writes a freeform answer, interpret it: words like "autonomous / orchestrator / no babysit / keep going" → …
- Very specific: line 112
Create the task file using templates/task-template.json as the base structure:
- Very specific: line 135
Use the template that matches MODE:
- Very specific: line 153
If the input was a single file: copy it to SPEC.md.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Long-Running Agent Setup
Turn a spec into a working long-running agent — phases, tasks, verification, and the operating prompt — in one shot.
This skill converts planning documents and specs into the file structure a long-running Claude agent uses to execute multi-session work: a claude-task.json task tracker, a claude-prompt.md operating manual, and a preserved SPEC.md. Before generating files it asks how autonomous the agent should be, so the prompt and task structure match.
Triggers
- "set up a long-running agent for..."
- "convert this spec into phases"
- "I have a spec, build out the agent task structure"
- "make a claude-task.json for this plan"
- "break this plan into phases with verification"
- "spin up an autonomous build of..."
Source of Truth
Before doing anything, fetch and read this blog post for the core patterns:
https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents
The blog defines the effective patterns for long-running coding agents. Apply them directly. Key takeaways: phase-based work with verification checkpoints, granular task enumeration, JSON task tracking, git checkpointing per task, never weaken/remove tests to make a phase pass.
Core Workflow
1. Gather Inputs
Request from the user:
- Spec / planning doc — the document to convert (required). Will be preserved as
SPEC.md. - Project name — short identifier; used in headings and the JSON
projectfield. - Output location — where to create files (default: a new directory at the user's choice).
If the user has the spec inline in chat or pointed at a file path, read it. If multiple files together form the spec (e.g., a SPEC.md + a data_model.md + a workflows.md), read all of them.
2. Read the Blog
Fetch the Anthropic blog post above. The patterns to apply:
- Phase-based work with verification checkpoints — verification is required before advance, in either operating mode
- Explicit feature/task enumeration — granular, single-task focus
- Task file as progress tracker — JSON, not markdown (the model is less likely to corrupt it)
- Git checkpointing after each task —
task-XXX: brief description - Strong constraints — never delete or weaken tests/verification
3. Decompose into Phases and Tasks
Break the spec into:
Phases (3–10 typically):
- Logical groupings of related work
- Each phase has a
verificationblock withdescription+steps - Verification steps should be machine-checkable where possible (commands + thresholds, not "looks good")
Tasks (per phase):
- Granular, implementable units (4–10 steps each is typical)
- Each task has a
description, astepsarray, andpasses: falseinitially - Tasks reference their parent phase
Example structure:
Phase 1: Project Foundation (3 tasks)
- setup-001: Initialize project structure
- setup-002: Create environment config
- types-001: Define core interfaces
Verification: "npx tsc --noEmit returns exit 0; no errors"
Phase 2: Storage & Skills (5 tasks)
- storage-001: Create storage interface
- skill-001..004: Create skill files
Verification: "Confirm skills load via test harness; storage round-trip test passes"4. Ask the User: Autonomy Mode
Before generating files, ask the user how autonomous the agent should be using AskUserQuestion. This decision shapes both claude-prompt.md and claude-task.json.
Use this exact question structure:
question: "How autonomous should this long-running agent be?"
header: "Autonomy"
multiSelect: false
options:
- label: "Orchestrator mode"
description: "Claude self-verifies at phase boundaries and continues to the next phase automatically. Stops only on auth/credentials, scope decisions not in the spec, destructive/visible-to-others actions, or persistent blockers. Best when you don't want to babysit and the spec is detailed."
- label: "Phase-checkpoint mode"
description: "Claude stops at every phase boundary, prints the verification steps, and waits for you to confirm before continuing. Best for high-risk projects, when verification needs human judgment, or when you want frequent visibility into what's been built."The answer determines:
- Which
claude-prompt.mdtemplate to use (Step 6) - Whether to add orchestrator-specific fields to
claude-task.json(Step 5)
If the user picks Other and writes a freeform answer, interpret it: words like "autonomous / orchestrator / no babysit / keep going" → orchestrator. Words like "checkpoint / stop / verify / supervise / approval" → checkpoint. Genuinely ambiguous → re-ask with a sharper question.
Save the chosen mode as MODE (orchestrator or checkpoint) for use in the next steps.
5. Generate claude-task.json
Create the task file using templates/task-template.json as the base structure:
phasesarray with verification stepstasksarray withpasses: falseinitially- Tasks reference their parent phase via
phasefield
If MODE = orchestrator, also include:
- Top-level
mode: "orchestrator"field - Top-level
orchestrator_notessummarizing the operating model - Per-phase
auto_advance: true | false—truewhen the phase's verification is fully programmatic (commands + thresholds with no human judgment);falsefor phases that need human review (e.g., a final hardening phase with a "comprehensive docs" check) - Per-task
dispatch_hintfield — one ofself,sub_agent_general,sub_agent_explore, orout_of_scope. Heuristics:sub_agent_generalfor: PDF/document extraction, per-vendor / per-shop / per-region / per-customer parallel work, DB exploration involving 5+ queries, code-review/critic passes, anything taking 15+ tool callssub_agent_explorefor: cross-repo search, "where is X used" huntsselffor: small DDL/config edits, single-file scripts, orchestration decisions, anything < 5 tool calls
- Per-task
dispatch_reason— one short line explaining the choice
If MODE = checkpoint, no extra fields are needed beyond the base template.
Output: {project-root}/claude-task.json
6. Generate claude-prompt.md
Use the template that matches MODE:
MODE = orchestrator→templates/claude-prompt-template-orchestrator.mdMODE = checkpoint→templates/claude-prompt-template.md
Key sections to customize in either template:
- Project overview and goal
- Key files list (
SPEC.md,claude-task.json, any reference docs) - Phases table showing all phases with status
- File structure target
- Any technical decisions specific to the project that the spec already settled
Output: {project-root}/claude-prompt.md
7. Keep the SPEC
The original spec should remain as SPEC.md for the agent to reference when it needs detailed requirements during execution.
If the input was a single file: copy it to SPEC.md. If the input was multiple files: either bundle them into one SPEC.md with a clear table of contents, OR keep them separate and have the generated claude-prompt.md list them under "Key Files."
Output Structure
{project-root}/
├── claude-prompt.md # Agent operating manual (orchestrator OR checkpoint variant)
├── claude-task.json # Phases and tasks (extra fields if orchestrator mode)
└── SPEC.md # Original planning doc (preserved for reference)Starting the Agent
Instruct the user to point a fresh agent session at the prompt:
@claude-prompt.mdThe agent will read claude-task.json, find the current phase, and:
- Orchestrator mode: work through tasks, self-verify at each phase boundary, continue to the next phase automatically. Stop only on documented escalation cases.
- Checkpoint mode: complete all tasks in the current phase, then stop and print verification steps for the user to run.
Patterns That Apply in Both Modes
- Verification is required before advance — never auto-declare completion without running checks
- Complete ALL tasks in phase before phase verification — no stopping mid-phase
- Git commit after each task —
task-XXX: description - Never skip phases — sequential progression
- Task file is the source of truth — agent reads and updates it
- Never weaken/remove tests or verification to make a phase "pass" — fix the root cause instead
The two modes differ only in who runs the verification at phase boundaries:
- Orchestrator mode: the agent runs them programmatically and continues
- Checkpoint mode: the agent prints them and waits for the human
Reference Materials
templates/claude-prompt-template.md— Phase-checkpoint mode template (default for high-risk or visibility-sensitive projects)templates/claude-prompt-template-orchestrator.md— Orchestrator-mode template (autonomous; stops only on escalation)templates/task-template.json— Base claude-task.json structure (mode-specific fields are described in Step 5)
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- mikeOnBreeze/cc-crossbeam★ 29736% same
Wrote their own version · 5
- madeinlowcode/skills-claude-code★ 7same name
- simtransforma/HAOS-CC-Model★ 1same name
- Throokie/claude-code-skills★ 1same name
- bowen31337/autonomous-agent-framework★ 0same name
- jaakjuu1/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 4 projects that use this
In this repository23 other files it gives its agents.
- data-lake-starterSkill
- google-workspaceSkill
- mcp-guideSkill
- secrets-managerSkill
- semantic-layer-auditSkill
- gmailSkill
- google-calendarSkill
- google-chatSkill
- slack-directorySkill
- slackSkill
- google-docsSkill
- google-driveSkill
- google-sheetsSkill
- google-tasksSkill
- brand-identitySkill
- creative-matrixSkill
- google-adsSkill
- nano-bananaSkill
- autoresearchSkill
- morning-briefingSkill
- playbook-discoverySkill
- revenue-forecasterSkill
- patent-figureSkill
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
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.

