AgentSkillsCN

commit

为这个 Electron + React 项目创建常规的 Commit 规范。在提交前运行类型检查,确保不会引入任何类型错误。

SKILL.md
--- frontmatter
name: commit
description: Create conventional commits for this Electron + React project. Run type checking before committing to ensure no type errors are introduced.
user_invocable: true
model: haiku
tools: Bash, Read

Commit Skill

Create well-formatted conventional commits for the Cleanify project.

Commit Message Format

Use conventional commits format:

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

[optional body]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Types

TypeWhen to Use
featNew feature or capability
fixBug fix
refactorCode change that neither fixes a bug nor adds a feature
perfPerformance improvement
styleFormatting, missing semicolons, etc.
docsDocumentation only changes
testAdding or correcting tests
choreMaintenance tasks, dependency updates
buildChanges to build system or external dependencies

Scopes

ScopeFiles Affected
mainsrc/main/**
renderersrc/renderer/**
preloadsrc/preload/**
typessrc/shared/types.ts
servicessrc/main/services/**
hookssrc/renderer/hooks/**
ipcIPC handlers and preload bridges
buildBuild configuration, electron-builder
depspackage.json dependency changes

Workflow

  1. Run pnpm typecheck to verify no type errors
  2. Run git status to see changes
  3. Run git diff --staged for staged changes (or git diff for all)
  4. Check recent commits with git log --oneline -5 for style consistency
  5. Create commit with appropriate type, scope, and description

Examples

bash
# Feature in renderer
feat(renderer): add disk usage visualization panel

# Bug fix in main process service
fix(services): handle null path in artifact scanner

# IPC changes spanning main and preload
feat(ipc): add real-time progress events for cleanup

# Type definition update
refactor(types): add discriminated union for scan states

# Dependency update
chore(deps): update electron to v40

Pre-Commit Check

Always run type checking before committing:

bash
pnpm typecheck

If there are errors, fix them before committing. Never commit code with type errors.