Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add resonatehq/resonate-skills --skill resonate-human-in-the-loop-pattern-typescriptgit clone --depth 1 https://github.com/resonatehq/resonate-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-typescript)<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-typescript"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-typescript/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-typescript"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-typescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.04177 |
| Opus 5 | $0.00023 | $0.02089 |
| Sonnet 5 | $0.00009 | $0.00835 |
| Haiku 4.5 | $0.00005 | $0.00418 |
Grade A, and why
resonate-human-in-the-loop-pattern-typescript scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 538 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Resonate Human-in-the-Loop Pattern (TypeScript)
SDK version: This skill reflects
@resonatehq/sdkv0.11.4 (current on npm).
Overview
The Human-in-the-Loop (HITL) pattern enables workflows to pause execution and wait for human input—decisions, approvals, reviews, or interventions. The workflow suspends (not blocks resources) and resumes exactly where it left off when the human responds, whether that's seconds, hours, or days later.
Core mechanism: Create a durable promise, read the ID the SDK generates for it, communicate that ID to a human (via email, UI, webhook), and yield* await the promise until it's externally resolved.
Mental Model
Workflow Human
│ │
├─ Create promise, read its ID │
├─ Send email with links │
│ (accept_link, reject_link) │
│ │
├─ yield* promise │
│ [SUSPENDED - not consuming │
│ resources, durable state] │
│ │
│ ├─ Click "Approve"
│ ├─ HTTP POST resolves promise
│ [RESUMES from checkpoint] │
│ │
├─ Process approval decision
└─ Complete workflow
Core Pattern
Step 1: Create the Durable Promise
function* approvalWorkflow(ctx: Context, orderId: string) {
// ctx.promise() generates the ID itself — you don't choose one
const approvalPromise = yield* ctx.promise<Decision>({
timeout: 24 * 60 * 60 * 1000 // 24 hours
});
// Continue...
}
Why read the ID back? The human (or webhook) needs to know which promise to resolve, and the SDK's auto-generated ID is the only ID there is. It's deterministic across replay — the sequence advances in call order — so approvalPromise.id is safe to hand to anything outside the workflow.
Step 2: Communicate Promise ID
function* approvalWorkflow(ctx: Context, orderId: string) {
const approvalPromise = yield* ctx.promise<Decision>();
// Send email with accept/reject links containing promise ID
yield* ctx.run(sendApprovalEmail, orderId, approvalPromise.id);
// Continue...
}
async function sendApprovalEmail(_ctx: Context, orderId: string, promiseId: string) {
const acceptLink = `https://example.com/approve/${promiseId}?action=accept`;
const rejectLink = `https://example.com/approve/${promiseId}?action=reject`;
await emailService.send({
to: "[email protected]",
subject: `Approval needed for order ${orderId}`,
body: `Accept: ${acceptLink}\nReject: ${rejectLink}`
});
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 538 lines · 45 tokens per session scan A 5d6663ec3951
resonate-human-in-the-loop-pattern-typescript is a skill published in the GitHub repository resonatehq/resonate-skills (6 stars, last pushed 20d ago), licensed Apache-2.0. It adds 45 tokens to every session and 4,177 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
tidebase
Give AI agents an identity and a credential vault (broker API calls so the agent and model never see the secret), plus checkpoint/resume, durable queues and cron schedules, cancellation, human approval gates, live progress state, subagent fanout, and per-run cost tracking, using Tidebase (open-source…
openJiuwen-DeepSearch
A deep-research tool that plans searches, gathers and checks information, and produces research reports in Markdown, DOC, or HTML format. It coordinates several AI agents for complex investigations.
my-custom-skill
Example custom agent skill — a template to get started.
economic-reasoning
Economic decision-making for agents in EconomySpace. Activate when the agent observes currency, prices, income, tax, or trading opportunities to make informed financial decisions.
safety.respond
Respond to urgent or risky events with safety movement, announcement, and memory.
care.basic
Offer basic care check-ins for neighbors.