An AI-powered triage assistant for the Mastra open source framework. This service automates GitHub issue management by classifying, triaging, and syncing issues with Discord conversations.
This project runs as a Mastra Cloud deployment and is triggered by GitHub Actions workflows in the main Mastra repository. It uses AI agents to classify issues and assign them to the appropriate engineering squads.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GitHub Actions (mastra-ai/mastra) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β issue-triage.yml β Triggered on: issues [opened, reopened] β
β cron-discord-triage.yml β Triggered on: schedule (cron) β
β cron-discord-github-sync.yml β Triggered on: schedule (cron) β
β cron-github-issues-follow-up.yml β Triggered on: schedule (cron) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mastra Cloud (this project) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Workflows (GitHub Actions triggered): β
β β’ triageWorkflow β Triage new GitHub issues β
β β’ discordToGithubWorkflow β Create GitHub issues from Discord threads β
β β’ discordSyncWorkflow β Sync Discord messages to GitHub issues β
β β’ githubIssueManagerWorkflow β Add follow-up labels to stale issues β
β β
β Workflows (Manual trigger for reporting): β
β β’ forumThreadAnalysisWorkflow β Analyze Discord threads for reporting β
β β’ discordAnalysisWorkflow β Categorize Discord posts for reporting β
β β
β Agents: β
β β’ classificationAgent β Labels issues by product area β
β β’ effortImpactAgent β Estimates effort and impact β
β β’ threadClassifierAgent β Classifies threads (manual reporting) β
β β’ analysisAgent β Analyzes categories (manual reporting) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Trigger: issue-triage.yml β runs when a GitHub issue is opened or reopened
Flow:
New Issue Created
β
βΌ
ββββββββββββββββββββ
β Fetch Issue Data β β Get title and body from GitHub API
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Fetch Labels β β Get available labels from GitHub repo
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Classify Area β β AI picks best area labels (e.g., "area: workflows")
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Label Squad β β Derive squad from area (e.g., "trio-tnt")
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Estimate Effort β β AI estimates effort & impact labels
β & Impact β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Apply Labels β β Add all labels, post welcome comment
ββββββββββββββββββββ
Actions:
- Adds labels:
status: needs triage,[area],[squad],[effort],[impact] - Posts a welcome comment with next steps
Trigger: cron-discord-triage.yml β runs on a cron schedule
Flow:
Cron Trigger
β
βΌ
βββββββββββββββββββββββ
β Fetch Forum Posts β β Get recent threads from Discord help forum
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββ΄ββββββ
β For Each β
β Post β
βββββββ¬ββββββ
β
βΌ
βββββββββββββββββββββββ
β Check Existing Issueβ β Search GitHub for existing issue with post ID
ββββββββββββ¬βββββββββββ
β
βββββββ΄ββββββ
β Branch β
βββββββ¬ββββββ
β
ββββββββΌβββββββββββββββ
β β β
βΌ βΌ βΌ
[Has [No Issue & [No Issue &
Issue] No skip-github Has skip-github
tag] tag]
β β β
β βΌ β
β βββββββββββββββββ β
β βFetch Discord β β
β βContent + Imagesβ β
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β βββββββββββββββββ β
β β Classify Area β β AI picks best area labels
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β βββββββββββββββββ β
β β Label Squad β β Derive squad from area
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β βββββββββββββββββ β
β βEstimate Effortβ β AI estimates effort & impact
β β& Impact β β
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β βββββββββββββββββ β
β βCreate GitHub β β
β βIssue β β
β βββββββββ¬ββββββββ β
β β β
β βΌ β
β βββββββββββββββββ β
β βPost Discord β β Reply to thread with issue link
β βMessage β β
β βββββββββββββββββ β
β β
ββββββββββββββββββββββββββ
Actions:
- Creates GitHub issues from Discord help forum threads
- Labels issues:
status: needs triage,discord,[area],[squad],[effort],[impact] - Posts a reply to the Discord thread with the GitHub issue link
Trigger: cron-discord-github-sync.yml β runs on a cron schedule
Flow:
Cron Trigger
β
βΌ
ββββββββββββββββββββββββ
β Fetch Issues with β β Get open issues with "discord" label
β "discord" Label β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Filter by Status β β Only "waiting for author" or "needs reproduction"
ββββββββββββ¬ββββββββββββ
β
βΌ
βββββββ΄ββββββ
β For Each β (concurrency: 10)
β Issue β
βββββββ¬ββββββ
β
βΌ
ββββββββββββββββββββββββ
β Extract Discord β β Parse thread ID from issue body
β Thread ID β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Fetch Discord β β Get messages after last synced message
β Messages β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Update/Create Sync β β Collapsible comment with all Discord messages
β Comment β
ββββββββββββββββββββββββ
Actions:
- Syncs new Discord messages to GitHub issues as a collapsible comment
- Tracks last synced message to avoid duplicates
- Records whether last author is a Mastra team member
Trigger: cron-github-issues-follow-up.yml β runs on a cron schedule
Flow:
Cron Trigger
β
βΌ
βββββββββββββββββββββββββββ
β Fetch Issues with β β "waiting for author" or "needs reproduction"
β Status Labels β
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββ΄ββββββ
β For Each β (concurrency: 10)
β Issue β
βββββββ¬ββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Check Last Comment β β Is last commenter a Mastra team member?
β Author β
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Check Discord Sync β β Is last Discord author a team member?
β Tracker β
ββββββββββββ¬βββββββββββββββ
β
βββββββ΄ββββββ
βLast authorβ
βis NOT teamβ
β member? β
βββββββ¬ββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Add "status: needs β β Flag for team to follow up
β follow up" Label β
βββββββββββββββββββββββββββ
Actions:
- Monitors issues waiting for author response
- Adds
status: needs follow uplabel when user has replied - Checks both GitHub comments and synced Discord messages
β οΈ DO NOT DELETE - These workflows are intentionally not triggered by GitHub Actions.
The following workflows are invoked manually by team members (Romain and Abhi) for generating periodic reports on Discord forum activity. They are not "dead code" - they serve an important reporting function.
Trigger: Manual invocation only
Purpose: Analyzes Discord help forum threads to identify trends, severity distribution, and key issues across different product categories.
Flow:
Manual Trigger
β
βΌ
βββββββββββββββββββββββββββ
β Fetch Forum Threads β β Get threads from Discord help forum
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββ΄ββββββ
β For Each β (concurrency: 5)
β Thread β
βββββββ¬ββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Fetch All Messages β β Get complete conversation from thread
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Classify Thread β β AI classifies type, category, severity
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Generate Report β β Create markdown table with statistics
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Save to File β β forum-thread-analysis.md
βββββββββββββββββββββββββββ
Output:
forum-thread-analysis.md- Comprehensive report with:- Summary statistics (by type, by severity)
- Category breakdown with key issues
- Detailed thread analysis table
Trigger: Manual invocation only
Purpose: Categorizes Discord help forum threads and generates severity reports for each category to help identify pain points.
Flow:
Manual Trigger
β
βΌ
βββββββββββββββββββββββββββ
β Fetch Forum Posts β β Get threads from Discord help forum
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Fetch First Message β β Get starter message for each thread
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Categorize Threads β β AI groups threads by category
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Analyze Categories β β AI summarizes each category
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Save Reports β β category-summary.md, JSON dumps
βββββββββββββββββββββββββββ
Output:
category-summary.md- Summary table with category counts and severityposts-dump.json- Raw posts datacategorized-posts-dump.json- Posts grouped by category
Used by both triageWorkflow and discordToGithubWorkflow to classify issues.
Model: openai/gpt-4o-mini
Capabilities:
- Analyzes issue/thread title and content
- Picks all appropriate area labels with confidence levels
- Returns:
labels[],reasoning
Used by both triageWorkflow and discordToGithubWorkflow to estimate issue complexity.
Model: openai/gpt-4o-mini
Capabilities:
- Estimates effort required to resolve the issue
- Estimates impact/value of resolving the issue
- Returns:
effortLabel,impactLabel,reasoning
Used by forumThreadAnalysisWorkflow for detailed thread analysis.
Model: openrouter/google/gemini-3-pro-preview
Capabilities:
- Analyzes complete Discord forum thread conversations
- Classifies threads as Bug, Feature Request, or Question
- Assigns severity scores (1-10) based on impact
- Provides concise summaries of thread content
Used by discordAnalysisWorkflow for category-based analysis.
Model: openai/gpt-4o-mini
Capabilities:
- Categorizes Discord messages into product areas
- Generates severity-based summaries for each category
| Squad | Areas of Ownership |
|---|---|
| trio-tnt | Workflows, Networks, Storage, RAG, Streaming, Server Cache, Pubsub |
| trio-wp | Playground, CI/Tests, Bundler, Deployer, CLI, Client SDK |
| trio-tb | Agents, Tools, Memory, MCP, Processors |
| trio-tron | Voice, Cloud Admin, Cloud Runner, Cloud Builder, Cloud Infrastructure |
| trio-tracery | Evals, Observability |
| Growth | Examples, Docs, Website, Analytics |
src/mastra/
βββ index.ts # Mastra instance configuration
βββ constants.ts # Product areas and ownership definitions
βββ constants/
β βββ members.ts # GitHub org members
βββ agents/
β βββ classification.ts # Classification & effort/impact agents
β βββ analysis.ts # Discord analysis agent (manual reporting)
β βββ thread-classifier.ts # Thread classifier agent (manual reporting)
βββ helpers/
β βββ client.ts # Discord client initialization (manual reporting)
β βββ messages.ts # Discord message fetching utilities (manual reporting)
βββ workflows/
β βββ triage.ts # GitHub issue triage workflow
β βββ analysis.ts # Discord analysis workflow (manual reporting)
β βββ forum-thread-analysis.ts # Forum thread analysis workflow (manual reporting)
β βββ discordSync/ # Discord β GitHub message sync workflow
β β βββ index.ts
β βββ discordToGithub/ # Discord β GitHub issue creation workflow
β β βββ index.ts # Main workflow
β β βββ createGithubIssue.ts # Sub-workflow: create issue & post to Discord
β βββ classification/ # Issue classification workflow
β β βββ index.ts # Classify area, squad, effort & impact
β βββ githubIssueManager/ # Issue follow-up management workflow
β βββ index.ts
β βββ helpers.ts # Discord sync comment helpers
βββ shared/
β βββ discord.ts # Discord client singleton
β βββ github.ts # GitHub client & label fetching
β βββ post.ts # Discord post schema
βββ tools/
βββ fetchForumPosts.ts # Discord forum fetching tool
| Variable | Description |
|---|---|
DISCORD_BOT_TOKEN |
Discord bot token for accessing the Mastra server |
GITHUB_PERSONAL_ACCESS_TOKEN |
GitHub token for issue management |
MASTRA_JWT_SECRET |
JWT secret for Mastra Cloud authentication |
MASTRA_DEV |
Set to "true" for debug logging |
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Build for production
pnpm build- mastra-ai/mastra β Main Mastra framework (contains the GitHub Actions triggers)