跳到內容

GitHub Action

這一頁介紹 GitHub Pull Request 中顯示的 PR Report。如果你只想先完成本機 CLI setup,請從 安裝 開始;當需要讓 reviewer 看到 Agent Note summary 時再回到這裡。

先在你的儲存庫裡執行一次:

Terminal window
npx agent-note init --agent claude

這樣就會替你建立 PR 報告 workflow:

.github/workflows/agentnote-pr-report.yml
name: Agent Note PR Report
on:
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: wasabeef/AgentNote@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

這樣就完成了。每個 PR 都會得到一份 AI 會話報告。

InputDefault說明
basePR 的 base branch用來比較的分支
pr_outputdescriptionPR 報告的輸出位置:descriptioncommentnone
prompt_detailcompactPR 報告中 prompt 歷史的詳細程度:compact 保持報告聚焦,full 顯示所有已保存 prompt
dashboardfalse執行 Dashboard Mode,而不是 PR Report Mode。通常由 agent-note init --dashboard 產生
Terminal window
npx agent-note init --agent claude --dashboard
Output類型說明
overall_ai_rationumber整個 PR 的 AI Ratio (0-100)
overall_methodstringlinefilemixednone
tracked_commitsnumber帶有 agent-note 資料的 commit 數
total_commitsnumberPR 內的 commit 總數
total_promptsnumber所有 commit 的 prompt 總數
jsonstring完整的結構化報告
markdownstring已渲染的 Markdown 報告
should_deployboolean stringDashboard Mode 輸出,用來告訴呼叫方 workflow 是否需要發布 Pages

PR 報告包含:

  • HeaderTotal AI Ratio 與進度條,以及下一行的 Model
  • Reviewer Context — 面向 AI Review tool 的 hidden Markdown comment,由通用 changed area 分組、review focus 和最新相關 intent signals 生成
  • 表格 — 每個 commit 的 AI Ratio、prompt 數與檔案列表
  • Prompts — 可折疊的 📝 Context🧑 Prompt🤖 Response 區塊

Reviewer Context 會作為 hidden Markdown comment 保存在 PR body 中。人類 reviewer 只會看到一般報告,而讀取 raw PR description 的工具可以使用這段額外 context。

這段 context 是確定性產生的。它會從 Agent Note data 中整理 changed area、review focus 和最近相關的 intent signals。Copilot、CodeRabbit、Devin、Greptile 等工具可以在閱讀 diff 前先理解 PR 為什麼發生變更。

它仍然只是指引,不是證明。review tool 應該把它和實際 diff、test、code 對照使用。

如果你還想要一個共享的 Pages 視圖來查看 open 與 merged 的 PR 歷史,請繼續閱讀 Dashboard