git-commit
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
- License 许可
- MIT
- 最近更新
- 2026-03-03
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- git-commit
- license
- MIT
- description
- Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
- allowed-tools
- Bash
02 资源文件 1
- 脚本scripts/quote.py2.8 KB
03 SKILL.md 正文
Git Commit with Conventional Commits
Overview
Create standardized, semantic git commits using the Conventional Commits specification. Analyze the actual diff to determine appropriate type, scope, and message.
Conventional Commit Format
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Commit Types
| Type | Purpose |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Formatting/style (no logic) |
refactor |
Code refactor (no feature/fix) |
perf |
Performance improvement |
test |
Add/update tests |
build |
Build system/dependencies |
ci |
CI/config changes |
chore |
Maintenance/misc |
revert |
Revert commit |
Breaking Changes
# Exclamation mark after type/scope
feat!: remove deprecated endpoint
# BREAKING CHANGE footer
feat: allow config to extend other configs
BREAKING CHANGE: `extends` key behavior changed
Workflow
1. Pre-flight: Check Dirty Issues
# Ensure all local issue changes are synced to GitHub before committing
node .agents/skills/issue-manager/scripts/issue-cli.mjs check-dirty --strict
# If exit code is non-zero, sync first:
node .agents/skills/issue-manager/scripts/issue-cli.mjs sync --all
2. Analyze Diff
# If files are staged, use staged diff
git diff --staged
# If nothing staged, use working tree diff
git diff
# Also check status
git status --porcelain
3. Stage Files (if needed)
If nothing is staged or you want to group changes differently:
# Stage specific files
git add path/to/file1 path/to/file2
# Stage by pattern
git add *.test.*
git add src/components/*
Never commit secrets (.env, credentials.json, private keys).
4. Generate Commit Message
Analyze the diff to determine:
- Type: What kind of change is this?
- Scope: What area/module is affected?
- Description: One-line summary of what changed (present tense, imperative mood, <72 chars)
5. Execute Commit
# Single line
git commit -m "<type>[scope]: <description>"
# Multi-line with body/footer
git commit -m "$(cat <<'EOF'
<type>[scope]: <description>
<optional body>
<optional footer>
EOF
)"
Best Practices
- One logical change per commit
- Present tense: "add" not "added"
- Imperative mood: "fix bug" not "fixes bug"
- Reference issues:
Closes #123,Refs #456 - Keep description under 72 characters
Git Safety Protocol
- NEVER update git config
- NEVER run destructive commands (--force, hard reset) without explicit request
- NEVER skip hooks (--no-verify) unless user asks
- NEVER force push to main/master
- If commit fails due to hooks, fix and create NEW commit (don't amend)
04 同仓库更多 Skills
qa-monitor
QA 持续监测 SubAgent。监听 git HEAD 变化,每有新 ship(commit)自动触发完整回归测试,无变化时进入可配置间隔的休眠轮询。触发方式:用户提及 "/qa-watch"、"QA 监测"、"continuous QA"、"watch ship" 等关键词时激活。
qa-engineer
QA 测试工程师 SubAgent。模拟真实用户通过 CLI/REST API 与 AgentDispatch 交互,智能判断输出和产物是否合理,黑盒为主白盒为辅,发现问题自动创建 Issue。触发方式:用户提及 "/qa"、"QA run"、"QA test"、"运行测试场景" 等关键词时激活。
pr-watcher
PR 轮询守护 SubAgent。持续监控 GitHub 上的 Open PR,自动调用 pr-handler 逐一处理,连续 N 轮无新可处理 PR 后退出。触发方式:用户提及 "/watch-prs"、"轮询 PR"、"watch prs" 等关键词时激活。
pr-handler
PR Gatekeeper SubAgent。自动化处理 Multi-Agent Pipeline 产出的 Draft PR:验证代码质量 → 本地合并 → 更新 Spec → Ship 交付。触发方式:用户提及 "/handle-pr"、"处理 PR"、"review pr"、"合并 PR" 等关键词时激活。
issue-manager
GitHub-first Issue 管理 SubAgent。Issue 编号和内容以 GitHub Issues 为准,本地 .trellis/issues/ 为 Obsidian 兼容缓存。触发方式:用户提及 "/issue"、"创建 issue"、"create issue"、"新建问题"、"提 bug" 等关键词时激活。
agent-dispatch-use
AgentDispatch 使用指南。教导 AI Agent 如何启动 Server、配置 Client Node、将各种 Agent 作为 Worker 挂载到分发集群、提交任务并监听状态。触发方式:用户提及 "/onboard"、"how to use dispatch"、"快速上手"、"set up agentdispatch"、"挂载 Agent"、"mount worker" 等关键词时激活。