git-atomic-commit by arisng/github-copilot-fc
npx skills add https://github.com/arisng/github-copilot-fc --skill git-atomic-commit此技能通过分析仓库中的所有变更,智能地将其分组为逻辑提交,并引导用户完成整个过程,从而能够构建具有规范提交消息的清晰、原子化的 git 提交。
提交消息遵循 type(scope): subject 模式。类型和作用域由三级层次结构管理:
| 层级 | 管理内容 | 定义者 | 稳定性 |
|---|---|---|---|
| 1. 通用 | 标准规范提交类型 | 行业惯例 | 在所有仓库中固定 |
| 2. 作者偏好 | 扩展类型 + 默认文件路径映射 | 技能作者(主观设定) | 跨仓库可移植;用户可覆盖 |
| 3. 工作区特定 | 作用域、附加类型、文件路径覆盖 | 每个仓库的 .github/git-scope-constitution.md |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 每个仓库唯一 |
提交类型 = 第 1 层 + 第 2 层。类型代表变更的意图。提交作用域 = 第 3 层。作用域代表变更的领域、模块或位置,与仓库的上下文紧密耦合。
标准规范提交类型 —— 这些是固定不变的,适用于所有地方:
| 类型 | 使用场景 |
|---|---|
feat | 新功能 |
fix | 错误修复 |
docs | 文档变更 |
style | 格式化、空格、缺少分号 |
refactor | 代码重构(无行为变更) |
perf | 性能改进 |
test | 添加或更新测试 |
build | 构建系统或外部依赖项 |
ci | CI 配置文件和脚本 |
chore | 不修改源代码或测试文件的维护工作 |
revert | 恢复先前的提交 |
给其他用户的提示: 这些扩展类型反映了作者 (
arisng) 在 AI/开发工具密集型仓库中的个人惯例。您可以自由修改、删除或添加自己的扩展类型以适应您的工作流程。
当文件匹配已知模式时,扩展类型优先于通用类型:
| 扩展类型 | 替换 | 领域 | 典型文件模式 |
|---|---|---|---|
agent | feat, chore | AI 代理资产(技能、指令) | skills/*, **/AGENTS.md |
copilot | feat, chore | GitHub Copilot 资产 | *.agent.md, *.prompt.md, instructions/*.md, .vscode/mcp.json, memory.json |
devtool | chore, build | 开发工具和编辑器配置 | scripts/*, .vscode/settings.json, .vscode/tasks.json |
codex | chore | OpenAI Codex 资产 | .codex/* |
规则: 当文件匹配扩展类型模式时,始终使用扩展类型而非通用类型。对于其他所有情况,回退到通用类型。
作用域完全特定于仓库,并由 .github/git-scope-constitution.md 管理。下面的文件路径到作用域映射是作者工作区的一个示例。每个仓库应通过 git-commit-scope-constitution 技能定义自己的映射。
作用域粒度原则: 作用域代表工件类别,而非特定实例。当扫描 git log --oneline 时,type(category) 告诉您什么类型的东西发生了变更;提交主题告诉您具体是哪一个。
| 文件路径模式 | 类型(第 2 层) | 作用域(第 3 层) | 原理 |
|---|---|---|---|
.docs/issues/* | docs | issue | 问题文档和跟踪 |
.docs/changelogs/* | docs | changelog | 变更日志文件 |
.github/git-scope-constitution.md | docs | constitution | 作用域宪法治理 |
instructions/*.md | copilot | instruction | 仓库级 Copilot 指令 |
skills/* | agent | skill | 代理技能定义和实现 |
scripts/* | devtool | script | 自动化脚本(PowerShell、Python、Bash) |
*.agent.md | copilot | custom-agent | 自定义代理定义 |
**/AGENTS.md | agent | instruction | 标准 AI 代理自定义指令 |
*.prompt.md | copilot | prompt | Copilot 提示文件 |
memory.json | copilot | memory | 知识图谱记忆系统 |
.codex/*.json | codex | config | Codex 配置文件 |
.codex/*.md | codex | instruction | Codex 指令文件 |
.vscode/mcp.json | copilot | mcp | MCP 服务器配置 |
.vscode/settings.json | devtool | vscode | VS Code 工作区设置 |
.vscode/tasks.json | devtool | vscode | VS Code 工作区任务配置 |
强制步骤: 在任何分组或规划之前,为每个变更文件单独分配一个提交类型和一个提交作用域。具有不同类型或不相关作用域的文件必须放在单独的提交中 —— 这对于原子性是不可妥协的。
关键规则:
需要避免的常见错误:
docs(issue) 不是类型。docs 是类型,issue 是作用域。feat(instructions) → ✅ copilot(instruction) —— 使用扩展类型 copilot(第 2 层)feat(skill) → ✅ agent(skill) —— 使用扩展类型 agent(第 2 层)ai(skill) → ✅ agent(skill) —— ai 类型已弃用;对所有面向 AI 模型的行为使用 agentai(agent) → ✅ agent(instruction) —— 已弃用的 ai 类型;旧的 agent 作用域映射到 agent 下的 instructionchore(issue) → ✅ docs(issue) —— docs 是合适的通用类型docs(无作用域) → ✅ docs(issue) 或 docs(changelog) —— 始终包含作用域agent(pdf) → ✅ agent(skill) —— 使用类别级作用域,将具体项放在主题中copilot(mcp) + devtool(vscode) → ✅ 分开提交强制: 对于每个变更文件,使用上面的映射表确定其确切的提交类型和作用域。记录此分配 - 它驱动整个提交策略。
强制: 分配类型和作用域后,验证作用域选择。
作用域验证流程:
.github/git-scope-constitution.md 是否有作用域宪法git-commit-scope-constitution 技能来:
作用域交叉引用:
type(scope): subject示例:
File: skills/pdf/SKILL.md
→ Type: agent [第 2 层扩展类型,用于 AI 代理资产]
→ Scope: skill [第 3 层类别级作用域]
→ Result: agent(skill): add table extraction to pdf
强制: 在呈现任何提交计划之前完成此清单:
feat、fix、chore)如果任何清单项失败,请在继续之前修订计划。
关键约束: 具有不同提交类型的文件不能分组在一起 —— 它们必须放在单独的提交中。
根据以下条件对剩余的相关变更进行分组:
如果分组会混合提交类型,立即拆分为单独的提交。
创建一个待办事项列表,跟踪每个计划的提交及其分配的类型。
强制验证: 审查每个计划的提交以确保:
如果验证失败,立即修订分组。
对于每个分组,按照规范提交格式生成提交消息:
<type>(<scope>): <subject>
<body>
<footer>
强制:规范提交语法 每个提交必须遵循此确切结构:
<type>(<scope>): <subject><type>(<scope>)(<scope_2>) 或 <type>(<scope1,scope2>)。使用一个最能代表变更的主要作用域。<subject> 部分明确提及(例如,<type>(primary-scope): [scope2] actual message 或 <type>(primary-scope): fix scope2 bug)。消息格式规则:
类型选择: 参考上面“区分提交类型与提交作用域”部分中的第 1 层和第 2 层表格。
关键: 当文件匹配扩展类型模式时,使用第 2 层扩展类型(例如 agent、copilot)而不是第 1 层通用类型(feat、chore)。始终将类型与来自仓库宪法的有效作用域配对。
作用域选择:
.github/git-scope-constitution.md 的作用域git-commit-scope-constitution 技能关键: 提供足够的细节以进行准确的变更日志生成和知识图谱跟踪。模糊的消息会导致误导性的摘要。
质量要求:
良好示例(具体):
copilot(custom-agent): remove unused agents - conductor, context7, implementation, microsoft-docs
Removes four specialized agents that were redundant.
Streamlines agent portfolio and reduces maintenance overhead.
不良示例(模糊):
refactor: update agent definitions
交互模式(用户引导):
自主模式(子代理):
安全性:
所有提交完成后,显示所有已创建提交的摘要。
.github/git-scope-constitution.md此技能与 git-commit-scope-constitution 技能协同工作,以确保提交消息的完全一致性:
职责划分:
工作流集成:
Changed Files
↓
git-atomic-commit: Map files → Commit types
↓
git-commit-scope-constitution: Select scopes for each type
↓
git-atomic-commit: Generate commit messages
↓
Final Commits: type(scope): subject
何时使用:
git-atomic-commitgit-commit-scope-constitution:
.github/git-scope-constitution.md宪法位置: .github/git-scope-constitution.md
作用域清单: .github/git-scope-inventory.md
# 查看所有变更文件(已暂存 + 未暂存)
git status --short
# 查看未暂存变更的差异
git diff -- <filepath>
# 查看已暂存变更的差异
git diff --cached -- <filepath>
# 暂存特定文件
git add <filepath>
# 取消暂存特定文件
git reset HEAD -- <filepath>
# 使用消息提交
git commit -m "<message>"
# 使用多行消息提交
git commit -m "<subject>" -m "<body>"
📦 Commit Plan (3 commits)
1. agent(skill): add vscode-docs skill for researching VS Code docs
Files: skills/vscode-docs/SKILL.md, skills/vscode-docs/assets/toc.md
2. copilot(instruction): update claude-skills orchestration guidelines
Files: instructions/claude-skills.instructions.md
3. docs(issue): remove deprecated copilot-skills design decision issue
Files: .docs/issues/251210_copilot-skills.md
✅ Pre-commit verification: All file paths mapped to correct project-specific types
Ready to proceed with commit #1? (yes/no/edit)
每周安装次数
1
仓库
GitHub 星标数
2
首次出现
1 天前
安全审计
安装在
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
This skill enables crafting clean, atomic git commits with conventional commit messages by analyzing all changes in the repository, intelligently grouping them into logical commits, and guiding the user through the process.
Commit messages follow the pattern type(scope): subject. Type and Scope are governed by a three-tier hierarchy:
| Tier | What it governs | Defined by | Stability |
|---|---|---|---|
| 1. Universal | Standard Conventional Commits types | Industry convention | Fixed across all repos |
| 2. Author Preferences | Extended types + default file-path mappings | Skill author (opinionated) | Portable across repos; users may override |
| 3. Workspace-Specific | Scopes, additional types, file-path overrides | .github/git-scope-constitution.md per repo | Unique per repository |
Commit Types = Tier 1 + Tier 2. Types represent the intent of the change. Commit Scopes = Tier 3. Scopes represent the domain, module, or location of the change, tightly coupled to the repository's context.
Standard Conventional Commits — these are immutable and apply everywhere:
| Type | Use Case |
|---|---|
feat | New features |
fix | Bug fixes |
docs | Documentation changes |
style | Formatting, whitespace, missing semi colons |
refactor | Code restructuring (no behavior change) |
perf | Performance improvements |
Note for other users: These extended types reflect the author's (
arisng) personal conventions for AI/DevTool-heavy repositories. You are free to modify, remove, or add your own extended types to suit your workflow.
Extended types take precedence over universal types when the file matches a known pattern:
| Extended Type | Replaces | Domain | Typical File Patterns |
|---|---|---|---|
agent | feat, chore | AI agent assets (skills, instructions) | skills/*, **/AGENTS.md |
copilot | feat, chore |
Rule: When a file matches an extended type pattern, always use the extended type instead of the universal one. Fall back to universal types for everything else.
Scopes are entirely repo-specific and governed by .github/git-scope-constitution.md. The file-path-to-scope mapping below is an example from the author's workspace. Each repository should define its own via the git-commit-scope-constitution skill.
Scope Granularity Principle: Scopes represent the artifact category , not a specific instance. When scanning git log --oneline, type(category) tells you what kind of thing changed; the commit subject tells you which one.
| File Path Pattern | Type (Tier 2) | Scope (Tier 3) | Rationale |
|---|---|---|---|
.docs/issues/* | docs | issue | Issue documentation and tracking |
.docs/changelogs/* | docs | changelog | Changelog files |
.github/git-scope-constitution.md |
MANDATORY STEP: Before any grouping or planning, assign a Commit Type and a Commit Scope to EACH changed file individually. Files with different types or unrelated scopes MUST be in separate commits — this is non-negotiable for atomicity.
Critical Rules:
Common Mistakes to Avoid:
docs(issue) is NOT a type. docs is the type, issue is the scope.feat(instructions) → ✅ copilot(instruction) — Use extended type copilot (Tier 2)feat(skill) → ✅ agent(skill) — Use extended type agent (Tier 2)ai(skill) → ✅ agent(skill) — type is deprecated; use for all AI model-facing behaviorMANDATORY: For each changed file, determine its exact commit type AND scope using the mapping table above. Document this assignment - it drives the entire commit strategy.
MANDATORY: After types and scopes are assigned, validate scope choices.
Scope Validation Process:
.github/git-scope-constitution.mdgit-commit-scope-constitution skill to:
Scope Cross-Reference:
type(scope): subjectExample:
File: skills/pdf/SKILL.md
→ Type: agent [Tier 2 extended type for AI agent assets]
→ Scope: skill [Tier 3 category-level scope]
→ Result: agent(skill): add table extraction to pdf
MANDATORY: Complete this checklist before presenting any commit plan:
feat, fix, chore) when a Tier 2 extended type appliesIf any checklist item fails, revise the plan before proceeding.
CRITICAL CONSTRAINT: Files with different commit types CANNOT be grouped together - they must be in separate commits.
Group remaining related changes based on:
If grouping would mix commit types, split into separate commits immediately.
Create a todo list tracking each planned commit with their assigned types.
MANDATORY VALIDATION: Review each planned commit to ensure:
If validation fails, revise the grouping immediately.
For each group, generate a commit message following Conventional Commits format:
<type>(<scope>): <subject>
<body>
<footer>
MANDATORY: Conventional Commit Syntax Every commit MUST follow this exact structure:
<type>(<scope>): <subject><type>(<scope>)(<scope_2>) or <type>(<scope1,scope2>). Use ONE primary scope that best represents the change.<subject> part (e.g., <type>(primary-scope): [scope2] actual message or <type>(primary-scope): fix scope2 bug).Message Format Rules:
Type Selection: Refer to the Tier 1 and Tier 2 tables in the "Distinguish Commit Type vs. Commit Scope" section above.
CRITICAL: Use Tier 2 extended types (e.g., agent, copilot) instead of Tier 1 universal types (feat, chore) when the file matches an extended type pattern. Always pair the Type with a valid Scope from the repository's constitution.
Scope Selection:
.github/git-scope-constitution.md if availablegit-commit-scope-constitution skill if unclearKEY: Provide sufficient detail for accurate changelog generation and knowledge graph tracking. Vague messages lead to misleading summaries.
Quality Requirements:
Good Example (Specific):
copilot(custom-agent): remove unused agents - conductor, context7, implementation, microsoft-docs
Removes four specialized agents that were redundant.
Streamlines agent portfolio and reduces maintenance overhead.
Bad Example (Vague):
refactor: update agent definitions
Interactive Mode (User-Guided):
Autonomous Mode (Subagent):
Safety:
After all commits are done, show a summary of all commits created.
.github/git-scope-constitution.md if availableThis skill works in tandem with the git-commit-scope-constitution skill to ensure complete commit message consistency:
Division of Responsibility:
git-atomic-commit (this skill):
git-commit-scope-constitution :
Workflow Integration:
Changed Files
↓
git-atomic-commit: Map files → Commit types
↓
git-commit-scope-constitution: Select scopes for each type
↓
git-atomic-commit: Generate commit messages
↓
Final Commits: type(scope): subject
When to Use Each:
git-atomic-commit for every commit workflowgit-commit-scope-constitution when:
.github/git-scope-constitution.mdConstitution Location: .github/git-scope-constitution.md Scopes Inventory: .github/git-scope-inventory.md
# View all changed files (staged + unstaged)
git status --short
# View diff for unstaged changes
git diff -- <filepath>
# View diff for staged changes
git diff --cached -- <filepath>
# Stage specific files
git add <filepath>
# Unstage specific files
git reset HEAD -- <filepath>
# Commit with message
git commit -m "<message>"
# Commit with multi-line message
git commit -m "<subject>" -m "<body>"
📦 Commit Plan (3 commits)
1. agent(skill): add vscode-docs skill for researching VS Code docs
Files: skills/vscode-docs/SKILL.md, skills/vscode-docs/assets/toc.md
2. copilot(instruction): update claude-skills orchestration guidelines
Files: instructions/claude-skills.instructions.md
3. docs(issue): remove deprecated copilot-skills design decision issue
Files: .docs/issues/251210_copilot-skills.md
✅ Pre-commit verification: All file paths mapped to correct project-specific types
Ready to proceed with commit #1? (yes/no/edit)
Weekly Installs
1
Repository
GitHub Stars
2
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装
OpenAI API 完整文档技能 - 官方文档集成与智能问答助手
1 周安装
Next.js 官方文档中文指南 - 从入门到精通,掌握App Router、数据获取与性能优化
1 周安装
Hono 框架中文文档 | 轻量级 Web 框架,支持 Bun、Deno、Cloudflare Workers
1 周安装
Express.js 全面中文文档与 API 参考 | 涵盖安全漏洞、性能优化与迁移指南
1 周安装
Drizzle ORM 完整文档 | 无头 ORM 与类 SQL 查询指南
1 周安装
Cortex 文档大全 | 集成指南与 API 参考 | 涵盖 FireHydrant、ServiceNow、Datadog 等
1 周安装
test| Adding or updating tests |
build | Build system or external dependencies |
ci | CI configuration files and scripts |
chore | Maintenance that doesn't modify src or test files |
revert | Reverts a previous commit |
| GitHub Copilot assets |
*.agent.md, *.prompt.md, instructions/*.md, .vscode/mcp.json, memory.json |
devtool | chore, build | Developer tooling & editor config | scripts/*, .vscode/settings.json, .vscode/tasks.json |
codex | chore | OpenAI Codex assets | .codex/* |
docs |
constitution |
| Scope constitution governance |
instructions/*.md | copilot | instruction | Repository-level Copilot instructions |
skills/* | agent | skill | Agent skill definitions and implementations |
scripts/* | devtool | script | Automation scripts (PowerShell, Python, Bash) |
*.agent.md | copilot | custom-agent | Custom agent definitions |
**/AGENTS.md | agent | instruction | Standard AI agent custom instructions |
*.prompt.md | copilot | prompt | Copilot prompt files |
memory.json | copilot | memory | Knowledge graph memory systems |
.codex/*.json | codex | config | Codex configuration files |
.codex/*.md | codex | instruction | Codex instruction files |
.vscode/mcp.json | copilot | mcp | MCP server configuration |
.vscode/settings.json | devtool | vscode | VS Code workspace settings |
.vscode/tasks.json | devtool | vscode | VS Code workspace task configurations |
aiagentai(agent) → ✅ agent(instruction) — deprecated ai type; the old agent scope maps to instruction under agentchore(issue) → ✅ docs(issue) — docs is the appropriate universal typedocs (no scope) → ✅ docs(issue) or docs(changelog) — Always include a scopeagent(pdf) → ✅ agent(skill) — Use category-level scope, put specific item in subjectcopilot(mcp) + devtool(vscode) in one commit → ✅ Separate commits