feat(trigger-dev): GitHub AI agent demo (Hookdeck + Trigger.dev)#6
Merged
feat(trigger-dev): GitHub AI agent demo (Hookdeck + Trigger.dev)#6
Conversation
Three AI-powered tasks triggered by GitHub webhooks via Hookdeck: - handle-pr: fetches PR diff, generates review summary with Claude, posts as PR comment - handle-issue: classifies issues with Claude, auto-applies labels - handle-push: summarizes deployments with Claude, posts to Slack Includes two integration patterns: - Pattern A: single Hookdeck connection, fan-out router task - Pattern B: per-event Hookdeck connections with header-based filter rules Shared utilities: Hookdeck event verification, GitHub API helpers, Anthropic SDK wrapper, Slack incoming webhook helper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- setup-hookdeck.sh: idempotent creation of all Hookdeck resources (source, destinations, connections, filters, transformation) for both Pattern A and Pattern B using hookdeck CLI upsert - setup-github-webhook.sh: registers GitHub webhook pointing to Hookdeck source URL, checks for existing webhook to avoid duplicates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- setup.sh walks through all credentials interactively - Auto-generates GITHUB_WEBHOOK_SECRET (random hex) - Auto-detects GITHUB_TOKEN from gh CLI - Auto-detects GITHUB_REPO from current repo - Prompts with help text for manual credentials - Slack webhook URL is optional (task logs to console if skipped) - Supports --check mode to verify .env - Orchestrates deploy + hookdeck setup + github webhook in sequence Also: slack.ts gracefully handles missing SLACK_WEBHOOK_URL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Setup: interactive setup.sh, quoted .env, GITHUB_LABELS from repo, prod-only Trigger keys - Hookdeck: capture source URL from connection output; GitHub webhook -F active (boolean) - trigger-wrapper: verified flag from context when headers absent - Trigger: syncEnvVars + --env-file .env, GITHUB_ACCESS_TOKEN - Tasks: Hookdeck payload types, Anthropic/GitHub env handling - Docs + collaboration build plan Made-with: Cursor
- Summarize any branch by default; GITHUB_PUSH_SUMMARY_DEFAULT_BRANCH_ONLY=true for main-only - Slack message shows branch; README + .env.example document optional env Made-with: Cursor
…okdeck fan-out - Add Mermaid diagrams (vertical), component captions, setup caveat - Frame Pattern A as Trigger fan-out (router) vs Pattern B as Hookdeck fan-out - Update collaboration build plan as needed Made-with: Cursor
…igger.dev co-promotion - Add GUIDE.md: long-form tutorial covering GitHub webhook automation with Hookdeck as the webhook edge and Trigger.dev as the task runtime, with Claude powering PR review, issue labeling, and Slack push summaries - Add images/: annotated screenshots for Hookdeck events, connections, source verification, and Trigger.dev run detail views - Simplify trigger-wrapper.js: remove in-transform HMAC verification; source-level verification (GitHub HMAC) is handled by Hookdeck at the source, making the payload-level check redundant - Remove verifyHookdeckEvent from all tasks and lib/verify-hookdeck.ts; the _hookdeck.verified flag is no longer set by the transform - Update setup-hookdeck.sh to reflect current connection names Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Correct JSON formatting in examples for pull request payloads - Update Hookdeck connections view image to reflect current state - Add new image for Hookdeck connections overview - Remove redundant line in the task routing section for clarity
- Remove outdated URL note regarding repository location - Clarify the behavior of GitHub event delivery when the task router is paused - Minor formatting adjustments for improved readability
- Add images illustrating AI-generated comments for GitHub PRs and issue labeling - Include a screenshot of Slack push summary messages generated by the AI agent - Improve visual documentation for better understanding of task functionalities
- Add JavaScript code snippet demonstrating header extraction and request transformation for GitHub events - Improve documentation clarity on how to bridge GitHub event formats with Trigger.dev expectations
…terminology - Revise section on routing patterns to enhance understanding of task routing and edge processing - Clarify the role of the transform in adapting GitHub event formats for Trigger.dev - Update headings and descriptions for consistency and better readability
- Add Trigger.dev CLI login as a prerequisite and inline prompt before deploy step (npx trigger.dev@latest login required before npm run deploy) - Clarify GITHUB_WEBHOOK_SECRET is user-chosen, suggest openssl rand -hex 32 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plicates On each push to a PR, handle-pr now finds the existing AI review comment (identified by an invisible HTML marker) and updates it in place rather than posting a new comment each time. Adds findExistingComment and updateComment helpers to github.ts. Updates GUIDE.md to document the upsert behaviour and updated code snippet.
2-3 minute talking head + screen recording script covering both routing patterns, with demo script usage notes and production guidance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the video script to walkthrough/README.md, add bash helpers next to it, point demo:* npm scripts at walkthrough/*.sh, and link from the package README. Ignore .plan/ for local planning notes. Made-with: Cursor
…rams Tutorial now lives on the Hookdeck site. Production notes reference README.md Mermaid diagrams instead of the removed in-repo guide. Made-with: Cursor
Collaborator
Author
AI Review SummarySummaryThis PR adds a comprehensive GitHub AI agent demo showcasing integration between Hookdeck (for webhook routing) and Trigger.dev (for task execution). The demo implements three AI-powered workflows: PR review summaries, issue labeling, and deployment notifications to Slack, demonstrating two different routing patterns. Key ObservationsStrengths:
Potential Concerns:
Suggestions for Improvement
This is a well-crafted demo that effectively showcases the integration patterns. The main concern is the potential for confusion around dual processing, but the documentation quality is excellent. Generated by Hookdeck + Trigger.dev |
- Paginate issue comments in findExistingComment; simplify handle-pr upsert (single HTML marker) - README: two-layer verification (source HMAC + Bearer); drop stale verifyHookdeckEvent claims - Remove unused verify-hookdeck.ts stub - Stop tracking .plan collaboration build plan (keep local under .gitignore) Made-with: Cursor
…EADME - Add trigger-dev/ to repo layout and Hookdeck-adjacent Trigger.dev table row - Align feature bullets (PR upsert, push branch default) with task code - Remove stale transform/router verification wording; match trigger-wrapper.js - Replace TODO with optional follow-ups for a complete demo Made-with: Cursor
- Copy X-GitHub-Delivery into payload.github_delivery_id after body spread - Router requires delivery id and uses global Trigger.dev idempotency keys per child task - README: update shared trigger-wrapper when changing hookdeck/trigger-wrapper.js - setup-hookdeck: note filtered connections reference named trigger-wrapper Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Polishes the
trigger-dev/github-ai-agentdemo: interactive setup, Hookdeck + GitHub webhook fixes, Trigger.dev Production deploy + env sync, transformation + task hardening, docs.Notes
pull_requestopened/synchronizeevents — the AI review task runs the same unless we filterpull_request.draftin code.Test plan
npm run setup/npm run deployfrom demo folderMade with Cursor