commit-detection
1
总安装量
1
周安装量
#46928
全站排名
安装命令
npx skills add https://github.com/fusengine/agents --skill commit-detection
Agent 安装分布
amp
1
opencode
1
kimi-cli
1
codex
1
gemini-cli
1
Skill 文档
Commit Type Detection Skill
Expert knowledge for detecting the optimal conventional commit type.
Detection Algorithm
Step 1: Gather Data
# Get modified files
git diff --name-only
git diff --staged --name-only
# Get change statistics
git diff --stat
git diff --staged --stat
# Check for keywords in diff
git diff | grep -i "fix\|bug\|error" | head -5
Step 2: Categorize Files
| Category | File Patterns |
|---|---|
| docs | *.md, *.txt, *.rst, README*, CHANGELOG* |
| test | *.test.*, *.spec.*, __tests__/*, test/* |
| config | *.json, *.yml, *.yaml, *.toml, .*rc |
| ci | .github/*, .gitlab-ci.yml, Jenkinsfile |
| build | package.json, Makefile, webpack.*, vite.* |
| style | Only whitespace, formatting changes |
| src | *.ts, *.js, *.py, *.go, *.rs, etc. |
Step 3: Apply Rules
IF only docs files changed:
â docs
IF only test files changed:
â test
IF only config/build files changed:
â chore
IF only CI files changed:
â ci
IF diff contains "fix", "bug", "error", "issue", "resolve":
â fix
IF new files added with business logic:
â feat
IF files renamed/moved without logic change:
â refactor
IF performance keywords ("optimize", "perf", "speed", "cache"):
â perf
IF formatting only (whitespace, semicolons):
â style
DEFAULT:
â Use /commit-pro:commit for smart analysis
Step 4: Determine Scope
Extract scope from primary directory:
src/components/Button.tsx â ui or button
src/api/auth.ts â auth
lib/utils/date.ts â utils
server/routes/user.ts â user
Quick Reference
| Type | When |
|---|---|
feat |
New functionality |
fix |
Bug correction |
docs |
Documentation only |
style |
Formatting only |
refactor |
Code restructure |
perf |
Performance |
test |
Tests only |
build |
Build/deps |
ci |
CI/CD config |
chore |
Maintenance |
Examples
Example 1: Only README changed
Files: README.md
â /commit-pro:docs
Example 2: New component + test
Files: src/Button.tsx, src/Button.test.tsx
â /commit-pro:feat (primary is new feature)
Example 3: Fix in existing file
Files: src/api/auth.ts
Diff contains: "fix login bug"
â /commit-pro:fix