with one click
將雜亂的 git 變更,依功能邏輯自動拆分成多個有意義的 conventional commit
npx skills add https://github.com/deancourse/git-worktree-demo --skill git-smart-commitCopy and paste this command into Claude Code to install the skill
將雜亂的 git 變更,依功能邏輯自動拆分成多個有意義的 conventional commit
npx skills add https://github.com/deancourse/git-worktree-demo --skill git-smart-commitCopy and paste this command into Claude Code to install the skill
根據當前 branch 與目標 branch 的差異,自動產生 Pull Request 的 Title 與 Description。當使用者提到「PR」、「Pull Request」、「寫 PR」、「PR 描述」、「PR description」、「建立 PR」時觸發此 Skill。
當使用者的需求是新增多個功能,或判斷使用者的需求適合拆分成多個 feature branch 並行開發時,或是提到 "worktree"、"git worktree"、"多分支開發"、"parallel branches",自動觸發此 Skill。先分析需求並建議 worktree 拆分方案,經使用者確認後執行建立。
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks.
| name | Git Smart Commit |
| description | 將雜亂的 git 變更,依功能邏輯自動拆分成多個有意義的 conventional commit |
將目前所有 staged / unstaged 變更,依功能邏輯分群後,逐批 git add + git commit。
執行以下指令取得完整變更清單:
git status --short
若沒有任何變更,告知使用者「目前沒有需要提交的變更」後結束。
接著取得所有變更的 diff 內容(用來判斷分群邏輯):
git diff
git diff --cached
根據以下維度,將檔案變更分成多個 commit 群組,每組代表一個獨立的邏輯單元:
| 優先級 | 維度 | 範例 |
|---|---|---|
| 1 | 專案腳手架 / 設定檔 | package.json, vite.config.*, .gitignore, README.md, tsconfig.json |
| 2 | 資料層 / config data | src/data/*.js, src/constants/*, src/config/* |
| 3 | 元件(按元件名稱分組) | src/components/Hero.jsx + 對應測試 + 對應樣式 |
| 4 | 頁面 / 路由 | src/pages/*, src/routes/*, src/App.jsx |
| 5 | 全域樣式 | src/index.css, src/styles/*, src/theme/* |
| 6 | 工具 / hooks / 型別 | src/utils/*, src/hooks/*, src/types/* |
| 7 | 測試 | __tests__/*, *.test.*, *.spec.* |
| 8 | 文件 / 其他 | docs/*, *.md(非 README), 其他雜項 |
feat,修改用 fix / refactor / style,刪除用 chore在執行任何 git 操作之前,先列出計畫讓使用者確認:
📋 Commit 計畫(共 N 個 commit)
1. chore(project): 初始化專案設定與相依套件
→ package.json, vite.config.js, .gitignore
2. feat(data): 新增首頁各區塊的設定資料
→ src/data/navigation.js, src/data/hero.js, ...
3. feat(navbar): 新增 Navbar 元件(含 RWD 漢堡選單)
→ src/components/Navbar.jsx
...
確認執行?(Y/n)
使用 notify_user 工具向使用者展示計畫並等待確認。
使用者確認後,對每一組依序執行:
git add <file1> <file2> ...
git commit -m "<type>(<scope>): <subject>"
<type>(<scope>): <簡短描述,繁體中文>
type 對照表:
| type | 使用時機 |
|---|---|
feat | 新增功能、元件、頁面 |
fix | 修復 bug |
style | 純樣式調整(不影響邏輯) |
refactor | 重構(不改變行為) |
chore | 雜務(設定檔、腳手架、CI) |
docs | 文件更新 |
test | 測試相關 |
scope 規則:
hero, navbar, pricingdatastyleprojectsubject 規則:
所有 commit 完成後,執行:
git log --oneline -20
將結果展示給使用者,確認所有 commit 都已正確建立。
.env 或敏感檔案:提醒使用者確認是否應被 gitignore,不自動提交