commit-in-group
1
总安装量
1
周安装量
#54642
全站排名
安装命令
npx skills add https://github.com/lchtao26/my-skills --skill commit-in-group
Agent 安装分布
replit
1
amp
1
opencode
1
cursor
1
codex
1
Skill 文档
commit-in-group
Overview
This skill organizes unstaged changes into logical groups and commits them separately, each with an appropriate commit message following Angular Conventional Commit format.
Workflow
- Check git status – Identify all unstaged changes
- Analyze changes – Group related files by:
- Common directory/path
- File type/purpose
- Functional area (e.g., auth, ui, api)
- Stage first group –
git add <files_in_group> - Generate commit message – Analyze staged changes and write message in Chinese with English technical terms
- Commit –
git commit -m "<message>" - Repeat – Continue with next group until all changes are committed
Grouping Strategy
Group files by these heuristics (in priority order):
- Same directory – Files in the same folder are likely related
- Same feature area – e.g., auth-related files across directories
- Same file type – e.g., all test files, all config files
- Functional dependency – Files that work together (component + test + style)
Commit Message Format
Follow Angular Conventional Commit specification:
<type>(<scope>): <subject>
<body>
Types
feat: æ°åè½ (new feature)fix: ä¿®å¤ bug (bug fix)docs: ææ¡£åæ´ (documentation changes)style: ä»£ç æ ¼å¼åæ´ (formatting, semicolons, etc.)refactor: éæä»£ç (code refactoring)perf: æ§è½ä¼å (performance improvements)test: æ·»å æä¿®æ¹æµè¯ (adding/updating tests)chore: æå»ºè¿ç¨æè¾ å©å·¥å ·åå¨ (maintenance tasks)ci: CI é ç½®åæ´ (CI configuration changes)build: æå»ºç³»ç»æå¤é¨ä¾èµåæ´ (build system changes)revert: åéä¹åç commit (revert previous commit)
Language Guidelines
- Write in Chinese for descriptions
- Keep technical terms in English (API, JWT, middleware, component, hook, etc.)
- Keep code references in English (function names, class names, file paths)
- Subject max 50 characters
Examples
Example 1: Group by feature area
Group 1: src/auth/login.ts, src/auth/token.ts
â feat(auth): æ·»å JWT token 认è¯åè½
Group 2: src/ui/Button.tsx, src/ui/Input.tsx
â feat(ui): æ°å¢ç»å½é¡µé¢åºç¡ç»ä»¶
Group 3: tests/auth.test.ts
â test(auth): æ·»å è®¤è¯æ¨¡ååå
æµè¯
Example 2: Group by file type/purpose
Group 1: src/api/user.ts, src/api/order.ts
â feat(api): å®ç°ç¨æ·åè®¢åæ¥å£
Group 2: package.json, tsconfig.json
â chore(config): æ´æ°é¡¹ç®ä¾èµåé
ç½®
Group 3: README.md, docs/API.md
â docs: è¡¥å
API ä½¿ç¨ææ¡£
Example 3: Group by directory
Group 1: frontend/src/components/*.tsx
â feat(frontend): æ°å¢ç¨æ·ç®¡ç页é¢ç»ä»¶
Group 2: backend/src/routes/*.ts
â feat(backend): æ·»å ç¨æ·ç®¡ç API è·¯ç±
Group 3: shared/types/*.ts
â feat(types): å®ä¹ç¨æ·ç¸å
³æ°æ®ç±»å
Execution Steps
For each group of related files:
- Run
git add <files>to stage the group - Run
git diff --cachedto see staged changes - Analyze changes to determine type, scope, and subject
- Write commit message in Chinese with English technical terms
- Run
git commit -m "<message>" - Move to next group
Important Notes
- Always stage files before generating commit message (need to see actual diff)
- If a group is too large (>10 files), consider splitting further
- If unsure about grouping, ask user for confirmation
- Each commit should represent a single logical change