tmdgusya/engineering-discipline/long-run
Claude Code and agent skill by tmdgusya/engineering-discipline
- community
Checking that the SKILL.md file is still in the repository.
Orchestrates multi-day execution of complex tasks through milestones. Each milestone goes through plan-crafting, run-plan (worker-validator), and review-work phases with checkpoint/recovery. Runs autonomously end-to-end — no per-milestone approval gates; escalates to the user only on failures. Triggers when the user says "long run", "start long run", "execute milestones", or "run all milestones".
Install
npx vskill@latest install tmdgusya/engineering-discipline/long-runSKILL.md
Long Run Harness
Orchestrates multi-day execution of complex tasks through a milestone pipeline. Each milestone passes through plan-crafting → run-plan → review-work with checkpoints between milestones for recovery from interruptions.
Core Principle
Long-running execution must be resumable, auditable, and fail-safe. Every state transition is persisted to disk before the next action begins. If execution stops for any reason — rate limit, crash, user pause, context loss — it can resume from the last checkpoint without repeating completed work.
Hard Gates
- Milestones must exist before execution. Either from
milestone-planningskill or user-provided. Never generate milestones inline during execution. - State file must be updated before and after every milestone. No in-memory-only state. If it's not on disk, it didn't happen.
- Each milestone must complete the full pipeline. plan-crafting → run-plan → review-work. No shortcuts. No skipping review-work "because it looked fine."
- Failed milestones block dependents. If M2 depends on M1 and M1 fails review, M2 does not start. Period.
- Autonomous by default — no approval gates between milestones. The user approved the milestone plan once, at milestone-planning's lock. From then on, milestones proceed plan → run → review → checkpoint without pausing for confirmation. Stop and ask ONLY when: a milestone exhausts its retry budget (
failed), Mid-Execution Correction requires a scope decision, integration escalation triggers, or loaded state is inconsistent. Post a brief status report at each phase transition so the user can interrupt anytime — state files make every pause resumable. - Never modify completed milestones. Once a milestone passes review-work, its files are locked. If a later milestone needs changes to earlier work, that is a new milestone.
- Checkpoint after every milestone completion. Write a checkpoint file recording what was done, test results, and review verdict before proceeding.
When To Use
- After
milestone-planninghas produced a milestone DAG - When the user says "long run", "start long run", "execute milestones", or "run all milestones"
- When resuming a previously paused long run session
When NOT To Use
- When milestones don't exist yet (use
milestone-planningfirst) - When there's only one milestone (use plan-crafting + run-plan directly)
- For quick tasks that don't warrant multi-phase execution
Input
- Harness state directory path — e.g.,
docs/engineering-discipline/harness/<session-slug>/ - The directory must contain
state.mdandmilestones/*.mdfiles
If no state directory exists, ask the user if they want to run milestone-planning first.
Process
Phase 1: Load and Validate State
- Read
state.mdfrom the harness directory - Read all milestone files from
milestones/ - Validate:
- All milestones referenced in state.md have corresponding files
- Dependency DAG is valid (no cycles, topological sort possible)
- No milestone is in an invalid state (e.g., "executing" without a plan file)
- Determine current position:
- Which milestones are completed?
- Which milestones are ready to start (all dependencies met)?
- Is this a fresh start or a resume?
- Present status to the user:
- If the loaded state is consistent, proceed immediately — the status display is a report, not a gate. Ask the user only if validation in step 3 found inconsistencies or a
failedmilestone blocks the path forward.
Phase 2: Milestone Execution Loop
For each milestone in topological order:
Step 2-1: Gate Check
Before starting a milestone:
- Verify all dependency milestones have status
completed - Verify no file conflicts with in-progress parallel milestones
- Update state.md: set milestone status to
planning - Update execution log with timestamp
Step 2-2: Plan Crafting Phase
- Compose a Context Brief from the milestone definition:
- Goal → from milestone file
- Scope → files affected from milestone file
- Success Criteria → from milestone file
- Constraints → inherited from the parent problem + completed milestone context
- Completed milestone context contract: From each completed predecessor, include ONLY:
- Files created/modified (from checkpoint's "Files Changed" list)
- Interface contracts established (function signatures, API shapes, type definitions)
- Success criteria that were verified as met
- Do NOT include: execution logs, review documents, worker/validator output, or full checkpoint contents
- Note: Context Briefs composed from milestone definitions omit the Complexity Assessment section, since routing has already been determined by the milestone-planning phase. The brief goes directly to plan-crafting without re-routing.
- Invoke the
plan-craftingskill pattern:
- Create a plan document at
docs/engineering-discipline/plans/YYYY-MM-DD-<milestone-name>.md - The plan must satisfy all milestone success criteria
- The plan must not modify files outside the milestone's scope
- Update state.md: record plan file path for this milestone
- Report, don't gate: Post a brief plan summary (goal, task count, files touched) as a progress report and proceed directly to execution. Do not wait for approval.
Step 2-3: Run Plan Phase
- Update state.md: set milestone status to
executing, incrementAttemptscounter by 1 - Execute the plan using the
run-planskill pattern:
- Worker-validator loop for each task
- Parallel execution for independent tasks
- Information-isolated validators
- If run-plan reports failure after 3 retries on any task:
- Update state.md: set milestone status to
failed - Record failure details in execution log
- Stop and report to user. Do not proceed to dependent milestones.
- If all tasks complete: proceed to review phase
Step 2-4: Review Work Phase
- Update state.md: set milestone status to
validating - Invoke the
review-workskill pattern:
- Information-isolated review against the plan document
- Binary PASS/FAIL verdict
- If PASS:
- Update state.md: set milestone status to
completed - Write checkpoint file (see Checkpoint Format below)
- Update execution log
- Proceed to next milestone
- If FAIL:
- Record review findings in execution log
- Retry decision (based on `Attempts` counter in state.md, which persists across crashes):
- If Attempts == 1: return to Step 2-3 with review feedback (re-execute same plan)
- If Attempts == 2: return to Step 2-2 (re-plan with review feedback as constraint)
- If Attempts >= 3: set status to
failed, stop, report to user
Step 2-5: Cross-Milestone Integration Check
After a milestone passes review-work but before writing the checkpoint, verify that the milestone's output integrates correctly with all previously completed milestones:
- Run the project's highest-level verification (from state.md's Verification Strategy or rediscover using plan-crafting's Verification Discovery order)
- Check cross-milestone interfaces: If the completed milestone defines or consumes interfaces from predecessor milestones, verify they are compatible (function signatures match, API contracts hold, types align)
If integration check passes: Proceed to checkpoint.
If integration check fails — Cross-Milestone Failure Response:
The milestone passed its own review-work (internal correctness) but breaks integration with other milestones. This is a boundary problem.
- Diagnose (attempt 1):
- Read the failure output
- Identify which interface boundary or interaction is broken
- Determine if the fix belongs to the current milestone or requires a corrective milestone
- If fixable within current milestone scope: dispatch a targeted fix worker → re-run review-work → re-run integration check
- If the fix is outside current milestone scope: proceed to escalation
- Diagnose (attempt 2):
- If the first fix didn't resolve it, re-analyze
- Apply a second targeted fix
- Re-run integration check
- Escalate to user (after 2 failed attempts):
- Report: which milestones are involved, what integration boundary failed, what fixes were tried
- Options: add corrective milestone, rollback to checkpoint, accept and continue (user acknowledges the integration gap)
- Log the user's decision in state.md execution log
Step 2-6: Checkpoint
After a milestone passes review:
Write checkpoints/M<N>-checkpoint.md:
Phase 3: Parallel Milestone Execution
When multiple milestones have all dependencies satisfied and no file conflicts:
- Identify parallelizable milestone group
- Run plan-crafting for ALL parallel milestones first (sequentially — plans are lightweight)
- Post all plan summaries as a single progress report (no approval wait), then dispatch each milestone's pipeline concurrently:
- Each milestone runs run-plan → review-work
- Each runs in a worktree (
isolation: "worktree") to prevent file conflicts - After both complete and pass review, merge worktrees back
- If either fails: handle independently (the other can continue if no dependency)
Worktree merge protocol:
- Both milestones pass review in their respective worktrees
- Check for file conflicts between worktree changes
- If no conflicts: merge sequentially (M_lower first, then M_higher)
- If conflicts detected: stop, report to user, request manual resolution
- After merge: run full test suite on merged result
- If tests fail: stop, report to user
Phase 4: Completion
After all milestones are completed (including the Integration Verification Milestone from milestone-planning):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/long-run/SKILL.md
Popularity
- Repository stars
- 125
- Repository forks
- 22
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tmdgusya/engineering-discipline/long-run)