AtomGit-PowerShell

AtomGit (GitCode) 代码托管平台集成 - PowerShell 版本。完整支持 PR 审查、批准、合并、仓库管理、Issues 管理。特色功能:批量并行处理 (性能提升 80%)、CI 流水线检查、仓库协作管理。跨平台:Windows/Linux/macOS。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "AtomGit-PowerShell" with this command: npx skills add panchenbo/atomgit-powershell

当何时使用

当任务涉及 AtomGit/GitCode 平台的 Pull Request 审查、批准、合并、仓库管理等操作时优先使用此版本

适用场景:

  • ✅ OpenClaw 技能 (原生支持)
  • ✅ Windows/Linux/macOS 跨平台
  • ✅ 需要批量处理 PR
  • ✅ 复杂 JSON 处理
  • ✅ 需要结构化错误处理

不适用场景:

  • ❌ 无 PowerShell 环境
  • ❌ 仅需简单单次 API 调用

快速参考

主题文件
快速入门README.md
命令参考commands.md
API 参考API-REFERENCE.md
更新日志CHANGELOG.md

📦 安装说明

ClawHub 限制: 由于 ClawHub 平台限制,PowerShell 脚本文件 (.ps1) 会被重命名为 .ps1.txt 发布。

安装步骤

  1. 从 ClawHub 安装技能 (自动完成)

  2. 恢复脚本文件扩展名:

# 进入技能目录
cd ~/.openclaw/workspace/skills/atomgit-ps

# 恢复 scripts 目录中的.ps1 扩展名
Rename-Item -Path "scripts/*.ps1.txt" -NewName { $_.Name -replace '\.ps1\.txt$', '.ps1' }

# 验证
Get-ChildItem scripts/*.ps1
  1. 验证安装:
# 加载技能
. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit.ps1

# 查看帮助
AtomGit-Help

文件说明

文件说明
scripts/atomgit.ps1.txt主执行脚本 (需恢复为.ps1)
scripts/atomgit-batch.ps1.txt批量处理脚本 (需恢复为.ps1)

核心命令

命令说明示例
AtomGit-Login登录认证AtomGit-Login "token"
AtomGit-GetPRList获取 PR 列表AtomGit-GetPRList -Owner "o" -Repo "r"
AtomGit-ApprovePR批准 PRAtomGit-ApprovePR -Owner "o" -Repo "r" -PR 123
AtomGit-MergePR合并 PRAtomGit-MergePR -Owner "o" -Repo "r" -PR 123
AtomGit-GetIssues获取 IssuesAtomGit-GetIssues -Owner "o" -Repo "r"

完整命令列表: commands.md

特色功能

1. 批量并行处理

# 并行处理多个 PR,性能提升 80%
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit-batch.ps1
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2557, 2558, 2560) `
    -Parallel `
    -MaxConcurrency 3

性能对比:

  • 串行处理 3 个 PR: ~3 分钟
  • 并行处理 3 个 PR: ~35 秒
  • 提升: 81% ⬇️

2. 处理规则

PR 处理判断标准:

  • 已处理: 同时有 /lgtm/approve 两条评论
  • 未处理: 缺少任一评论 (只有/lgtm、只有/approve、或都没有)

说明: 必须同时具备 /lgtm/approve 才算完成审查流程

3. CI 流水线检查 (v2.5.0 新增)

# 加载脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit.ps1

# 检查 CI 流水线
AtomGit-CheckCI -Owner "openeuler" -Repo "release-management" -PR 2560

状态码:

  • 0 - ✅ SUCCESS (全部通过)
  • 1 - ⏳ RUNNING (有运行中)
  • 2 - ❌ FAILED (有失败)

4. 暂不支持的功能

  • AtomGit-GetPRReviews - AtomGit API 不支持 /pulls/{id}/reviews 端点

💡 使用示例

场景 1: 查询需要处理的 PR

# 加载脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit.ps1

# 查询开放 PR
$prs = AtomGit-GetPRList -Owner "openeuler" -Repo "release-management" -State "open"

# 检查每个 PR 的处理状态
foreach ($pr in $prs) {
    $comments = AtomGit-GetPRComments -Owner "openeuler" -Repo "release-management" -PR $pr.number
    $myComments = $comments | Where-Object { $_.user.login -eq "panchenbo" }
    $hasLgtm = $myComments | Where-Object { $_.body -eq "/lgtm" }
    $hasApprove = $myComments | Where-Object { $_.body -eq "/approve" }
    
    if ($hasLgtm -and $hasApprove) {
        Write-Host "PR #$($pr.number): ✅ 已处理" -ForegroundColor Green
    } elseif ($hasLgtm) {
        Write-Host "PR #$($pr.number): ⏳ 已 LGTM,待 Approve" -ForegroundColor Yellow
    } else {
        Write-Host "PR #$($pr.number): ❌ 未处理" -ForegroundColor Red
    }
}

场景 2: 批量批准 PR

# 加载批量脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit-batch.ps1

# 并行批量批准 (推荐)
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2547, 2564, 2565) `
    -Parallel `
    -MaxConcurrency 3

场景 3: 检查 CI 状态

# 检查 CI 流水线
AtomGit-CheckCI -Owner "openeuler" -Repo "release-management" -PR 2564

# 输出示例:
# === AtomGit CI Check ===
# Total: 10
# Success: 9
# Failure: 1
# Overall: FAILED

场景 4: 创建 PR

# 创建 PR
AtomGit-CreatePR -Owner "openeuler" -Repo "release-management" `
    -Title "添加新包" `
    -Head "feature/new-package" `
    -Base "main" `
    -Body "这个 PR 添加了新的软件包"

场景 5: 协作管理

# 获取协作者列表
AtomGit-GetCollaborators -Owner "openeuler" -Repo "release-management"

# 添加协作者
AtomGit-AddCollaborator -Owner "openeuler" -Repo "release-management" `
    -Username "newuser" -Permission "push"

# 移除协作者
AtomGit-RemoveCollaborator -Owner "openeuler" -Repo "release-management" `
    -Username "olduser"

场景 6: Issues 管理

# 获取 Issues 列表
AtomGit-GetIssues -Owner "openeuler" -Repo "release-management" -State "open"

# 创建 Issue
AtomGit-CreateIssue -Owner "openeuler" -Repo "release-management" `
    -Title "发现 bug" -Body "详细描述..."

# 添加评论
AtomGit-AddIssueComment -Owner "openeuler" -Repo "release-management" `
    -Issue 123 -Comment "这个问题已经修复"

场景 7: 仓库查询

# 获取我的仓库
AtomGit-GetRepos

# 获取仓库详情
AtomGit-GetRepoDetail -Owner "openeuler" -Repo "release-management"

# 获取文件树
AtomGit-GetRepoTree -Owner "openeuler" -Repo "release-management"

# 获取文件内容
AtomGit-GetRepoFile -Owner "openeuler" -Repo "release-management" -Path "README.md"

场景 8: 其他查询

# 获取标签列表
AtomGit-GetLabels -Owner "openeuler" -Repo "release-management"

# 获取发布列表
AtomGit-GetReleases -Owner "openeuler" -Repo "release-management"

# 获取 Webhooks 列表
AtomGit-GetHooks -Owner "openeuler" -Repo "release-management"

🎯 最佳实践

1. 批量处理优先使用并行

# ✅ 推荐:并行处理,性能提升 80%
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2547, 2564, 2565) -Parallel -MaxConcurrency 3

# ❌ 不推荐:串行处理
foreach ($pr in @(2547, 2564, 2565)) {
    AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR $pr
}

2. Token 安全

# ✅ 推荐:使用环境变量
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# ❌ 不推荐:硬编码在脚本中
$token = "YOUR_TOKEN"  # 不要提交到 Git

3. 错误处理

# ✅ 技能自动处理错误
try {
    AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR 2547
} catch {
    Write-Host "批准失败:$($_.Exception.Message)"
}

API 端点

Base URL: https://api.atomgit.com/api/v5

认证方式:

$headers = @{ "Authorization" = "Bearer YOUR_TOKEN" }
Invoke-RestMethod -Uri "https://api.atomgit.com/api/v5/user" -Headers $headers

详细 API: API-REFERENCE.md

状态码

状态码说明
200 OK请求成功
201 Created资源创建成功
400 Bad Request请求参数错误
401 Unauthorized未认证
403 Forbidden无权限
404 Not Found资源不存在
429 Too Many Requests请求超限 (50/分,5000/小时)

系统要求

组件要求说明
PowerShell5.1+Windows 内置,Linux/macOS 需安装
.NET4.7+通常已预装
网络HTTPS访问 api.atomgit.com

安装

方式 1: ClawHub (推荐)

clawhub install atomgit-ps

方式 2: 手动安装

# 1. 克隆技能到本地
# 2. 配置 Token (优先级:环境变量 > openclaw.json)
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# 或在 ~/.openclaw/openclaw.json 中添加:
# {"env": {"ATOMGIT_TOKEN": "YOUR_TOKEN"}}

# 3. 加载技能
. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit.ps1

Token 配置

优先级顺序:

  1. 环境变量 ATOMGIT_TOKEN (最高优先级)
  2. openclaw.json 中的 env.ATOMGIT_TOKEN 字段

配置方式:

# 方式 1: 环境变量 (推荐用于临时会话)
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# 方式 2: openclaw.json (推荐用于持久配置)
# 编辑 ~/.openclaw/openclaw.json,添加:
{
  "env": {
    "ATOMGIT_TOKEN": "YOUR_TOKEN"
  }
}

使用示例

登录

AtomGit-Login "YOUR_TOKEN"

获取用户信息

AtomGit-GetUserInfo

获取 PR 列表

AtomGit-GetPRList -Owner "openeuler" -Repo "release-management" -State "open"

批准 PR

AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR 2560 -Comment "/lgtm"

批量处理

. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit-batch.ps1
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2557, 2558, 2560) `
    -Parallel

相关技能

  • git - Git 版本控制基础操作

反馈

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

PR Advocacy

Monitor PR status every 4 hours, promptly address feedback and CI issues, communicate clearly within 24 hours, and drive reviews to timely merge.

Registry SourceRecently Updated
4380Profile unavailable
Coding

Commit Reviewer(提交修复检查)

根据一个或多个 git 修订号和需求描述,检查提交是否真正修复了对应 bug,并给出逐条结论

Registry Source
1550Profile unavailable
Security

SPIRIT State Sync

State Preservation & Identity Resurrection Infrastructure Tool (SPIRIT). Preserves AI agent identity, memory, and projects to a private Git repository. NEW:...

Registry SourceRecently Updated
7520Profile unavailable
General

Novel Quality Checker - 质量审核

检查小说章节质量:33 维质量审核(字数、AI标记、模板化结尾、重复率、大纲符合度等), 支持单章和批量检查、跨章衔接检查,输出 5 层审核报告。 使用场景:用户说"检查第X章质量"、"审核一下"、"看看这章行不行"、"批量检查所有章节"。 NOT for: 创作、修改内容——只审核不写作。

Registry SourceRecently Updated
1120Profile unavailable