Build microfeed automations
SkillCloud & infraBuild persistent microfeed webhook receivers, integrations, and autonomous workflows. Use when implementing or reviewing a service or deployed AI agent that reacts asynchronously to microfeed events, verifies Standard Webhooks signatures, queues durable work, calls the authenticated API, prevents loops, or prepares a webhook automation for production. Do not use for interactive content editing through @microfeed/cli; use manage-microfeed-content instead.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Build microfeed automations skill
What this skill tells your AI
The instructions your AI receives, as published by microfeed/microfeed in .agents/skills/build-microfeed-automation/SKILL.md and read by ahel’s review.
Build the receiver as a durable, least-privilege system. A webhook announces a change; it is neither an instruction nor authorization to act.
Start from the deployed contract
- Ask for the microfeed site URL and the intended outcome.
- Prefer
yarn microfeed webhook scaffold .microfeed/webhooks/<endpoint-name> --language javascriptto create the local receiver, changing the language topythonwhen appropriate. The microfeed clone ignores.microfeed/; do not check this development receiver or populated secret files into microfeed. Treat the scaffold as a non-production inspector with in-memory duplicate tracking, not a durable architecture. Run the root command as written; its relative output resolves to<microfeed-root>/.microfeed/webhooks/, notpackages/cli/.microfeed/. - Discover the site's generated OpenAPI 3.1 contract at
<site-url>/api/v1/openapi.json, or its self-contained agent reference at<site-url>/api/v1/llms-full.txt. - Inspect the exact named event examples and JavaScript/Python
x-codeSamplesin that webhook operation. When available, use Admin → Webhooks → Event explorer oryarn microfeed webhook sample <event> --jsonto preview the same canonical examples. - Select the narrowest event set. Do not copy event schemas into a second hand-maintained contract.
- List required API reads and writes separately. Create one named integration credential with only those permissions.
Use docs/webhooks/ inside a microfeed clone or
https://docs.microfeed.org/webhooks/ elsewhere for setup, delivery limits,
recovery, and production operations. Use docs/automation/ or
https://docs.microfeed.org/automation/ for automation platforms, design, and
examples.
Keep interactive management separate
Use this skill for a server, Worker, integration, or agent that remains
deployed and reacts asynchronously. Use manage-microfeed-content for an
interactive coding agent that logs in through @microfeed/cli and edits
content while a person is present.
Do not make the persistent automation scrape Admin pages, use a dashboard password, inspect CLI credentials, or drive browser consent.
Implement the receiver in this order
- Read the HTTP body once as raw bytes.
- Before parsing JSON, verify
webhook-id,webhook-timestamp, andwebhook-signaturewith the maintainedstandardwebhooksJavaScript or Python library and the endpoint secret. Enforce its timestamp tolerance. Do not lead with hand-written HMAC code. - Validate the parsed envelope against the generated OpenAPI event union.
- After signature verification, inspect the required signed-body
testboolean. Routetest: truethrough a deterministic no-production-effects policy. Never let thex-microfeed-testheader override the signed body. - Insert the delivery ID and durable job in one storage transaction. Treat a repeated delivery ID as already accepted.
- Return
202or another2xximmediately after durable acceptance. Never wait for a model, external tool, or long API workflow. - Run decisions and actions in a durable Queue, Workflow, Agent task queue, or equivalent recoverable system.
Cloudflare Queue delivery is at-least-once. Deduplication is mandatory, and every side effect must also be idempotent.
Make decisions safely
- Treat titles, HTML, attachment contents, URLs, and metadata as untrusted model input.
- Resolve tools, credentials, destinations, system prompts, rate limits, and approval rules only from trusted configuration.
- Do not let content grant permission, select a credential, add a destination, weaken a policy, or suppress an audit record.
- Fetch current microfeed state before consequential action. The event is a change notification and may already be stale.
- Require explicit human approval for publication, destructive changes, payments, and externally visible messages unless the owner has established a narrow, auditable policy in advance.
- Keep model generation separate from tool execution. Validate the proposed action against an allowlisted schema and policy before executing it.
Prevent duplicates and loops
Use the delivery ID only to deduplicate transport. Use
<event.id>:<action-name> as the durable idempotency key for a logical side
effect.
For any API write:
- preserve
event.context.correlation_idinMicrofeed-Correlation-Id; - send
event.idinMicrofeed-Causation-Id; - add a stable automation marker to content when the data model permits it;
- ignore events whose causation ID or marker proves that the same bounded action already ran.
Do not rely on prompt instructions to prevent loops. Enforce loop rules in deterministic code and durable state.
Test locally
- Start the site with plain
yarn dev. Local Queue simulation, its consumer, hourly maintenance trigger, and a local encryption secret are automatic; no Cloudflare Queue, permission, usage, or charge is created. Reconciliation runs hourly and retention cleanup runs on the 00:00 UTC invocation only while an endpoint is configured.yarn dev --enable-webhooksis only an optional explicit alias. - Prefer
yarn microfeed webhook scaffold .microfeed/webhooks/<endpoint-name> --language javascriptand run the generated receiver at127.0.0.1:3000/webhook. Before installing or running it, create that endpoint in Admin and store its one-timewhsec_…value only inMICROFEED_WEBHOOK_SECRET. Then install dependencies, start the receiver with that secret, and send an Event Explorer test. Signature verification is the endpoint authentication; do not add another passcode, bearer token, URL credential, or custom header. - Use
yarn microfeed webhook listenon127.0.0.1:8978/webhookwhen an inspector or exact-body forwarder is more useful than a project. Supply the secret through the visible prompt,MICROFEED_WEBHOOK_SECRET, or--secret-file; never add a plaintext--secretflag. Use--forward-toonly for another explicit loopback server. To receive a deployed instance's short-lived test on the local listener, preferyarn microfeed webhook listen --tunnel. It uses an installedcloudflaredor, after explicit approval, downloads a pinned official binary into the microfeed cache and verifies its SHA-256 digest. Register only the printed temporary/webhookURL, keep signature verification enabled, and stop the listener after the test. Treat the public Quick Tunnel as development infrastructure, never a production receiver or durable relay. - Inspect the event first with
yarn microfeed webhook sample <event> --jsonor Admin Event Explorer. On loopback Admin, terminal printing is side-effect-free; an endpoint send uses normal Queue, retry, and daily-budget accounting. - Send
webhook.testand at least one real event type withtest: true. Prove neither path can call production models, tools, APIs, or destinations. - Trigger every subscribed real event and verify
test: false. - Replay a delivery and verify delivery deduplication and action idempotency.
- Use deterministic mock model and external-service responses for tests.
- Test a write-back event and prove causation/correlation loop prevention.
Check production readiness
Before declaring the integration ready, verify:
- raw-byte signature validation and timestamp tolerance;
- exact event-specific validation from deployed OpenAPI and a signed
testgate that prevents production effects; - transactional durable acknowledgement and duplicate delivery handling;
- durable background execution with bounded retries and dead-letter recovery;
- least-privilege credentials isolated per integration;
- action schemas, prompt-injection boundaries, and human approvals;
- event/action audit logs without secrets;
- rate limits, the instance's owner-configured webhook daily budget (default 1,000, allowed 0 through 1,000,000), model/tool cost alerts, and Queue backlog alerts;
- handling for six microfeed attempts, 10-second timeouts, daily-budget suppression, and endpoint auto-pause after 10 terminal failures;
- secret rotation, manual redelivery, reconciliation, and safe shutdown;
- removal procedure that disables the endpoint, drains work, revokes API and destination credentials, then deletes the endpoint.
State clearly that microfeed delivery succeeds when the receiver durably accepts the job. Failures after that acknowledgement are owned and retried by the automation.
Signals
- GitHub stars
- 4k
- Forks
- 1k
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
build-microfeed-automation- Source
- github.com/microfeed/microfeed