git-helpers

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Helpers

Git 助手

Git workflow with conventional commits, confidence-scored code review, and automated PR management.
具备规范提交、带置信度评分的代码审查以及自动化PR管理功能的Git工作流。

Workflow

工作流

commit --> review --> summary --> push-pr
Each 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 PatternReference
Commit changes, create commitcommit.md
Review code, check changescode-review.md
Summarize changes, generate PR descriptionsummary.md
Push branch, create PR, open pull requestpush-pr.md
Analyze diff, diff patternsworkflow-patterns.md
Notes:
  • guidelines-audit.md
    is not a direct trigger. It is loaded by
    code-review.md
    as part of the review process.
  • conventional-commits.md
    is not a direct trigger. It is loaded by
    commit.md
    and
    push-pr.md
    for message format rules.
触发模式参考文档
Commit changes, create commitcommit.md
Review code, check changescode-review.md
Summarize changes, generate PR descriptionsummary.md
Push branch, create PR, open pull requestpush-pr.md
Analyze diff, diff patternsworkflow-patterns.md
注意事项:
  • guidelines-audit.md
    不是直接触发项。它会在code-review.md的审查过程中被加载。
  • conventional-commits.md
    不是直接触发项。它会被commit.md和push-pr.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不可用:终止操作并告知用户安装该工具
  • 未找到指南文件:跳过指南审查并进行报告
  • 存在合并冲突:终止操作并告知用户先解决冲突