Token导航 LogoToken导航TokenDH.com
研究检索执行命令clawhub未标认证来源可访问clear审计通过

effective-git有效的 git

Agent Skill

effective-git 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 OpenClaw 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,328

周安装

184

GitHub Stars

公开资料未说明

下载量

1,516
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:effective-git(有效的 git)
来源仓库:https://github.com/guguoyi/effective-git
安装命令:
openclaw skills install effective-git
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install effective-git

简介

effective-git 遵循最佳实践的智能 Git 工作流程助手,辅助提交、分析和消息编写。

  • 专为 OpenClaw 设计,适用于需要规范版本控制操作的场景。
  • 通过 ClawHub 安装,支持自动分析更改、生成提交信息及推送管理功能。
  • 使用前需确认权限范围、维护状态,以及是否会触发命令执行或文件修改操作。
  • 建议在受控环境中使用,避免对生产代码造成意外变更。

SKILL.md

name
effective-git
description
Intelligent Git workflow assistant following best practices. Use when user needs help with git commits, analyzing changes, writing commit messages, pushing code, rebasing, merging, or any git operations. Also triggers on quick command prefix 'gq' or 'gq:' for rapid operations like 'gq b:l' (list branches), 'gq b:n name' (create branch), 'gq:s' (status). Automatically analyzes changes, suggests appropriate commit strategies (amend vs new commit), follows project conventions, and ensures safe operations with confirmation for dangerous commands.

Effective Git

Smart Git workflow assistant that helps you commit, push, and manage code changes following best practices.

Getting Help

Quick help: When user asks "gq help", "gq:h", or "git help", run scripts/show_help.sh to display usage guide

Detailed help: When user asks about specific topics:

  • "show me git best practices" → Read references/best-practices.md
  • "how to resolve conflicts" → Read references/conflict-resolution.md
  • "quick commands list" → Read references/quick-commands.md

Usage examples:

  • Use gq <command> for quick operations (status, branch switching, etc.)
  • Use natural language for commits, pushes, merges (full workflow with analysis and safety checks)
  • Examples:

- "gq b:l" → Quick branch list - "help me commit code" → Full commit workflow with analysis - "gq:s" → Quick status - "resolve conflicts" → Full conflict resolution with guidance

Core Workflow

When helping with git operations, follow this sequence:

Quick Operations Mode

For simple, read-only operations or quick checks, use scripts/git_quick.sh:

When user asks for:

  • "list branches" → git_quick.sh b:l
  • "switch to xxx" → git_quick.sh "b->" xxx
  • "create branch xxx" → git_quick.sh b:n xxx
  • "check status" → git_quick.sh s
  • "recent commits" → git_quick.sh l
  • "show changes" → git_quick.sh "d"

- If GIT_QUICK_DIFF_TERMINAL is set, opens in new terminal window - Otherwise uses $PAGER (default: less) - Staged changes: git_quick.sh "d:s"

See references/quick-commands.md for full command list.

Full Workflow Mode

For commits, pushes, merges, and conflict resolution, follow the detailed workflow below:

1. Analyze Recent Changes

Run scripts/analyze_changes.sh to understand:

  • Current branch
  • Uncommitted changes
  • Recent commit history
  • Last commit details

2. Determine Commit Strategy

Check if changes should amend the last commit or create a new one:

Use git commit --amend when:

  • Fixing typos or small issues in the last commit
  • Adding forgotten files to the last commit
  • Last commit hasn't been pushed yet
  • Changes are logically part of the last commit

Use git commit -m "message" when:

  • Changes represent a new logical unit of work
  • Last commit has been pushed
  • Changes are unrelated to the last commit

3. Check Project Conventions

Before writing commit message:

  1. Review recent commit messages: git log --oneline -10
  2. Look for patterns:

- Prefixes (feat:, fix:, chore:, etc.) - Ticket references (#123, JIRA-456) - Emoji usage (✨, 🐛, 📝) - Capitalization style

  1. If unclear, ask user about project conventions

4. Write Commit Message

Follow conventions from references/best-practices.md:

  • Use imperative mood ("Add feature" not "Added feature")
  • Keep subject line under 50 chars
  • Be specific and descriptive
  • Match project conventions discovered above

5. Safe Push Operations

Critical constraint: Only push to current branch.

Before pushing:

  1. Confirm current branch: git branch --show-current
  2. Show what will be pushed: git log origin/$(git branch --show-current)..HEAD --oneline
  3. Ask user to confirm
  4. Push: git push origin HEAD

Never use git push --force without explicit user confirmation.

Dangerous Operations

These require user confirmation before execution:

  • git push --force or git push -f
  • git reset --hard
  • git clean -fd
  • git rebase on shared/public branches
  • git branch -D (force delete)
  • Any history rewriting on pushed commits

Always explain the risk before asking for confirmation.

Conflict Resolution

Critical Principle: When resolving conflicts, the absolute priority is preserving all code. If unable to confidently resolve, you must summarize the issue and feedback to the user. DO NOT perform automatic merges.

Conflict Handling Workflow:

  1. Pre-merge/Rebase Snapshot: Before attempting a merge or rebase, save a snapshot of the current state for documentation and safety.
    scripts/save_diff.sh
    # Also create backup branch
    git branch <current-branch>-backup

This creates a git diff document before the merge.

  1. Detect and Analyze Conflicts: If conflicts arise during a merge or rebase:
    scripts/analyze_conflicts.sh

This provides detailed three-way diff analysis for each conflicted file.

  1. Deep Conflict Analysis: For complex conflicts where both sides modified the same code:

Analyze the intent: - What problem does each version solve? - What functionality does each add/remove/modify? - Is it a bug fix, feature, refactor, or optimization?

Compare approaches: - Do they implement different algorithms? - Do they change APIs or interfaces differently? - What are the trade-offs (performance vs readability, simplicity vs robustness)?

Determine resolution strategy: - Keep Both (Merge): Both changes are valuable and can be combined - Keep Ours: Our change is more complete/correct - Keep Theirs: Their change is more complete/correct - Rewrite: Neither is ideal, create better solution combining insights - Ask User: Cannot decide confidently, need user guidance

  1. Present Analysis to User: When conflicts cannot be resolved automatically, create a structured summary:

- Show both versions of conflicting code - Explain the intent and trade-offs of each - Provide your recommendation with reasoning - Ask for user's decision - See references/conflict-resolution.md for detailed template

  1. Post-Resolution Documentation: After conflicts are resolved:
    # Generate diff of resolution
    git diff --cached > .git/merge-diffs/resolution_$(date +%Y%m%d_%H%M%S).diff
    
    # Show summary
    git diff --cached --stat
  1. Verify No Code Loss: After completing merge/rebase:
    # Compare with backup branch
    git diff <branch>-backup <branch>
    
    # Review carefully for unexpected deletions

Special attention for edge cases:

  • Detached HEAD: Scripts will detect and warn; recommend creating a branch before operations
  • Submodules: Detected and flagged; require special handling (see references/conflict-resolution.md)
  • Large files: Output automatically limited to prevent overwhelming context
  • Rebase to less code: Default to preserving current branch's work (see references/conflict-resolution.md)

Rebase & Merge

Interactive Rebase

# Clean up last N commits
git rebase -i HEAD~N

# Rebase feature branch onto main
git checkout feature-branch
git fetch origin
git rebase origin/main

Merge Strategies

# Standard merge (preserves history)
git merge feature-branch

# Squash merge (single commit)
git merge --squash feature-branch

Common Tasks

Stash Changes

git stash                    # Stash current changes
git stash list              # List stashes
git stash pop               # Apply and remove last stash
git stash apply stash@{0}   # Apply specific stash

Cherry-pick

git cherry-pick <commit-hash>

Undo Changes

git restore <file>          # Discard working changes
git restore --staged <file> # Unstage file
git reset HEAD~1            # Undo last commit (keep changes)

Resources

  • Help script: scripts/show_help.sh (usage guide and examples)
  • Best practices reference: references/best-practices.md
  • Conflict resolution guide: references/conflict-resolution.md (includes detailed analysis framework and templates)
  • Quick commands reference: references/quick-commands.md (shorthand for common operations)
  • Change analysis script: scripts/analyze_changes.sh
  • Conflict analysis script: scripts/analyze_conflicts.sh (deep three-way diff analysis)
  • Save diff script: scripts/save_diff.sh
  • Visualize conflicts script: scripts/visualize_conflicts.sh
  • Quick operations script: scripts/git_quick.sh (fast branch switching, status checks, etc.)

Quick Commands

For rapid git operations, use scripts/git_quick.sh with the gq prefix pattern:

Trigger pattern: When user message starts with gq: or uses git quick command syntax

Common commands:

  • gq b:l or gq:b:l - List branches
  • gq b-> <name> - Switch to branch
  • gq b:n <name> - Create new branch from current
  • gq s - Quick status
  • gq l - Recent commits
  • gq d - Show diff

Usage in conversation:

  • User: "gq b:l" → Run scripts/git_quick.sh b:l
  • User: "gq b-> feature" → Run scripts/git_quick.sh "b->" feature
  • User: "gq:s" → Run scripts/git_quick.sh s

⚠️ Shell quoting rule: Always quote the command argument when calling git_quick.sh to prevent shell misinterpreting special characters. Use git_quick.sh "b->" <branch>, never git_quick.sh b-> <branch> (shell will treat > as redirection).

See references/quick-commands.md for full command list and usage patterns.

Important: Only trigger quick commands when user explicitly uses gq prefix or quick command syntax. Do not auto-trigger for general git questions.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

84.44%
按下载量换算1,280

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install effective-git 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills