Skip to content

mastra-ai/mastra-triage

Repository files navigation

Triage Nurse

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.

Overview

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.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         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)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Workflows

1. Issue Triage (triageWorkflow)

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

2. Discord to GitHub (discordToGithubWorkflow)

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

3. Discord Sync (discordSyncWorkflow)

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

4. GitHub Issue Manager (githubIssueManagerWorkflow)

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 up label when user has replied
  • Checks both GitHub comments and synced Discord messages

Manual Trigger Workflows (Reporting)

⚠️ 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.

5. Forum Thread Analysis (forumThreadAnalysisWorkflow)

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

6. Discord Analysis (discordAnalysisWorkflow)

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 severity
  • posts-dump.json - Raw posts data
  • categorized-posts-dump.json - Posts grouped by category

Agents

Classification Agent

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

Effort/Impact Agent

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

Thread Classifier Agent (Manual Reporting)

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

Analysis Agent (Manual Reporting)

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

Engineering Squads

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

Project Structure

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

Environment Variables

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

Development

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build for production
pnpm build

Related Repositories

  • mastra-ai/mastra β€” Main Mastra framework (contains the GitHub Actions triggers)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •