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 agentmods add skills/martineserios/thebrana/webhook-handler-patternsnpx skills add martineserios/thebrana --skill webhook-handler-patternsgit clone --depth 1 https://github.com/martineserios/thebranaWhat 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 | $0.00052 | $0.00677 |
| Opus 5 | $0.00026 | $0.00338 |
| Sonnet 5 | $0.00010 | $0.00135 |
| Haiku 4.5 | $0.00005 | $0.00068 |
Grade A, and why
webhook-handler-patterns 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 3d 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 — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Webhook Handler Patterns
When to Use This Skill
- Following the correct webhook handler order (verify → parse → handle idempotently)
- Implementing idempotent webhook handlers
- Handling errors and configuring retry behavior
- Understanding framework-specific gotchas (raw body, middleware order)
- Building production-ready webhook infrastructure
Resources
Handler Sequence
- references/handler-sequence.md (upstream
references/handler-sequence.md, not installed locally) - Verify first, parse second, handle idempotently third
Best Practices
- references/idempotency.md (upstream
references/idempotency.md, not installed locally) - Prevent duplicate processing - references/error-handling.md (upstream
references/error-handling.md, not installed locally) - Return codes, logging, dead letter queues - references/retry-logic.md (upstream
references/retry-logic.md, not installed locally) - Provider retry schedules, backoff patterns
Framework Guides
- references/frameworks/express.md (upstream
references/frameworks/express.md, not installed locally) - Express.js patterns and gotchas - references/frameworks/nextjs.md (upstream
references/frameworks/nextjs.md, not installed locally) - Next.js App Router patterns - references/frameworks/fastapi.md (upstream
references/frameworks/fastapi.md, not installed locally) - FastAPI/Python patterns
Quick Reference
Handler Sequence
- Verify signature first — Use raw body; reject invalid requests with 4xx.
- Parse payload second — After verification, parse or construct the event.
- Handle idempotently third — Check event ID, then process; return 2xx for duplicates.
Response Codes
| Code | Meaning | Provider Behavior |
|---|---|---|
2xx |
Success | No retry |
4xx |
Client error | Usually no retry (except 429) |
5xx |
Server error | Retry with backoff |
429 |
Rate limited | Retry after delay |
Idempotency Checklist
- Extract unique event ID from payload
- Check if event was already processed
- Process event within transaction
- Store event ID after successful processing
- Return success for duplicate events
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.
- 3d ago First seen · 69 lines · 52 tokens per session scan A 07eb771a3753
webhook-handler-patterns is a skill published in the GitHub repository martineserios/thebrana (3 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 677 once invoked, about $0.0003 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
webhook-subscriptions
Design, implement, and debug webhook integrations with security and reliability.
background-task
Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.
agent-tool
Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.
frontend-feature
Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.
pytest-suite
Write or extend the backend test suite following this project's conventions. Use when adding tests for a new service/route/repository, when coverage is missing, or when asked to test a feature. Knows the mocked-session + httpx AsyncClient setup so tests run with no database.
rag-knowledge
Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…