跳到正文
Skillpedia
通用编程40k · #7399

repo-standardizer

它能做什么

这个 AI 代理可以帮你整理 GitHub 仓库,并改善仓库的外观。它会添加或更新配置文件和文档文件,例如 Issue 表单、PR 模板、标签和 CI 工作流,但不会修改代码本身。

适用场景

  • ✓当你新建仓库,需要做初始设置时。
  • ✓当已有仓库看起来杂乱或内容不完整时。
  • ✓当你希望多个仓库的外观和规范保持统一时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/repo-standardizer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/repo-standardizer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我整理这个 GitHub 仓库,添加模板、标签和 CI 工作流。”

每周 5 个新技能,1 分钟读完。

工作原理

它会先检查你仓库的当前状态,找出缺失或过时的部分,然后应用标准配置。整个过程很安全,不会修改你项目中的实际代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

GitHub Repo Standardizer

Detect a repository's current state, then polish its surface: issue forms, PR template, label taxonomy, CI, CODEOWNERS, rulesets, docs. Works on repo metadata and config files only — code logic is never touched. Idempotent — safe to re-run; fills gaps and reconciles drift without duplicating or clobbering.

When to use

  • User says "standardize / tidy up / professionalize this repo"
  • A new repo was just created and needs templates, labels, CI, and rules from day one
  • A repo looks bare: no templates, no labels, no CI, no branch protection

Preflight (mandatory, in order)

Requires: gh CLI (authenticated), git, jq, python3 — verify they exist before starting (which gh git jq python3).

1. Authenticate — check gh login first

gh auth status 2>/dev/null || echo "NOT_LOGGED_IN"
  • Logged in → continue; print gh api user -q .login so the user knows which account will act.
  • Not logged in → STOP. Tell the user (do not guess):
    1. Run gh auth login (web/device flow), or
    2. Export a token: export GH_TOKEN=ghp_xxx — needs repo, workflow (for CI files) and, for org repos, admin:org (or admin:repo_hook / org membership admin) scopes.
    • Never paste tokens into chat, logs, or files. If the user pastes a token in chat, advise them to revoke it and re-issue.
    • If gh auth login is impossible in this environment (headless), suggest gh auth login --with-token reading from a file the user created.

Verify the acting account can write to the target:

# user repos: no extra check needed beyond token scopes
# org repos: must be a member/admin of the org
gh api "orgs/ORG/memberships/$(gh api user -q .login)" -q .role 2>/dev/null || echo "NO_ORG_ACCESS"
  • admin/member → OK. 404 → stop and ask the user to add the account to the org first.

2. Detect repository type

gh repo view OWNER/REPO --json name,owner,visibility,defaultBranchRef,isArchived,isFork \
  -q '{name:.name, ownerType:.owner.type, visibility:.visibility, defaultBranch:.defaultBranchRef.name, archived:.isArchived, fork:.isFork}'
Field Meaning Consequence
ownerType User = personal, Organization = org Org repos can also use org-level rulesets; both support repo-level rulesets
visibility PUBLIC / PRIVATE / INTERNAL Private: skip public-facing docs pressure, keep CI secrets minimal; public: README badges + CONTRIBUTING/SECURITY matter
archived / fork Read-only / fork Skip write modules; report why

If the repo was not explicitly named by the user, confirm before touching an org or private repository.

3. Audit current state

gh label list --repo OWNER/REPO --limit 200
gh api repos/OWNER/REPO/contents/.github -q '.[].path' 2>/dev/null || echo "no .github dir"
gh api repos/OWNER/REPO/contents/.github/workflows -q '.[].name' 2>/dev/null || echo "no workflows"
gh api repos/OWNER/REPO/rulesets -q '.[] | {name:.name, enforcement:.enforcement}' 2>/dev/null || echo "no rulesets"
gh api repos/OWNER/REPO/branches -q '.[].name' 2>/dev/null
for f in README.md CONTRIBUTING.md SECURITY.md LICENSE .gitignore; do
  gh api "repos/OWNER/REPO/contents/$f" -q .name 2>/dev/null || echo "missing: $f"
done

4. Detect test framework (for CI module)

Check for these signals (first match wins):

gh api repos/OWNER/REPO/contents/package.json -q .name 2>/dev/null   # node → templates/ci-node.yml
gh api repos/OWNER/REPO/contents/pyproject.toml -q .name 2>/dev/null # python → templates/ci-python.yml
gh api repos/OWNER/REPO/contents/go.mod -q .name 2>/dev/null         # go → templates/ci-go.yml
gh api repos/OWNER/REPO/contents/Cargo.toml -q .name 2>/dev/null     # rust → templates/ci-rust.yml

No signal → propose the generic CI (or ask the user whether CI is wanted at all).

5. Ask about language (before planning)

  • Ask the user which language CONTRIBUTING.md and the PR template should be written in (default: English, or the project's primary language for local projects). Translate the templates accordingly when generating — never assume a language.
  • (README languages are asked separately in Module F.)

6. Ask about automation (decides the Governance labels)

Ask the user whether the repo has any automation bots or AI writers running on it — e.g. dependabot, a Stale bot, ClawSweeper, or an AI coding agent that auto-files PRs / auto-fixes issues.

…

常见问题

“幂等”是什么意思?

意思是你可以多次运行这个代理,每次得到的最终结果都一样,不会引发问题,也不会产生重复的内容。

它会修改我项目的代码吗?

不会,它只修改仓库的配置文件和文档文件,比如标签、模板和 CI 工作流。你项目的代码保持不变。

我需要安装什么东西吗?

需要。你的电脑上要安装一些工具,比如 `gh`(GitHub 命令行工具)、`git`、`jq` 和 `python3`,并且要登录你的 GitHub 账号。

详情

作者的原始描述

Polish any GitHub repository's surface — labels (emoji rating tiers, P0–P3 priority, impact severity), issue forms, PR template, CI workflows, CODEOWNERS, rulesets, docs. Repo meta & config only — no code logic touched. Use when creating a new repo or polishing an existing one.

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7399
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能