Agent skill
ai-commit
Create properly attributed commits for AI-generated code
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ai-commit-baphled-dotopencode
SKILL.md
Skill: ai-commit
What I do
I provide expertise in creating properly attributed commits for AI-generated code using the project's standard workflow. I ensure every commit is atomic, follows conventional commit formats, and includes mandatory co-authoring attribution.
When to use me
- When creating new commits for code generated or modified by AI
- When you need to split changes into atomic, logical units
- When attributing work to both the human developer and the AI agent
Core principles
- Atomic commits: Each commit must represent a single, logical change. Do not bundle unrelated fixes or features together.
- Standard workflow: Always write your commit message to a temporary file first, then use the project's make target for execution.
- Proper attribution: Include the Co-authored-by trailer for the AI model used to maintain a clear audit trail.
- Conventional format: Use clear types like feat, fix, docs, or refactor to categorise changes.
Patterns & examples
Workflow for a new commit:
- Stage your changes with
git add. - Write the message to a file, for example
/tmp/commit.txt. - Run
make ai-commit FILE=/tmp/commit.txt.
Example commit message in /tmp/commit.txt:
feat: add user authentication middleware
Implement JWT validation for all protected routes to ensure secure access.
Co-authored-by: Claude <[email protected]>
Using fixup commits:
For small corrections to a previous, unpushed commit, use git commit --fixup=<hash> to keep history clean before a final squash.
Anti-patterns to avoid
- ❌ Direct git commit: Skipping the
make ai-committarget loses consistent formatting and attribution. - ❌ Bloated commits: Bundling multiple logical changes makes code reviews difficult and rollbacks risky.
- ❌ Missing trailers: Failing to include co-authoring information breaks the project's attribution rules.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Git/AI Commit.md
Related skills
git-master: For advanced history search and planninggit-advanced: For rebase and history managementclean-code: To ensure the committed code meets quality standards
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?