Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

long-term-task-orchestration长期任务编排

Agent Skill

long-term-task-orchestration 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

264

周安装

11

GitHub Stars

18

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:long-term-task-orchestration(长期任务编排)
来源仓库:https://github.com/hixuanxuan/long-running-agent-tasks
仓库路径:skills/long-term-task-orchestration
安装命令:
npx skills add https://github.com/hixuanxuan/long-running-agent-tasks --skill long-term-task-orchestration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hixuanxuan/long-running-agent-tasks --skill long-term-task-orchestration

简介

long-term-task-orchestration 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Long-Term Task Orchestration Meta-Skill

A framework for designing and generating "long-running task Skills" for AI Coding Agents, with eval and multi-layer review to ensure quality delivery. Characteristics of long-running tasks: large number of files (dozens to tens of thousands), cannot complete in a single session, requires concurrent scheduling, requires cross-session resumption.


Generation Workflow (End-to-End)

Step 1 — Requirements Analysis

Based on the user's description, infer initial answers to the four key elements yourself, then confirm with the user (see full template in references/requirements.md).

Important: Always present your own inferred answers before asking questions. State directly what you can already determine; only use option-style questions for genuinely uncertain elements. Guide the user with directed questions — do not present a blank questionnaire for them to fill in.

Step 2 — Architecture Decisions

Make three key choices based on requirements (decision matrix in references/architecture.md, existing case comparisons in references/examples.md):

  1. State storage format: TSV / JSON manifest+inputs / JSON single file
  2. Grouping strategy: By directory + line count / Per file / By dependency topological order
  3. State machine: Basic (TODO→DONE/FAILED) / Extended (with merging phase)
  4. Isolation strategy: Shared working directory / git worktree isolation (decision rules in references/architecture.md § git worktree)

Step 3 — Generate Skill Files

Interface specs, implementation patterns, and common utility functions for each script are in references/script_patterns.md. Generate each in the following order, consulting the corresponding section before writing each script:

  1. setup-env.js — Environment setup (see also references/claude_cli.md § Environment Initialization Spec)
  2. discover.js — Scan + group + generate task manifest
  3. build-prompt.js — Build subtask prompts (see also references/prompt_design.md)
  4. dispatch.js — Concurrent scheduling core (see also references/error_handling.md)
  5. status.js — Progress query
  6. merge.js (optional) — Merge results
  7. poll.js (optional, for worktree scenarios) — Poll and backfill

Generated directory structure:

<skill-name>/
├── SKILL.md                    # Phase definitions + resumption detection + completion criteria
├── scripts/
│   ├── setup-env.js            # Environment setup (unified template, rarely needs changes)
│   ├── discover.js             # Scan → generate task manifest (idempotent)
│   ├── dispatch.js             # Read manifest → group → concurrent dispatch
│   ├── build-prompt.js         # Programmatically build subtask prompts
│   ├── status.js               # Query progress
│   ├── merge.js                # Merge subtask results (optional)
│   └── poll.js                 # Poll + backfill (optional, for worktree isolation scenarios)
├── references/
│   ├── phase0_setup.md
│   ├── phase1_analyze.md
│   ├── phase2_dispatch.md
│   └── phase3_finalize.md
└── evals/
    └── evals.json

Step 4 — Write SKILL.md

Assemble Phase definitions, resumption detection, and completion criteria into the generated SKILL.md. See references/phase_template.md for the Phase reference file writing pattern. Keep it under 500 lines.

Step 5 — Eval Smoke Test (User Confirmation Gate)

Invoke skill-eval to obtain eval capabilities, run a smoke test round on the generated Skill to verify end-to-end completeness — confirm the generated artifacts can be triggered normally and phases connect without obvious gaps. This step is executed only once; the result is handed to the user for judgment.

  1. Invoke skill-eval to obtain generation and execution capabilities, run eval against the current generated Skill directory, execute only once
  2. Present the full eval results to the user, including: passing test cases, failing test cases, covered scenarios
  3. Wait for user decision:

- User accepts current results → proceed directly to Step 6 - User requests improvements → modify corresponding files based on feedback, then proceed to Step 6

Step 6 — Artifact Quality Review

Conduct a file-by-file quality review of generated artifacts through an independent eval agent. See references/eval_grader.md for the full flow and grader prompt template.

  1. Assemble grader prompt from the eval_grader.md template, write to a temporary file
  2. claude -p <prompt> --cwd <skill directory> to launch eval agent (independent session)
  3. Eval agent reads files and runs checks autonomously, writes findings to eval-report.json
  4. Read report: findings present → abstract and generalize problem patterns, apply global fixes, then re-run review; no findings → done
  5. Maximum 3 rounds; if problems remain after round 3, present to user

Fix principle: Do not patch individual findings. First determine "whether this problem also exists elsewhere", do a global sweep, then fix uniformly. See eval_grader.md § Abstract Generalization.


Four Phases

PhaseResponsibilityExecutorOutput
0: Environment SetupFollow claude_cli.md environment initialization spec to complete Node.js / claude-cli / API Key / model selection, write all variables to .agent.env in one shotMain Agent + setup-env.js.agent.env
1: Analysis & PlanningScan targets, analyze dependencies, generate task manifestMain Agent + discover.jsTask manifest file
2: Batch ExecutionGroup, dispatch subagents, validate, retrydispatch.js + subagentPer-subtask output
3: Finalization & ValidationMerge results, global validation, generate reportMain Agent + merge.jsFinal artifacts

Before each Phase begins, the main Agent first views the corresponding references/phaseN_xxx.md for detailed instructions.

Subagents must be executed as independent processes via claude -p CLI, and must NOT be called via Agent tools nested within the main Agent session.

Each subtask is an independent CLI process and Agent session, launched and managed by the dispatch.js script via claude --print, not nested within the main Agent conversation. This design is a core architectural decision of the long-running task framework: 1. Prompt Determinism: Subtask prompts are assembled programmatically by build-prompt.js, with consistent structure and controlled content. If the main Agent were to relay prompts through the session, it would "re-interpret" and rewrite the instructions — adding its own inferences, changing content organization — causing the subtask to receive instructions that deviate from intent, leading to unstable output quality. 2. Eliminate Context Accumulation: Each CLI subtask's context contains only the information needed for that task. If dispatched serially within the main Agent session, all preceding subtask conversation history accumulates in context, wasting tokens and distracting attention. This also avoids the main Agent spending tokens "thinking about how to write subtask instructions" — prompt construction is a programmatic zero-cost operation. 3. Controlled Concurrency: CLI processes have their concurrency controlled by scripts, adjustable dynamically based on resources and rate limits (3 to 20+ lanes). Having the Agent self-schedule concurrency in a conversation tends to be overly conservative, making true high concurrency hard to achieve. 4. Pre/Post Logic Orchestration: Scripts insert deterministic logic before and after subtask execution (create worktree, validate output, update state, clean up temp files) without requiring Agent involvement.

Session Resumption Detection (must be written into generated SKILL.md)

1. Does .agent.env exist?         No → Phase 0
2. Does task manifest exist?      No → Phase 1
3. Any IN_PROGRESS tasks?         Yes → Check if their output files exist and are valid
                                       → Valid: mark DONE, continue
                                       → Invalid or missing: reset to TODO, enter Phase 2
4. All complete?                  Yes → Phase 3 / No → Phase 2 (continue)

Six Design Principles the Generated Skill Must Embody

The following principles are quality standards for generated artifacts — the generated Skill must exhibit these characteristics, not constraints on this meta-skill's workflow.

  1. File As Progress — All state is persisted to the filesystem; resumption relies only on disk. Write to disk immediately after each operation completes. → In all scripts, state changes must be followed by immediate writeFileSync — do not wait until batch ends.
  2. Context Reset — Each subagent has a fresh context; prompts must be fully self-contained and cannot assume the subagent "already knows" any information. → build-prompt must include: complete file content, rule constraints, output format, output path.
  3. Task Contract — Each subtask has an input/output/validation triplet contract. dispatch determines completion based on output files, not by parsing text output. → Success = output file exists + format valid (e.g., JSON.parse passes); does not rely on stdout/stderr.
  4. Idempotent & Incremental — Repeated execution does not overwrite existing results. dispatch only processes pending/error; discover only supplements new files. → Each script loads existing state before running, skipping already-completed entries.
  5. Programmatic over Agent — What can be solved by scripts should not be delegated to the Agent. Grouping, prompt assembly, state updates, and result merging are all scripted. → The Agent only does work requiring comprehension (code modification, review judgment, fix decisions). → Subagents are dispatched as independent processes via claude -p CLI; nested calls via Agent tools within the main Agent session are prohibited. Independent processes guarantee the determinism of programmatic prompt construction, eliminate context accumulation, support true high-concurrency control, and enable pre/post script orchestration.
  6. Failure Isolation — Errors are resolved at the smallest possible scope; errors must not carry over to subsequent phases or escape from subtasks. → Subtask self-containment: If a subagent detects validation failure internally, it first attempts to fix within the current session; if unfixable, revert the environment, mark FAILED, explicitly report — do not let problematic output mix into the completion queue. → Phase-level convergence: Failed tasks during Phase 2 (batch execution) must be handled within that phase (retried or marked FAILED); when entering Phase 3, only "completed" or "explicitly marked FAILED" states are allowed. → Three-layer retry mechanism (see references/error_handling.md):

- Inner layer: process crash / network failure → resume the same session with original conversationId - Middle layer: output validation failure → new session with error context for targeted fix, max 2-3 times; if exceeded, revert + mark FAILED - Outer layer: main Agent evaluates FAILED count, decides whether to re-dispatch (few → retry, many → diagnose first) → To determine which layer to use: check output file state (existence + format validity); do not parse Agent text output.


Completion Criteria (Generic Template)

# All entries in the task manifest are in a terminal state (done/failed/skipped)
node ${SKILL_DIR}/scripts/status.js --root .
# Exit code 0 = all complete, non-0 = incomplete entries remain

References

FileContent
references/requirements.mdRequirements analysis template, scope variable spec
references/architecture.mdArchitecture decisions: state storage selection, grouping strategy, state machine, git worktree isolation
references/prompt_design.mdPrompt design philosophy, quality principles, examples and counter-examples, Context Budget
references/phase_template.mdPhase Reference writing pattern
references/error_handling.mdRuntime error handling: three-layer retry mechanism, success determination, IN_PROGRESS residual handling
references/script_patterns.mdInterface specs + implementation patterns for each script
references/claude_cli.mdComplete claude CLI reference: --print (start a new Agent session), --resume (resume session), all options
references/examples.mdQuick reference for existing long-running task Skill cases (js-to-ts, codebase-review, review-fix)
references/eval_grader.mdEval quality gate: grader prompt template, review dimensions, abstract generalization feedback principle

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.95%
按下载量换算33

Claude

27.97%
按下载量换算25

Cursor

19.04%
按下载量换算17

Gemini CLI

9.88%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills