skills/github-automation/SKILL.md
自动化 GitHub 操作。当用户需要推送代码到 GitHub、管理仓库、创建 PR、处理 Issue、git push 失败时使用此技能。优先使用 mcporter call github.push_files 而不是 git push。
npx skillsauth add aaaaqwq/agi-super-team github-automationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
此技能专门用于自动化 GitHub 平台的各种操作,包括:
当需要推送到 GitHub 时,优先使用 mcporter call github.push_files 而不是 git push!
方法1:使用 mcporter(推荐)
# 单个文件
mcporter call github.push_files \
owner=aAAaqwq \
repo=my-repo \
branch=master \
message="feat: add new feature" \
files='[{"path":"README.md","content":"file content"}]'
# 多个文件(使用 Python)
python3 << 'EOF'
import json
import subprocess
payload = {
"owner": "aAAaqwq",
"repo": "my-repo",
"branch": "master",
"message": "feat: update multiple files",
"files": [
{"path": "README.md", "content": "..."},
{"path": "src/main.py", "content": "..."}
]
}
result = subprocess.run([
'mcporter', 'call', 'github.push_files',
f'owner={payload["owner"]}',
f'repo={payload["repo"]}',
f'branch={payload["branch"]}',
f'message={payload["message"]}',
f'files={json.dumps(payload["files"])}'
], capture_output=True, text=True)
print(result.stdout)
EOF
方法2:传统 git push(需要配置认证)
# 仅在 MCP 不可用时使用
git push origin master
查看所有可用工具:
mcporter list github --schema
常用工具:
github.push_files - 推送多个文件到仓库github.create_or_update_file - 创建或更新单个文件github.get_file_contents - 获取文件内容github.list_commits - 列出提交历史// 创建仓库
const repo = await createRepository({
name: "my-project",
description: "项目描述",
private: false,
autoInit: true
});
// 批量提交文件
await pushFiles({
owner: "username",
repo: "my-project",
branch: "main",
files: [
{
path: "README.md",
content: "# My Project\n\n项目说明"
},
{
path: "src/index.js",
content: "console.log('Hello World');"
}
],
message: "Initial commit"
});
// 创建新分支
await createBranch({
owner: "username",
repo: "my-project",
branch: "feature/new-feature",
from_branch: "main"
});
// 提交代码到新分支
await createOrUpdateFile({
owner: "username",
repo: "my-project",
path: "src/feature.js",
content: "// 新功能代码",
message: "Add new feature",
branch: "feature/new-feature"
});
// 创建 Pull Request
await createPullRequest({
owner: "username",
repo: "my-project",
title: "添加新功能",
head: "feature/new-feature",
base: "main",
body: "## 变更说明\n- 添加了新功能\n- 更新了文档"
});
// 创建 Issue
const issue = await createIssue({
owner: "username",
repo: "my-project",
title: "修复登录问题",
body: "## 问题描述\n用户无法登录\n\n## 复现步骤\n1. 打开登录页面\n2. 输入凭证\n3. 点击登录",
labels: ["bug", "high-priority"],
assignees: ["developer1"]
});
// 添加评论
await addIssueComment({
owner: "username",
repo: "my-project",
issue_number: issue.number,
body: "正在调查此问题"
});
// 更新 Issue
await updateIssue({
owner: "username",
repo: "my-project",
issue_number: issue.number,
state: "closed",
labels: ["bug", "fixed"]
});
// 获取 PR 详情
const pr = await getPullRequest({
owner: "username",
repo: "my-project",
pull_number: 123
});
// 获取 PR 文件变更
const files = await getPullRequestFiles({
owner: "username",
repo: "my-project",
pull_number: 123
});
// 创建审查
await createPullRequestReview({
owner: "username",
repo: "my-project",
pull_number: 123,
body: "代码看起来不错,有几点建议",
event: "COMMENT",
comments: [
{
path: "src/index.js",
line: 10,
body: "建议添加错误处理"
}
]
});
// 合并 PR
await mergePullRequest({
owner: "username",
repo: "my-project",
pull_number: 123,
merge_method: "squash",
commit_title: "feat: 添加新功能"
});
// 搜索代码
const codeResults = await searchCode({
q: "function login repo:username/my-project"
});
// 搜索 Issue
const issueResults = await searchIssues({
q: "is:open label:bug repo:username/my-project",
sort: "created",
order: "desc"
});
// 搜索仓库
const repoResults = await searchRepositories({
query: "react stars:>1000 language:javascript"
});
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: npm test
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy
run: ./deploy.sh
development
Technology-agnostic prompt generator that creates customizable AI prompts for scanning codebases and identifying high-quality code exemplars. Supports multiple programming languages (.NET, Java, JavaScript, TypeScript, React, Angular, Python) with configurable analysis depth, categorization methods, and documentation formats to establish coding standards and maintain consistency across development teams.
tools
Expert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analyzing network traffic, and profiling performance.
data-ai
Prompt for creating detailed feature implementation plans, following Epoch monorepo structure.
tools
Interactive prompt refinement workflow: interrogates scope, deliverables, constraints; copies final markdown to clipboard; never writes code. Requires the Joyride extension.