AgentSkillsCN

knowns.commit

在提交代码变更时,遵循规范的常规提交格式并进行验证时使用。

SKILL.md
--- frontmatter
name: knowns.commit
description: Use when committing code changes with proper conventional commit format and verification

Committing Changes

Create well-formatted commits following conventional commit standards.

Announce at start: "I'm using the knowns.commit skill to commit changes."

Core principle: VERIFY BEFORE COMMITTING - check staged changes, ask for confirmation.

The Process

Step 1: Review Staged Changes

bash
git status
git diff --staged

Step 2: Generate Commit Message

Format:

code
<type>(<scope>): <message>

- Bullet point summarizing change
- Another point if needed

Types:

TypeDescription
featNew feature
fixBug fix
docsDocumentation only
styleFormatting, no code change
refactorCode restructure
perfPerformance improvement
testAdding tests
choreMaintenance

Rules:

  • Title lowercase, no period, max 50 chars
  • Scope optional but recommended
  • Body explains why, not just what

Step 3: Ask for Confirmation

Present message to user:

code
Ready to commit:

feat(auth): add JWT token refresh

- Added refresh token endpoint
- Tokens expire after 1 hour

Proceed? (yes/no/edit)

Wait for user approval.

Step 4: Commit

bash
git commit -m "feat(auth): add JWT token refresh

- Added refresh token endpoint
- Tokens expire after 1 hour"

Guidelines

  • Only commit staged files (don't git add unless asked)
  • NO "Co-Authored-By" lines
  • NO "Generated with Claude Code" ads
  • Ask before committing, never auto-commit

Examples

Good:

code
feat(api): add user profile endpoint
fix(auth): handle expired token gracefully
docs(readme): update installation steps

Bad:

code
update code          (too vague)
WIP                  (not ready)
fix bug              (which bug?)

Remember

  • Review staged changes first
  • Follow conventional format
  • Ask for confirmation
  • Keep messages concise