git-helpers
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Helpers
Git 助手
Git workflow with conventional commits, confidence-scored code review,
and automated PR management.
具备规范提交、带置信度评分的代码审查以及自动化PR管理功能的Git工作流。
Workflow
工作流
commit --> review --> summary --> push-prEach step is independent. Use any workflow in isolation or chain them together.
commit --> review --> summary --> push-pr每个步骤都是独立的。可以单独使用任意工作流,也可以将它们串联起来使用。
Context Loading Strategy
上下文加载策略
Load only the reference matching the current trigger. Never load multiple references simultaneously unless explicitly noted (code-review.md loads guidelines-audit.md as part of its process).
仅加载与当前触发词匹配的参考文档。除非特别说明,否则不会同时加载多个参考文档(code-review.md会在审查过程中加载guidelines-audit.md)。
Triggers
触发词
| Trigger Pattern | Reference |
|---|---|
| Commit changes, create commit | commit.md |
| Review code, check changes | code-review.md |
| Summarize changes, generate PR description | summary.md |
| Push branch, create PR, open pull request | push-pr.md |
| Analyze diff, diff patterns | workflow-patterns.md |
Notes:
- is not a direct trigger. It is loaded by
guidelines-audit.mdas part of the review process.code-review.md - is not a direct trigger. It is loaded by
conventional-commits.mdandcommit.mdfor message format rules.push-pr.md
| 触发模式 | 参考文档 |
|---|---|
| Commit changes, create commit | commit.md |
| Review code, check changes | code-review.md |
| Summarize changes, generate PR description | summary.md |
| Push branch, create PR, open pull request | push-pr.md |
| Analyze diff, diff patterns | workflow-patterns.md |
注意事项:
- 不是直接触发项。它会在code-review.md的审查过程中被加载。
guidelines-audit.md - 不是直接触发项。它会被commit.md和push-pr.md加载,用于提供消息格式规则。
conventional-commits.md
Cross-References
交叉引用
code-review.md -----> guidelines-audit.md (loaded as part of review)
commit.md ----------> conventional-commits.md (format rules)
push-pr.md ---------> conventional-commits.md (format rules)code-review.md -----> guidelines-audit.md (loaded as part of review)
commit.md ----------> conventional-commits.md (format rules)
push-pr.md ---------> conventional-commits.md (format rules)Guidelines
指南规范
- Confidence scoring: only report findings with confidence >= 80
- No attribution lines in commit messages or PRs
- Auto-detect base branch: development > develop > main > master
- Always use imperative mood in commit messages and PR titles
- HEREDOC format for multi-line commit messages
- Analyze actual diff and staged files, never conversation context
- Follow existing project conventions for commit message format
- 置信度评分:仅报告置信度≥80的发现结果
- 提交消息或PR中不得包含归因行
- 自动检测基准分支:优先级为 development > develop > main > master
- 提交消息和PR标题始终使用祈使语气
- 多行提交消息采用HEREDOC格式
- 分析实际的代码差异和暂存文件,绝不使用对话上下文
- 遵循项目现有的提交消息格式规范
Error Handling
错误处理
- No changes to commit: inform user working tree is clean
- gh cli not available: stop and inform user to install it
- No guideline files found: skip guidelines audit, report it
- Merge conflicts: stop and inform user to resolve first
- 无提交变更:告知用户工作区已清理
- gh cli不可用:终止操作并告知用户安装该工具
- 未找到指南文件:跳过指南审查并进行报告
- 存在合并冲突:终止操作并告知用户先解决冲突