
long-run-implement
by fiatkongen
Claude Code plugin marketplace - personal skills, commands, and agents
SKILL.md
name: long-run-implement description: Execute long-running implementation tasks autonomously. Use when user wants to implement a plan, run autonomous implementation, execute tasks with minimal checkpoints, or do long-run execution. context: fork allowed-tools: Task, Read, Write, Edit, Bash, Glob, Grep, Skill user-invocable: true
Long-Run Implement
Transform task specifications into executable plans and run them autonomously with minimal checkpoints, per-task atomic commits, and full state persistence.
Usage
/long-run-implement [spec-path] [--prepare-only]
Flags
--prepare-only: Stop after Phase 2 (plan preparation). Use to review generated plans before execution.
When to Use This Skill
Activate when the user says things like:
- "Implement this plan autonomously"
- "Run long-run implementation"
- "Execute these tasks with minimal interruption"
- "Implement the spec with atomic commits"
What This Skill Does
- Initialize - Set up or restore execution state
- Prepare Plans - Call plan-fixer to validate, optimize, and split into individual plans
- Execute - Spawn fresh subagent per plan via Task tool (preserves quality)
- Finalize - Present summary and verification options
Architecture: Fresh Context Per Plan
CRITICAL: This skill spawns a fresh subagent for each plan to prevent context degradation.
long-run-implement (orchestrator - stays in main context)
│
├── Plan 01 → Task tool → fresh subagent (0% context) → executes → returns
│ ↑
│ 200k tokens available
│
├── Plan 02 → Task tool → fresh subagent (0% context) → executes → returns
│
└── Plan 03 → Task tool → fresh subagent (0% context) → executes → returns
Why this matters:
- 0-30% context: Peak quality
- 30-50% context: Good quality
- 50-70% context: Degrading quality
- 70%+ context: Poor quality
Each plan executes at peak quality because it starts fresh.
Key Features
- Fresh Context Per Plan - Each plan spawns a new subagent with 200k tokens at 0%
- Minimal Checkpoints - Only stops for genuine blockers (architectural changes, external actions, unrecoverable errors)
- Per-Task Atomic Commits - Each completed task is committed immediately with conventional commit format
- Full Persistence - All state saved to disk; resume anytime from interruption point
- Automatic Deviation Handling - Auto-fix minor issues; log enhancements to ISSUES.md
Workflow Phases
Phase 1: Initialize
- Locate and validate spec folder
- Check for existing state (resume detection)
- Initialize .long-run/ directory structure
- Pre-flight checks (clean working tree)
Phase 2: Prepare Plans (calls plan-fixer)
- If tasks.md exists and .long-run/plans/ is empty:
- Run plan-fixer skill on tasks.md (Phases 0-4)
- Plan-fixer validates, fixes, optimizes, and splits into individual plans
- If PLAN.md exists at root and .long-run/plans/ is empty:
- Run plan-fixer Phase 4 only (split existing plan)
- If .long-run/plans/ already populated:
- Skip to Phase 3
If --prepare-only flag is set: STOP here
Phase 3: Execute
- Execute plans sequentially
- Spawn subagent for each plan (agent type from orchestration.yml)
- Handle deviations automatically where possible
- Per-task atomic commits
- Update checkpoints after each task
Phase 4: Finalize
- Aggregate results from all summaries
- Present completion report
- Offer verification and cleanup options
Stop Conditions
| Condition | Phase | What Happens |
|---|---|---|
| Task group too vague | Transform | Asks for clarification |
| Architectural decision needed | Execute | Presents decision with options |
| External action needed | Execute | Provides instructions, waits |
| Error after 3 retries | Execute | Offers retry/skip/abort |
File Structure (Runtime)
{spec-folder}/
├── spec.md # Input
├── tasks.md # Input (updated with checkboxes)
└── .long-run/ # Created by this skill
├── STATE.md # Position, metrics, progress
├── agent-history.json # Subagent tracking
├── current-agent-id.txt # Quick resume lookup
├── clarifications.md # Q&A log
├── ISSUES.md # Deferred enhancements
├── plans/
│ ├── 01-PLAN.md # Transformed plans
│ ├── 01-CHECKPOINT.json # Task-level progress
│ └── ...
└── summaries/
├── 01-SUMMARY.md # Completion summaries
└── ...
Commit Format
{type}({plan}): {task-name}
Types: feat, fix, test, refactor, chore, docs
Resume Capability
If execution is interrupted, invoke this skill again on the same spec. It will:
- Detect existing state
- Find last checkpoint
- Offer resume options
- Continue from where it left off
Orchestration Integration
This skill integrates with orchestration.yml to enable specialized agents per task group.
How It Works
-
orchestrate-tasks (upstream) creates
{spec_path}/orchestration.yml:task_groups: - name: authentication-system claude_code_subagent: backend-specialist - name: user-dashboard claude_code_subagent: frontend-specialist -
plan-fixer (called per task group) adds metadata to PLAN.md:
- Reads orchestration.yml
- Adds frontmatter with
task_groupandclaude_code_subagent
-
long-run-implement Phase 3 spawns the correct agent:
- Reads orchestration.yml
- Looks up
task_groupfrom PLAN.md frontmatter - Finds matching
claude_code_subagent - Spawns that agent type instead of "general-purpose"
Agent Resolution
Agents are resolved from the PROJECT's .claude/agents/ folder:
orchestration.yml: claude_code_subagent: backend-specialist
→ .claude/agents/backend-specialist.md
If the agent is not found in orchestration.yml or orchestration.yml doesn't exist, the fallback is "general-purpose".
Note: Agents in .claude/agents/ have their own hard-coded references to the standards they need. No separate standards embedding is required.
Example PLAN.md structure:
---
task_group: authentication-system
claude_code_subagent: backend-specialist
---
<task name="implement-login">
...
</task>
References
Workflows
- initialize-state.md
- detect-resume.md
- transform-task-group.md
- validate-enrichment.md
- clarification-protocol.md
- validate-dependencies.md
- atomic-commit.md
- apply-deviation-rules.md
- enrich-task.md
- spawn-plan-executor.md
- update-state.md
- track-agent.md
- timeout-handling.md
- cleanup.md
- create-plan-summary.md
- atomic-write.md
Templates
See references/templates/ for state and checkpoint templates.
Agents
- long-run-orchestrator - Stays in main context, spawns subagents per plan, handles responses
- long-run-executor - Spawned as subagent per plan, executes tasks, returns structured output
Related Commands
/long-run-orchestrator- Execute-only entry point (expects .long-run/plans/ to exist)
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です