Chuyển đến nội dung
Skillpedia
Lập trình chung40k · #7399

repo-standardizer

Skill này làm gì

Agent AI này giúp sắp xếp và cải thiện diện mạo của kho lưu trữ GitHub. Nó thêm hoặc cập nhật các tệp cấu hình và tài liệu, như biểu mẫu issue, mẫu PR, nhãn và quy trình CI, mà không thay đổi chính mã nguồn.

Khi nào nên dùng

  • ✓Khi tạo một kho lưu trữ mới và cần thiết lập ban đầu.
  • ✓Khi một kho lưu trữ hiện có trông lộn xộn hoặc chưa đầy đủ.
  • ✓Để chuẩn hóa giao diện và quy tắc trên nhiều kho lưu trữ.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/repo-standardizer/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy sắp xếp kho lưu trữ GitHub này, thêm mẫu, nhãn và quy trình CI.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra tình trạng hiện tại của kho lưu trữ, xác định những gì còn thiếu hoặc đã lỗi thời, rồi áp dụng các cấu hình chuẩn. Nó làm việc này an toàn, không sửa mã dự án thực sự của bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

…

Câu hỏi thường gặp

“Idempotent” nghĩa là gì?

Nghĩa là bạn có thể chạy agent nhiều lần và nó luôn cho ra cùng một kết quả cuối cùng mà không gây lỗi hoặc lặp lại thông tin.

Nó có thay đổi mã dự án của tôi không?

Không, nó chỉ sửa các tệp cấu hình và tài liệu của kho lưu trữ, như nhãn, mẫu và quy trình CI. Mã dự án của bạn vẫn không bị động đến.

Tôi có cần cài đặt gì không?

Có, bạn cần cài một số công cụ trên máy, như `gh` (công cụ dòng lệnh của GitHub), `git`, `jq` và `python3`, đồng thời đăng nhập vào tài khoản GitHub của mình.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7399
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự