mcpField
P
prowler-commit

prowler-commit

github.com/prowler-cloud开发15.1k70 次安装今天更新
代码仓库

关于 prowler-commit

prowler-commit 是面向 Prowler 仓库贡献者的提交准备技能。它规定 Conventional Commits 格式、范围选择和消息撰写方式,并要求提交前先确认,同时限制破坏性 Git 操作。

主要功能

  1. 01Conventional Commits 格式
  2. 02提交类型与范围指引
  3. 03标题和正文简洁规则
  4. 04撰写前检查变更
  5. 05提交前确认
  6. 06限制强制推送和特定提交参数

适用场景

  1. 01为 API、UI、SDK 或 CI 变更拟定提交消息
  2. 02为仓库修改选择提交类型和范围
  3. 03准备提交并在执行前请求确认

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/prowler-cloud/prowler --skill prowler-commit

安装后在 Claude Code 中输入/prowler-commit确认已加载。

详细介绍

关键规则

  • 始终使用 conventional-commits 格式:type(scope): description
  • 始终将第一行控制在 72 个字符以内
  • 提交前始终征求用户确认
  • 绝不要过于具体(避免使用“6 个小节”“3 个文件”等数量)
  • 标题中绝不要包含实现细节
  • 除非用户明确要求,否则绝不要使用 -n 标志
  • 绝不要使用 git push --force 或 git push -f(具有破坏性,会重写历史记录)
  • 绝不要主动提出提交;等待用户明确提出请求

提交格式

type(scope): concise description

- Key change 1
- Key change 2
- Key change 3
类型
类型使用场景
feat新增功能
fix修复错误
docs仅涉及文档
chore维护、依赖项、配置
refactor不涉及新增功能或修复的代码更改
test添加或更新测试
perf性能改进
style格式调整,不涉及代码更改
范围
范围适用情况
api更改位于 api/
ui更改位于 ui/
sdk更改位于 prowler/
mcp更改位于 mcp_server/
skills更改位于 skills/
ci更改位于 .github/
docs更改位于 docs/
省略涉及多个范围或根目录

正反示例

标题行
# GOOD - Concise and clear
feat(api): add provider connection retry logic
fix(ui): resolve dashboard loading state
chore(skills): add Celery documentation
docs: update installation guide

# BAD - Too specific or verbose
feat(api): add provider connection retry logic with exponential backoff and jitter (3 retries max)
chore(skills): add comprehensive Celery documentation covering 8 topics
fix(ui): fix the bug in dashboard component on line 45
正文(项目符号)
# GOOD - High-level changes
- Add retry mechanism for failed connections
- Document task composition patterns
- Expand configuration reference

# BAD - Too detailed
- Add retry with max_retries=3, backoff=True, jitter=True
- Add 6 subsections covering chain, group, chord
- Update lines 45-67 in dashboard.tsx

工作流

  1. 分析更改

    git status
    git diff --stat HEAD
    git log -3 --oneline  # Check recent commit style
    
  2. 起草提交信息

    • 选择合适的类型和范围
    • 编写简洁的标题(< 72 个字符)
    • 为重要更改添加 2-5 个项目符号
  3. 提交给用户确认

    • 显示要提交的文件
    • 显示拟定的提交信息
    • 等待用户明确确认
  4. 执行提交

    git add <files>
    git commit -m "$(cat <<'EOF'
    type(scope): description
    
    - Change 1
    - Change 2
    EOF
    )"
    

决策树

Single file changed?
├─ Yes → May omit body, title only
└─ No → Include body with key changes

Multiple scopes affected?
├─ Yes → Omit scope: `feat: description`
└─ No → Include scope: `feat(api): description`

Fixing a bug?
├─ User-facing → fix(scope): description
└─ Internal/dev → chore(scope): fix description

Adding documentation?
├─ Code docs (docstrings) → Part of feat/fix
└─ Standalone docs → docs: or docs(scope):

命令

# Check current state
git status
git diff --stat HEAD

# Standard commit
git add <files>
git commit -m "type(scope): description"

# Multi-line commit
git commit -m "$(cat <<'EOF'
type(scope): description

- Change 1
- Change 2
EOF
)"

# Amend last commit (same message)
git commit --amend --no-edit

# Amend with new message
git commit --amend -m "new message"

评论

支持 Markdown