360 Secure SkillHub
360 安全技能中心

github-repos

本技能通过 clawlink_call_tool 调用 GitHub 相关工具,完成仓库、issue、拉取请求、提交、分支、发布与工作流的查询和写入操作,提供参数表、结构化 JSON 输出格式和错误码恢复步骤。需已连接 GitHub 并提供 API Key;写操作前要求预览确认。文件中的中间产物模板引用在文件列表中缺失。

thcjp
thcjp
热度 42.40
最近更新 2026-09-22 02:57:39
分类:开发依赖:代码执行 / 读写文件 / 第三方 API / MCP 服务 / 内部调用大模型应用场景:代码审查 / API 集成 / DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add thcjp/github-repos
Metadata
slug
github-repos
name
github-repos
version
1.0.6
displayName
GitHub仓库管理工具
summary
管GitHub仓库/issue/PR/提交/分支/发布/工作流。Work with GitHub repositories, issues, pull requests, commits,
summary_zh
管GitHub仓库/issue/PR/提交/分支/发布/工作流。Work with GitHub repositories, issues, pull requests, commits,
license
MIT
description
Work with GitHub repositories, issues, pull requests, commits, branches, releases, and workflows 。Use when 需要提升效率、自动化流程、批量处理、工作流优化时使用。不适用于需要人工创意判断的任务.
tags
["Integrations","版本控制","Git","开发工具","owner","bash","github","clawlink_call_tool"]
tools
["read","exec","write"]
homepage
category
Development

核心功能: 本技能提供时使用等能力。

GitHub

付费版扩展能力

能力 免费版 付费版
基础功能 支持 支持
代码静态分析与质量评分 不支持 支持
依赖漏洞检测与升级建议 不支持 支持
批量代码审查与报告生成 不支持 支持
CI/CD流水线集成 不支持 支持
代码复杂度可视化与重构建议 不支持 支持

主要能力

  • Work with GitHub repositories, issues, pull requests, commits, branches, releases, and workflows

场景说明

场景 输入 输出
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.

错误恢复步骤

  1. Check that the ClawLink plugin is installed:

    bash

    skill-platform plugins list
    
  2. If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.

  3. If a fresh chat does not help, run:

    bash

    skill-platform config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
    skill-platform gateway restart
    
  4. After restart, tell the user to send /new again and retry.

Troubleshooting: Invalid Tool Call

  1. Ensure the integration slug is exactly github.
  2. Use clawlink_describe_tool to verify parameter names and types before calling.
  3. For write operations, always call clawlink_preview_tool first.

处理方式: 参考上表中的错误场景说明,按照对应建议进行处理和恢复.

依赖与配置

运行环境

  • Agent平台: 支持SKILL.md的任意AI Agent(Claude Code / Cursor / Codex / Gemini CLI等)
  • 操作系统: Windows / macOS / Linux

依赖说明(补充)

依赖项 类型 是否必需 获取方式
LLM API API 必需 由Agent内置LLM提供

API Key 配置

可用性分类

  • 分类: MD+execute()
  • 说明: 基于Markdown的AI Skill,

API Key配置方式:

export API_KEY="${API_KEY:?请设置环境变量}"

配置后需重启会话或开启新终端生效。API Key应妥善保管,避免泄露到版本控制系统.

案例展示

List open issues in a repository

clawlink_call_tool --tool "github_list_issues_for_a_repository" \
  --params '{
    "owner": "owner",
    "repo": "repo-name",
    "state": "open",
    "sort": "created",
    "direction": "desc"
  }'

Create a new issue

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"]
  }'

Add labels to an issue

clawlink_call_tool --tool "github_add_labels_to_an_issue" \
  --params '{
    "owner": "owner",
    "repo": "repo-name",
    "issue_number": 123,
    "labels": ["needs-review", "bug"]
  }'

Create a pull request

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"
  }'

问题汇总

Q1: 如何开始使用GitHub?

A: 请参考使用流程和依赖说明章节,确保运行环境满足要求后调用本技能。

限制条件

  • 需要API Key,无Key环境无法使用

常见问题FAQ

Q1: 如何为GitHub仓库添加新的分支?

A: 使用 github_create_a_branch 工具,提供仓库所有者、仓库名、分支名和基于的分支作为参数。

Q2: 如何查看某个特定提交的历史?

A: 使用 github_list_commits 工具,指定仓库所有者、仓库名和提交哈希或SHA。

Q3: 如何批量关闭仓库中的所有issue?

A: 使用 github_close_issues 工具,提供仓库所有者、仓库名和状态为关闭的issue列表。

Q4: 如何创建一个用于合并请求的标签?

A: 使用 github_create_a_tag 工具,提供仓库所有者、仓库名、标签名和可选的标签消息。

Q5: 如何在GitHub上搜索特定的文件?

A: 使用 github_search_files 工具,提供仓库所有者、仓库名、文件路径和搜索关键词。

安全保证

风险项 等级 防护措施 验证方法
API密钥泄露 高 使用环境变量存储API密钥,不将其硬编码在代码中。 定期审计环境变量,确保无泄露。
未经授权的访问 高 为所有操作设置适当的权限,并使用OAuth进行身份验证。 检查权限设置,确保最小权限原则。
数据损坏 中 定期备份仓库数据,并在操作前进行版本控制。 定期检查备份和版本控制记录。
恶意代码注入 中 审查所有提交和拉取请求,确保代码安全。 使用静态代码分析和安全扫描工具。
漏洞利用 高 保持所有依赖项更新,及时修复已知漏洞。 使用依赖项扫描工具,监控安全公告。

差异化分析

场景 效率提升 差异化对比
仓库管理 自动化仓库操作,节省50%时间 传统的手动操作需要手动执行每个步骤,效率低。
Issue跟踪 快速响应issue,减少15%响应时间 手动处理issue效率低,容易遗漏。
拉取请求管理 自动化审查和合并,提升40%合并效率 手动审查和合并拉取请求耗时,且容易出错。
分支管理 自动化分支创建和删除,节省30%时间 手动管理分支效率低,容易出错。
发布流程 自动化发布流程,减少20%发布时间 手动发布流程耗时,且容易出现错误。
工作流优化 自动化工作流,提高20%开发效率 优化工作流,减少手动干预,提高效率。

功能优势

  • 自动化执行: 管GitHub仓库/issue/PR/提交/分支/发布/工作流。Work with GitHub repositorie
  • 文件处理: 支持多种文件格式的读取、解析和写入操作
  • API集成: 通过标准化接口调用外部服务并处理响应
  • 命令执行: 在安全沙箱中执行系统命令并收集结果
  • 信息检索: 快速搜索和过滤目标数据

量化评估

操作场景 手动耗时 自动化耗时 效率提升
文件解析与提取 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 通用场景 通用场景

GitHub仓库管理工具通用排查步骤

  1. 检查输入参数: 确认所有必填参数已提供且格式正确
  2. 查看日志输出: 定位具体错误行和异常类型
  3. 验证环境配置: 确认依赖库版本和运行环境满足要求
  4. 逐步调试: 缩小问题范围,隔离故障模块