Skip to content

feat(trigger-dev): GitHub AI agent demo (Hookdeck + Trigger.dev)#6

Draft
leggetter wants to merge 6 commits intomainfrom
feat/trigger-dev-github-ai-agent
Draft

feat(trigger-dev): GitHub AI agent demo (Hookdeck + Trigger.dev)#6
leggetter wants to merge 6 commits intomainfrom
feat/trigger-dev-github-ai-agent

Conversation

@leggetter
Copy link
Collaborator

Summary

Polishes the trigger-dev/github-ai-agent demo: interactive setup, Hookdeck + GitHub webhook fixes, Trigger.dev Production deploy + env sync, transformation + task hardening, docs.

Notes

  • Draft PRs still emit pull_request opened / synchronize events — the AI review task runs the same unless we filter pull_request.draft in code.

Test plan

  • npm run setup / npm run deploy from demo folder
  • Issue labeler / PR review / push → Slack as applicable

Made with Cursor

leggetter and others added 4 commits March 19, 2026 18:28
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
@leggetter
Copy link
Collaborator Author

AI Review Summary

Summary

This PR adds a comprehensive GitHub AI agent demo showcasing Hookdeck + Trigger.dev integration. The demo includes interactive setup scripts, webhook handling, AI-powered automation tasks (PR reviews, issue labeling, deployment summaries), and documentation covering two different architectural patterns for webhook routing.

Key Observations

Strengths:

  • Comprehensive automation: The setup scripts handle end-to-end configuration (Trigger.dev deployment, Hookdeck resources, GitHub webhooks) with proper ordering and idempotency
  • Real-world use cases: AI-powered PR reviews, issue labeling, and deployment summaries are genuinely useful automation examples
  • Multiple patterns: Shows both fan-out (single entry point) and direct routing approaches with clear trade-offs
  • Security-focused: Three-layer verification chain (GitHub HMAC → Hookdeck verification → task-level validation)
  • Production-ready: Proper error handling, environment variable management, and deployment strategies

Potential Concerns:

  • File size: The .plan/ file is 932 lines and appears to be build documentation rather than runtime code - consider if this belongs in the repo
  • Complexity: While comprehensive, the setup requires 6+ external services and API keys, which may be a barrier for quick experimentation
  • Production-only: Hardcoded to production environment limits development workflow flexibility
  • Draft PR behavior: The note about draft PRs still triggering reviews should be addressed in code rather than left as documentation

Suggestions for Improvement

  1. Reduce complexity for first-time users: Consider a simplified "quick start" path with fewer dependencies (maybe just one task type) alongside the full demo
  2. Environment flexibility: Allow development environment usage with appropriate configuration switches
  3. Filter draft PRs: Add the draft PR check mentioned in the description: if (payload.pull_request?.draft) return;
  4. Optimize file structure: Move the large .plan/ file to documentation or remove it if it's just build notes
  5. Add validation: Include basic validation in setup scripts to verify API keys work before proceeding with full setup

The demo effectively showcases both platforms' capabilities and provides a solid foundation for developers to build GitHub automation workflows.


Generated by Hookdeck + Trigger.dev

- 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
@leggetter
Copy link
Collaborator Author

AI Review Summary

Summary

This PR adds a comprehensive GitHub AI agent demo showcasing the integration between Hookdeck (webhook routing) and Trigger.dev (task execution). The demo includes three AI-powered GitHub automation tasks: PR code review summaries, issue labeling, and deployment notifications to Slack, with two different architectural patterns for connecting the services.

Key Observations

Strengths:

  • Excellent documentation and developer experience with complete automation scripts and clear setup instructions
  • Well-architected comparison of two integration patterns (fan-out vs. Hookdeck routing) with clear trade-offs
  • Comprehensive security model with three-layer verification chain
  • Production-ready configuration with proper environment variable management and idempotent setup scripts
  • Real-world utility - the tasks solve actual developer workflow problems

Areas of Concern:

  • File size and complexity: The build plan document is 932 lines, which may indicate over-engineering for a demo
  • Production-only deployment: Hardcoded to Production environment limits development flexibility and could be risky for demo purposes
  • Multiple external dependencies: Requires accounts/keys for 5+ services (Hookdeck, Trigger.dev, GitHub, Anthropic, Slack)
  • Error handling gaps: Setup scripts use set -euo pipefail but may not gracefully handle partial failures during multi-step setup

Suggestions for Improvement

  1. Consider dev environment support: Add a --dev flag or separate dev configuration to allow safer experimentation without affecting production resources

  2. Add rollback capability: Include cleanup scripts (npm run cleanup) to remove created webhooks and Hookdeck resources for easier iteration

  3. Simplify initial experience: Consider a "quick start" mode with fewer integrations (maybe just PR reviews) to lower the barrier to entry

  4. Add validation steps: Include health checks in setup scripts to verify each service integration before proceeding to the next

  5. Break down the build plan: The 900+ line planning document suggests this might benefit from being split into multiple smaller, focused demos

The technical implementation looks solid and the automation is impressive, but consider whether the scope might be too broad for a single demo.


Generated by Hookdeck + Trigger.dev

…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
@leggetter
Copy link
Collaborator Author

AI Review Summary

Summary

This PR introduces a comprehensive GitHub AI agent demo integrating Hookdeck and Trigger.dev. It includes setup automation, two different webhook routing patterns, and three AI-powered GitHub automation tasks (PR review, issue labeling, and deployment summaries to Slack).

Key Observations

Strengths:

  • Excellent documentation: The extensive plan document and README provide clear architectural guidance and explain two distinct integration patterns
  • Production-ready automation: Setup scripts handle the complete workflow from deployment to webhook registration
  • Real-world utility: The three demo tasks (AI PR reviews, issue labeling, Slack summaries) solve actual developer pain points
  • Security-conscious: Implements proper verification chain (GitHub HMAC → Hookdeck → Trigger.dev Bearer token → task-level checks)
  • Educational value: Comparing Pattern A (fan-out in code) vs Pattern B (fan-out in Hookdeck) teaches architectural trade-offs

Potential Concerns:

  • Complexity: The extensive documentation and dual patterns might overwhelm newcomers - consider a "quick start" path
  • Resource duplication: Setup creates both patterns simultaneously, which could cause confusion or duplicate processing
  • Production-only deployment: No local dev workflow shown, which limits development iteration
  • External dependencies: Requires multiple API keys (GitHub, Anthropic, Slack, Hookdeck, Trigger.dev) which increases setup friction

Suggestions for Improvement

  1. Simplify initial experience: Consider defaulting to one pattern in the main README, with the other as an "advanced" section
  2. Add local development guidance: Show how developers can test changes before deploying to production
  3. Include troubleshooting section: Common issues with webhook delivery, API rate limits, or authentication failures
  4. Consider a minimal example: A single-task version that newcomers can get running quickly before exploring the full demo
  5. Add cleanup instructions: How to tear down resources when done experimenting

The demo effectively showcases both platforms' capabilities and provides genuine developer value. The thorough documentation is impressive, though the complexity might benefit from a more gradual onboarding experience.


Generated by Hookdeck + Trigger.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant