Compatibility alias for substrate-specific ADR-0217 runtime bridge work. For new work, load `workflow-rig` first; use this skill only when the task is explicitly about external-repo bridging, queue-family contracts, or low-level runtime submission mechanics.
77%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/restate-workflows/SKILL.mdThis skill is now a compatibility alias for substrate work.
For new work, load workflow-rig first. Use this skill only when the real problem is the runtime bridge itself: external repo submission, queue-family contracts, or low-level ADR-0217 substrate mechanics.
The boundary is the joelclaw CLI.
Do not reach into Redis directly. Do not import private joelclaw packages. Do not pretend the other repo knows internal queue schemas unless you have explicitly verified them.
ADR-0217 currently reads best as:
An external repo should integrate at the edge, not by coupling itself to the middle.
That means:
joelclaw workload run when the work has already been shaped at the workload layerjoelclaw queue emit only as the low-level escape hatch for verified raw queue familiesUse this skill when a user asks for any of these:
joelclaw workload run for approved workload artifacts; use joelclaw queue emit only when you are intentionally working at the raw queue-family layer.@joelclaw/*, Redis keys, internal TypeScript types, worker-only contracts) unless the repo itself is the joelclaw monorepo.Run these before designing the bridge:
joelclaw workload run --help
joelclaw queue --help
joelclaw queue emit --helpIf the target repo is supposed to monitor results too, also inspect:
joelclaw jobs status --hours 1 --count 10
joelclaw queue observe --hours 1If you are unsure whether a workflow family already exists, search docs or ask instead of inventing one.
The default deliverable is a thin wrapper command/module/script around joelclaw workload run when the repo can produce a saved workload artifact. Fall back to joelclaw queue emit only when you have a verified low-level family and there is no workload artifact to bridge.
Good shapes:
scripts/request-work.tsbin/request-background-worksrc/lib/joelclaw/requestWorkflow.tssrc/cli/restate-workflow.tsBad shape:
Every request payload should include these fields unless the target family has a stricter contract:
{
"idempotencyKey": "repo-name:task-type:base-sha:input-hash",
"requestId": "uuid-or-stable-derived-id",
"repo": {
"path": "/abs/path/or/null",
"url": "git@github.com:owner/repo.git",
"name": "repo-name",
"baseSha": "abc123",
"branch": "main"
},
"task": {
"kind": "sandboxed-change",
"prompt": "what the runtime should do",
"artifacts": ["patch", "test-report", "summary.json"]
},
"caller": {
"source": "external-repo-name",
"requestedBy": "human-or-agent",
"sessionId": "optional-session-id",
"callback": {
"kind": "poll",
"target": "joelclaw jobs status"
}
},
"meta": {
"dryRun": false,
"createdAt": "2026-03-08T05:00:00.000Z"
}
}idempotencyKey must be stable for the same intended work requestbaseSha must reflect the code the sandbox should start fromprompt must say what success looks likeartifacts must list what the caller expects backcaller.source must identify who emitted the requestThe wrapper should construct JSON, then call the CLI.
Example pattern:
joelclaw queue emit <event-family> --data '<json>'Example Node/Bun sketch:
import { spawn } from "node:child_process";
export async function requestWorkflow(
event: string,
payload: unknown,
dryRun = false,
) {
const data = JSON.stringify(payload);
if (dryRun) {
return {
ok: true,
mode: "dry-run",
event,
payload,
};
}
return await new Promise((resolve, reject) => {
const child = spawn("joelclaw", ["queue", "emit", event, "--data", data], {
stdio: ["ignore", "pipe", "pipe"],
});
let stdout = "";
let stderr = "";
child.stdout.on("data", (chunk) => {
stdout += chunk.toString();
});
child.stderr.on("data", (chunk) => {
stderr += chunk.toString();
});
child.on("close", (code) => {
if (code === 0) {
resolve({ ok: true, mode: "live", event, payload, stdout });
return;
}
reject(
new Error(`joelclaw queue emit failed (${code}): ${stderr || stdout}`),
);
});
});
}Do not hijack an unrelated proof family just because it exists.
Rules:
content/updated is a dogfood family, not a generic bucket for outside reposA good stop-and-document line is:
No canonical workflow-request family was verified in the target runtime. This repo now emits a validated payload object locally and documents the proposed
sandbox/work.requestedcontract, but does not enqueue live requests until the runtime family is confirmed.
That is honest. Honesty beats fake integration.
The command must be able to print the exact event + payload without sending it.
Dry-run output should be parseable JSON, for example:
{
"ok": true,
"mode": "dry-run",
"event": "sandbox/work.requested",
"payload": { "...": "..." }
}Handle these explicitly:
joelclaw binary missingbaseSha, prompt, or idempotencyKeyReturn stable JSON on success, not prose.
At minimum:
{
"ok": true,
"mode": "live",
"event": "sandbox/work.requested",
"idempotencyKey": "...",
"stdout": "raw joelclaw output"
}Tests should verify:
Mock the CLI process if needed. Do not require the real runtime for unit tests.
Document these four things in the calling repo:
Minimum verification section:
joelclaw jobs status --hours 1 --count 10
joelclaw queue observe --hours 1If there is a known workflow ID or downstream surface, include it.
Do not do this:
task/runbaseSha for code-changing workWhen asked to implement this integration in another repo, deliver:
Paste this:
Use
/skill:restate-workflows. Add a thin wrapper in this repo aroundjoelclaw queue emitso it can submit work into joelclaw without talking to Redis or private joelclaw internals. Checkjoelclaw queue emit --helpfirst. Emit machine-readable JSON withrequestId,idempotencyKey, repourl/branch/baseSha, task prompt, expected artifacts, and caller metadata. Support--dry-run, add a README example and tests, and if the canonical event family is not verified, stop and document the proposed family instead of guessing.
joelhooks/joelclaw
f5b3a16
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.