Long-Running Task Orchestration for Openclaw

Orchestrate multi-phase background development by using coding agents as workers and cron jobs as automated managers.

mmthebest
v1.1.0
Mar 4, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install long-running-tasks

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install long-running-tasks using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Long-Running Task Orchestration?

The Long-Running Task Orchestration skill is designed to overcome the primary limitation of coding agents: their one-shot nature. Typically, an agent completes a single task and exits, requiring human intervention to start the next step. This skill introduces a robust architecture where a cron-based orchestrator manages a queue of tasks, ensuring continuous progress on complex projects. By utilizing Openclaw Skills, developers can transform interactive agents into autonomous background workers capable of handling multi-phase development cycles.

This system ensures high reliability through stall detection, crash recovery, and structured status reporting. It allows for a seamless 'handoff' between tasks by reading from a central TODO.md file and maintaining state via specific runtime files in the system's temporary directory. This approach is ideal for developers who want to maintain project momentum without constant manual oversight.

Long-Running Task Orchestration Use Cases

  • Managing multi-phase development projects that require sequential execution of numerous sub-tasks.
  • Maintaining continuous background progress on codebase refactoring or feature implementation.
  • Implementing autonomous development cycles with built-in crash recovery and stall detection using Openclaw Skills.
  • Orchestrating complex workflows where coding agents need to cold-start from a persistent task queue.

How Long-Running Task Orchestration Works

  1. An orchestrator, triggered by a cron job every 10-30 minutes, checks the current project state and lock files.
  2. The system checks for a .pause file to determine if automation should be temporarily suspended.
  3. If no active worker is detected, the orchestrator parses the project's TODO.md file to find the first unblocked, incomplete task.
  4. A new worker session is spawned to implement the task, run the test suite, and commit the changes.
  5. Upon completion, the worker updates the task status in TODO.md and signals the system before exiting.
  6. The orchestrator monitors worker PIDs to detect stalls, cleaning up dead processes and generating progress reports based on new git commits.

Long-Running Task Orchestration Setup

1. Initialize Task Queue

Create a TODO.md file in the project root to serve as the task queue. Use standard markdown checkboxes to indicate progress.

2. Define Project Context

Create a CLAUDE.md or AGENTS.md file (keep under 100 lines) to provide the agent with essential technical context, stack details, and environment setup.

3. Configure the Orchestrator

Set up a cron job using Openclaw Skills configuration with sessionTarget: "isolated" and payload.kind: "agentTurn".

4. Manual Initialization

Spawn the first worker manually to create the initial PID and log tracking:

cd /path/to/project && nohup <agent-command> '<task prompt>' > /tmp/lrt-<project>-worker.log 2>&1 &
echo $! > /tmp/lrt-<project>-worker.pid

Long-Running Task Orchestration Data Schema & Taxonomy

The skill manages state using a project-specific slug to prevent file collisions.

File Path Description
/tmp/lrt-<project>-worker.pid The Process ID of the current active worker.
/tmp/lrt-<project>-orchestrator.lock A lock file containing the orchestrator's PID to prevent concurrent management.
/tmp/lrt-<project>-last-commit Stores the last reported commit hash to ensure unique progress reporting.
/tmp/lrt-<project>-worker.log Capture of the worker's stdout and stderr for debugging and auditing.
.pause A file in the project root that signals the orchestrator to skip spawning new workers.

Long-Running Task Orchestration Advanced Features

  • Stall and Crash Recovery: Automatically identifies stalled worker PIDs and cleans up stale lock files to restart the development pipeline.
  • Project Isolation: Uses unique project slugs to manage multiple concurrent long-running projects on the same host without interference.
  • Differential Progress Reporting: Optimized reporting that provides git diff statistics only when new commits are detected, reducing notification noise.
  • Autonomous Git Management: Integrated instructions for workers to test, commit, and push code following project-specific conventions.
  • Security Scoping: Support for dedicated deploy keys and machine accounts to ensure workers operate with minimum required privileges through Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*