Skillquality 0.57

hcom-workflow-scripts

Build multi-agent workflow scripts using hcom. Use this skill when the user wants to create custom hcom scripts, design multi-agent pipelines, write automation that coordinates Claude and Codex agents, or build applications that use hcom as the communication backbone. Covers scri

Price
free
Protocol
skill
Verified
no

What it does

hcom workflow scripts

build custom multi-agent workflow scripts that launch, coordinate, and manage AI coding agents via hcom.

decision tree

  1. write a new script → use the script template below + read references/script-template.md
  2. choose a multi-agent pattern → read references/patterns.md
  3. need hcom architecture details → read references/architecture.md
  4. cross-tool scripting (claude + codex) → read references/cross-tool-scripting.md
  5. debug a script → read references/debugging.md
  6. want pre-built scripts → check references/scripts/ directory

script template

every hcom workflow script follows this structure:

#!/usr/bin/env bash
# description shown in `hcom run` listing.
set -euo pipefail

LAUNCHED_NAMES=()
track_launch() {
  local names=$(echo "$1" | grep '^Names: ' | sed 's/^Names: //')
  for n in $names; do LAUNCHED_NAMES+=("$n"); done
}
cleanup() {
  for name in "${LAUNCHED_NAMES[@]}"; do
    hcom kill "$name" --go 2>/dev/null || true
  done
}
trap cleanup ERR

name_flag=""
task=""
while [[ $# -gt 0 ]]; do
  case "$1" in --name) name_flag="$2"; shift 2 ;; -*) shift ;; *) task="$1"; shift ;; esac
done
name_arg=""
[[ -n "$name_flag" ]] && name_arg="--name $name_flag"

thread="workflow-$(date +%s)"

# --- your workflow logic ---

# launch agent
launch_out=$(hcom 1 claude --tag worker --go --headless \
  --hcom-prompt "task: ${task}. when done: hcom send \"@reviewer-\" --thread ${thread} --intent inform -- \"DONE: <result>\". then: hcom stop" 2>&1)
track_launch "$launch_out"
worker=$(echo "$launch_out" | grep '^Names: ' | sed 's/^Names: //' | tr -d ' ')

# wait for signal
hcom events --wait 120 --sql "type='message' AND msg_thread='${thread}' AND msg_text LIKE '%DONE%'" $name_arg >/dev/null 2>&1

# cleanup
trap - ERR
for name in "${LAUNCHED_NAMES[@]}"; do hcom kill "$name" --go 2>/dev/null || true; done

place scripts in ~/.hcom/scripts/ as .sh or .py. run with hcom run <name> "task".

agent topologies

topologyagentshcom primitives
worker-reviewer2worker sends result, reviewer reads transcript, sends APPROVED/FIX
pipelineN sequentialeach stage reads previous via hcom transcript, signals via thread
ensembleN+1 (judge)N agents answer independently, judge reads all via hcom events --sql
hub-spoke1+Ncoordinator broadcasts to @tag-, workers report back
reactiveNhcom events sub triggers agent actions on file edits/status changes

communication primitives

whathowlatency
send messagehcom send @name --thread T --intent X -- "msg"under 1s (claude), 1-3s (codex)
wait for signalhcom events --wait N --sql "..."under 1s after match
read agent's workhcom transcript @name --full --detailedunder 1s
react to file changeshcom events sub --file "*.py"under 2s
react to agent idlehcom events sub --idle nameunder 2s
cross-devicehcom send @name:DEVICE -- "msg"1-5s
structured handoffhcom send --title X --transcript N-M:full --files a.pyunder 1s

required flags for script launches

flagwhy it's required
--goskips confirmation prompt — without it, script hangs forever
--headlessruns agent as detached background process
--tag Xgroups agents for @X- routing (essential for scripts)
--hcom-prompt "..."sets the agent's initial task

key rules

  • never use sleep — use hcom events --wait or hcom listen
  • never hardcode agent names — parse from grep '^Names: ' in launch output
  • always use --thread — without it, messages leak across workflows
  • always use trap cleanup ERR — orphan headless agents run indefinitely
  • always use hcom kill for cleanup (not stop) — kill also closes the terminal pane
  • always forward --name — hcom injects it, scripts must propagate it
  • wait for codex before messaginghcom events --wait 30 --idle "$codex_name"

timing reference (measured)

operationclaudecodex
launch to ready3-5s5-10s
message deliveryunder 1s1-3s
transcript readunder 1sunder 1s
full 2-agent round-trip15-25s25-40s
full 4-agent ensemble25-35sn/a

integration with external systems

hcom scripts are bash — they can call any CLI tool:

# ci/cd trigger
hcom send @worker- --from "github-actions" -- "PR merged, deploy"

# webhook notification
curl -X POST $WEBHOOK -d "$(hcom events --sql "msg_thread='${thread}'" --last 5)"

# pipe output
echo "complex task description" | hcom send @worker-

reference files

filewhen to read
references/script-template.mdwriting a new script from scratch — full template with commentary
references/patterns.mdchoosing and implementing multi-agent patterns — 6 tested examples
references/architecture.mdunderstanding hcom internals — db schema, hooks, delivery pipeline, events
references/cross-tool-scripting.mdclaude + codex mixed scripts — per-tool quirks, timing, session binding
references/debugging.mdfixing broken scripts — common failures, stale agents, message delivery
references/scripts/basic-messaging.shtested: two agents exchange messages
references/scripts/review-loop.shtested: worker-reviewer feedback loop
references/scripts/cross-tool-duo.shtested: claude architect + codex engineer
references/scripts/ensemble-consensus.shtested: 3 independent agents + judge
references/scripts/cascade-pipeline.shtested: sequential plan then execute pipeline
references/scripts/codex-worker.shtested: codex codes, claude reviews transcript

Capabilities

skillsource-aannooskill-hcom-workflow-scriptstopic-agenttopic-agent-skillstopic-ai-agentstopic-ai-toolstopic-automationtopic-claudetopic-claude-codetopic-claude-code-hookstopic-clitopic-codextopic-coding-agenttopic-communication

Install

Quality

0.57/ 1.00

deterministic score 0.57 from registry signals: · indexed on github topic:agent-skills · 235 github stars · SKILL.md body (5,889 chars)

Provenance

Indexed fromgithub
Enriched2026-04-22 06:54:17Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-22

Agent access