← Back to Skills Marketplace
liverock

Contextual Git-Committer

by Peter Lum · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
107
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install contextual-git-committer
Description
AI-powered Git assistant that analyzes staged changes and terminal history to craft meaningful, conventional commit messages.
README (SKILL.md)

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
Usage Guidance
This skill does what it says: it reads staged git diffs, recent commits, and your shell history to build context for commit messages. The main risk is privacy: your shell history and staged diffs can contain secrets (API keys, passwords, tokens, or sensitive commands). If you run this skill, be aware the collected context will be printed and then provided to the agent/LLM that generates messages. Before installing or invoking it: - Review handler.py (included) and confirm you are comfortable with it reading ~/.bash_history and ~/.zsh_history. - Avoid running it in environments where your shell history contains sensitive commands, or clear/trim those history files first. - Consider modifying the handler to skip terminal history or to filter/sanitize history entries (or to limit to certain safe commands). - Be cautious about staged diffs that may include secrets—inspect diffs before staging or use git-secrets/tools to pre-scan. If you need minimal exposure, prefer a version that only reads the staged diff and recent commits (no shell history), or run the tool locally with an LLM that does not send data to an external service. If you want me to, I can suggest a safe modification to handler.py to disable or sanitize history reading.
Capability Analysis
Type: OpenClaw Skill Name: contextual-git-committer Version: 1.0.0 The skill gathers workspace context by reading the user's shell history (~/.bash_history and ~/.zsh_history) in handler.py. While this behavior is documented in SKILL.md as a way to provide context for commit messages, it is a high-risk capability because shell histories often contain sensitive information like API keys, tokens, or passwords, which are then exposed to the AI's context window.
Capability Assessment
Purpose & Capability
Name/description match the implementation: the code gathers staged diffs, recent commits, changed files, parses diff hunks, and reads terminal history to produce context for commit message suggestions. Reading terminal history is explicitly described in SKILL.md, but it is a potentially disproportionate source of context (it can contain sensitive commands or secrets) relative to the stated goal of crafting commit messages.
Instruction Scope
SKILL.md instructs the tool to read ~/.bash_history and ~/.zsh_history and the handler implements this. That behavior is visible and intentional, but it expands the scope beyond purely repository-local data: terminal history can include sensitive content (commands containing tokens, passwords, or other secrets). The instructions and handler also cause the full staged diff to be emitted (possibly including secrets), which will be provided to whatever LLM the agent uses—this is a privacy/exfiltration risk even if no network code is present in the skill itself.
Install Mechanism
No install spec or external downloads; the skill is instruction-only plus a small local Python handler. No remote installers or archive extraction are used.
Credentials
The skill requests no environment variables, credentials, or config paths beyond reading common shell history files (explicitly documented). There are no unrelated or excessive env/credential demands.
Persistence & Privilege
always is false and the skill does not request persistent/always-on privileges or modify other skills or system configs. It runs only when invoked.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install contextual-git-committer
  3. After installation, invoke the skill by name or use /contextual-git-committer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
# Contextual Git-Committer An AI-powered Git assistant for OpenClaw that writes descriptive, high-quality commit messages by analyzing your local workspace context. ## Why This Exists "misc changes", "fixed bug", "updates" — we've all written these meaningless commit messages at the end of a long coding session. Contextual Git-Committer eliminates that fatigue by looking at what you actually changed and why, then crafting commit messages that your future self will thank you for. ## Core Features | Feature | Description | |---------|-------------| | **Diff Analysis** | Scans `git diff --cached` to understand exactly which functions were modified, added, or deleted. | | **History Correlation** | Cross-references changes with recent terminal commands (e.g., `npm install`, `pytest`) to provide context on *why* a change happened. | | **Conventional Commits** | Automatically formats messages following standards like `feat:`, `fix:`, or `refactor:` based on the nature of the code changes. | | **Semantic Explanation** | Goes beyond "how" and explains "what" the change achieves in plain English. | ## Requirements - **Environment:** Must be run within a Git repository. - **Tools:** Access to `git` CLI. - **Python:** 3.6+ (stdlib only — no external dependencies). ## Project Structure ``` Contextual-Git-Committer/ ├── readme.md # This file └── Contextual-Git-Committer/ ├── SKILL.md # OpenClaw skill definition & AI prompts └── handler.py # Context-gathering handler ``` ## Commands ### `suggest_commit` Analyzes staged changes and suggests 3 possible commit messages in different styles. **Arguments:** | Argument | Type | Required | Default | Description | |----------|------|----------|---------|-------------| | `style` | string | No | `"conventional"` | `"conventional"` for standard commit format, or `"detailed"` for longer explanations. | | `scope` | string | No | — | The specific module being updated (e.g., `"auth"`, `"api"`). | **Output:** Three commit message options: 1. **Conventional Commit** — Standards-compliant (`feat:`, `fix:`, `refactor:`, etc.) 2. **Story / Detailed** — Plain-English narrative explaining the *why* 3. **Emoji** — Casual, emoji-prefixed message for informal projects ## Usage Examples ``` /suggest_commit /suggest_commit --style detailed /suggest_commit --scope auth /suggest_commit --style detailed --scope api ``` ## What It Analyzes When you run `suggest_commit`, the skill gathers: | Data Source | What It Provides | |-------------|-----------------| | **Staged diff** | The full content of your `git diff --cached` | | **Changed files** | Which files were added, modified, deleted, or renamed | | **Modified functions** | Function and method names touched by the changes | | **Diff stats** | Lines added/removed summary | | **Terminal history** | Last 10 shell commands for activity context | | **Recent commits** | Last 5 commit messages for style consistency | | **Branch name** | Current branch for additional context | ## How It Works 1. The handler gathers all context from your local workspace. 2. The structured context is returned to the AI. 3. The AI generates 3 commit message options tailored to your changes. No external APIs are called. Everything runs locally using only Git and your shell history. ## Example Output ``` Suggested Commit Messages: 1. Conventional: feat(api): add rate-limiting middleware to public endpoints 2. Story: Added rate-limiting to the public API after noticing abuse patterns in the logs. Each IP is now capped at 100 requests per minute. 3. Emoji: 🚦 Added rate limiting to API | 🔒 100 req/min per IP ```
Metadata
Slug contextual-git-committer
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Contextual Git-Committer?

AI-powered Git assistant that analyzes staged changes and terminal history to craft meaningful, conventional commit messages. It is an AI Agent Skill for Claude Code / OpenClaw, with 107 downloads so far.

How do I install Contextual Git-Committer?

Run "/install contextual-git-committer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Contextual Git-Committer free?

Yes, Contextual Git-Committer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Contextual Git-Committer support?

Contextual Git-Committer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Contextual Git-Committer?

It is built and maintained by Peter Lum (@liverock); the current version is v1.0.0.

💬 Comments