ha-workflow-script

Author and review replay-safe workflow.js scripts for durable multi-agent orchestration runs.

1.6k|149|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/shiwenwen/hope-agent --skill ha-workflow-script
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ha-workflow-script
Source: https://github.com/shiwenwen/hope-agent/tree/main/skills/ha-workflow-script
Command: npx skills add https://github.com/shiwenwen/hope-agent --skill ha-workflow-script

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing durable, replay-safe workflow.js scripts for multi-agent orchestration is error-prone: unbounded fan-out, ambient time and randomness, unsafe isolation, and false completion claims all break runs. This Skill provides authoring and review guidance so Workflow scripts stay deterministic, budgeted, and honestly closed.

Core Features & Use Cases

  • Deterministic Authoring: Enforces replay-safe identity, fixed script hashes, and host-API-only side effects using workflow.now() and workflow.random(seed).
  • Bounded Parallelism: Guides correct use of workflow.parallel, workflow.pipeline, waitAny, and waitAll with staged result consumption and budget checks.
  • Typed Child Results: Covers outputSchema, bounded schemaRetries, worktree isolation, and honest closure via workflow.finish().
  • Use Case: Ask the agent to draft a workflow.js that fans out typed reviewer sub-agents in parallel, consumes results through a pipeline, and finishes with verified artifacts instead of a false success.

Quick Start

Ask the agent to draft a replay-safe workflow.js with typed parallel reviewers and pipeline-based result consumption.

Frequently Asked Questions about ha-workflow-script

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a replay-safe workflow.js script?

Export a default async main(workflow) function, use workflow.now() and workflow.random(seed) instead of ambient time or randomness, and route all side effects through approved host APIs. Keep the script hash fixed for a run and finish with workflow.finish(result).

When should I use workflow.parallel versus workflow.pipeline?

Use workflow.parallel for bounded independent work followed by a barrier. Use workflow.pipeline when fast results should be consumed and replenished before slower children finish, avoiding a fixed wait-all policy for every task.

Can a workflow.js script access the filesystem or network directly?

No. Raw filesystem, process, environment, network, dynamic import, eval, and Function are prohibited. All side effects must go through approved host APIs, with permissions and isolation enforced by the runtime.

How do I get typed results from child agents in a workflow?

Pass an outputSchema when spawning children so the parent receives machine-consumable fields. Keep schemaRetries bounded, reserve output tokens before spawn, and treat repair output as structure repair only.

Why does workflow.finish fail when child agents are still running?

workflow.finish cannot honestly complete while owned children remain non-terminal. If the runtime budget expires first, return a blocked result rather than reporting false success, since child completion is not proof of outcome completion.