Conventional Commit Skill
Prerequisites
- The agent must have shell access to run
gitcommands. - Code changes must be present in the git staging area.
Execution Steps
- Analyze: Run
git diff --cachedto extract the staged code changes. - Classify: Determine the commit type based on the modifications:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
- Format: Draft a message strictly following:
<type>(<optional-scope>): <description>- Use the imperative mood (e.g., "add", not "added").
- Limit the subject line to 50 characters.
- Confirm: Display the generated message to the user and ask for explicit confirmation.
- Commit: Run
git commit -m "<message>"upon approval.