git-commit-enterprise
Enterprise Git Commit Workflow
This skill enforces Conventional Commits specification for enterprise projects, ensuring consistent, readable, and automatable commit messages.
Format
<type>[optional scope][!]: <description>
Required: Type and description
Optional: Scope, breaking change indicator (!)
Commit Types
| Type | Purpose |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Code style (formatting, no logic change) |
refactor |
Code restructuring (no behavior change) |
perf |
Performance improvement |
test |
Adding/updating tests |
build |
Build system/dependencies |
ci |
CI/CD configuration |
chore |
Other maintenance tasks |
revert |
Revert a commit |
For detailed type decision guidance, see commit-types.md.
Writing Style Rules
- Imperative mood: Use "add" not "added" or "adds"
- Lowercase first letter: "add feature" not "Add feature"
- No trailing period: "add feature" not "add feature."
- Subject max 72 chars: Total length including type/scope
- Body wrap at 72: If adding a detailed body
Examples:
- ✅
feat(api): add user authentication - ✅
fix(auth): resolve token expiration - ❌
feat(api): Add user authentication. - ❌
Updated the authentication flow
Workflow
1. Full Commit Workflow
When user requests creating a commit:
-
Analyze changes
git status git diff --staged git log -5 --oneline -
Determine commit type - Use the decision tree in commit-types.md
-
Determine scope (optional) - Based on affected area (api, ui, auth, database, etc.)
-
Check for breaking changes - Does this break existing functionality?
-
Draft commit message following the format:
- Start with type and scope
- Add
!if breaking - Add colon and space
- Write description in imperative mood
-
Stage files (if not already staged):
git add <files> -
Validate commit message using the validation script (see below)
-
Create commit:
git commit -m "$(cat <<'EOF' <type>[scope]: <description> [optional body] [optional footer] EOF )" -
Run git status to verify success
2. Validate Commit Message
Use the validation script to check commit message format:
echo "feat(api): add user endpoint" | python3 scripts/validate_commit.py
The script checks:
- Valid commit type
- Proper format (type: description or type(scope): description)
- Description not empty
- Imperative mood (lowercase start)
- No trailing period
- Subject under 72 characters
Exit code: 0 for valid, 1 for invalid.
3. Generate Commit Message from Changes
To generate a commit message based on code changes:
- Analyze the diff:
git diff --staged - Identify the primary change type
- Determine affected scope
- Draft a concise description
- Validate the message
Analysis prompts:
- Multiple related changes → Group under single cohesive message
- Mixed types → Split into multiple logical commits
- Complex changes → Add body paragraph explaining context
Breaking Changes
For breaking changes, add ! after type/scope:
feat(api)!: remove deprecated endpoint
BREAKING CHANGE: The /users endpoint has been removed.
Use /v2/users instead.
Commit Message with Body
For complex changes, add a body:
feat(api): add user pagination
Implement cursor-based pagination for improved performance
with large datasets.
- Add before/after cursor parameters
- Limit max results to 100 per page
- Include pagination metadata in response
Closes #123
Common Patterns
Fix a bug
fix(auth): resolve session timeout issue
Add a feature
feat(api): add user search functionality
Update dependencies
chore(deps): upgrade react to v18
Refactor code
refactor(auth): extract token validation
Breaking change
feat(api)!: change authentication format
BREAKING CHANGE: API now requires Bearer token format.
Update all API clients accordingly.
Reference
- Full specification: conventional-commits.md
- Type decision guide: commit-types.md
- Validation script:
scripts/validate_commit.py
More from azure12355/weilan-skills
browser-agent
AI 驱动的浏览器自动化工具集,包含 agent-browser(无障碍树提取)、actionbook(50+ 网站自动化食谱)、browser-use(Python 自动化库)。使用场景:(1) 抓取需要 JS 渲染的网页内容 (2) 从 X/Twitter、GitHub、Reddit 等平台获取数据 (3) 截图网页 (4) 自动化浏览器操作 (5) 获取网页的无障碍树结构。当用户需要访问动态网页、绕过反爬虫、或执行浏览器自动化时使用此技能。
25drawio-diagrams
专业的 DrawIO 图表生成工具,使用 Material Design 配色和圆角矩形风格。支持 (1) 算法/数据结构图 - DP 状态转移、递归树、排序过程、双指针/滑动窗口 (2) 架构图 - 系统架构、微服务、网络拓扑、组件依赖 (3) 流程图/时序图 - 业务流程、决策流程、审批流程 (4) UML/ER 图 - 类图、实体关系、用例图。当用户提到 "drawio"、"draw.io"、需要绘制流程图、架构图、UML 图、ER 图、DP 状态图、算法可视化时使用此技能。
6github-researcher
GitHub 开源项目深度调研工具。在 GitHub 上搜索、分析特定领域的开源项目,汇总生成结构化调研报告。触发场景:用户要求"调研 GitHub 上的 XXX 工具"、"搜索 XXX 开源项目"、"汇总 GitHub 仓库"、"找 XXX 的开源替代方案"、"对比 GitHub 上的 XXX 项目"、或需要批量分析开源项目并输出报告时使用此 skill。
5diagram-prompter
分析代码库结构并生成各种架构图、流程图、时序图等的 AI 绘图提示词。使用场景:当用户需要为任何代码项目生成可视化图表时,包括系统架构图、模块依赖关系、数据流图、时序图、状态机图、部署架构图等。支持多种图表类型如 Mermaid、PlantUML、C4 模型、UML 类图、ER 图等。适用于技术文档编写、架构设计、代码评审、学习理解新项目等场景。
4yt-dlp-downloader
下载视频和音频的通用工具。支持 YouTube、Bilibili、Twitter/X、抖音、快手等数千个网站。当用户提供视频链接时自动下载到 ~/Downloads 文件夹。
4technical-writer
|
4