mcpField
S
sc-git

sc-git

github.com/tony363开发2090 次安装30 周前更新
代码仓库

关于 sc-git

sc-git 是用于分析仓库状态并自动执行常见 Git 操作的技能,可生成 Conventional Commits 提交信息并引导合并,也可通过 PAL MCP 和 Rube MCP 协调验证及仓库操作。

主要功能

  1. 01分析仓库状态并提供建议
  2. 02生成 Conventional Commits 提交信息
  3. 03引导合并并协助处理冲突
  4. 04通过 PAL MCP 验证和审查代码
  5. 05通过 Rube MCP 创建 PR 并发送通知

适用场景

  1. 01提交前检查暂存和未暂存的更改
  2. 02根据 diff 生成提交信息
  3. 03按步骤处理合并冲突
  4. 04运行提交前检查或创建 PR

MCP 相关

该技能可使用 PAL MCP 执行提交前验证、代码审查、冲突处理策略和 Git 问题排查。它也可使用 Rube MCP 查找仓库工具、创建 PR、通知团队及更新问题。

安装

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

$npx skills add https://github.com/tony363/superclaude --skill sc-git

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

详细介绍

Git 操作技能

智能 Git 操作与智能提交信息生成。

快速开始

# Status analysis
/sc:git status

# Smart commit
/sc:git commit --smart-commit

# Interactive merge
/sc:git merge feature-branch --interactive

行为流程

  1. 分析 - 检查仓库状态和变更
  2. 验证 - 确保操作合适
  3. 执行 - 自动运行 Git 命令
  4. 优化 - 应用智能消息和模式
  5. 报告 - 提供状态和后续步骤

标志

标志类型默认值描述
--smart-commitboolfalse生成符合 Conventional Commits 规范的提交信息
--interactiveboolfalse引导式操作模式

证据要求

此技能不需要确凿证据。Git 操作通过以下信息即可自我说明:

  • 提交历史
  • 分支状态
  • 仓库日志

操作

状态分析
/sc:git status
# Repository state with change summary
# Actionable recommendations
智能提交
/sc:git commit --smart-commit
# Analyzes changes
# Generates conventional commit message
# Format: type(scope): description
分支操作
/sc:git branch feature/new-feature
/sc:git checkout main
/sc:git merge feature-branch
交互式操作
/sc:git merge feature --interactive
# Guided merge with conflict resolution
# Step-by-step assistance

提交信息格式

智能提交遵循 Conventional Commits 规范:

type(scope): description

[optional body]

[optional footer]

类型:

  • feat - 新功能
  • fix - 修复错误
  • docs - 文档
  • refactor - 代码重构
  • test - 添加测试
  • chore - 维护

示例

分析变更
/sc:git status
# Summary of staged/unstaged changes
# Recommended next actions
分析后提交
/sc:git commit --smart-commit
# Scans diff, generates message:
# feat(auth): add JWT token refresh mechanism
引导式合并
/sc:git merge feature/auth --interactive
# Conflict detection and resolution guidance
# Step-by-step assistance

MCP 集成

PAL MCP(验证与审查)
工具使用时机用途
mcp__pal__precommit提交前全面验证变更
mcp__pal__codereview合并前审查变更的代码质量
mcp__pal__consensus合并冲突多模型解决策略
mcp__pal__debugGit 问题调查仓库问题
PAL 使用模式
# Pre-commit validation (--smart-commit)
mcp__pal__precommit(
    path="/path/to/repo",
    step="Validating changes before commit",
    findings="Security, completeness, test coverage",
    include_staged=True,
    include_unstaged=False
)

# Review before merge
mcp__pal__codereview(
    review_type="full",
    step="Reviewing feature branch before merge",
    findings="Quality, security, breaking changes",
    compare_to="main"
)

# Consensus on merge conflict resolution
mcp__pal__consensus(
    models=[{"model": "gpt-5.2", "stance": "neutral"}, {"model": "gemini-3-pro", "stance": "neutral"}],
    step="Evaluate: Which conflict resolution preserves intended behavior?"
)
Rube MCP(自动化与通知)
工具使用时机用途
mcp__rube__RUBE_SEARCH_TOOLSGitHub/GitLab查找仓库管理工具
mcp__rube__RUBE_MULTI_EXECUTE_TOOLPR/通知创建 PR、通知团队、更新问题
mcp__rube__RUBE_CREATE_UPDATE_RECIPEGit 工作流保存可复用的 Git 自动化流程
Rube 使用模式
# Create PR and notify team after commit
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
    {"tool_slug": "GITHUB_CREATE_PULL_REQUEST", "arguments": {
        "repo": "myapp",
        "title": "feat: Add user authentication",
        "body": "## Summary\n- Added JWT auth\n- Added refresh tokens",
        "base": "main",
        "head": "feature/auth"
    }},
    {"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
        "channel": "#pull-requests",
        "text": "New PR ready for review: feat: Add user authentication"
    }}
])

# Update issue status on merge
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
    {"tool_slug": "JIRA_UPDATE_ISSUE", "arguments": {
        "issue_key": "PROJ-123",
        "status": "Done"
    }},
    {"tool_slug": "GITHUB_CREATE_ISSUE_COMMENT", "arguments": {
        "repo": "myapp",
        "issue_number": 456,
        "body": "Merged in PR #789"
    }}
])

标志(扩展)

标志类型默认值描述
--pal-precommitboolfalse使用 PAL 提交前验证
--pal-reviewboolfalse合并前使用 PAL 代码审查
--create-prboolfalse提交后通过 Rube 创建 PR
--notifystring-通过 Rube 通知(slack、teams、email)

工具协调

  • Bash - 执行 Git 命令
  • Read - 分析仓库状态
  • Grep - 解析日志
  • Write - 生成提交信息
  • PAL MCP - 提交前验证、代码审查、冲突解决
  • Rube MCP - 创建 PR、团队通知、问题更新

评论

支持 Markdown