|
| 1 | +# Changelog generator using the Claude Agent SDK and Trigger.dev |
| 2 | + |
| 3 | +An AI agent that explores GitHub commits, investigates unclear changes by fetching diffs on demand, and generates developer-friendly changelogs. Built with the Claude Agent SDK and Trigger.dev. |
| 4 | + |
| 5 | +## Tech Stack |
| 6 | + |
| 7 | +- **[Next.js](https://nextjs.org)** – Frontend framework using App Router |
| 8 | +- **[Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk)** – Anthropic's agent SDK for building AI agents with custom tools |
| 9 | +- **[Trigger.dev](https://trigger.dev)** – Background task orchestration with real-time streaming to the frontend, observability, and deployment. |
| 10 | +- **[Octokit](https://github.com/octokit/octokit.js)** – GitHub API client for fetching commits and diffs. |
| 11 | + |
| 12 | +## Demo |
| 13 | + |
| 14 | +<video src="https://content.trigger.dev/claude-changelog-generator.mp4" controls autoplay loop muted width="100%"></video> |
| 15 | + |
| 16 | +## Running the project locally |
| 17 | + |
| 18 | +1. **Install dependencies** |
| 19 | + |
| 20 | + ```bash |
| 21 | + npm install |
| 22 | + ``` |
| 23 | + |
| 24 | +2. **Configure environment variables** |
| 25 | + |
| 26 | + ```bash |
| 27 | + cp .env.example .env |
| 28 | + ``` |
| 29 | + |
| 30 | + - `TRIGGER_SECRET_KEY` – From [Trigger.dev dashboard](https://cloud.trigger.dev/) |
| 31 | + - `TRIGGER_PROJECT_REF` – Your project ref (starts with `proj_`) |
| 32 | + - `ANTHROPIC_API_KEY` – From [Anthropic Console](https://console.anthropic.com/) |
| 33 | + - `GITHUB_TOKEN` (optional) – For private repos, needs `repo` scope |
| 34 | + |
| 35 | +3. **Start development servers** |
| 36 | + |
| 37 | + ```bash |
| 38 | + # Terminal 1: Next.js |
| 39 | + npm run dev |
| 40 | + |
| 41 | + # Terminal 2: Trigger.dev |
| 42 | + npx trigger.dev@latest dev |
| 43 | + ``` |
| 44 | + |
| 45 | +4. Open [http://localhost:3000](http://localhost:3000) in your browser to see the demo |
| 46 | + |
| 47 | +## Features |
| 48 | + |
| 49 | +- **Two-phase analysis** – Lists all commits first, then selectively fetches diffs only for ambiguous ones to minimize token usage |
| 50 | +- **Custom MCP tools** – `list_commits` and `get_commit_diff` called autonomously by Claude |
| 51 | +- **Real-time streaming** – Changelog streams to the frontend as it's generated via Trigger.dev Realtime |
| 52 | +- **Live observability** – Agent phase, turn count, and tool calls broadcast via run metadata |
| 53 | +- **Markdown rendering** – Streamed output formatted with [Streamdown](https://github.com/vercel/streamdown) and Shiki syntax highlighting |
| 54 | +- **Private repo support** – Optional GitHub token for private repositories |
| 55 | + |
| 56 | +## Relevant Files |
| 57 | + |
| 58 | +- [trigger/generate-changelog.ts](trigger/generate-changelog.ts) – Main task with MCP tools |
| 59 | +- [trigger/changelog-stream.ts](trigger/changelog-stream.ts) – Stream definition |
| 60 | +- [app/api/generate-changelog/route.ts](app/api/generate-changelog/route.ts) – API endpoint |
| 61 | +- [app/response/[runId]/page.tsx](app/response/[runId]/page.tsx) – Streaming display page |
0 commit comments