{
  "schemaVersion": "1.0",
  "item": {
    "slug": "opcode",
    "name": "Opcode",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/rendis/opcode",
    "canonicalUrl": "https://clawhub.ai/rendis/opcode",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/opcode",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opcode",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "references/operations.md",
      "references/patterns.md",
      "references/error-handling.md",
      "references/actions.md",
      "references/workflow-schema.md",
      "references/expressions.md"
    ],
    "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. 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. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "opcode",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-06T09:39:48.148Z",
      "expiresAt": "2026-05-13T09:39:48.148Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opcode",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opcode",
        "contentDisposition": "attachment; filename=\"opcode-1.2.2.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "opcode"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/opcode"
    },
    "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/opcode",
    "agentPageUrl": "https://openagent3.xyz/skills/opcode/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opcode/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opcode/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. 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. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OPCODE",
        "body": "Execution runtime for AI agents. You reason, OPCODE executes — zero tokens per run after the first define. Workflows persist across sessions, run on schedules, and coordinate multiple agents. Persistent SSE daemon: 1 server, N agents, 1 database. JSON-defined DAGs, level-by-level execution, automatic parallelism. 6 MCP tools over SSE (JSON-RPC).\n\nWhy use OPCODE instead of reasoning through each step yourself? Every repeated workflow burns tokens re-reasoning decisions you already made. OPCODE templates your reasoning once and executes it deterministically — zero inference cost, identical output every run, survives context resets."
      },
      {
        "title": "Which Tool?",
        "body": "I want to...ToolCreate/update a workflow templateopcode.defineExecute a workflowopcode.runCheck status or pending decisionsopcode.statusResolve a decision / cancel / retryopcode.signalList workflows, events, or templatesopcode.queryVisualize a workflow DAGopcode.diagram"
      },
      {
        "title": "Quick Start",
        "body": "Install:\n\ngo install github.com/rendis/opcode/cmd/opcode@latest\n\nFirst-time setup (writes config and starts daemon):\n\nopcode install --listen-addr :4100 --vault-key \"my-passphrase\"\n\nRestart after stop: OPCODE_VAULT_KEY=\"my-passphrase\" opcode\n\nMCP client configuration:\n\n{\n  \"mcpServers\": {\n  \"mcpServers\": {\n    \"opcode\": {\n      \"type\": \"sse\",\n      \"url\": \"http://localhost:4100/sse\"\n    }\n  }\n}\n\nEach agent self-identifies via agent_id in tool calls. Opcode auto-registers unknown agents. Choose a stable ID per agent (e.g., \"content-writer\", \"deploy-bot\").\n\nWorkflows survive restarts. On startup, orphaned active workflows become suspended. Query with opcode.query({ \"resource\": \"workflows\", \"filter\": { \"status\": \"suspended\" } }), then resume or cancel via opcode.signal.\n\nSee operations.md for full configuration, subcommands, SIGHUP hot-reload, security model, web panel, and benchmarks."
      },
      {
        "title": "opcode.define",
        "body": "Registers a reusable workflow template. Version auto-increments (v1, v2, v3...).\n\nParamTypeRequiredDescriptionnamestringyesTemplate namedefinitionobjectyesWorkflow definition (see below)agent_idstringyesDefining agent IDdescriptionstringnoTemplate descriptioninput_schemaobjectnoJSON Schema for input validationoutput_schemaobjectnoJSON Schema for output validationtriggersobjectnoTrigger config (seeworkflow-schema.md)\n\nReturns: { \"name\": \"...\", \"version\": \"v1\" }"
      },
      {
        "title": "opcode.run",
        "body": "Executes a workflow from a registered template.\n\nParamTypeRequiredDescriptiontemplate_namestringyesTemplate to executeagent_idstringyesInitiating agent IDversionstringnoVersion (default: latest)paramsobjectnoInput parameters\n\nReturns:\n\n{\n  \"workflow_id\": \"uuid\",\n  \"status\": \"completed | suspended | failed\",\n  \"output\": { ... },\n  \"started_at\": \"RFC3339\",\n  \"completed_at\": \"RFC3339\",\n  \"steps\": {\n    \"step-id\": { \"step_id\": \"...\", \"status\": \"completed\", \"output\": {...}, \"duration_ms\": 42 }\n  }\n}\n\nIf status is \"suspended\", call opcode.status to see pending_decisions."
      },
      {
        "title": "opcode.status",
        "body": "Gets workflow execution status.\n\nParamTypeRequiredDescriptionworkflow_idstringyesWorkflow to query\n\nReturns:\n\n{\n  \"workflow_id\": \"uuid\",\n  \"status\": \"suspended\",\n  \"steps\": { \"step-id\": { \"status\": \"...\", \"output\": {...} } },\n  \"pending_decisions\": [\n    {\n      \"id\": \"uuid\",\n      \"step_id\": \"reason-step\",\n      \"context\": { \"prompt\": \"...\", \"data\": {...} },\n      \"options\": [ { \"id\": \"approve\", \"description\": \"Proceed\" } ],\n      \"timeout_at\": \"RFC3339\",\n      \"fallback\": \"reject\",\n      \"status\": \"pending\"\n    }\n  ],\n  \"events\": [ ... ]\n}\n\nWorkflow statuses: pending, active, suspended, completed, failed, cancelled."
      },
      {
        "title": "opcode.signal",
        "body": "Sends a signal to a suspended workflow.\n\nParamTypeRequiredDescriptionworkflow_idstringyesTarget workflowsignal_typeenumyesdecision / data / cancel / retry / skippayloadobjectyesSignal payload (see below)step_idstringnoTarget stepagent_idstringnoSignaling agentreasoningstringnoAgent's reasoning\n\nPayload by signal type:\n\nSignalstep_idPayloadBehaviordecisionrequired{ \"choice\": \"<option_id>\" }Resolves decision, auto-resumesdataoptional{ \"key\": \"value\", ... }Injects data into workflowcancelno{}Cancels workflowretryrequired{}Retries failed stepskiprequired{}Skips failed step\n\nReturns (decision): { \"ok\": true, \"resumed\": true, \"status\": \"completed\", ... }\nReturns (other): { \"ok\": true, \"workflow_id\": \"...\", \"signal_type\": \"...\" }"
      },
      {
        "title": "opcode.query",
        "body": "Queries workflows, events, or templates.\n\nParamTypeRequiredDescriptionresourceenumyesworkflows / events / templatesfilterobjectnoFilter criteria\n\nFilter fields by resource:\n\nResourceFieldsworkflowsstatus, agent_id, since (RFC3339), limiteventsworkflow_id, step_id, event_type, since, limittemplatesname, agent_id, limit\n\nNote: event queries require either event_type or workflow_id in filter.\n\nReturns: { \"<resource>\": [...] } -- results wrapped in object keyed by resource type."
      },
      {
        "title": "opcode.diagram",
        "body": "Generates a visual DAG diagram from a template or running workflow.\n\nParamTypeRequiredDescriptiontemplate_namestringno*Template to visualize (structure preview)versionstringnoTemplate version (default: latest)workflow_idstringno*Workflow to visualize (with runtime status)formatenumyesascii / mermaid / imageinclude_statusboolnoShow runtime status overlay (default: true if workflow_id)\n\n* One of template_name or workflow_id required.\n\ntemplate_name -- preview DAG structure before execution\nworkflow_id -- visualize with live step status\nformat: \"ascii\" -- CLI-friendly text with box-drawing characters\nformat: \"mermaid\" -- markdown-embeddable flowchart syntax\nformat: \"image\" -- base64-encoded PNG for visual channels\n\nReturns: { \"format\": \"ascii\", \"diagram\": \"...\" }"
      },
      {
        "title": "Workflow Definition",
        "body": "{\n  \"steps\": [ ... ],\n  \"inputs\": { \"key\": \"value or ${{secrets.KEY}}\" },\n  \"context\": { \"intent\": \"...\", \"notes\": \"...\" },\n  \"timeout\": \"5m\",\n  \"on_timeout\": \"fail | suspend | cancel\",\n  \"on_complete\": { /* step definition */ },\n  \"on_error\": { /* step definition */ },\n  \"metadata\": {}\n}\n\nFieldTypeRequiredDescriptionstepsStepDefinition[]yesWorkflow stepsinputsobjectnoInput parameters (supports ${{}})contextobjectnoWorkflow context, accessible via ${{context.*}}timeoutstringnoWorkflow deadline (e.g.,\"5m\", \"1h\")on_timeoutstringnofail (default), suspend, cancelon_completeStepDefinitionnoHook step after completionon_errorStepDefinitionnoHook step on workflow failuremetadataobjectnoArbitrary metadata"
      },
      {
        "title": "Step Definition",
        "body": "{\n  \"id\": \"step-id\",\n  \"type\": \"action | condition | loop | parallel | wait | reasoning\",\n  \"action\": \"http.get\",\n  \"params\": { ... },\n  \"depends_on\": [\"other-step\"],\n  \"condition\": \"CEL guard expression\",\n  \"timeout\": \"30s\",\n  \"retry\": { \"max\": 3, \"backoff\": \"exponential\", \"delay\": \"1s\", \"max_delay\": \"30s\" },\n  \"on_error\": { \"strategy\": \"ignore | fail_workflow | fallback_step | retry\", \"fallback_step\": \"id\" },\n  \"config\": { /* type-specific */ }\n}\n\ntype defaults to action. See workflow-schema.md for all config blocks."
      },
      {
        "title": "action (default)",
        "body": "Executes a registered action. Set action to the action name, params for input."
      },
      {
        "title": "condition",
        "body": "Evaluates a CEL expression and branches.\n\n{\n  \"id\": \"route\",\n  \"type\": \"condition\",\n  \"config\": {\n    \"expression\": \"inputs.env\",\n    \"branches\": { \"prod\": [...], \"staging\": [...] },\n    \"default\": [...]\n  }\n}"
      },
      {
        "title": "loop",
        "body": "Iterates over a collection or condition. Loop variables: ${{loop.item}}, ${{loop.index}}.\n\n{\n  \"id\": \"process-items\",\n  \"type\": \"loop\",\n  \"config\": {\n    \"mode\": \"for_each\",\n    \"over\": \"[\\\"a\\\",\\\"b\\\",\\\"c\\\"]\",\n    \"body\": [\n      {\n        \"id\": \"hash\",\n        \"action\": \"crypto.hash\",\n        \"params\": { \"data\": \"${{loop.item}}\" }\n      }\n    ],\n    \"max_iter\": 100\n  }\n}\n\nModes: for_each (iterate over), while (loop while condition true), until (loop until condition true)."
      },
      {
        "title": "parallel",
        "body": "Executes branches concurrently.\n\n{\n  \"id\": \"fan-out\",\n  \"type\": \"parallel\",\n  \"config\": {\n    \"mode\": \"all\",\n    \"branches\": [\n      [{ \"id\": \"a\", \"action\": \"http.get\", \"params\": {...} }],\n      [{ \"id\": \"b\", \"action\": \"http.get\", \"params\": {...} }]\n    ]\n  }\n}\n\nModes: all (wait for all branches), race (first branch wins)."
      },
      {
        "title": "wait",
        "body": "Delays execution or waits for a named signal.\n\n{ \"id\": \"pause\", \"type\": \"wait\", \"config\": { \"duration\": \"5s\" } }"
      },
      {
        "title": "reasoning",
        "body": "Suspends workflow for agent decision. Empty options = free-form (any choice accepted).\n\n{\n  \"id\": \"review\",\n  \"type\": \"reasoning\",\n  \"config\": {\n    \"prompt_context\": \"Review data and decide\",\n    \"options\": [\n      { \"id\": \"approve\", \"description\": \"Proceed\" },\n      { \"id\": \"reject\", \"description\": \"Stop\" }\n    ],\n    \"data_inject\": { \"analysis\": \"steps.analyze.output\" },\n    \"timeout\": \"1h\",\n    \"fallback\": \"reject\",\n    \"target_agent\": \"\"\n  }\n}"
      },
      {
        "title": "Variable Interpolation",
        "body": "Syntax: ${{namespace.path}}\n\nNamespaceExampleAvailable fieldssteps${{steps.fetch.output.body}}<id>.output.*, <id>.statusinputs${{inputs.api_key}}Keys from params in opcode.runworkflow${{workflow.run_id}}run_id, name, template_name, template_version, agent_idcontext${{context.intent}}Keys from context in workflow definitionsecrets${{secrets.DB_PASS}}Keys stored in vaultloop${{loop.item}}, ${{loop.index}}item (current element), index (0-based)\n\nTwo-pass resolution: non-secrets first, then secrets via AES-256-GCM vault.\n\nCEL gotcha: loop is a reserved word in CEL. Use iter.item / iter.index in CEL expressions. The ${{loop.item}} interpolation syntax is unaffected.\n\nSee expressions.md for CEL, GoJQ, Expr engine details."
      },
      {
        "title": "Built-in Actions",
        "body": "CategoryActionsHTTPhttp.request, http.get, http.postFilesystemfs.read, fs.write, fs.append, fs.delete, fs.list, fs.stat, fs.copy, fs.moveShellshell.execCryptocrypto.hash, crypto.hmac, crypto.uuidAssertassert.equals, assert.contains, assert.matches, assert.schemaExpressionexpr.evalWorkflowworkflow.run, workflow.emit, workflow.context, workflow.fail, workflow.log, workflow.notify\n\nQuick reference (most-used actions):\n\nhttp.get: url (req), headers, timeout, fail_on_error_status -- output: { status_code, headers, body, duration_ms }\n\n\nshell.exec: command (req), args, stdin, timeout, env, workdir -- output: { stdout, stderr, exit_code, killed }\n\n\nfs.read: path (req), encoding -- output: { path, content, encoding, size }\n\n\nworkflow.notify: message (req), data -- output: { notified: true/false } -- pushes real-time notification to agent via MCP SSE (best-effort)\n\n\nexpr.eval: expression (req), data -- output: { result: <value> } -- evaluates Expr expression against workflow scope (steps, inputs, workflow, context)\n\nSee actions.md for full parameter specs of all 26 actions."
      },
      {
        "title": "Scripting with shell.exec",
        "body": "shell.exec auto-parses JSON stdout. Convention: stdin=JSON, stdout=JSON, stderr=errors, non-zero exit=failure. Use stdout_raw for unprocessed text.\n\nSee patterns.md for language-specific templates (Bash, Python, Node, Go)."
      },
      {
        "title": "Reasoning Node Lifecycle",
        "body": "Workflow reaches a reasoning step\n\n\nExecutor creates PendingDecision, emits decision_requested event\n\n\nWorkflow status becomes suspended\n\n\nAgent calls opcode.status to see pending decision with context and options\n\n\nAgent resolves via opcode.signal:\n{\n  \"workflow_id\": \"...\",\n  \"signal_type\": \"decision\",\n  \"step_id\": \"reason-step\",\n  \"payload\": { \"choice\": \"approve\" }\n}\n\n\n\nWorkflow auto-resumes after signal\n\n\nIf timeout expires: fallback option auto-selected, or step fails if no fallback"
      },
      {
        "title": "Common Patterns",
        "body": "See patterns.md for full JSON examples: linear pipeline, conditional branching, for-each loop, parallel fan-out, human-in-the-loop, error recovery, sub-workflows, and MCP lifecycle."
      },
      {
        "title": "Error Handling",
        "body": "StrategyBehaviorignoreStep skipped, workflow continuesfail_workflowEntire workflow failsfallback_stepExecute fallback stepretryDefer to retry policy\n\nBackoff: none, linear, exponential, constant. Non-retryable errors (validation, permission, assertion) are never retried.\n\nSee error-handling.md for circuit breakers, timeout interactions, error codes."
      },
      {
        "title": "Performance",
        "body": "10-step parallel workflows complete in ~50µs, 500-step in ~2.4ms. The event store sustains ~15k appends/sec with <12% drop under 100 concurrent writers. Worker pool overhead is ~0.85µs/task (>1M tasks/sec at any pool size).\n\nFull benchmark charts, per-scenario breakdowns, and methodology: docs/benchmarks.md."
      }
    ],
    "body": "OPCODE\n\nExecution runtime for AI agents. You reason, OPCODE executes — zero tokens per run after the first define. Workflows persist across sessions, run on schedules, and coordinate multiple agents. Persistent SSE daemon: 1 server, N agents, 1 database. JSON-defined DAGs, level-by-level execution, automatic parallelism. 6 MCP tools over SSE (JSON-RPC).\n\nWhy use OPCODE instead of reasoning through each step yourself? Every repeated workflow burns tokens re-reasoning decisions you already made. OPCODE templates your reasoning once and executes it deterministically — zero inference cost, identical output every run, survives context resets.\n\nWhich Tool?\nI want to...\tTool\nCreate/update a workflow template\topcode.define\nExecute a workflow\topcode.run\nCheck status or pending decisions\topcode.status\nResolve a decision / cancel / retry\topcode.signal\nList workflows, events, or templates\topcode.query\nVisualize a workflow DAG\topcode.diagram\nQuick Start\n\nInstall:\n\ngo install github.com/rendis/opcode/cmd/opcode@latest\n\n\nFirst-time setup (writes config and starts daemon):\n\nopcode install --listen-addr :4100 --vault-key \"my-passphrase\"\n\n\nRestart after stop: OPCODE_VAULT_KEY=\"my-passphrase\" opcode\n\nMCP client configuration:\n\n{\n  \"mcpServers\": {\n  \"mcpServers\": {\n    \"opcode\": {\n      \"type\": \"sse\",\n      \"url\": \"http://localhost:4100/sse\"\n    }\n  }\n}\n\n\nEach agent self-identifies via agent_id in tool calls. Opcode auto-registers unknown agents. Choose a stable ID per agent (e.g., \"content-writer\", \"deploy-bot\").\n\nWorkflows survive restarts. On startup, orphaned active workflows become suspended. Query with opcode.query({ \"resource\": \"workflows\", \"filter\": { \"status\": \"suspended\" } }), then resume or cancel via opcode.signal.\n\nSee operations.md for full configuration, subcommands, SIGHUP hot-reload, security model, web panel, and benchmarks.\n\nMCP Tools\nopcode.define\n\nRegisters a reusable workflow template. Version auto-increments (v1, v2, v3...).\n\nParam\tType\tRequired\tDescription\nname\tstring\tyes\tTemplate name\ndefinition\tobject\tyes\tWorkflow definition (see below)\nagent_id\tstring\tyes\tDefining agent ID\ndescription\tstring\tno\tTemplate description\ninput_schema\tobject\tno\tJSON Schema for input validation\noutput_schema\tobject\tno\tJSON Schema for output validation\ntriggers\tobject\tno\tTrigger config (seeworkflow-schema.md)\n\nReturns: { \"name\": \"...\", \"version\": \"v1\" }\n\nopcode.run\n\nExecutes a workflow from a registered template.\n\nParam\tType\tRequired\tDescription\ntemplate_name\tstring\tyes\tTemplate to execute\nagent_id\tstring\tyes\tInitiating agent ID\nversion\tstring\tno\tVersion (default: latest)\nparams\tobject\tno\tInput parameters\n\nReturns:\n\n{\n  \"workflow_id\": \"uuid\",\n  \"status\": \"completed | suspended | failed\",\n  \"output\": { ... },\n  \"started_at\": \"RFC3339\",\n  \"completed_at\": \"RFC3339\",\n  \"steps\": {\n    \"step-id\": { \"step_id\": \"...\", \"status\": \"completed\", \"output\": {...}, \"duration_ms\": 42 }\n  }\n}\n\n\nIf status is \"suspended\", call opcode.status to see pending_decisions.\n\nopcode.status\n\nGets workflow execution status.\n\nParam\tType\tRequired\tDescription\nworkflow_id\tstring\tyes\tWorkflow to query\n\nReturns:\n\n{\n  \"workflow_id\": \"uuid\",\n  \"status\": \"suspended\",\n  \"steps\": { \"step-id\": { \"status\": \"...\", \"output\": {...} } },\n  \"pending_decisions\": [\n    {\n      \"id\": \"uuid\",\n      \"step_id\": \"reason-step\",\n      \"context\": { \"prompt\": \"...\", \"data\": {...} },\n      \"options\": [ { \"id\": \"approve\", \"description\": \"Proceed\" } ],\n      \"timeout_at\": \"RFC3339\",\n      \"fallback\": \"reject\",\n      \"status\": \"pending\"\n    }\n  ],\n  \"events\": [ ... ]\n}\n\n\nWorkflow statuses: pending, active, suspended, completed, failed, cancelled.\n\nopcode.signal\n\nSends a signal to a suspended workflow.\n\nParam\tType\tRequired\tDescription\nworkflow_id\tstring\tyes\tTarget workflow\nsignal_type\tenum\tyes\tdecision / data / cancel / retry / skip\npayload\tobject\tyes\tSignal payload (see below)\nstep_id\tstring\tno\tTarget step\nagent_id\tstring\tno\tSignaling agent\nreasoning\tstring\tno\tAgent's reasoning\n\nPayload by signal type:\n\nSignal\tstep_id\tPayload\tBehavior\ndecision\trequired\t{ \"choice\": \"<option_id>\" }\tResolves decision, auto-resumes\ndata\toptional\t{ \"key\": \"value\", ... }\tInjects data into workflow\ncancel\tno\t{}\tCancels workflow\nretry\trequired\t{}\tRetries failed step\nskip\trequired\t{}\tSkips failed step\n\nReturns (decision): { \"ok\": true, \"resumed\": true, \"status\": \"completed\", ... } Returns (other): { \"ok\": true, \"workflow_id\": \"...\", \"signal_type\": \"...\" }\n\nopcode.query\n\nQueries workflows, events, or templates.\n\nParam\tType\tRequired\tDescription\nresource\tenum\tyes\tworkflows / events / templates\nfilter\tobject\tno\tFilter criteria\n\nFilter fields by resource:\n\nResource\tFields\nworkflows\tstatus, agent_id, since (RFC3339), limit\nevents\tworkflow_id, step_id, event_type, since, limit\ntemplates\tname, agent_id, limit\n\nNote: event queries require either event_type or workflow_id in filter.\n\nReturns: { \"<resource>\": [...] } -- results wrapped in object keyed by resource type.\n\nopcode.diagram\n\nGenerates a visual DAG diagram from a template or running workflow.\n\nParam\tType\tRequired\tDescription\ntemplate_name\tstring\tno*\tTemplate to visualize (structure preview)\nversion\tstring\tno\tTemplate version (default: latest)\nworkflow_id\tstring\tno*\tWorkflow to visualize (with runtime status)\nformat\tenum\tyes\tascii / mermaid / image\ninclude_status\tbool\tno\tShow runtime status overlay (default: true if workflow_id)\n\n* One of template_name or workflow_id required.\n\ntemplate_name -- preview DAG structure before execution\nworkflow_id -- visualize with live step status\nformat: \"ascii\" -- CLI-friendly text with box-drawing characters\nformat: \"mermaid\" -- markdown-embeddable flowchart syntax\nformat: \"image\" -- base64-encoded PNG for visual channels\n\nReturns: { \"format\": \"ascii\", \"diagram\": \"...\" }\n\nWorkflow Definition\n{\n  \"steps\": [ ... ],\n  \"inputs\": { \"key\": \"value or ${{secrets.KEY}}\" },\n  \"context\": { \"intent\": \"...\", \"notes\": \"...\" },\n  \"timeout\": \"5m\",\n  \"on_timeout\": \"fail | suspend | cancel\",\n  \"on_complete\": { /* step definition */ },\n  \"on_error\": { /* step definition */ },\n  \"metadata\": {}\n}\n\nField\tType\tRequired\tDescription\nsteps\tStepDefinition[]\tyes\tWorkflow steps\ninputs\tobject\tno\tInput parameters (supports ${{}})\ncontext\tobject\tno\tWorkflow context, accessible via ${{context.*}}\ntimeout\tstring\tno\tWorkflow deadline (e.g.,\"5m\", \"1h\")\non_timeout\tstring\tno\tfail (default), suspend, cancel\non_complete\tStepDefinition\tno\tHook step after completion\non_error\tStepDefinition\tno\tHook step on workflow failure\nmetadata\tobject\tno\tArbitrary metadata\nStep Definition\n{\n  \"id\": \"step-id\",\n  \"type\": \"action | condition | loop | parallel | wait | reasoning\",\n  \"action\": \"http.get\",\n  \"params\": { ... },\n  \"depends_on\": [\"other-step\"],\n  \"condition\": \"CEL guard expression\",\n  \"timeout\": \"30s\",\n  \"retry\": { \"max\": 3, \"backoff\": \"exponential\", \"delay\": \"1s\", \"max_delay\": \"30s\" },\n  \"on_error\": { \"strategy\": \"ignore | fail_workflow | fallback_step | retry\", \"fallback_step\": \"id\" },\n  \"config\": { /* type-specific */ }\n}\n\n\ntype defaults to action. See workflow-schema.md for all config blocks.\n\nStep Types\naction (default)\n\nExecutes a registered action. Set action to the action name, params for input.\n\ncondition\n\nEvaluates a CEL expression and branches.\n\n{\n  \"id\": \"route\",\n  \"type\": \"condition\",\n  \"config\": {\n    \"expression\": \"inputs.env\",\n    \"branches\": { \"prod\": [...], \"staging\": [...] },\n    \"default\": [...]\n  }\n}\n\nloop\n\nIterates over a collection or condition. Loop variables: ${{loop.item}}, ${{loop.index}}.\n\n{\n  \"id\": \"process-items\",\n  \"type\": \"loop\",\n  \"config\": {\n    \"mode\": \"for_each\",\n    \"over\": \"[\\\"a\\\",\\\"b\\\",\\\"c\\\"]\",\n    \"body\": [\n      {\n        \"id\": \"hash\",\n        \"action\": \"crypto.hash\",\n        \"params\": { \"data\": \"${{loop.item}}\" }\n      }\n    ],\n    \"max_iter\": 100\n  }\n}\n\n\nModes: for_each (iterate over), while (loop while condition true), until (loop until condition true).\n\nparallel\n\nExecutes branches concurrently.\n\n{\n  \"id\": \"fan-out\",\n  \"type\": \"parallel\",\n  \"config\": {\n    \"mode\": \"all\",\n    \"branches\": [\n      [{ \"id\": \"a\", \"action\": \"http.get\", \"params\": {...} }],\n      [{ \"id\": \"b\", \"action\": \"http.get\", \"params\": {...} }]\n    ]\n  }\n}\n\n\nModes: all (wait for all branches), race (first branch wins).\n\nwait\n\nDelays execution or waits for a named signal.\n\n{ \"id\": \"pause\", \"type\": \"wait\", \"config\": { \"duration\": \"5s\" } }\n\nreasoning\n\nSuspends workflow for agent decision. Empty options = free-form (any choice accepted).\n\n{\n  \"id\": \"review\",\n  \"type\": \"reasoning\",\n  \"config\": {\n    \"prompt_context\": \"Review data and decide\",\n    \"options\": [\n      { \"id\": \"approve\", \"description\": \"Proceed\" },\n      { \"id\": \"reject\", \"description\": \"Stop\" }\n    ],\n    \"data_inject\": { \"analysis\": \"steps.analyze.output\" },\n    \"timeout\": \"1h\",\n    \"fallback\": \"reject\",\n    \"target_agent\": \"\"\n  }\n}\n\nVariable Interpolation\n\nSyntax: ${{namespace.path}}\n\nNamespace\tExample\tAvailable fields\nsteps\t${{steps.fetch.output.body}}\t<id>.output.*, <id>.status\ninputs\t${{inputs.api_key}}\tKeys from params in opcode.run\nworkflow\t${{workflow.run_id}}\trun_id, name, template_name, template_version, agent_id\ncontext\t${{context.intent}}\tKeys from context in workflow definition\nsecrets\t${{secrets.DB_PASS}}\tKeys stored in vault\nloop\t${{loop.item}}, ${{loop.index}}\titem (current element), index (0-based)\n\nTwo-pass resolution: non-secrets first, then secrets via AES-256-GCM vault.\n\nCEL gotcha: loop is a reserved word in CEL. Use iter.item / iter.index in CEL expressions. The ${{loop.item}} interpolation syntax is unaffected.\n\nSee expressions.md for CEL, GoJQ, Expr engine details.\n\nBuilt-in Actions\nCategory\tActions\nHTTP\thttp.request, http.get, http.post\nFilesystem\tfs.read, fs.write, fs.append, fs.delete, fs.list, fs.stat, fs.copy, fs.move\nShell\tshell.exec\nCrypto\tcrypto.hash, crypto.hmac, crypto.uuid\nAssert\tassert.equals, assert.contains, assert.matches, assert.schema\nExpression\texpr.eval\nWorkflow\tworkflow.run, workflow.emit, workflow.context, workflow.fail, workflow.log, workflow.notify\n\nQuick reference (most-used actions):\n\nhttp.get: url (req), headers, timeout, fail_on_error_status -- output: { status_code, headers, body, duration_ms }\n\nshell.exec: command (req), args, stdin, timeout, env, workdir -- output: { stdout, stderr, exit_code, killed }\n\nfs.read: path (req), encoding -- output: { path, content, encoding, size }\n\nworkflow.notify: message (req), data -- output: { notified: true/false } -- pushes real-time notification to agent via MCP SSE (best-effort)\n\nexpr.eval: expression (req), data -- output: { result: <value> } -- evaluates Expr expression against workflow scope (steps, inputs, workflow, context)\n\nSee actions.md for full parameter specs of all 26 actions.\n\nScripting with shell.exec\n\nshell.exec auto-parses JSON stdout. Convention: stdin=JSON, stdout=JSON, stderr=errors, non-zero exit=failure. Use stdout_raw for unprocessed text.\n\nSee patterns.md for language-specific templates (Bash, Python, Node, Go).\n\nReasoning Node Lifecycle\n\nWorkflow reaches a reasoning step\n\nExecutor creates PendingDecision, emits decision_requested event\n\nWorkflow status becomes suspended\n\nAgent calls opcode.status to see pending decision with context and options\n\nAgent resolves via opcode.signal:\n\n{\n  \"workflow_id\": \"...\",\n  \"signal_type\": \"decision\",\n  \"step_id\": \"reason-step\",\n  \"payload\": { \"choice\": \"approve\" }\n}\n\n\nWorkflow auto-resumes after signal\n\nIf timeout expires: fallback option auto-selected, or step fails if no fallback\n\nCommon Patterns\n\nSee patterns.md for full JSON examples: linear pipeline, conditional branching, for-each loop, parallel fan-out, human-in-the-loop, error recovery, sub-workflows, and MCP lifecycle.\n\nError Handling\nStrategy\tBehavior\nignore\tStep skipped, workflow continues\nfail_workflow\tEntire workflow fails\nfallback_step\tExecute fallback step\nretry\tDefer to retry policy\n\nBackoff: none, linear, exponential, constant. Non-retryable errors (validation, permission, assertion) are never retried.\n\nSee error-handling.md for circuit breakers, timeout interactions, error codes.\n\nPerformance\n\n10-step parallel workflows complete in ~50µs, 500-step in ~2.4ms. The event store sustains ~15k appends/sec with <12% drop under 100 concurrent writers. Worker pool overhead is ~0.85µs/task (>1M tasks/sec at any pool size).\n\nFull benchmark charts, per-scenario breakdowns, and methodology: docs/benchmarks.md."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/rendis/opcode",
    "publisherUrl": "https://clawhub.ai/rendis/opcode",
    "owner": "rendis",
    "version": "1.2.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/opcode",
    "downloadUrl": "https://openagent3.xyz/downloads/opcode",
    "agentUrl": "https://openagent3.xyz/skills/opcode/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opcode/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opcode/agent.md"
  }
}