/kombinat:write-webhook-gatesfrom kombinat
Writes gate scripts for Kombinat webhook routines that validate sender signatures, filter events, and keep follow-up messages in one run.
Ships in kombinat. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A routine with webhook: true starts on a POST to http://localhost:7433/api/routines/<name>/webhook, and the request body goes to the end of its prompt. Without a gate, anyone who can reach that URL starts a run with their own text. A gate is a command that decides about each request first:
webhook: true
webhookGate: node scripts/check-github.ts
It runs in the folder with routines/ and has 3 seconds. It gets the body on stdin, the headers as JSON in KOMBINAT_WEBHOOK_HEADERS, with their names in lowercase, and the routine's name in KOMBINAT_ROUTINE. It gets no URL and no query string.
| Exit | Result |
|---|---|
0 | The run starts. What the gate prints replaces the body. If it prints nothing, the body stays |
78 | No run. The sender gets 200, with what the gate prints if it is JSON |
79 | The request belongs to a conversation, see below |
| Other | No run. The sender gets 401, and the routine's Webhooks tab shows what the gate wrote to stderr |
// scripts/check-github.ts
import { createHmac, timingSafeEqual } from 'node:crypto';
import { buffer } from 'node:stream/consumers';
const body = await buffer(process.stdin);
const headers = JSON.parse(process.env.KOMBINAT_WEBHOOK_HEADERS ?? '{}');
const secret = process.env.KOMBINAT_GITHUB_SECRET;
if (!secret) throw new Error('KOMBINAT_GITHUB_SECRET is not set');
const expected = Buffer.from(`sha256=${createHmac('sha256', secret).update(body).digest('hex')}`);
const signature = Buffer.from(headers['x-hub-signature-256'] ?? '');
if (signature.length !== expected.length || !timingSafeEqual(signature, expected)) process.exit(1);
if (headers['x-github-event'] !== 'issues') process.exit(78);
const event = JSON.parse(body.toString());
if (event.action !== 'opened') process.exit(78);
const { number, title, html_url: url, body: description } = event.issue;
console.log(JSON.stringify({ number, title, url, description }));
Keep the secret in a KOMBINAT_ variable. kombinat install saves only the ones set in the shell it runs in. To add one, have the user run it again with all of them set.
A signature proves the app, not the person. Where anyone can write, such as in a public repository, also check who did.
| App | Signature | Also |
|---|---|---|
| GitHub | x-hub-signature-256 is sha256= and the hex HMAC-SHA256 of the body | The event's name is in x-github-event. Set the webhook's content type to application/json |
| Linear | linear-signature is the hex HMAC-SHA256 of the body | Reject a webhookTimestamp, in the body and in milliseconds, older than a minute |
| Slack | x-slack-signature is v0= and the hex HMAC-SHA256 of v0:<x-slack-request-timestamp>:<body> | Reject a timestamp, in seconds, older than 5 minutes. For a url_verification request, print {"challenge": "<its challenge>"} and exit 78 |
For another app, read how it signs requests in its own docs.
To keep follow-ups in one run, such as the comments on one pull request, exit 79 and print a key and the message for the agent:
{ "conversation": "<key>", "message": "…" }
The key is any text, such as the number of the pull request, and belongs to this routine. The message is a string. The first message with a key starts a run, with the message at the end of the prompt. Each later one continues that run in its session, or starts a new run when the first one has no session, as with agent: command.
Other output with exit 79 answers 401. In Node, set process.exitCode = 79 after you print: process.exit(79) can cut long output.
The daemon listens only on localhost, and its dashboard has no login. An app on the internet needs a public URL, from a tunnel or a reverse proxy. Forward only /api/routines/<name>/webhook to port 7433, never the whole dashboard.
Run the gate by hand before you connect the app, with a request you sign yourself:
body='{"action":"opened","issue":{"number":1,"title":"Crash","html_url":"https://example.com/1","body":"It crashes"}}'
signature="sha256=$(printf '%s' "$body" | openssl dgst -sha256 -hmac test | sed 's/^.* //')"
printf '%s' "$body" | KOMBINAT_GITHUB_SECRET=test KOMBINAT_WEBHOOK_HEADERS="{\"x-github-event\":\"issues\",\"x-hub-signature-256\":\"$signature\"}" node scripts/check-github.ts; echo "exit $?"
It must print the fields and exit 0. Change one character of the body, and it must exit 1. After a real request, the routine's Webhooks tab lists the call, the status of the answer and why the gate rejected it.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub danilqa/kombinat --plugin kombinat5 skills in this plugin
/debug-runsFinds out why a Kombinat run failed, timed out, was blocked, did nothing or never started, and suggests the fix. Use when a routine did not do what was expected, or when asked why a run ended the way it did./migrate-to-routinesMoves scheduled jobs, such as crontab lines, scheduled GitHub Actions workflows, launchd jobs and systemd timers, to Kombinat routines. Use when asked to migrate, convert or replace a cron job or a scheduled workflow with a routine./review-routinesReviews the routines of a Kombinat folder for wasted tokens, risky permissions, weak prompts and schedules that collide. Use when asked to review, audit or improve routines, or to cut what they cost./write-routinesWrites and edits Kombinat routines, the markdown files in `routines/` that run an AI agent on a schedule, on a webhook or after another routine. Use when asked to add, change, review or fix a routine, or to automate a recurring task with Kombinat.Other plugins' skills for the same job