← 返回 Skills 市场
94
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gitskills
功能描述
提供GitHub操作的完整解决方案,包括仓库管理、分支管理、PR和Issue管理、安全最佳实践、开源项目规范和IM通道集成。当用户需要操作GitHub仓库、创建开源项目或集成IM通道时调用。
使用说明 (SKILL.md)
GitHub 操作技能
本技能提供GitHub操作的完整解决方案,包括仓库管理、分支管理、PR和Issue管理、安全最佳实践、开源项目规范和IM通道集成。
核心功能
1. 仓库管理
- 创建仓库:支持设置仓库名称、描述和隐私设置
- 列出仓库:获取用户所有仓库列表
- 查看仓库详情:获取仓库的详细信息
- 删除仓库:安全删除指定仓库
2. 分支管理
- 创建分支:从默认分支创建新分支
- 列出分支:获取仓库的所有分支
3. PR管理
- 创建PR:支持设置标题、内容、源分支和目标分支
- 列出PR:获取仓库的所有PR
4. Issue管理
- 创建Issue:支持设置标题和内容
- 列出Issue:获取仓库的开放Issue
5. 安全最佳实践
- Token管理:使用环境变量存储GitHub token
- .gitignore配置:确保敏感文件不被提交
- Git历史清理:移除已提交的敏感信息
- 最小权限原则:使用最小权限的token
6. 开源项目规范
- README.md:项目说明、安装指南、使用方法
- LICENSE:开源许可证文件
- CONTRIBUTING.md:贡献指南
- 标准目录结构:组织代码和文档
7. IM通道集成
- 飞书:通过Webhook发送消息
- 企业微信:通过企业微信应用发送消息
- 微信个人号:通过iLink Bot发送消息
- Slack:通过Slack API发送消息
环境配置
1. 安装依赖
pip install PyGithub python-dotenv requests
2. 配置环境变量
创建.env文件:
# GitHub API Token
GITHUB_TOKEN=你的GitHub令牌
# 飞书配置
FEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-id
# 企业微信配置
WECOM_CORP_ID=你的企业ID
WECOM_APP_SECRET=你的应用密钥
WECOM_AGENT_ID=你的应用ID
# 微信个人号配置
WEIXIN_BOT_TOKEN=你的iLink Bot Token
WEIXIN_API_URL=https://api.ilink.qq.com
# Slack配置
SLACK_API_TOKEN=你的Slack API Token
使用示例
仓库管理
# 列出所有仓库
python main.py repo list
# 创建新仓库
python main.py repo create --name my-repo --description "我的新仓库"
# 获取仓库详情
python main.py repo get --name my-repo
# 删除仓库
python main.py repo delete --name my-repo
分支管理
# 创建新分支
python main.py branch create --repo my-repo --name feature-branch
# 列出分支
python main.py branch list --repo my-repo
PR管理
# 创建PR
python main.py pr create --repo my-repo --title "添加新功能" --body "这是一个新功能" --head feature-branch --base main
# 列出PR
python main.py pr list --repo my-repo
Issue管理
# 创建Issue
python main.py issue create --repo my-repo --title "Bug报告" --body "有东西坏了"
# 列出Issue
python main.py issue list --repo my-repo
安全措施
- Token安全:GitHub token存储在环境变量中,不硬编码在代码中
- 权限控制:使用最小权限的token
- 操作验证:重要操作需要用户确认
- 日志记录:记录所有操作,便于审计
- 错误处理:处理异常情况,避免信息泄露
IM通道集成示例
飞书集成
class FeishuIntegration:
def __init__(self):
self.feishu_webhook_url = os.getenv('FEISHU_WEBHOOK_URL')
def send_message(self, message):
if self.feishu_webhook_url:
payload = {
"msg_type": "text",
"content": {
"text": message
}
}
response = requests.post(self.feishu_webhook_url, json=payload)
return response.json()
return {"error": "FEISHU_WEBHOOK_URL not set"}
微信集成
class WeChatIntegration:
def __init__(self):
# 企业微信配置
self.wecom_corp_id = os.getenv('WECOM_CORP_ID')
self.wecom_app_secret = os.getenv('WECOM_APP_SECRET')
self.wecom_agent_id = os.getenv('WECOM_AGENT_ID')
# 微信个人号配置(使用iLink Bot)
self.weixin_bot_token = os.getenv('WEIXIN_BOT_TOKEN')
self.weixin_api_url = os.getenv('WEIXIN_API_URL', 'https://api.ilink.qq.com')
开源项目规范
README.md 模板
# 项目名称
项目描述
## 功能特性
- 功能1
- 功能2
- 功能3
## 安装说明
1. 克隆仓库
2. 安装依赖
3. 配置环境变量
## 使用方法
### 命令示例
```bash
# 命令1
# 命令2
# 命令3
贡献指南
详见CONTRIBUTING.md文件。
许可证
本项目采用MIT许可证 - 详见LICENSE文件。
### .gitignore 模板
环境变量文件
.env
依赖目录
pycache/ *.py[cod]
编辑器文件
.vscode/ .idea/ *.swp *.swo *~
系统文件
.DS_Store Thumbs.db
## 最佳实践
1. **代码组织**:使用模块化设计,分离核心逻辑和命令行接口
2. **错误处理**:使用try-except捕获异常,提供友好的错误信息
3. **文档编写**:使用中文编写清晰的文档,便于国内开发者理解
4. **安全意识**:时刻注意保护敏感信息,避免硬编码
5. **版本控制**:使用Git进行版本控制,提交有意义的commit信息
## 常见问题
### 1. GitHub token权限不足
**解决方案**:在GitHub个人访问令牌设置中,确保选择了适当的权限范围,如`repo`权限。
### 2. 网络连接问题
**解决方案**:检查网络连接,确保能访问GitHub API。
### 3. 敏感信息泄露
**解决方案**:使用`.gitignore`文件排除敏感文件,使用环境变量存储敏感信息。
### 4. 命令执行错误
**解决方案**:检查命令参数是否正确,确保仓库名称存在,分支名称有效。
## 总结
本技能提供了GitHub操作的完整解决方案,涵盖了仓库管理、分支管理、PR和Issue管理、安全最佳实践、开源项目规范和IM通道集成。通过使用本技能,用户可以安全、高效地管理GitHub仓库,创建标准化的开源项目,并通过各种IM通道进行控制。
安全使用建议
This skill appears to do what it says: GitHub management plus optional IM notifications. Before installing: 1) Confirm the registry metadata mismatch — the script requires GITHUB_TOKEN even though the registry listed none. 2) Only provide a GitHub token with the minimal scopes needed (prefer a repo-scoped machine/service account instead of a personal token). 3) Review and only supply IM webhook/API tokens for channels you trust; the skill will post messages to configured endpoints. 4) Run the code in an isolated environment or test account first, and inspect scripts (scripts/main.py) yourself to ensure there are no hidden network endpoints or behaviors you don't accept. 5) For destructive actions (delete repo), the code requires explicit confirmation; still test carefully and avoid giving high-privilege tokens to untrusted agents.
功能分析
Type: OpenClaw Skill
Name: github-operations
Version: 1.0.0
The skill bundle provides GitHub repository management and IM integration (Feishu, Slack, WeChat). It is classified as suspicious due to the 'clean_git_history' function in 'scripts/main.py', which uses 'subprocess.run' to execute 'git filter-branch' with a formatted string, creating a potential shell injection vulnerability within the shell environment spawned by Git. Additionally, the IM integration features provide a functional path for data exfiltration if the agent is manipulated into sending sensitive environment variables (like GITHUB_TOKEN) to external webhooks.
能力评估
Purpose & Capability
Name/description describe GitHub repo/PR/issue management plus IM integrations. The code implements GitHub operations (via PyGithub) and IM webhook/API callers (Feishu, WeCom, iLink, Slack), which is coherent with the stated purpose.
Instruction Scope
SKILL.md instructs installing PyGithub/python-dotenv/requests, creating a .env with GitHub and IM tokens, and running the provided CLI. The runtime instructions and included scripts focus on GitHub and IM actions; they do not read unrelated system files or reach unexpected external endpoints beyond the documented IM providers and GitHub API.
Install Mechanism
No install spec is provided (instruction-only), and dependencies are declared in requirements.txt (PyPI packages). There are no downloads from arbitrary URLs or archive extraction steps in the package metadata — dependency installation is proportional to the functionality.
Credentials
The code and SKILL.md require a GITHUB_TOKEN and various IM tokens, which are appropriate for the feature set. However, top-level skill metadata in the provided registry excerpt lists "Required env vars: none" and "Primary credential: none", which conflicts with the script and SKILL.md that both require GITHUB_TOKEN and optional IM credentials. Verify the registry metadata before installing. Also ensure tokens use least privilege (e.g., repo-scoped token, not full account access).
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent platform-wide privileges or attempt to modify other skills. Note: autonomous invocation (disable-model-invocation=false) is the platform default — combined with networked credentials this increases operational blast radius, so be cautious about what tokens are provided and to which agent instances this skill is granted.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gitskills - 安装完成后,直接呼叫该 Skill 的名称或使用
/gitskills触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release with repository management, branch management, PR management, issue management, git history cleaning, and IM channel integration
元数据
常见问题
GitHub Operations 是什么?
提供GitHub操作的完整解决方案,包括仓库管理、分支管理、PR和Issue管理、安全最佳实践、开源项目规范和IM通道集成。当用户需要操作GitHub仓库、创建开源项目或集成IM通道时调用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 94 次。
如何安装 GitHub Operations?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gitskills」即可一键安装,无需额外配置。
GitHub Operations 是免费的吗?
是的,GitHub Operations 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
GitHub Operations 支持哪些平台?
GitHub Operations 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 GitHub Operations?
由 AI花生(@edwardwason)开发并维护,当前版本 v1.0.0。
推荐 Skills