Community研究與資料分析github.com

ComposioHQ/pr-review-ci-fix

自動化 PR 審查與 CI 自動修復,支援 GitHub 與 GitLab。透過 Composio CLI 提取差異、擷取失敗日誌、發布審查意見,並循環提交修復直至檢查全數通過。

pr-review-ci-fix 是什麼?

這個技能讓 AI 代理(如 Claude Code、Cursor 等)能夠直接從命令列驅動 GitHub 與 GitLab 的 PR 審查與 CI 故障排除流程,無需在瀏覽器、終端機與對話視窗間切換。其核心流程為:提取 PR 差異與中繼資料 → 分析正確性、風格與風險並發布結構化審查意見 → 擷取 CI 失敗的執行日誌 → 解析錯誤原因並自動修改程式碼 → 提交推送修正 → 重新輪詢 CI 結果,直到所有檢查皆變為綠色。支援的平台包括 GitHub(Pull Request、Review、Workflow Run)與 GitLab(Merge Request、Discussion)。使用者需先安裝 Composio CLI 並連結對應平台帳號,再透過 `composio execute` 執行指定的 API slug 來實現每一步操作。此外,可將整個流程寫入單一腳本檔案,以 `composio run` 一鍵執行。這對於希望將開發者工作流程完全自動化的團隊與 CI/CD 實踐非常實用,能大幅減少手動審查與除錯時間。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/pr-review-ci-fix

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

PR 審查 + CI 自動修復

從 shell 使用 Composio CLI 驅動 GitHub/GitLab 的 PR 審查與 CI 故障排除。無需在瀏覽器、終端機與對話視窗之間切換。

使用時機

  • 某個 PR 需要結構化審查(正確性、風格、風險)並附帶行內評論。
  • CI 顯示紅燈,您希望代理人讀取日誌、修補程式碼並重新檢查。
  • 您希望一個指令就能循環:提取差異 → 評論 → 修復 → 推送 → 重新執行。

先決條件

curl -fsSL https://composio.dev/install | bash
composio login
composio link github        # 或:composio link gitlab

非互動式執行可設定環境變數:COMPOSIO_API_KEY。

核心工具組

透過搜尋發現 slug,再將其固定以便重複使用:

composio search "list pull request files" --toolkits github
composio search "download workflow logs" --toolkits github
composio search "create pr comment" --toolkits gitlab

常見的重複使用 slug:

  • GITHUB_GET_A_PULL_REQUEST
  • GITHUB_LIST_PULL_REQUESTS_FILES
  • GITHUB_CREATE_A_REVIEW_FOR_A_PULL_REQUEST
  • GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY
  • GITHUB_DOWNLOAD_WORKFLOW_RUN_LOGS
  • GITLAB_GET_SINGLE_MERGE_REQUEST
  • GITLAB_LIST_MERGE_REQUEST_DISCUSSIONS
  • GITLAB_CREATE_NEW_MERGE_REQUEST_NOTE

首次使用前務必透過 composio execute <SLUG> --get-schema 確認。

審查工作流程

  1. 提取 PR 中繼資料與差異:
    composio execute GITHUB_GET_A_PULL_REQUEST \
      -d '{"owner":"acme","repo":"app","pull_number":482}'
    composio execute GITHUB_LIST_PULL_REQUESTS_FILES \
      -d '{"owner":"acme","repo":"app","pull_number":482}'
    
  2. 歸納風險區域(認證、遷移、公開 API、測試)成為審查主體。
  3. 發布審查意見並附帶行內評論:
    composio execute GITHUB_CREATE_A_REVIEW_FOR_A_PULL_REQUEST -d '{
      "owner":"acme","repo":"app","pull_number":482,
      "event":"COMMENT",
      "body":"整體上沒問題,但有兩個阻斷注意事項。",
      "comments":[
        {"path":"src/auth.ts","line":42,"body":"缺少對 session 的 null 檢查"},
        {"path":"src/auth.ts","line":88,"body":"Token TTL 是硬編碼的;請移至配置"}
      ]
    }'
    

CI 自動修復循環

  1. 找出紅燈執行:
    composio execute GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY \
      -d '{"owner":"acme","repo":"app","branch":"feat/billing","status":"failure"}'
    
  2. 提取日誌:
    composio execute GITHUB_DOWNLOAD_WORKFLOW_RUN_LOGS \
      -d '{"owner":"acme","repo":"app","run_id":123456}'
    
  3. 解析失敗 → 本地修補(代理人將修復寫入工作樹)。
  4. 透過本地 git 提交 + 推送,然後重新輪詢步驟 1,直到 conclusion=success。
  5. 發布 PR 評論,描述每個修復提交,讓人類審查者了解做了哪些變更。

一次性工作流程腳本

另存為 scripts/review-and-fix.ts,並用 composio run --file ./scripts/review-and-fix.ts -- --pr 482 執行:

const pr = process.argv.includes("--pr")
  ? Number(process.argv[process.argv.indexOf("--pr") + 1])
  : null;

const meta = await execute("GITHUB_GET_A_PULL_REQUEST", {
  owner: "acme", repo: "app", pull_number: pr
});
const files = await execute("GITHUB_LIST_PULL_REQUESTS_FILES", {
  owner: "acme", repo: "app", pull_number: pr
});

console.log(JSON.stringify({ meta, files }, null, 2));

GitLab 變體

替換 slug 與參數名稱:

composio execute GITLAB_GET_SINGLE_MERGE_REQUEST \
  -d '{"id":"acme/app","merge_request_iid":482}'
composio execute GITLAB_CREATE_NEW_MERGE_REQUEST_NOTE \
  -d '{"id":"acme/app","merge_request_iid":482,"body":"CI 修復已推送為提交 deadbeef"}'

故障排除

  • Connection required for github → composio link github
  • 未知的輸入結構 → composio execute <SLUG> --get-schema
  • 日誌下載過大 → 透過 composio proxy 串流原始 API,並在本地用 grep 過濾
  • 速率限制 → 序列化呼叫或降低輪詢頻率;對同一個儲存庫避免使用 --parallel

完整的 CLI 參考: docs.composio.dev/docs/cli

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相關技能