Theme / v0.9.56

Graphify

Codebase 知識圖譜

指令詳解

graphify prs 指令詳解

graphify prs 把 GitHub PR 排在圖譜維度上:CI、review、graph impact、merge 衝突風險

指令用途

graphify prs 是 graphify 對 GitHub Pull Request 的「PR dashboard」。它把 PR 跟你的 graph.json 結合,告訴你:

  • 這個 PR 影響了哪些 community / god node(graph impact)
  • 兩個 PR 是否會互相衝突(共用同一個 community → merge order 風險)
  • 用 AI 排 review queue--triage

基本用法

預設:開啟 PR 全貌

graphify prs

輸出含:

欄位 內容
CI CI 狀態(pass/fail/pending)
Review review 狀態(approvals、變更請求)
Worktree worktree → branch → PR mapping
Graph impact PR 改的檔案落在哪個 / 哪些 community

深入單一 PR

graphify prs 42

針對 PR #42 給更詳細的:

  • 變更的節點列表(用 git diff 對應到 graph.json 的節點)
  • 受影響 community
  • 受影響 god nodes

重要子選項

--triage:AI 排 review 優先度

graphify prs --triage

graphify 用目前設定的 LLM backend(如 kimi / claude / openai)對你的 review queue 排序,把高風險 PR 排前面。可以選 backend:

GRAPHIFY_TRIAGE_BACKEND=kimi graphify prs --triage
GRAPHIFY_TRIAGE_MODEL=claude-opus-4-7 graphify prs --triage

--conflicts:找出會互相踩的 PR

graphify prs --conflicts

輸出共享 community 的 PR 配對,這些 PR 如果 merge 順序不對會導致 conflict 或 regress:

PR #41  ↔  PR #43    shared community: auth (Community 1)
PR #52  ↔  PR #58    shared community: billing (Community 3)

merge order 建議:先 merge 改動較小的那個、reviewer 在 merge 第二個時重跑 CI。

--worktrees:worktree → branch → PR 對應

graphify prs --worktrees

特別適合平行開發多個 PR 的人。

--base main:只看針對特定 base 的 PR

graphify prs --base main

--repo owner/repo:指定 repo

graphify prs --repo jamesliu0618/techspecs

MCP 工具

把圖譜開成 MCP server (python -m graphify.serve) 後,目前的 MCP host 可呼叫:

MCP 工具 對應 CLI
list_prs graphify prs
get_pr_impact graphify prs PR_NUMBER
triage_prs graphify prs –triage

範例:review queue 排序

$ graphify prs --triage

Triage ranking (5 PRs):

1. #58 (HIGH)    billing refactor
   - touches 3 god nodes in Community 3
   - 12 modified files, CI failing
   - Suggested reviewer: domain owner

2. #52 (MED)     add export endpoint
   - touches Community 3 (billing)
   - 3 modified files, CI passing
   - Could conflict with #58 per --conflicts

3. #41 (LOW)     typo fix in docs
   - 1 modified file, CI passing

內部連結與外部參考


下一步

  1. graphify install 指令詳解
  2. graphify watch-update 指令詳解
  3. 完整開發工作流(含 PR 影響)