AgentSkillsCN

common-conventional-commits

采用 Conventional Commits 规范,创建标准化的 Git 提交。适用于分析差异、暂存文件、生成语义化提交信息并正确标注类型与范围,或当用户使用 /commit 命令时使用。

SKILL.md
--- frontmatter
name: common-conventional-commits
description: Create standardized git commits using the Conventional Commits specification. Use for analyzing diffs, staging files, generating semantic commit messages with correct types/scopes, or when user uses the /commit command.
license: MIT

Conventional Commits

Format Specification

code
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Commit Types

TypePurpose
featNew feature
fixBug fix
docsDocumentation only
styleFormatting/style (no logic)
refactorCode refactor (no feature/fix)
perfPerformance improvement
testAdd/update tests
buildBuild system/dependencies
ciCI/config changes
choreMaintenance/misc
revertRevert commit

Project Scopes

ScopeFiles Affected
csvCSV upload flow, CSV parser, src/lib/csv.ts
chartsChart components (DailyExpensesChart, etc.)
dashboardMain dashboard (src/routes/+page.svelte)
headerAppHeader.svelte, navigation
analyticsBusiness logic, src/lib/analytics.ts
storeState management, src/lib/stores/
stylingTailwind CSS, component styles
testUnit tests (.spec.ts)
e2ePlaywright tests in e2e/
configConfiguration files (vite.config.ts, etc.)

Breaking Changes

Add ! after type/scope or BREAKING CHANGE: footer.

code
feat!: drop support for Node 16

Workflow Requirements

  1. Analyze Changes:

    • Run git diff --staged (or git diff if nothing staged).
    • Identify logical groups of changes.
  2. Stage Files:

    • If needed, stage files intelligently: git add <path>.
    • NEVER commit secrets or .env files.
  3. Generate Message:

    • Determine Type and Scope.
    • Write a short Description (imperative mood, <72 chars).
  4. Commit:

    • Run git commit -m "type(scope): description".

Examples

  • feat(charts): add income vs expense ratio visualization
  • fix(csv): handle MoneyWiz sep= preamble correctly
  • style(header): reduce padding for compact appearance
  • test(e2e): add test for CSV upload

Safety Directives

  • NEVER Use --no-verify.
  • NEVER Force push.
  • NEVER Update git config unless explicitly asked.
  • ALWAYS Use bun for package operations.