2.2 KiB
2.2 KiB
description
| description |
|---|
| Commit staged files with auto-generated message and create version tag |
Auto-generate a commit message for staged files, commit to the local repository, and create a version tag following semantic versioning.
Please follow the git workflow defined in @skill/git/SKILL.md:
- Check staging area - Verify files are staged with
git diff --cached --name-only- If empty, inform the user and stop
- Collect information - Run these commands in parallel:
git statusgit diff --cachedgit log --oneline -10git tag --list | sort -V | tail -5- Read
@AGENTS.mdif it exists (repository type, version rules, project structure)
- Detect repository type - Polyrepo (tag:
1.2.0) or Monorepo (tag:subproject-1.2.0) - Detect project type and version - Check for version files:
- iOS:
*.xcodeproj/project.pbxproj→MARKETING_VERSION - Node.js:
package.json→version - Android:
build.gradle(.kts)→versionName - Go: Git tag only
- iOS:
- Generate commit message following Conventional Commits:
- Format:
<type>(<scope>): <subject> - Use Chinese for commit messages (macOS/Linux)
- Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build
- For monorepo, use subproject as scope if changes affect single subproject
- Format:
- Update version number if needed:
- feat: minor +1 (1.2.0 → 1.3.0)
- fix/perf: patch +1 (1.2.3 → 1.2.4)
- Breaking change: major +1 (1.2.3 → 2.0.0)
- Only for user-perceivable changes (feat, fix, perf, breaking)
- Add updated version file to staging
- Commit changes with generated message
- Create version tag if version was updated (unless user specified "skip tag"):
- Polyrepo:
git tag -a "1.2.0" -m "commit message" - Monorepo:
git tag -a "subproject-1.2.0" -m "commit message"
- Polyrepo:
Options:
- User can input "skip tag" or "skip" to skip tag creation
Display result in Chinese:
✓ 提交成功
提交信息:[commit message]
版本标签:[tag] (如果创建了)
要推送到远程仓库,请运行:/git-push
Important: This command does NOT push to remote. Use /git-push to push commits and tags.