Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4737

git-pr-workflows-git-workflow

Skill này làm gì

Agent này giúp tổ chức quy trình gửi thay đổi mã để người khác review. Nó đảm bảo mọi thứ được kiểm thử, ghi lại đúng cách và gửi như một pull request mà không vi phạm các quy tắc của dự án.

Khi nào nên dùng

  • ✓Khi bạn viết xong mã và muốn gửi để người khác review.
  • ✓Khi dự án có quy định nghiêm ngặt về cách gửi và kiểm thử mã.
  • ✓Khi bạn muốn tự động hóa việc tạo pull request sau khi thay đổi.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-pr-workflows-git-workflow/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-pr-workflows-git-workflow/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

“Tôi muốn gửi các thay đổi mới nhất để review, kiểm thử mọi thứ và tạo một pull request vào nhánh chính.”

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

Cách hoạt động

Agent trước hết kiểm tra trạng thái hiện tại của mã và các quy tắc của dự án. Sau đó, nó chạy kiểm thử và xác thực, chuẩn bị các thay đổi trên một nhánh mới, và cuối cùng tạo pull request với đầy đủ thông tin cần thiết.

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.

Guarded Git Pull Request Workflow

Move completed changes from local review to a verified pull request without bypassing repository policy or branch protection.

When to Use

Use for completed implementation work that must be reviewed, tested, committed, pushed to a topic branch, and opened as a pull request. Use the repository's dedicated maintainer or release workflow instead when one is mandatory.

Policy Gate

Before mutation:

  1. Read AGENTS.md, contribution guidance, maintainer docs, and relevant nested instructions.
  2. Inspect the current branch, worktree, remotes, upstream, and effective target-branch protection.
  3. Discover repository-native validation, commit, PR, merge, and release commands.
  4. Preserve unrelated dirty and staged files.

Repository policy wins over flags and user shorthand. Trunk-based development does not imply a direct push: when the target is protected, use a short-lived branch and pull request. If a repository defines a mandatory maintainer skill or guarded merge command, hand off merge and release actions to it. In agentic-awesome-skills, use antigravity-maintainer-batch-release and npm run merge:batch.

Inputs

Resolve these from the request and repository:

  • target branch, defaulting to the repository default branch;
  • intended changed files and excluded user work;
  • required test, lint, security, build, and documentation checks;
  • branch naming and commit-message conventions;
  • draft or ready-for-review PR state;
  • required reviewers, labels, issue links, and merge method.

Ask only when a missing choice changes the result materially.

Workflow

1. Capture the exact change

git status --short --branch
git diff --stat
git diff --cached --stat
git branch --show-current
git remote -v

Confirm every file in scope. Stop if staged or dirty files cannot be separated safely.

2. Review in parallel

When subagents are available and authorized, assign independent bounded passes for:

  • correctness and regression risk;
  • security, secrets, permissions, and dependency risk;
  • test coverage and repository-policy compliance.

Give each reviewer the raw diff and repository instructions. Keep the main agent responsible for deduplication, severity, edits, and final verification.

3. Validate and repair

Run the repository's targeted checks, then its required pre-PR suite. If a check fails:

  1. identify whether the cause is source, policy, environment, or infrastructure;
  2. fix only source or policy defects in scope;
  3. rerun the targeted failure;
  4. rerun the complete required suite.

Do not weaken gates, hide skipped tests, or treat deterministic failures as flaky.

4. Prepare the branch and commit

Fetch the target before committing. If currently on a protected/default branch, create a topic branch before mutation.

git fetch origin <target-branch>
git switch -c <topic-branch> origin/<target-branch>
git status --short --branch

Stage only intended paths and create focused conventional commits according to repository policy. Rebase or update the topic branch when strict required checks demand the latest target; never force a shared branch without explicit authorization.

5. Push and create the pull request

git push -u origin <topic-branch>
gh pr create --base <target-branch> --head <topic-branch> \
  --title "<conventional title>" --body-file <body-file>

The PR body must truthfully include:

  • what changed and why;
  • tests and validation actually run;
  • risk, deployment, rollback, and breaking-change notes when applicable;
  • issue links, screenshots, and repository checklists when applicable.

Never mark a pending automated review or test as completed.

6. Verify the remote result

gh pr view <pr-number> --json headRefOid,baseRefOid,mergeable,mergeStateStatus,url
gh pr checks <pr-number>

Bind review evidence to the current full head SHA. If the head or base changes, discard stale conclusions and rerun affected checks.

Use the repository's guarded merge path. Do not replace required checks, merge queues, exact-SHA attestations, or maintainer commands with a raw merge API. After merge, fetch the target and verify the requested remote, CI, deployment, or release state.

Stop Condition

…

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

Pull request là gì?

Đây là yêu cầu đưa các thay đổi mã của bạn vào dự án chính. Người khác có thể review mã của bạn trước khi nó được chấp nhận.

Nhánh (branch) là gì?

Nhánh giống như các bản sao song song của dự án, nơi bạn có thể làm tính năng mới hoặc sửa lỗi mà không ảnh hưởng đến mã chính. Sau đó bạn có thể gộp các thay đổi lại.

Điều gì xảy ra nếu kiểm thử thất bại?

Agent sẽ cố xác định vấn đề và sửa nếu nó liên quan đến mã hoặc quy tắc của bạn. Nó sẽ không tiếp tục nếu các kiểm thử quan trọng thất bại.

Chi tiết

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

Orchestrate review, tests, commits, branch pushes, and pull-request creation with parallel agents. Use when completed changes must move through validation into a PR or guarded merge.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4737
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ự