Add a webhook source to headless-ops: one line in the edge Worker, one hook file on the server, one test. Use when asked to "add a webhook", "connect <vendor>", or "listen for <event>".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Add Webhook?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/asteroidai-add-webhook)
---
name: add-webhook
description: Add a webhook source to headless-ops: one line in the edge Worker, one hook file on the server, one test. Use when asked to "add a webhook", "connect <vendor>", or "listen for <event>".
---
# add-webhook
Ask for two things if they are not given: the vendor, and what should happen when the event arrives.
1. **Find how the vendor signs.** Read its webhook docs. It is one of three schemes:
- `hmac`: a header holds the hex HMAC-SHA256 of the raw body. Note the header name, and a prefix such as `sha256=`.
- `standard`: Standard Webhooks (`webhook-id`, `webhook-timestamp`, `webhook-signature`).
- `token`: the vendor does not sign. You set a shared token in a header of your choice. Never in the URL.
2. **Add one line** to `SOURCES` in `edge/src/sources.ts`.
3. **Add `server/src/hooks/<name>.ts`.** Copy `cal.ts`. Read the body with `obj` and `str`. Throw `BadBody` when a field you need is not there. Give `ctx.run` a `key` of the form `<name>:<event id>`, so a retry makes no second job and two sources never share a key. Use `ctx.post` and no skill when the event needs no judgement.
4. **Add a skill** in `agent/.claude/skills/<skill>/SKILL.md` if the hook names a new one. Copy `research-company`.
5. **Add two tests.** In `test/edge.test.ts`: a body with a good signature passes, and one with a wrong signature gets 401. Use the header and scheme from the vendor's docs. In `test/server.test.ts`: the body makes the job you expect, and a repeat makes none.
6. Run `pnpm test && pnpm typecheck`.
7. Tell the person the two commands to run: `pnpm exec wrangler secret put <SECRET> -c edge/wrangler.jsonc` and `pnpm edge:deploy`. Then the URL to give the vendor: `https://<the worker>/webhooks/<name>`.
Never put a word a stranger typed in the `skill` name. Put it in `input`, or in `label` for people to read.