首页/ AI 技能 / @skilllib/skill-2117939930272413313
Skill站外收录 @skilllib/skill-2117939930272413313

git-commits

实现规范化的 Git 提交流程,自动分析代码变更范围与类型,智能判断是否拆分提交,并生成符合项目风格的结构化提交信息,确保每次代码更新都具备清晰的意图说明和可追溯性。

0.0 (0) 14 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# Git Commits **Always invoke this skill for every commit.** This ensures consistent, well-structured commits. ## Workflow 1. Run `git status` and `git diff` to see changes 2. Run `git log --oneline -5` to see recent commit style 3. Determine if changes should be one or multiple commits 4. Stage and commit with clear message ## When to Split vs Combine **Separate commits:** - CSS vs PHP logic - Different features (even in same file) - Refactoring vs new functionality - Multiple bug fixes (one per fix) **Single commit:** - Related changes for one feature - A handler + its CSS - Tests for the feature being added ## Commit Message Format ``` <summary line - what and why, not how> <optional body with more context> ``` ## Examples **Input:** Single file change to update details ```diff - $title = __( 'Old title', 'simple-history' ); + $title = __( 'New title', 'simple-history' ); ``` **Output:** ``` Update 5.22.0 update details title ``` **Input:** Multiple related changes across files ```diff # file1.php + public function new_feature() { ... } # file2.php + add_filter( 'hook', [ $this, 'new_feature' ] ); ``` **Output:** ``` Add new feature for X Register hook and implement handler. ``` ## Multiple Repositories When changes span core + premium: 1. Commit core first, then premium 2. Use related commit messages

评论 0

还没有评论,来抢沙发。