{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-step-sequencer",
    "name": "Agent Step Sequencer",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/gostlightai/agent-step-sequencer",
    "canonicalUrl": "https://clawhub.ai/gostlightai/agent-step-sequencer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-step-sequencer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-step-sequencer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CHANGELOG.md",
      "README.md",
      "SKILL.md",
      "references/state-schema.md",
      "scripts/README.md",
      "scripts/step-sequencer-check.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-step-sequencer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-step-sequencer",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Agent Step Sequencer",
        "body": "Multi-step scheduler for in-depth requests. Enables step-based actions with heartbeat integration—survives gateway reset mid-step."
      },
      {
        "title": "Core Pattern",
        "body": "Interpret when user request requires multiple steps\nSuggest step plan, wait for confirmation\nPersist state.json (with plan format)\nAgent invokes scripts/step-sequencer-check.py immediately (no wait for heartbeat)\nHeartbeat (e.g. every 5 min) also invokes the script—keeps sequencer aligned with email jobs and other heartbeat tasks\n\nCritical: If gateway resets mid-step, next heartbeat reads state and resumes correctly."
      },
      {
        "title": "Plan Format",
        "body": "Agent builds a plan when user approves. During approval, agent asks: Use 2-minute delay between steps? Recommended for rate-limit–sensitive API calls. User chooses; agent sets stepDelayMinutes (0 or 2) in state. Each step has title, instruction, and optionally requiredOutputs (paths relative to workspace that must exist before the step is marked DONE):\n\n{\n  \"plan\": {\n    \"steps\": {\n      \"step-1\": { \"title\": \"Research topic X\", \"instruction\": \"Research topic X and produce a concise summary\", \"requiredOutputs\": [\"study/summary.md\"] },\n      \"step-2\": { \"title\": \"Write paper\", \"instruction\": \"Using the summary from step 1, write a research paper...\" }\n    }\n  },\n  \"stepQueue\": [\"step-1\", \"step-2\"],\n  \"currentStep\": 0,\n  \"stepRuns\": {},\n  \"stepDelayMinutes\": 0,\n  \"status\": \"IN_PROGRESS\"\n}\n\ntitle: Human-readable label\ninstruction: Full instruction for the agent (research, summarize, pull X from Y, etc.)\nrequiredOutputs (optional): List of paths (relative to workspace). Runner marks step DONE only if agent exits 0 and all these paths exist; otherwise step is FAILED with \"Missing required outputs: …\"."
      },
      {
        "title": "Roles",
        "body": "Agent: Builds plan, persists state; does not touch state during step execution. Takes prompts.\nRunner (step-sequencer-runner.py): Invokes agent with step instruction, waits for exit, marks DONE/FAILED. Applies stepDelayMinutes. On retry, agent gets troubleshoot prompt.\nCheck script (step-sequencer-check.py): If work to do, invokes runner. Handles FAILED → retry (reset PENDING, invoke runner).\nHeartbeat: Invokes check script on schedule."
      },
      {
        "title": "Step execution: autonomous recovery",
        "body": "Do not stop mid-step to ask the user. When executing a step, if something fails (empty fetch, API error, source unavailable):\n\nRetry once (same source/URL) if it might be transient.\nTry an alternative (e.g. CoinGecko instead of CoinMarketCap, different endpoint or token) and complete the step with what you can.\nDocument and exit only if you truly cannot complete the step—then exit non-zero so the runner marks FAILED; the scheduler will retry with a troubleshoot prompt.\n\nDo not stop silently. If you cannot complete the step after retry and alternatives: actively prompt the user—post a short message that you hit a snag, what failed, and what you tried (e.g. \"Step 2 (research Meteora) failed: CoinMarketCap fetch empty, tried CoinGecko—also empty. Need another source or skip this token.\"). Then exit non-zero so the runner marks FAILED and the scheduler can retry or add to blockers. Never just stop without telling the user."
      },
      {
        "title": "How Agent Determines Multi-Step",
        "body": "Agent must suggest before proceeding. When MULTI_STEP, propose the step plan and wait for confirmation before executing.\n\nMULTI_STEP =\n  (action_count >= 3)\n  OR has_sequential_language\n  OR has_output_dependency\n  OR high_scope_or_risk\n  OR user_requests_steps\n  OR contains_setup_keywords\n\nSINGLE_STEP =\n  (action_count == 1)\n  AND NOT has_output_dependency\n  AND immediate_execution\n\nDECISION =\n  IF MULTI_STEP THEN suggest_multi_step → wait for confirm → proceed\n  ELSE single_step\n\nDefinitions:\n\nCriterionMeaningaction_countNumber of distinct actions (file edits, commands, etc.)has_sequential_language\"then\", \"after\", \"first...then\", \"step 1\"has_output_dependencyStep B needs output from step Ahigh_scope_or_riskMany files, destructive ops, migrationuser_requests_steps\"step by step\", \"break this down\", \"one at a time\"contains_setup_keywords\"set up\", \"migrate\", \"implement from scratch\", \"full X\", \"complete Y\""
      },
      {
        "title": "State Schema",
        "body": "See references/state-schema.md. Key fields:\n\nplan.steps: step definitions (title, instruction, optional requiredOutputs)\nstepQueue, currentStep, stepRuns\nstepDelayMinutes: 0 = no delay; 2 = 2 min between steps\nblockers, lastHeartbeatIso, artifacts"
      },
      {
        "title": "Heartbeat Flow",
        "body": "Heartbeat invokes scripts/step-sequencer-check.py. Agent also invokes it right after persisting state.\n\nRead state.json\nIf no state or status=DONE → do nothing\nIf step FAILED → bump tries, reset to PENDING, invoke runner (immediate retry)\nIf step DONE → advance currentStep, invoke runner\nIf step PENDING or IN_PROGRESS → invoke runner\nUpdate lastHeartbeatIso\n\nRunner invokes agent (configurable via STEP_AGENT_CMD). Runner applies stepDelayMinutes."
      },
      {
        "title": "Failure Flow",
        "body": "Runner marks step FAILED, stores error in stepRuns\nRunner invokes check script immediately (no heartbeat wait)\nCheck script bumps tries, resets status to PENDING, invokes runner\nRunner invokes agent with troubleshoot prompt: \"Step X failed (tries: N). Previous run ended with: [error]. Please troubleshoot and retry: [instruction]\"\nRepeats until DONE or max retries / blockers"
      },
      {
        "title": "Check script → Runner",
        "body": "flowchart TD\n    A[Heartbeat or Agent] --> B[step-sequencer-check.py]\n    B --> C{Work to do?}\n    C -->|No| D[Do nothing]\n    C -->|Yes| E[Invoke runner]\n    E --> F[step-sequencer-runner.py]\n    F --> G[Invoke agent with instruction]\n    G --> H{Agent exit}\n    H -->|Success| I[Mark DONE]\n    H -->|Fail| J[Mark FAILED, invoke check script]\n    I --> K[Check advances or done]\n    J --> B"
      },
      {
        "title": "User flow (propose + persist)",
        "body": "flowchart TD\n    U[User Request] --> V{Complex enough?}\n    V -->|No| W[Execute directly]\n    V -->|Yes| X[Propose step plan]\n    X --> Y[User confirms]\n    Y --> Z[Persist state.json with plan]\n    Z --> AA[Agent invokes step-sequencer-check]\n    AA --> AB[Runner invokes agent - step 1]\n    AB --> AC[Heartbeat also invokes on schedule]"
      },
      {
        "title": "Configuration",
        "body": "EnvDescriptionSTEP_AGENT_CMDRequired. Command to invoke agent (space-separated). Prompt appended as last arg. Example: openclaw agent --messageSTEP_RUNNERPath to step-sequencer-runner.py (optional)STEP_MAX_RETRIESMax retries on FAILED before adding to blockers. Default: 3\n\nOpenClaw: Wire STEP_AGENT_CMD to OpenClaw's agent invocation (e.g. openclaw agent --message).\n\nSecurity: Set STEP_AGENT_CMD only to your trusted agent binary. Do not use shell interpreters (bash, sh, etc.) or -c/-e—the runner rejects these to prevent command injection. The instruction from state.json is passed as a single argument; it is never executed by a shell."
      },
      {
        "title": "Final Deliverables Step",
        "body": "When all steps complete:\n\nConfirm all requirements of the steps are met\nProduce summary with links or paths to any files created/written\nMark state DONE → on subsequent heartbeats, scheduler does nothing"
      },
      {
        "title": "Installation",
        "body": "clawhub install agent-step-sequencer\n\nManual copy:\n\ncp -r agent-step-sequencer ~/.openclaw/skills/agent-step-sequencer\n\nHeartbeat integration — Add this to your heartbeat (or have the agent add it):\n\n# Agent Step Sequencer check (add to heartbeat cycle)\npython3 ~/.openclaw/skills/agent-step-sequencer/scripts/step-sequencer-check.py ~/.openclaw/workspace/state.json\n\nOr if skill is in workspace: python3 ~/.openclaw/workspace/skills/agent-step-sequencer/scripts/step-sequencer-check.py ~/.openclaw/workspace/state.json\n\nSet STEP_AGENT_CMD to your agent invocation before running. Agent should invoke the check script immediately after persisting state."
      }
    ],
    "body": "Agent Step Sequencer\n\nMulti-step scheduler for in-depth requests. Enables step-based actions with heartbeat integration—survives gateway reset mid-step.\n\nCore Pattern\nInterpret when user request requires multiple steps\nSuggest step plan, wait for confirmation\nPersist state.json (with plan format)\nAgent invokes scripts/step-sequencer-check.py immediately (no wait for heartbeat)\nHeartbeat (e.g. every 5 min) also invokes the script—keeps sequencer aligned with email jobs and other heartbeat tasks\n\nCritical: If gateway resets mid-step, next heartbeat reads state and resumes correctly.\n\nPlan Format\n\nAgent builds a plan when user approves. During approval, agent asks: Use 2-minute delay between steps? Recommended for rate-limit–sensitive API calls. User chooses; agent sets stepDelayMinutes (0 or 2) in state. Each step has title, instruction, and optionally requiredOutputs (paths relative to workspace that must exist before the step is marked DONE):\n\n{\n  \"plan\": {\n    \"steps\": {\n      \"step-1\": { \"title\": \"Research topic X\", \"instruction\": \"Research topic X and produce a concise summary\", \"requiredOutputs\": [\"study/summary.md\"] },\n      \"step-2\": { \"title\": \"Write paper\", \"instruction\": \"Using the summary from step 1, write a research paper...\" }\n    }\n  },\n  \"stepQueue\": [\"step-1\", \"step-2\"],\n  \"currentStep\": 0,\n  \"stepRuns\": {},\n  \"stepDelayMinutes\": 0,\n  \"status\": \"IN_PROGRESS\"\n}\n\ntitle: Human-readable label\ninstruction: Full instruction for the agent (research, summarize, pull X from Y, etc.)\nrequiredOutputs (optional): List of paths (relative to workspace). Runner marks step DONE only if agent exits 0 and all these paths exist; otherwise step is FAILED with \"Missing required outputs: …\".\nRoles\nAgent: Builds plan, persists state; does not touch state during step execution. Takes prompts.\nRunner (step-sequencer-runner.py): Invokes agent with step instruction, waits for exit, marks DONE/FAILED. Applies stepDelayMinutes. On retry, agent gets troubleshoot prompt.\nCheck script (step-sequencer-check.py): If work to do, invokes runner. Handles FAILED → retry (reset PENDING, invoke runner).\nHeartbeat: Invokes check script on schedule.\nStep execution: autonomous recovery\n\nDo not stop mid-step to ask the user. When executing a step, if something fails (empty fetch, API error, source unavailable):\n\nRetry once (same source/URL) if it might be transient.\nTry an alternative (e.g. CoinGecko instead of CoinMarketCap, different endpoint or token) and complete the step with what you can.\nDocument and exit only if you truly cannot complete the step—then exit non-zero so the runner marks FAILED; the scheduler will retry with a troubleshoot prompt.\n\nDo not stop silently. If you cannot complete the step after retry and alternatives: actively prompt the user—post a short message that you hit a snag, what failed, and what you tried (e.g. \"Step 2 (research Meteora) failed: CoinMarketCap fetch empty, tried CoinGecko—also empty. Need another source or skip this token.\"). Then exit non-zero so the runner marks FAILED and the scheduler can retry or add to blockers. Never just stop without telling the user.\n\nHow Agent Determines Multi-Step\n\nAgent must suggest before proceeding. When MULTI_STEP, propose the step plan and wait for confirmation before executing.\n\nMULTI_STEP =\n  (action_count >= 3)\n  OR has_sequential_language\n  OR has_output_dependency\n  OR high_scope_or_risk\n  OR user_requests_steps\n  OR contains_setup_keywords\n\nSINGLE_STEP =\n  (action_count == 1)\n  AND NOT has_output_dependency\n  AND immediate_execution\n\nDECISION =\n  IF MULTI_STEP THEN suggest_multi_step → wait for confirm → proceed\n  ELSE single_step\n\n\nDefinitions:\n\nCriterion\tMeaning\naction_count\tNumber of distinct actions (file edits, commands, etc.)\nhas_sequential_language\t\"then\", \"after\", \"first...then\", \"step 1\"\nhas_output_dependency\tStep B needs output from step A\nhigh_scope_or_risk\tMany files, destructive ops, migration\nuser_requests_steps\t\"step by step\", \"break this down\", \"one at a time\"\ncontains_setup_keywords\t\"set up\", \"migrate\", \"implement from scratch\", \"full X\", \"complete Y\"\nState Schema\n\nSee references/state-schema.md. Key fields:\n\nplan.steps: step definitions (title, instruction, optional requiredOutputs)\nstepQueue, currentStep, stepRuns\nstepDelayMinutes: 0 = no delay; 2 = 2 min between steps\nblockers, lastHeartbeatIso, artifacts\nHeartbeat Flow\n\nHeartbeat invokes scripts/step-sequencer-check.py. Agent also invokes it right after persisting state.\n\nRead state.json\nIf no state or status=DONE → do nothing\nIf step FAILED → bump tries, reset to PENDING, invoke runner (immediate retry)\nIf step DONE → advance currentStep, invoke runner\nIf step PENDING or IN_PROGRESS → invoke runner\nUpdate lastHeartbeatIso\n\nRunner invokes agent (configurable via STEP_AGENT_CMD). Runner applies stepDelayMinutes.\n\nFailure Flow\nRunner marks step FAILED, stores error in stepRuns\nRunner invokes check script immediately (no heartbeat wait)\nCheck script bumps tries, resets status to PENDING, invokes runner\nRunner invokes agent with troubleshoot prompt: \"Step X failed (tries: N). Previous run ended with: [error]. Please troubleshoot and retry: [instruction]\"\nRepeats until DONE or max retries / blockers\nFlow Diagrams\nCheck script → Runner\nflowchart TD\n    A[Heartbeat or Agent] --> B[step-sequencer-check.py]\n    B --> C{Work to do?}\n    C -->|No| D[Do nothing]\n    C -->|Yes| E[Invoke runner]\n    E --> F[step-sequencer-runner.py]\n    F --> G[Invoke agent with instruction]\n    G --> H{Agent exit}\n    H -->|Success| I[Mark DONE]\n    H -->|Fail| J[Mark FAILED, invoke check script]\n    I --> K[Check advances or done]\n    J --> B\n\nUser flow (propose + persist)\nflowchart TD\n    U[User Request] --> V{Complex enough?}\n    V -->|No| W[Execute directly]\n    V -->|Yes| X[Propose step plan]\n    X --> Y[User confirms]\n    Y --> Z[Persist state.json with plan]\n    Z --> AA[Agent invokes step-sequencer-check]\n    AA --> AB[Runner invokes agent - step 1]\n    AB --> AC[Heartbeat also invokes on schedule]\n\nConfiguration\nEnv\tDescription\nSTEP_AGENT_CMD\tRequired. Command to invoke agent (space-separated). Prompt appended as last arg. Example: openclaw agent --message\nSTEP_RUNNER\tPath to step-sequencer-runner.py (optional)\nSTEP_MAX_RETRIES\tMax retries on FAILED before adding to blockers. Default: 3\n\nOpenClaw: Wire STEP_AGENT_CMD to OpenClaw's agent invocation (e.g. openclaw agent --message).\n\nSecurity: Set STEP_AGENT_CMD only to your trusted agent binary. Do not use shell interpreters (bash, sh, etc.) or -c/-e—the runner rejects these to prevent command injection. The instruction from state.json is passed as a single argument; it is never executed by a shell.\n\nFinal Deliverables Step\n\nWhen all steps complete:\n\nConfirm all requirements of the steps are met\nProduce summary with links or paths to any files created/written\nMark state DONE → on subsequent heartbeats, scheduler does nothing\nInstallation\nclawhub install agent-step-sequencer\n\n\nManual copy:\n\ncp -r agent-step-sequencer ~/.openclaw/skills/agent-step-sequencer\n\n\nHeartbeat integration — Add this to your heartbeat (or have the agent add it):\n\n# Agent Step Sequencer check (add to heartbeat cycle)\npython3 ~/.openclaw/skills/agent-step-sequencer/scripts/step-sequencer-check.py ~/.openclaw/workspace/state.json\n\n\nOr if skill is in workspace: python3 ~/.openclaw/workspace/skills/agent-step-sequencer/scripts/step-sequencer-check.py ~/.openclaw/workspace/state.json\n\nSet STEP_AGENT_CMD to your agent invocation before running. Agent should invoke the check script immediately after persisting state."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/gostlightai/agent-step-sequencer",
    "publisherUrl": "https://clawhub.ai/gostlightai/agent-step-sequencer",
    "owner": "gostlightai",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-step-sequencer",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-step-sequencer",
    "agentUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-step-sequencer/agent.md"
  }
}