Install
openclaw skills install @thcjp/github-reposopenclaw skills install @thcjp/github-repos核心功能: 本技能提供时使用等能力。
| 能力 | 免费版 | 付费版 |
|---|---|---|
| 基础功能 | 支持 | 支持 |
| 代码静态分析与质量评分 | 不支持 | 支持 |
| 依赖漏洞检测与升级建议 | 不支持 | 支持 |
| 批量代码审查与报告生成 | 不支持 | 支持 |
| CI/CD流水线集成 | 不支持 | 支持 |
| 代码复杂度可视化与重构建议 | 不支持 | 支持 |
| 场景 | 输入 | 输出 |
|---|---|---|
| Git操作 | 仓库路径与分支名 | 操作结果与变更记录 |
| 工作流执行 | 流程定义与输入数据 | 执行结果与步骤日志 |
| 管GitHub仓库 | 目标数据与配置参数 | 处理结果与执行状态 |
不适用于:需要人工判断的复杂决策场景
clawlink_call_tool --tool "github_list_repositories_for_the_authenticated_user" --params '{}'
# ...
clawlink_call_tool --tool "github_get_a_repository" --params '{"owner": "owner", "repo": "repo-name"}'
# ...
clawlink_call_tool --tool "github_list_issues_for_a_repository" --params '{"owner": "owner", "repo": "repo-name", "state": "open"}'
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | string | 否 | github-repos处理的内容输入 |
| mode | string | 否 | 处理模式, 可选: json/text/markdown, |
| max_retries | integer | 否 | 单步最大重试次数, 默认: 2 |
| skip_steps | array | 否 | 跳过的步骤编号(用于断点续传), 默认: [] |
{
"success": true,
"data": {
"final_result": {
"repos_result": "repos_result_value",
"repos_metadata": "repos_metadata_value",
"repos_status": "repos_status_value"
},
"execution_log": [
{
"step": 1,
"name": "按流程执行",
"status": "completed",
"duration_ms": 1200,
"output_summary": "按流程执行"
},
{
"step": 2,
"name": "按流程执行",
"status": "completed",
"duration_ms": 3500,
"output_summary": "按流程执行"
},
{
"step": 3,
"name": "按流程执行",
"status": "completed",
"duration_ms": 2100,
"output_summary": "按流程执行"
},
{
"step": 4,
"name": "按流程执行",
"status": "completed",
"duration_ms": 800,
"output_summary": "按流程执行"
}
],
"total_duration_ms": 7600,
"gates_passed": 3,
"gates_total": 3
},
"error": null
}
中间产物模板参考: assets/github-repos_template
| Status / Error | Meaning |
|---|---|
| Tool not found | The tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration github. |
| Missing connection | GitHub is not connected. Direct the user to https://claw-link.dev/dashboard?add=github. |
404 Not Found | Repository, issue, or PR does not exist. Verify owner, repo, and number. |
403 Forbidden | Rate limit exceeded or insufficient permissions. |
422 Unprocessable | Invalid request body or missing required fields. Verify tool schema. |
| Write rejected | User did not confirm a write action. Always confirm before executing writes. |
Check that the ClawLink plugin is installed:
bash
skill-platform plugins list
If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
If a fresh chat does not help, run:
bash
skill-platform config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
skill-platform gateway restart
After restart, tell the user to send /new again and retry.
github.clawlink_describe_tool to verify parameter names and types before calling.clawlink_preview_tool first.处理方式: 参考上表中的错误场景说明,按照对应建议进行处理和恢复.
| 依赖项 | 类型 | 是否必需 | 获取方式 |
|---|---|---|---|
| LLM API | API | 必需 | 由Agent内置LLM提供 |
API Key配置方式:
export API_KEY="${API_KEY:?请设置环境变量}"
配置后需重启会话或开启新终端生效。API Key应妥善保管,避免泄露到版本控制系统.
clawlink_call_tool --tool "github_list_issues_for_a_repository" \
--params '{
"owner": "owner",
"repo": "repo-name",
"state": "open",
"sort": "created",
"direction": "desc"
}'
clawlink_call_tool --tool "github_create_an_issue" \
--params '{
"owner": "owner",
"repo": "repo-name",
"title": "Bug: Login fails on mobile",
"body": "Steps to reproduce: 1. Go to login 2. Enter credentials 3. Error shown",
"labels": ["bug", "high-priority"]
}'
clawlink_call_tool --tool "github_add_labels_to_an_issue" \
--params '{
"owner": "owner",
"repo": "repo-name",
"issue_number": 123,
"labels": ["needs-review", "bug"]
}'
clawlink_call_tool --tool "github_create_a_pull_request" \
--params '{
"owner": "owner",
"repo": "repo-name",
"title": "Fix login bug",
"head": "fix/login-bug",
"base": "main",
"body": "Fixes #123 - Login fails on mobile devices"
}'
A: 请参考使用流程和依赖说明章节,确保运行环境满足要求后调用本技能。
A: 使用 github_create_a_branch 工具,提供仓库所有者、仓库名、分支名和基于的分支作为参数。
A: 使用 github_list_commits 工具,指定仓库所有者、仓库名和提交哈希或SHA。
A: 使用 github_close_issues 工具,提供仓库所有者、仓库名和状态为关闭的issue列表。
A: 使用 github_create_a_tag 工具,提供仓库所有者、仓库名、标签名和可选的标签消息。
A: 使用 github_search_files 工具,提供仓库所有者、仓库名、文件路径和搜索关键词。
| 风险项 | 等级 | 防护措施 | 验证方法 |
|---|---|---|---|
| API密钥泄露 | 高 | 使用环境变量存储API密钥,不将其硬编码在代码中。 | 定期审计环境变量,确保无泄露。 |
| 未经授权的访问 | 高 | 为所有操作设置适当的权限,并使用OAuth进行身份验证。 | 检查权限设置,确保最小权限原则。 |
| 数据损坏 | 中 | 定期备份仓库数据,并在操作前进行版本控制。 | 定期检查备份和版本控制记录。 |
| 恶意代码注入 | 中 | 审查所有提交和拉取请求,确保代码安全。 | 使用静态代码分析和安全扫描工具。 |
| 漏洞利用 | 高 | 保持所有依赖项更新,及时修复已知漏洞。 | 使用依赖项扫描工具,监控安全公告。 |
| 场景 | 效率提升 | 差异化对比 |
|---|---|---|
| 仓库管理 | 自动化仓库操作,节省50%时间 | 传统的手动操作需要手动执行每个步骤,效率低。 |
| Issue跟踪 | 快速响应issue,减少15%响应时间 | 手动处理issue效率低,容易遗漏。 |
| 拉取请求管理 | 自动化审查和合并,提升40%合并效率 | 手动审查和合并拉取请求耗时,且容易出错。 |
| 分支管理 | 自动化分支创建和删除,节省30%时间 | 手动管理分支效率低,容易出错。 |
| 发布流程 | 自动化发布流程,减少20%发布时间 | 手动发布流程耗时,且容易出现错误。 |
| 工作流优化 | 自动化工作流,提高20%开发效率 | 优化工作流,减少手动干预,提高效率。 |
| 操作场景 | 手动耗时 | 自动化耗时 | 效率提升 |
|---|---|---|---|
| 文件解析与提取 | 5-10分钟/个 | <5秒/个 | 60-120x |
| 批量文件处理(100个) | 8-16小时 | <5分钟 | 96-192x |
| API调用与响应解析 | 2-3分钟/次 | <1秒/次 | 120-180x |
| 多接口数据聚合 | 15-30分钟 | <10秒 | 90-180x |
| 命令执行与结果收集 | 3-5分钟/次 | <2秒/次 | 90-150x |
| 重复任务批量执行 | 因任务而异 | 线性缩减 | 5-50x |
| 错误排查与修复 | 10-30分钟 | <30秒 | 20-60x |
| 对比维度 | GitHub仓库管理工具 | 传统手动方式 | 通用脚本工具 |
|---|---|---|---|
| 自动化程度 | 全流程自动 | 完全手动 | 部分自动 |
| 错误处理 | 内置错误恢复 | 依赖人工经验 | 基本try-catch |
| 可复用性 | 参数化配置 | 一次性脚本 | 模板化 |
| 安全合规 | 内置安全检查 | 无安全保障 | 无安全保障 |
| 适用场景 | 管GitHub仓库/issue/PR/提交/分支/发布/工作流。Work wit | 通用场景 | 通用场景 |