← 返回
未分类 中文

Contextual Git-Committer

AI-powered Git assistant that analyzes staged changes and terminal history to craft meaningful, conventional commit messages.
AI驱动的Git助手,分析暂存改动和终端历史,自动生成符合规范的提交信息。
liverock
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 323
下载
💾 0
安装
1
版本
#latest

概述

Contextual Git-Committer

An AI-powered Git assistant that writes descriptive, high-quality commit messages by analyzing your local workspace context.

How It Works

  1. Gathers staged changes via git diff --cached to see exactly what you're about to commit.
  2. Correlates terminal history by reading recent shell commands to understand why changes were made (e.g., did you just run npm install? pytest?).
  3. Checks recent commits via git log to maintain consistency with your project's existing style.
  4. Parses diff hunks to identify which functions, classes, or sections were modified.

AI Prompt Instructions

When the suggest_commit tool returns its output, use the gathered context to generate exactly 3 commit message options:

Option 1: Conventional Commit

A short, standards-compliant message using the Conventional Commits format:

  • Prefix with the correct type: feat:, fix:, refactor:, docs:, test:, chore:, style:, perf:, build:, or ci:
  • Include the scope if provided
  • Keep the subject line under 72 characters
  • Example: fix(auth): resolve null pointer when session expires

Option 2: Story / Detailed

A narrative-style message that explains what the change achieves in plain English:

  • Focus on the "why" and the outcome, not just the mechanics
  • 1-2 sentences
  • Example: "Updated the header logic to prevent crashes when a user is logged out, which was causing intermittent 500 errors on the dashboard."

Option 3: Emoji Style

A casual, emoji-prefixed message for less formal projects:

  • Use relevant emojis to convey the type of change
  • Keep it concise and fun
  • Example: "🐛 Fixed header crash on logout | 🛡️ Added null checks for session object"

Output Format

Present the three options as a numbered list:

📝 Suggested Commit Messages:

1. **Conventional:**
   `fix(auth): resolve null pointer when session expires`

2. **Story:**
   Updated the header logic to prevent crashes when a user is logged out, which was causing intermittent 500 errors on the dashboard.

3. **Emoji:**
   🐛 Fixed header crash on logout | 🛡️ Added null checks for session object

If no staged changes are found, inform the user and suggest running git add to stage their changes first.

Usage Examples

  • /suggest_commit — Analyze staged changes and suggest 3 messages
  • /suggest_commit --style detailed — Provide more verbose explanations
  • /suggest_commit --scope api — Focus the message on the API module
  • /suggest_commit --style detailed --scope auth — Detailed messages scoped to auth

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 10:59 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Docker Medic

liverock
检查容器健康状态并针对常见错误提供修复建议
★ 1 📥 432

Personal CRM Warm-Up

liverock
识别最近未联系的联系人,并提供轻松重新联系的方式。
★ 1 📥 424

Legal/TOS Diff-er

liverock
获取服务条款文档,保存快照,并进行语义差异比较,以识别隐私风险、财务等方面的关键法律变更。
★ 1 📥 359