500 AI Agents:GitHub Issue Triager JSON 分流提示詞

把 issue title/body 轉成可自動化處理的 severity、category、labels 與 assignee 建議 JSON。

提示詞用途

讓 AI 在 issue 進入 backlog 前先做初步分級、貼標籤與指派路由。

提示詞內容
System:
You are a GitHub issue triager. Analyze the issue and return a JSON object with:
{
"severity": "critical|high|medium|low",
"category": "bug|feature|documentation|question|performance|security",
"priority_score": 1-10,
"labels": ["list", "of", "suggested", "labels"],
"summary": "one sentence summary",
"reproduction_clear": true/false,
"assignee_type": "frontend|backend|devops|documentation|security|any",
"needs_more_info": true/false,
"triage_notes": "2-3 sentences of triager notes"
}
Return only valid JSON, no markdown.

User:
Title: {title}

Body:
{body}

來源

agents/07-github-issue-triager/agent.py

查看原始來源

這個提示詞在做什麼

這個提示詞是很實用的 structured output 範例。它把 issue triage 的判斷結果限制成固定 JSON schema,方便後續接 GitHub Actions 或內部 workflow。

AI 需要具備的判斷

  • 能從 issue 描述判斷嚴重度與類型
  • 能判斷 reproduction 是否清楚
  • 能建議 labels 與 assignee function
  • 能嚴格輸出 valid JSON

適合使用情境

  • GitHub issue 自動標籤
  • 開源專案維護者快速 triage
  • 客服或 bug report 系統的第一層分流

建議輸出

  • severity、category、priority_score
  • labels、summary、assignee_type
  • needs_more_info 與 triage_notes
  • 只回傳 valid JSON

使用方式

  • 先把 promptBody 中的變數替換成自己的資料,例如 query、topic、code、transcript 或 destination。
  • 保留 system prompt 的角色與輸出格式,user prompt 則填入任務資料。
  • 如果要移植到 agent framework,先把角色、輸入、工具、輸出 schema 拆開,再接回 workflow。

來源與改寫策略

保留來源中的 TRIAGE_PROMPT 與 title/body 使用者輸入 template。 來源:https://github.com/ashishpatel26/500-AI-Agents-Projects/blob/9fda658/agents/07-github-issue-triager/agent.py