git-master
Skill này làm gì
Agent này giúp bạn quản lý lịch sử phiên bản của mã bằng Git. Nó có thể lưu các thay đổi của bạn với mô tả rõ ràng (commit), sắp xếp lại lịch sử thay đổi và trả lời các câu hỏi về ai đã thay đổi gì và khi nào.
Khi nào nên dùng
- ✓Khi bạn cần lưu một nhóm thay đổi mã.
- ✓Khi bạn muốn hiểu hoặc sắp xếp lại lịch sử thay đổi của mã.
- ✓Khi bạn cần tìm xem ai đã thực hiện một thay đổi cụ thể trong mã.
Liên kết skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/git-master/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lưu các thay đổi gần đây của tôi thành một commit với thông điệp ‘Add login functionality’.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent phân tích lệnh của bạn và dùng các công cụ Git để thực hiện hành động như tạo commit, sắp xếp lại lịch sử hoặc lấy thông tin về các thay đổi trước đây. Nó kiểm tra trạng thái hiện tại của mã trước khi hành động.
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.
Git Master
Use this skill when the user asks you to operate on Git history or answer a Git-history question. Be exact, conservative, and evidence-led. Read the repository state before you infer anything.
Mode Gate
Classify the request first:
COMMIT: stage and commit local changes.REBASE: rebase, squash, fixup, autosquash, reorder, split, or otherwise rewrite branch history.HISTORY: answer when, where, who, why, or which commit changed something.STATUS: inspect branch, diff, or working-tree state without changing it.
Do not commit, rebase, push, force-push, reset, stash-pop, or delete anything unless the user explicitly asked for that operation. If the request is only investigative, report findings and stop.
Ground Truth
Gather independent facts in parallel when the tools allow it:
git status --short
git diff --stat
git diff --staged --stat
git branch --show-current
git log -30 --oneline
git log -30 --pretty=format:%s
git rev-parse --abbrev-ref @{upstream}
git merge-base HEAD origin/main
git merge-base HEAD origin/master
Missing upstream or missing main/master is normal. Fall back to the best available branch or report the missing fact. Never treat a failed lookup as proof.
PR Body Evidence Attachments
When a PR body needs screenshots or terminal PNGs, use the repo reference at docs/reference/github-attachment-upload.md. The allowed hosting path is GitHub user attachments from the authenticated web attachment flow; never commit temporary images, never use GitHub Releases for PR evidence, and never use external image hosts. Do not log browser cookies, CSRF tokens, S3 form fields, or upload headers.
Commit Mode
Commit only the user's requested changes. Preserve unrelated dirty work.
- Detect message style from recent history. Use the dominant local pattern, language, and casing. Do not default to Conventional Commits unless the repo uses them.
- Inspect the full diff, not only filenames. Separate unrelated user edits from the requested commit.
- Build atomic groups by behavior, module, and revertability. Keep implementation and its direct tests together.
- Prefer multiple commits for unrelated concerns. A single commit is acceptable only when the changed files form one indivisible behavior or the user explicitly asks for one commit.
- Stage by path or hunk so each commit contains only its atomic group.
- Before each commit, verify
git diff --staged --statand enough staged diff to prove the group is right. - Commit with the detected style. After each commit, verify
git log -1 --oneline.
Grouping rules:
- Split different features, modules, generated artifacts, config, docs, and test-only changes unless they are inseparable.
- Keep generated files with the source change that produced them when omitting them would leave the repo inconsistent.
- Never hide failing or unrelated changes inside a broad commit.
Final report: list commit hashes, messages, and any remaining uncommitted files.
Rebase Mode
History rewriting is a shared-impact operation.
- Never rebase or rewrite
main,master,dev, release branches, or a protected branch unless the user explicitly named that exact operation. - If commits may already be pushed, ask before force-pushing. Use
--force-with-lease, never plain--force. - If the worktree is dirty, preserve it intentionally before rebasing. Do not stash-pop over conflicts without checking what changed.
- For fixups, prefer
git commit --fixup=<hash>followed byGIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <base>. - For conflicts, read the conflicting files and resolve by intent. Do not choose ours/theirs blindly.
- If a rebase goes wrong, use
git rebase --abortfirst. Use reflog only after explaining the recovery path.
After rewriting, run the relevant tests or at least the project's cheapest smoke check, then show the new branch log from base to HEAD.
History Mode
Choose the Git tool by the question:
git log -S "text": when the count of an exact string changed.git log -G "regex": when diffs touched lines matching a pattern.git blame -L start,end -- file: who last changed specific lines.git log --follow -- file: history across renames for one file.git show <hash>: inspect the commit that appears relevant.git bisect: find the first bad commit when there is a deterministic pass/fail command and known good/bad bounds.
…
Câu hỏi thường gặp
“Atomic commit” là gì?
Đó là việc lưu thay đổi tập trung vào một công việc hoặc một bản sửa duy nhất, giúp lịch sử dễ hiểu và dễ quản lý hơn.
“Viết lại lịch sử” nghĩa là gì?
Nghĩa là chỉnh sửa các commit đã được thực hiện, như gộp nhiều commit thành một hoặc thay đổi thứ tự của chúng. Việc này cần làm cẩn thận.
Git có làm gì nếu tôi không yêu cầu lưu không?
Nếu bạn chỉ hỏi về lịch sử hoặc yêu cầu kiểm tra trạng thái, nó chỉ cung cấp thông tin mà không thực hiện thay đổi nào.
Chi tiết
Mô tả gốc của tác giả
Handles git work: atomic commits, rebase, squash, blame, bisect, reflog, and history questions. Use whenever a task needs a commit or a git-history investigation; skip for ordinary code edits.
Độ phổ biến
- Sao GitHub
- 70k
- Vị trí xếp hạng
- #3134
- Giấy phép
- NOASSERTION
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
comment-checker
70kGiúp agent của bạn hiểu và phản hồi các nhận xét từ công cụ kiểm tra bình luận tự động. Hữu ích khi xử lý kết quả từ việc rà soát mã hoặc nội dung tự động.
lcx-contribute-bug-fix
70kGiúp agent của bạn đóng góp bản sửa lỗi cho các dự án liên quan đến LazyCodex. Agent tạo issue hoặc pull request để đảm bảo chất lượng mã.
lcx-doctor
70kCho phép agent của bạn kiểm tra tình trạng cài đặt LazyCodex và Codex CLI. Hữu ích khi hệ thống hoạt động lạ sau khi cập nhật hoặc thay đổi.
lcx-report-bug
70kGiúp agent của bạn báo lỗi chi tiết cho các dự án LazyCodex. Agent tạo issue với thông tin hữu ích để lập trình viên sửa vấn đề.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.