ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

gitcode-pr-audit

Quality audit for merged GitCode PRs: sample by time range or repo list, check compliance (labels, comments, tests, size, etc.), output table. Use when user asks to 抽检/质量检查 已合入的 PR 规范性、多仓库 PR、或 将结果整理成表格. Multi-repo (owner/repo). Python 3.7+ stdlib only.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/autoxj/gitcode-pr-audit
Or

GitCode 合入 PR 质量抽检

对指定时间范围内合入主分支的 PR 进行抽检,按多维度判断质量并输出表格。支持多仓库、可配置阈值与必选标签,输出可写为 Markdown 或 CSV。

何时使用

  • 用户表达以下任一意图时使用本 skill:
    • 规范性抽检/质量抽检:如「对已合入的 PR 进行质量抽检」「最近 30 天合入的 PR 抽检」「已合入 PR 规范性检查」;
    • 多仓库/仓库列表:如「对以下仓库的 PR 抽检」「对owner组织下某几个仓库的 PR 检查」;
    • 输出形式:如「将抽检结果整理成表格」「输出表格形式」。
  • 需提供 至少一个仓库(格式 owner/repo);可多仓库、可选时间(默认最近 30 天)与分支、可选抽检数量或「全部」检查。

认证

GITCODE_TOKEN:按以下优先级读取。

优先级来源
1进程环境变量 GITCODE_TOKEN
2Windows 用户级环境变量
3Windows 系统级环境变量
  • Linux/macOS:在 ~/.bashrc~/.zshrcexport GITCODE_TOKEN="..."
  • 未配置时:脚本报错并提示到 GitCode 个人访问令牌 创建并设置环境变量。

路径与跨平台

  • 技能根目录SKILL_ROOT):本 SKILL.md 所在目录。脚本通过 __file__ 定位,不依赖当前工作目录。
  • 支持 Linux / macOS / Windows;执行时使用脚本绝对路径(如 python <SKILL_ROOT>/scripts/pr_audit.py ...)。

固化流程

  1. 解析参数:从用户输入提取 --repo(可多个)、--pr(可多个)、--branch--since--until--days--all--output 等。
  2. 调用脚本
    python <SKILL_ROOT>/scripts/pr_audit.py --repo owner/repo [--pr N] [--pr N2 ...] [--branch BRANCH] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--days N] [--all] [--output path.md|path.csv]
    
    • 指定 PR 时:使用 --pr N(可多次)并且仅指定一个 --repo,脚本只检查这些 PR,不按时间范围拉取。
    • 未指定 --pr 时:未指定时间则默认 最近 30 天--days 30);指定 --since/--until 则按用户时间。
    • 未指定分支时,每个仓库依次尝试 master → develop → main,都不存在则报错;指定则用指定分支,不存在则报错。
    • 未指定抽检数量时,每个仓库随机抽 5~10 条分析,不足 5 条则全部分析;用户明确「全部」或「所有」或传 --all 时,该时间范围内合入的 PR 全部检查。
  3. 读取结果:脚本将表格输出到 stdout(Markdown 格式);若指定 --output 则同时写入该文件(.md 或 .csv)。退出码非 0 或 stderr 有错误时,向用户展示错误并结束。
  4. 成功:将 stdout 表格呈现给用户;若写入了文件,说明路径。

脚本参数

参数必填说明
--repo是(可多次)仓库,格式 owner/repo,可多次传入多仓库
--pr否(可多次)指定 PR 编号;与时间范围二选一,使用时常需且仅需一个 --repo
--branch目标分支;未传时自动尝试 master → develop → main
--since起始日期 YYYY-MM-DD(含该日 00:00 上海时间)
--until结束日期 YYYY-MM-DD(含该日 24:00 前)
--days最近 N 天(默认 30);与 since/until 二选一,未指定 since/until 时生效
--all不抽样,该时间范围内合入的 PR 全部检查
--output输出文件路径,扩展名 .md 或 .csv,UTF-8(CSV 带 BOM)
--config配置文件路径,未传则使用技能根目录下 config.json
  • 指定 PR:传 --pr N(可多个)时仅检查这些 PR,需且仅需一个 --repo,不按时间筛选。
  • 时间约定:仅用 --days、或仅用 --since/--until。若同时传,脚本按 --since/--until 优先。
  • 多仓库时:每个仓库各自按上述规则抽样或全部检查(方案 A)。

分析维度(8 项)

Metadata

Author@autoxj
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-autoxj-gitcode-pr-audit": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.