← ClaudeAtlas

agy-commitlisted

Delegate git smart commit to agy-cli. Use when: committing changes via agy-cli's git-smart-commit skill (offload commit batching to Antigravity). Not for: a single simple commit, or when agy-cli is unavailable. Output: grouped commits created by agy-cli plus a git log summary.
hmj1026/dhpk · ★ 2 · Code & Development · score 71
Install: claude install-skill hmj1026/dhpk
# agy-commit — 委派 agy-cli 執行智慧拆分提交 透過 agy-cli non-interactive 模式委派智慧拆分提交,自動分群並逐批 commit。 --- ## When NOT to Use - 單一、簡單的變更(一個 commit 就夠)→ 直接用 `/smart-commit`。 - agy-cli 未安裝或不可用。 - 有未解決的 merge conflict(先處理衝突再提交)。 - 目前沒有任何 git 變更。 --- ## 流程 ### 1. 前置檢查 依序執行以下檢查,任一失敗則中止: ```bash # 檢查 agy-cli 是否存在 command -v agy >/dev/null 2>&1 && echo "AGY_OK" || echo "AGY_MISSING" ``` - `AGY_MISSING` → 回報:「agy-cli 未安裝。安裝與設定請參考 https://antigravity.google/docs/cli/reference」,中止。 ```bash # 檢查 git 變更 git status --short ``` - 無輸出 → 回報:「目前沒有需要提交的變更」,中止。 - 有 merge conflict 標記(`UU`、`AA`)→ 回報:「有未解決的合併衝突,請先處理」,中止。 --- ### 2. 顯示變更摘要 將 `git status --short` 結果和 `git diff --stat` 展示給使用者,說明即將委派 agy-cli 執行智慧拆分提交。 告知使用者: - agy-cli 會以 `--dangerously-skip-permissions` 自動批准權限,並用 `--add-dir "$(pwd)"` 將範圍限定在目前 repo - agy-cli 會先產出計畫、再逐批 commit - 過程中 agy-cli 的輸出會即時顯示 - prompt 已含約束,禁止 agy 修改任何檔案(僅允許 git 操作) --- ### 3. 調用 agy-cli 使用 non-interactive 模式執行,自動批准權限並將工作範圍限定在目前 repo: ```bash printf 'Y\n' | agy --dangerously-skip-permissions --add-dir "$(pwd)" -p "Group the current git changes into cohesive, conventional-commit batches and commit each batch. ONLY run git commands (git add / git commit); do NOT edit, create, or delete any files." ``` **參數說明:** - `printf 'Y\n' |`:agy 的 git-smart-commit 產出計畫後會以 `確認執行?(Y/n)` 徵詢確認並從 **stdin** 讀取。`--dangerously-skip-permissions` **無法**跳過此計畫確認,必須以 stdin 餵入 `Y`,否則 `-p` 執行會卡住直到 `--print-timeout`(預設 5 分鐘)。 - `--dangerously-skip-permissions`:自動批准每個 git 指令的 tool 權限請求(與