ClawSkills logoClawSkills

Gitai - Git Commit Automation

利用 Gitai 提升开发人员生产力:这是一款 AI 驱动的 Git 自动化工具,可分析代码更改并即时生成语义化的 Conventional Commits。支

介绍

# Gitai Automation - AI-Powered Git Workflow

> **通过智能、自动化的提交管理,改变您的开发工作流。**

Gitai 分析您的代码更改,生成符合 **Conventional Commits** 标准的精确、描述性提交信息。它消除了编写提交信息的繁琐过程,自动确保干净、语义化和专业的 git 历史记录。

**核心功能:** - **通用语言支持**:支持分析 Node.js、Python、Java、Go、PHP 等。 - **多 LLM 支持**:选择您偏好的 AI 大脑——OpenAI (GPT)、Anthropic (Claude) 或 Groq。 - **工作流自动化**:通过单一命令完成暂存、提交和推送更改。 - **标准化历史**:强制执行项目版本历史的一致性。

---

## 📦 前置条件(必须)

此技能要求系统上必须先安装并配置 `@notyped/gitai` CLI 工具,**然后**代理才能运行。

**代理绝不得尝试安装此软件包或对其进行配置。**

1. **检查** `gitai` 是否可用: ```bash command -v gitai ``` 2. **如果缺失**,立即停止并通知用户: > "The `gitai` CLI tool is not installed. Please install it globally (e.g., `npm install -g @notyped/gitai`) and configure it before using this skill." 3. **检查** `~/.gitai` 是否存在。 4. **如果缺失**,立即停止并通知用户: > "The `gitai` tool is installed but not configured. Please run `gitai` in your terminal to complete the setup."

5. **仅当两项检查均通过后**,继续操作。

## 🚀 用法与工作流

### 命令结构 基于 `gitai --help`: ```bash gitai [options] [projectPath] [baseMessage] ```

**参数:** - `projectPath`:项目路径(默认:".")。 - `baseMessage`:基础提交信息(可选)。

**选项:** - `-p, --push`:提交后是否推送(默认:false)。 - `-V, --version`:输出版本号。 - `-h, --help`:显示命令帮助。

### 标准工作流

| 命令 | 动作描述 | |---------|--------------------| | `gitai . ''` | 分析当前文件夹,生成信息并提交 | | `gitai . '' --push` | 分析当前文件夹,生成信息,提交,**并**推送到远程 | | `gitai ./frontend 'ui update'` | 仅分析 `./frontend` 目录,生成信息并提交 |

### 验证 检查当前激活的 Gitai 版本: ```bash gitai --version ```

---

## ⚠️ 故障排除

- **交互式向导卡住**:如果 `gitai` 在等待输入时卡住,这意味着 `~/.gitai` 缺失或无效。请按照步骤 2 中的描述手动创建该文件。 - **Node 版本错误**:确保激活了 Node.js 18+ (`node -v`)。 - **API 错误**:检查 `~/.gitai` 中的 `API_KEY`。

---

## 链接 - **GitHub**: [https://github.com/leandrosilvaferreira/gitai-skill](https://github.com/leandrosilvaferreira/gitai-skill) - **Issues**: [https://github.com/leandrosilvaferreira/gitai-skill/issues](https://github.com/leandrosilvaferreira/gitai-skill/issues)

## 作者 - **Leandro Zuck** - **GitHub**: [https://github.com/leandrosilvaferreira](https://github.com/leandrosilvaferreira) - **Email**: [email protected]

## 许可证 MIT

更多产品