基于代码差异生成规范化 Git 提交信息,并支持按逻辑分组提交
该技能材料显示其主要是基于 Git diff 生成规范化提交信息的提示型/开源技能,不需要密钥,也未声明任何远程连接,整体风险较低。需注意其围绕提交流程会读取本地仓库状态与差异,若实际实现包含 git add/commit 等本地操作,则属于常规本地数据访问与命令执行留意项。
材料明确注明无需密钥或环境变量,README 仅提醒避免提交 .env、私钥、token 等敏感文件,未见要求收集、存储或外发凭证的事实。
未声明任何远程端点,功能描述集中于本地分析 git diff 与生成提交信息;文中提到 GitHub Issues/Azure DevOps 仅作为工单引用语义,未见实际联网或数据外发说明。
README 展示了 git diff、git status、git add 等命令作为工作流步骤,说明该技能至少意图指导或可能触发本机 Git 命令;这属于此类开发工具的常规本地命令执行能力,材料中未见超出声明用途的系统权限红旗。
为分析和分组提交,技能会访问当前仓库的状态、差异、已暂存/未暂存文件列表,并可能涉及 .memory/git-config.md、.gitignore 等本地文件;这些访问与其声明功能直接相关,未见明显过度授权。
来源为 GitHub 且标注开源,可一定程度审计,属于降低风险因素;但仓库 star 为 0、许可证未声明、维护状态未知,供应链可信度尚可但偏弱,建议在使用前核查实际代码与最近更新。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "git-commit" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/devsquad-copilot/main/.github/plugins/devsquad/skills/git-commit/SKILL.md 2. 保存为 ~/.claude/skills/git-commit/SKILL.md 3. 装好后重载技能,告诉我可以用了
请分析当前 git diff,按照 Conventional Commits 规范生成提交信息并直接提交;如果包含不同类型改动,请按逻辑分组提交。
生成一个或多个符合 Conventional Commits 的提交,并按改动类型合理拆分。
根据当前代码差异,给我一个 Conventional Commits 风格的提交信息,包含 type、scope 和简洁说明,先不要执行提交。
输出一条规范的提交信息建议,便于手动确认后使用。
请分析当前改动并创建规范提交,关联 GitHub Issue #128;如果改动涉及修复和文档更新,请拆成两个提交。
生成带工作项引用的规范提交,并将修复与文档改动分别提交。
<type>[optional scope]: <description>
[optional body]
[optional footer]
References: Conventional Commits and How to Write a Git Commit Message.
| Type | Usage |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation-only change |
style | Formatting, semicolons, whitespace (no logic change) |
refactor | Refactoring without behavior change |
perf | Performance improvement |
test | Adding or fixing tests |
build | Build system or external dependencies |
ci | CI/CD configuration |
chore | General maintenance (scripts, configs) |
revert | Revert a previous commit |
| SDD Artifact | Likely type |
|---|---|
docs/features/**/spec.md | docs |
docs/architecture/decisions/*.md (ADR) | docs |
tasks.md, work items | docs or chore |
| Implementation code | feat, fix, refactor, perf |
| Tests | test |
Agents, skills, instructions (.github/) | chore or ci |
# ! marker after type/scope
feat!: remove deprecated endpoint
# Or BREAKING CHANGE footer
feat(api): allow extensible configuration
BREAKING CHANGE: behavior of the `extends` key changed
# If there are staged files, use staged diff
git diff --staged --stat
git diff --staged
# If nothing is staged, use working tree
git diff --stat
git diff
# Check overall status
git status --porcelain
Determine from the diff:
auth, api, docs, spec)If the diff contains logically distinct changes, group them into separate commits:
# Group by logical area
git add src/auth/*.ts # commit 1: feat(auth)
git add tests/auth/*.test.ts # commit 2: test(auth)
git add docs/features/login/ # commit 3: docs(login)
Principle: one commit = one coherent logical change.
If all changes are part of the same logical unit, stage everything:
git add -A
Before committing, verify:
# Does .gitignore exist?
test -f .gitignore && echo "OK" || echo "⚠ .gitignore missing"
# No secrets being committed?
git diff --staged --name-only | grep -iE '\.(env|pem|key|credentials|secret)' && echo "⚠ POSSIBLE SECRET" || echo "OK"
Never commit: .env, private keys, tokens, credentials, credentials.json.
Before committing, check if the current branch is the integration branch:
CURRENT_BRANCH=$(git branch --show-current)
Resolve the integration branch in this order:
Integration Branch from .memory/git-config.md (if it exists)git symbolic-ref refs/remotes/origin/HEADmain, master, or developIf the current branch matches the integration branch:
You are about to commit directly to `[branch]`. Direct commits to the integration branch bypass code review and are difficult to revert safely.
[B] Create a feature branch first (recommended)
[C] Continue on [branch] (I understand the risks)
If the user chooses [B]:
| Current state | Recovery action |
|---|---|
| Changes are staged but not committed | Run git switch -c <feature-branch> (preserves working tree and index) |
| Changes are unstaged | Run git switch -c <feature-branch> (preserves working tree) |
After switching, continue the commit flow on the new branch.
If the user chooses [C], proceed with the commit. Log the override in the reasoning log (if active).
Never commit to the integration branch without explicit user confirmation.
…
系统化排查测试失败、构建中断与异常运行问题,帮助快速恢复开发进度
为软件架构图提供设计与审查建议,提升文档中的图示清晰度与规范性
帮助你创建、切换并检查代码分支,确保实现前遵循正确分支策略。
用于初始化项目或校验并生成 SDD 文档模板,确保规范齐全且为最新版本。
用于初始化项目时检查并创建社区治理所需的标准仓库文件。
用于统一项目 Markdown 文档的格式、结构与写作风格规范。
为已暂存或未暂存代码创建提交,并自动生成符合仓库风格的提交信息
将 AI 生成的代码改动按主题分组为待提交候选,审核后再落库。
自动分析 Git 提交并生成面向用户的清晰更新日志与发布说明。
帮助开发者在提交代码或生成 diff 时套用正确的提交前缀、审阅人和测试计划。
在实现完成后协助提交代码、推送分支并发起拉取请求与自动审查。
帮助团队审查 Git 变更与 Markdown 内容,并通过 MCP 接入 AI 流程。