From 77031c3f21bd100acbac838d0b02f5f04bf66188 Mon Sep 17 00:00:00 2001
From: "Begonia, HE" <163421589+BegoniaHe@users.noreply.github.com>
Date: Fri, 16 Jan 2026 05:51:41 +0100
Subject: docs(github): add commit helper agent and references
- Add commit.agent.md with branch validation workflow
- Include commit instructions for AI coding assistants
- Add Conventional Commits specification reference
- Implement Step 0 branch checking before commits
Reviewed-by: Claude Sonnet 4.5
---
.github/instructions/commit.instructions.md | 38 +++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 .github/instructions/commit.instructions.md
(limited to '.github/instructions')
diff --git a/.github/instructions/commit.instructions.md b/.github/instructions/commit.instructions.md
new file mode 100644
index 0000000..cc29e9c
--- /dev/null
+++ b/.github/instructions/commit.instructions.md
@@ -0,0 +1,38 @@
+---
+applyTo: "**"
+---
+
+# Commit Helper Instructions
+
+When user requests commit help → Follow .github/agents/commit.agent.md
+
+## Critical Rules
+
+1. **Language**: Commit message ALWAYS in **English** (unless user specifies otherwise)
+2. **Explanation**: Use **user's request language** ONLY when commit language differs
+ - Chinese user + English commit → Explain in Chinese
+ - English user + Chinese commit → Explain in English
+ - Same language → No extra explanation needed
+3. **Confirmation**: ALWAYS ask before committing (unless "commit directly" requested)
+
+## Quick Reference
+
+**Format**: `[scope]: `
+
+**Common types**: `feat` `fix` `docs` `refactor` `perf` `test` `chore`
+
+**AI commits MUST include**: `Reviewed-by: [MODEL_NAME]`
+
+**Spec**: .github/references/git/conventional-commit.md
+
+## Common Mistakes
+
+| Wrong | Right |
+|-------|-------|
+| `feat: Added feature` | `feat: add feature` (imperative) |
+| `Fix bug.` | `fix: resolve auth issue` (lowercase, no period) |
+| `feat: add A, refactor B, update C` | Split into 3 commits |
+
+## User Triggers
+
+"create commit", "commit message", "conventional commit"
\ No newline at end of file
--
cgit v1.2.3-70-g09d2