Skip to content

Commit 2d5c9da

Browse files
authored
Merge pull request #35 from hookdeck/feat/hookdeck-skills-restructure
feat: Restructure Hookdeck skills and add dynamic test discovery
2 parents b983d0c + 20678cb commit 2d5c9da

49 files changed

Lines changed: 707 additions & 1165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "run_all=true" >> $GITHUB_OUTPUT
2929
echo "has_changes=true" >> $GITHUB_OUTPUT
3030
# Return all providers as JSON array
31-
PROVIDERS=$(ls -d skills/*-webhooks skills/hookdeck-event-gateway 2>/dev/null | xargs -n1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))')
31+
PROVIDERS=$(ls -d skills/*-webhooks 2>/dev/null | xargs -n1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))')
3232
echo "providers=$PROVIDERS" >> $GITHUB_OUTPUT
3333
exit 0
3434
fi
@@ -45,7 +45,7 @@ jobs:
4545
grep -E '^skills/[^/]+/' | \
4646
sed 's|skills/\([^/]*\)/.*|\1|' | \
4747
sort -u | \
48-
grep -E '(-webhooks|hookdeck-event-gateway)$' || true)
48+
grep -E '(-webhooks)$' || true)
4949
5050
if [ -z "$CHANGED_PROVIDERS" ]; then
5151
echo "No skill changes detected"

AGENTS.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ webhook-skills/
1515
├── TESTING.md # Testing documentation
1616
├── LICENSE
1717
├── scripts/
18-
│ ├── test-all-examples.sh # Run all example tests
18+
│ ├── test-examples.sh # Run example tests (all or specific skills)
1919
│ └── test-agent-scenario.sh # Run agent integration tests
2020
├── .github/
2121
│ └── workflows/
@@ -701,10 +701,14 @@ See [TESTING.md](TESTING.md) for comprehensive testing documentation.
701701

702702
**Run example tests:**
703703
```bash
704-
# All examples
705-
./scripts/test-all-examples.sh
704+
# All skills with examples
705+
./scripts/test-examples.sh
706706

707-
# Single example
707+
# Specific skill(s)
708+
./scripts/test-examples.sh stripe-webhooks
709+
./scripts/test-examples.sh stripe-webhooks github-webhooks
710+
711+
# Single example directly
708712
cd skills/{provider}-webhooks/examples/express && npm test
709713
```
710714

@@ -788,7 +792,7 @@ cd skills/{provider}-webhooks/examples/nextjs && npm test
788792
cd skills/{provider}-webhooks/examples/fastapi && pytest test_webhook.py -v
789793

790794
# Run all example tests
791-
./scripts/test-all-examples.sh
795+
./scripts/test-examples.sh
792796
```
793797

794798
Ensure test scripts exit properly (e.g. `"test": "vitest run"` not `"vitest"`).

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ Framework-agnostic best practices for webhook handling, applicable across any we
5858

5959
### Webhook Infrastructure Skills
6060

61-
Skills for setting up reliable webhook infrastructure with routing, replay, and monitoring.
61+
Skills for webhook infrastructure products — routing, queuing, delivery, and observability.
6262

6363
| Skill | What It Does |
6464
|-------|--------------|
65-
| [`hookdeck-event-gateway`](skills/hookdeck-event-gateway/) | Set up Hookdeck Event Gateway for webhook routing, retry, replay, and monitoring |
65+
| [`hookdeck-event-gateway`](skills/hookdeck-event-gateway/) | Webhook infrastructure that replaces your queue — guaranteed delivery, retries, rate limiting, replay, observability |
66+
| [`hookdeck-event-gateway-webhooks`](skills/hookdeck-event-gateway-webhooks/) | Verify `x-hookdeck-signature` and handle webhooks forwarded by the Hookdeck Event Gateway |
67+
| [`outpost`](skills/outpost/) | Send webhooks and events to user-preferred destinations (HTTP, SQS, RabbitMQ, Pub/Sub, EventBridge, Kafka) |
6668

6769
## Quick Start
6870

TESTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ npm test
3838
Use the test runner script to run all examples:
3939

4040
```bash
41-
./scripts/test-all-examples.sh
41+
# All skills with examples
42+
./scripts/test-examples.sh
43+
44+
# Specific skill(s)
45+
./scripts/test-examples.sh stripe-webhooks
46+
./scripts/test-examples.sh stripe-webhooks github-webhooks
4247
```
4348

4449
### CI Pipeline
@@ -151,17 +156,17 @@ Validate that AI agents (Cursor, Claude, Copilot) can successfully use these ski
151156

152157
---
153158

154-
#### Scenario 4: Hookdeck Event Gateway Setup
159+
#### Scenario 4: Hookdeck Event Gateway Webhooks Setup
155160

156161
**Setup:**
157162
1. Existing Express app with webhook endpoint
158-
2. Install the skill: `npx skills add hookdeck/webhook-skills --skill hookdeck-event-gateway`
163+
2. Install the skill: `npx skills add hookdeck/webhook-skills --skill hookdeck-event-gateway-webhooks`
159164

160165
**Prompt:**
161166
> "I'm receiving webhooks through Hookdeck. Add signature verification for Hookdeck's signature."
162167
163168
**Expected Behaviors:**
164-
- [ ] Agent reads `hookdeck-event-gateway/SKILL.md`
169+
- [ ] Agent reads `hookdeck-event-gateway-webhooks/SKILL.md`
165170
- [ ] Agent references `references/verification.md`
166171
- [ ] Generated code verifies `x-hookdeck-signature` header
167172
- [ ] Generated code uses base64-encoded HMAC SHA-256

providers.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ providers:
301301
providers and forwards them to your app with an x-hookdeck-signature header.
302302
Uses HMAC-SHA256 with base64 encoding. Signed content format is the raw request body.
303303
testScenario:
304-
skillName: hookdeck-event-gateway
305304
events:
306305
- webhooks via Event Gateway
307306
prompt: >
Lines changed: 110 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
#!/bin/bash
22

3-
# Test All Webhook Skills Examples
4-
# This script runs tests for all example applications across providers and frameworks.
3+
# Test Webhook Skills Examples
4+
# Runs tests for example applications across skills and frameworks.
5+
#
6+
# Usage:
7+
# ./scripts/test-examples.sh # Test all skills that have examples
8+
# ./scripts/test-examples.sh stripe-webhooks # Test one specific skill
9+
# ./scripts/test-examples.sh stripe-webhooks github-webhooks # Test multiple skills
10+
#
11+
# Discovery: Finds skills by looking for skills/*/examples/ directories.
512

613
set -e
714

@@ -13,6 +20,7 @@ SKILLS_DIR="$ROOT_DIR/skills"
1320
RED='\033[0;31m'
1421
GREEN='\033[0;32m'
1522
YELLOW='\033[1;33m'
23+
BLUE='\033[0;34m'
1624
NC='\033[0m' # No Color
1725

1826
# Track results
@@ -21,16 +29,107 @@ FAILED=0
2129
SKIPPED=0
2230
FAILED_TESTS=()
2331

24-
# Providers to test
25-
PROVIDERS=("stripe-webhooks" "shopify-webhooks" "github-webhooks" "hookdeck-event-gateway" "deepgram-webhooks")
26-
2732
# Frameworks to test
2833
FRAMEWORKS=("express" "nextjs" "fastapi")
2934

35+
usage() {
36+
echo "Usage: $0 [skill-name ...]"
37+
echo ""
38+
echo "Test webhook skill example applications."
39+
echo ""
40+
echo " No arguments Discover and test all skills that have examples/"
41+
echo " skill-name ... Test only the specified skill(s)"
42+
echo ""
43+
echo "Examples:"
44+
echo " $0 # Test all"
45+
echo " $0 stripe-webhooks # Test one"
46+
echo " $0 stripe-webhooks github-webhooks # Test multiple"
47+
echo ""
48+
echo "Options:"
49+
echo " -h, --help Show this help message"
50+
echo ""
51+
52+
# Show available skills with examples
53+
echo "Skills with examples:"
54+
for dir in "$SKILLS_DIR"/*/examples; do
55+
if [ -d "$dir" ]; then
56+
local skill_name
57+
skill_name=$(basename "$(dirname "$dir")")
58+
# List which frameworks are available
59+
local frameworks=()
60+
for fw in "${FRAMEWORKS[@]}"; do
61+
if [ -d "$dir/$fw" ]; then
62+
frameworks+=("$fw")
63+
fi
64+
done
65+
echo " $skill_name (${frameworks[*]})"
66+
fi
67+
done
68+
exit 0
69+
}
70+
71+
# Parse arguments
72+
REQUESTED_SKILLS=()
73+
while [[ $# -gt 0 ]]; do
74+
case $1 in
75+
-h|--help)
76+
usage
77+
;;
78+
-*)
79+
echo -e "${RED}Unknown option: $1${NC}"
80+
echo ""
81+
usage
82+
;;
83+
*)
84+
REQUESTED_SKILLS+=("$1")
85+
shift
86+
;;
87+
esac
88+
done
89+
90+
# Discover skills with examples
91+
discover_skills() {
92+
local skills=()
93+
for dir in "$SKILLS_DIR"/*/examples; do
94+
if [ -d "$dir" ]; then
95+
skills+=("$(basename "$(dirname "$dir")")")
96+
fi
97+
done
98+
# Sort alphabetically
99+
IFS=$'\n' skills=($(sort <<<"${skills[*]}")); unset IFS
100+
echo "${skills[@]}"
101+
}
102+
103+
# Determine which skills to test
104+
if [ ${#REQUESTED_SKILLS[@]} -gt 0 ]; then
105+
# Validate requested skills exist and have examples
106+
SKILLS=()
107+
for skill in "${REQUESTED_SKILLS[@]}"; do
108+
if [ ! -d "$SKILLS_DIR/$skill" ]; then
109+
echo -e "${RED}Error: Skill '$skill' not found in $SKILLS_DIR/${NC}"
110+
exit 1
111+
fi
112+
if [ ! -d "$SKILLS_DIR/$skill/examples" ]; then
113+
echo -e "${RED}Error: Skill '$skill' has no examples/ directory${NC}"
114+
exit 1
115+
fi
116+
SKILLS+=("$skill")
117+
done
118+
else
119+
# Discover all skills with examples
120+
read -ra SKILLS <<< "$(discover_skills)"
121+
fi
122+
123+
if [ ${#SKILLS[@]} -eq 0 ]; then
124+
echo -e "${YELLOW}No skills with examples found.${NC}"
125+
exit 0
126+
fi
127+
30128
echo "========================================"
31129
echo " Webhook Skills Example Tests"
32130
echo "========================================"
33131
echo ""
132+
echo -e "Skills to test: ${BLUE}${#SKILLS[@]}${NC} (${SKILLS[*]})"
34133

35134
# Function to run Node.js tests (Express/Next.js)
36135
run_node_tests() {
@@ -165,22 +264,17 @@ run_python_tests() {
165264
deactivate
166265
}
167266

168-
# Run tests for each provider
169-
for provider in "${PROVIDERS[@]}"; do
170-
provider_dir="$SKILLS_DIR/$provider"
171-
172-
if [ ! -d "$provider_dir" ]; then
173-
echo "Provider $provider not found, skipping..."
174-
continue
175-
fi
267+
# Run tests for each skill
268+
for skill in "${SKILLS[@]}"; do
269+
skill_dir="$SKILLS_DIR/$skill"
176270

177271
echo ""
178-
echo "Testing $provider"
272+
echo "Testing $skill"
179273
echo "----------------------------------------"
180274

181275
for framework in "${FRAMEWORKS[@]}"; do
182-
example_dir="$provider_dir/examples/$framework"
183-
test_name="$provider/$framework"
276+
example_dir="$skill_dir/examples/$framework"
277+
test_name="$skill/$framework"
184278

185279
if [ ! -d "$example_dir" ]; then
186280
echo -n " Testing $test_name... "

skills/chargebee-webhooks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ We recommend installing the [webhook-handler-patterns](https://github.com/hookde
240240
- [openai-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/openai-webhooks) - OpenAI webhook handling
241241
- [paddle-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/paddle-webhooks) - Paddle billing webhook handling
242242
- [webhook-handler-patterns](https://github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns) - Handler sequence, idempotency, error handling, retry logic
243-
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Production webhook infrastructure (routing, replay, monitoring)
243+
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers

skills/clerk-webhooks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@ We recommend installing the [webhook-handler-patterns](https://github.com/hookde
230230
- [openai-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/openai-webhooks) - OpenAI webhook handling
231231
- [paddle-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/paddle-webhooks) - Paddle billing webhook handling
232232
- [webhook-handler-patterns](https://github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns) - Handler sequence, idempotency, error handling, retry logic
233-
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Production webhook infrastructure (routing, replay, monitoring)
233+
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers

skills/cursor-webhooks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ For production-ready webhook handling, also use the webhook-handler-patterns ski
192192
- [shopify-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/shopify-webhooks) - Shopify webhook handling
193193
- [openai-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/openai-webhooks) - OpenAI webhook handling
194194
- [webhook-handler-patterns](https://github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns) - Idempotency, error handling, retry logic
195-
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Production webhook infrastructure
195+
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers

skills/deepgram-webhooks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ For production handlers, install the patterns skill alongside this one. Key refe
175175
- [shopify-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/shopify-webhooks) - Shopify store webhooks
176176
- [github-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/github-webhooks) - GitHub repository webhooks
177177
- [webhook-handler-patterns](https://github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns) - Idempotency, error handling, retry logic
178-
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Production webhook infrastructure (reliability, monitoring, replay)
178+
- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers

0 commit comments

Comments
 (0)