iamriajul/gitlab-agent-webhook · Archived

webhook-handler

Guide for adding new GitLab webhook event handlers. Use when asked to handle a new webhook event type, add a new event handler, or extend webhook processing.

First seen Jun 18, 2026

Installation

$ npx skills add iamriajul/gitlab-agent-webhook --skill webhook-handler

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Grep, Glob, Edit, Write, Bash

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,650 B
  • docs SUMMARY.md 180 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Add a New Webhook Event Handler

Follow these steps exactly. Do not skip any step.

Step 1: Write Failing Tests

Create test file tests/events/<handler-name>.test.ts with test cases for:

  • Valid payload parsing
  • Invalid payload rejection (returns err)
  • Edge cases (system notes, ignored actions)

Run bun test to confirm the tests fail.

Step 2: Add Zod Schema

In src/events/parser.ts:

  • Define the Zod schema for the new event payload
  • Export the inferred TypeScript type

Step 3: Add Event Variant

In src/types/events.ts:

  • Add a new variant to the WebhookEvent discriminated union:

``typescript | { readonly kind: "neweventname"; readonly payload: NewPayloadType } ``

Step 4: Update Parser

In src/events/parser.ts:

  • Add a new parsing function (e.g., parseNewEventHook)
  • Add the event type check to parseWebhookPayload

Step 5: Update Router

In src/events/router.ts:

  • Add a new case to the switch (event.kind) block
  • TypeScript will error until you handle the new variant (no default case)

Step 6: Verify

Run bun run check (typecheck + lint + test). All must pass.

Key Rules

  • Every new event variant in the union MUST be handled in the router (exhaustive switch)
  • Payloads MUST be validated through Zod schemas (never trust raw input)
  • The parser function MUST return Result<WebhookEvent, AppError> (never throw)