git-commit
AI 智能生成 commit message 并分批提交。读取 active preset 的 subject 格式、type 枚举、分支规则、业务词归一表,自动适配 generic / example-company / 公司自定义 preset。**不自动 push** —— push 时机交回 shk 的…
Skill by duoglas
Chalk Labs
Need help deploying git-commit?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/duoglas-git-commit
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/git-commit
What's inside
- Skill name
git-commit- Description
- AI 智能生成 commit message 并分批提交。读取 active preset 的 subject 格式、type 枚举、分支规则、业务词归一表,自动适配 generic / example-company / 公司自定义 preset。**不自动 push** —— push 时机交回 shk 的 verification-gate(仅 REVIEW 阶段放行)。Use when 用户说提交、commit、git commit、分批提交、生成 commit message 等。
- License
- MIT
- Instructions
- 292 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# git-commit
AI 自动生成 commit message 并分批提交。Test 与非 Test 自动分离,大改自动拆批。
> **本 skill 不 push**。push 时机由 shk 的 `verification-gate.js` 决定(其他阶段直接 exit 2 阻断)。
## 何时使用
- 用户说 "提交"、"commit"、"分批提交"、"帮我生成 commit message"
- 完成 EXECUTE 进入 VERIFY/REVIEW 前
- `git status` 有较多变更想拆 commit
## 何时不要用
- 用户已经写好 message + `git commit -m` 手动提交 → 直接放行,本 skill 不必介入
- 在 PLAN / SETUP / EXECUTE 阶段(verification-gate 会拒 commit;先验证再来)
## 执行原则
> 严格按步骤顺序执行,前一步成功后才进入下一步。
> 🔒 标记的步骤必须等待用户实际输入,禁止自动跳过。
---
## 1. 环境检查
```bash
git rev-parse --is-inside-work-tree
git symbolic-ref --short HEAD # $BRANCH
git status --porcelain # changes
```
- 非仓库 / 游离 HEAD / 无变更 → 终止
- 记录 `$BRANCH` 备后续步骤使用
## 2. 读取 active preset
```bash
node scripts/hooks/load-preset.js
```
吐出的 JSON 取以下字段:
| 字段 | 用途 |
|---|---|
| `commit_format.subject_regex` | 校验 subject 必须匹配 |
| `commit_format.format_description` | 人类可读说明(生成时参考) |
| `commit_format.type_enum` | 候选 type 列表 |
| `commit_format.type_blocked_on_branch` | type→[branch] 禁用表(支持 `!` 取反) |
| `commit_format.type_required_on_branch` | branch→[type] allowlist |
| `commit_format.title_hints` | 业务词归一表(可选;公司自定义 preset 可能提供,generic 没有) |
> 没有 `HARNESS_PRESET` / `.harness.local.json` / `.claude/settings.json` 配置时,loader fallback 到 `generic`。
## 3. 获取上次前缀
```bash
git log -1 --format=%B
```
按 active preset 的 `subject_regex` 解析第一行,提取:
- **generic / Conventional**:`<type>(scope?): subject` → `LAST_TYPE` = 第 1 个捕获组
- **任务 ID 前缀风格**(公司自定义 preset 可能采用):`{任务ID?} {type} {title}` → `LAST_TASKID` + `LAST_TYPE`
仅作为下一步"前缀复用"的默认建议。
## 4. 前缀判定(含分支×类型约束)
### 4.1 type 选择
按以下优先级决定本批次的 `type`:
1. **Test 批次**(见 §5.1 识别)→ 强制 `test`,最高优先级
2. `LAST_TYPE` 仍合法(在 `type_enum`、不被 §4.2 拒)→ 复用
3. 否则 🔒 提示用户输入:`请输入 type(候选: <从 preset.type_enum 列出>)`
### 4.2 分支×类型校验
读 `type_blocked_on_branch` 与 `type_required_on_branch`:
- `type_blocked_on_branch[type]` 任一 pattern 匹配 `$BRANCH`(含 `!pattern` 取反)→ 该 type 在该分支被禁
- `type_required_on_branch` 中存在 pattern 匹配 `$BRANCH` 而 `type` 不在该 pattern 的 allowlist → 该 type 在该分支被禁
> 例:某公司 preset 下:
> - `master` 分支不能用 `fix`(`fix: ['!fix-*']`)
> - `fix-PROJ-42` 分支只能用 `fix` 或 `test`(`fix-*: ['fix','test']`)
> - `release-20260429` 分支不能用 `feat`(`feat: ['release-*','fix-*']`)
被禁 → 🔒 提示用户重选 type 或换分支。**严禁绕过**——`branch-policy-guard.js` 同时会在 `git commit` 时 exit 2 阻断。
### 4.3 任务 ID
仅当 active preset 的 `subject_regex` 允许任务 ID 段(例如形如 `(?:\S+\s+)?` 的可选段)时执行:
- `LAST_TASKID` 仍有效 → 复用
- 否则 🔒 输入:`请输入任务号(可跳过)`
## 5. 分批
### 5.1 Test 识别
`git diff HEAD --numstat` 后,按路径分桶:
**TEST_GROUP**(命中即视为 Test):
- `test/` / `tests/` / `__tests__/` 目录
- `*.test.*` / `*.spec.*`
- `*_test.go` / `Test*.java` / `*_test.py`
**NONTEST_GROUP**:其余
约束:Test 与非 Test 必须分独立 commit,**不允许混合**。
### 5.2 分批策略
每组内:
- ≤ 4000 行优先聚合
- ≤ 40 文件兜底From duoglas/simple-harness-kit, MIT.
More from duoglas/simple-harness-kit
- 0.655score
auto-harness-loop-fix
duoglas
在 AI 工具内执行受控自动修复 loop。Use when tests, E2E, quality gate, or verification fails and the user expects the agent to fix and rerun instead of only reporting…
SkillAFreshness: A★ 39Claude Code +9 - 0.655score
auto-harness-review
duoglas
执行交付前 5 项复盘检查,确保流程合规和质量达标。Use when about to deliver work to users, before final handoff, or when completing a development cycle.
SkillAFreshness: A★ 39Claude Code +9 - 0.655score
harness-start
duoglas
启动 Harness 任务(交互式收集需求,自动带上全部流程约束)。Use when starting a new feature, task, or any development work in a Harness-enabled project.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
auto-harness-learn
duoglas
分析 session 观察数据,提取行为模式生成 instinct,给出改进建议和 Token 优化提议。Use when user says "分析学习数据"、"看看有什么模式"、"harness learn"。
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
auto-harness-santa
duoglas
执行 Santa Method 双独立对抗验证。Use when reviewing high-risk changes, production deployments, or complex logic before shipping.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
harness-feedback
duoglas
执行 F1-F5 结构化反馈处理流程,从问题中提炼规则并写入约束系统。Use when receiving bug reports, user feedback, review findings, or test failures.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
harness-off
duoglas
临时关闭 Harness 模式(本会话)。Use when you need to use other skills or do non-development tasks without Harness 6-stage loop.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
harness-on
duoglas
重新启用 Harness 模式。Use when you want to resume Harness 6-stage loop after /harness-off.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
auto-harness-test-bootstrap
duoglas
为缺少测试的已有项目渐进式补充多层自动化测试覆盖。Use when project has low or no test coverage and needs automated test generation.
SkillAFreshness: A★ 39Claude Code +9 - 0.651score
harness-init
duoglas
为当前项目初始化完整的 Harness Engineering 配置(Rules、Hooks、Constraints、QA 标准)。Use when bootstrapping a new project or adding harness to an existing project.
SkillAFreshness: A★ 39Claude Code +9 - 0.650score
auto-harness-qa
duoglas
执行 5 层 QA 金字塔检查,生成量化验证报告。Use when completing a feature, before committing, or before creating a PR.
SkillAFreshness: A★ 39Claude Code +9
Signals
- Stars
- 39
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- May 29, 2026 (5 months ago)
- Last release
- Oct 9, 2026 (25 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/duoglas/simple-harness-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from duoglas
- 0.655score
auto-harness-loop-fix
duoglas
在 AI 工具内执行受控自动修复 loop。Use when tests, E2E, quality gate, or verification fails and the user expects the agent to fix and rerun instead of only reporting…
SkillAFreshness: A★ 39Claude Code +9 - 0.655score
auto-harness-review
duoglas
执行交付前 5 项复盘检查,确保流程合规和质量达标。Use when about to deliver work to users, before final handoff, or when completing a development cycle.
SkillAFreshness: A★ 39Claude Code +9 - 0.655score
harness-start
duoglas
启动 Harness 任务(交互式收集需求,自动带上全部流程约束)。Use when starting a new feature, task, or any development work in a Harness-enabled project.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
auto-harness-learn
duoglas
分析 session 观察数据,提取行为模式生成 instinct,给出改进建议和 Token 优化提议。Use when user says "分析学习数据"、"看看有什么模式"、"harness learn"。
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
auto-harness-santa
duoglas
执行 Santa Method 双独立对抗验证。Use when reviewing high-risk changes, production deployments, or complex logic before shipping.
SkillAFreshness: A★ 39Claude Code +9 - 0.654score
harness-feedback
duoglas
执行 F1-F5 结构化反馈处理流程,从问题中提炼规则并写入约束系统。Use when receiving bug reports, user feedback, review findings, or test failures.
SkillAFreshness: A★ 39Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get git-commit running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
git-commit skill. Agent Mart. https://agentmart.dev/skills/duoglas-git-commit (last updated 2026-10-24)