be-commit
Create a commit from staged changes with validated message.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- be-commit
- description
- Create a commit from staged changes with validated message.
- allowed-tools
- Read, Bash
- argument-hint
- [topic: <hint>] [short]
- user-invocable
- true
03 SKILL.md 正文
Smart Commit
Create a git commit from already-staged changes with a validated commit message following project conventions.
Instructions
Step 0: Validate Configuration
- Read
.claude/backend-springboot-plugin.json - If missing, tell the user to run
/backend-springboot-plugin:be-initfirst and stop
Step 1: Check Staged Changes
Run git diff --staged to see what is staged.
- If nothing is staged, inform the user:
"No staged changes found. Stage your changes with
git addfirst." - Stop if nothing is staged
Step 1.5: Pipeline Status Warning
Check if any feature progress files exist in {workDocDir}/.progress/:
- Glob
{workDocDir}/.progress/*.json— exclude files matchingreview-report-*.jsonorfix-report-*.json(only keep entity progress files) - For each progress file, read
pipeline.status - If any feature has a status other than
reviewedordone(i.e.,scaffolded,implementing,implemented,verified,verify-failed,review-failed,fixing,resolved,escalated):"Warning: Feature '{feature}' is in '{status}' status — review/verification may not be complete." "Continue with commit?" If the user declines, stop here.
- If all features are
reviewed,done, or no progress files exist: proceed without warning
Step 2: Parse Arguments
topic: <topic>-- optional topic hint for the commit message (inferred from diff if omitted)short-- if present, generate subject line only (skip body)
Step 3: Security Scan
Run ${CLAUDE_PLUGIN_ROOT}/scripts/pre-commit-check.sh security to scan staged changes for secrets and dangerous files.
- If the script reports issues, show the findings and abort the commit
- Do not proceed to message drafting until the security scan passes
Step 4: Analyze Changes
From the staged diff, determine:
- Which files were changed, added, or deleted
- The nature of the change: new feature, enhancement, bug fix, refactoring, test, configuration
- The domain/module affected
- If a topic hint was provided, use it to guide the message focus
Step 5: Draft Commit Message
Follow the commit standards in ${CLAUDE_PLUGIN_ROOT}/skills/be-spring-shared/SKILL.md:
-
Subject line (mandatory):
- English, present tense, imperative mood ("Add", "Fix", "Update", not "Added", "Fixes")
- Maximum 50 characters
- Start with uppercase letter (exception: lowercase identifiers like function names)
- No prefix (no
fix:,feat:,docs:, etc.) - Focus on "why" rather than "what"
-
Body (skip if
shortargument):- Blank line after subject
- Maximum 72 characters per line
- Only break within paragraphs when exceeding 72 characters
- Describe the motivation and context
- Do not mention test code
- Do not list file names
- Do not include tool advertisements or branding
Step 6: Validate
Check the draft message against the commit message rules in those standards:
- [ ] English (#1)
- [ ] Present tense imperative (#2)
- [ ] Subject <= 50 characters (#3)
- [ ] Blank line between subject and body (#4)
- [ ] Body lines <= 72 characters (#5)
- [ ] Only break within a paragraph when exceeding 72 characters (#6)
- [ ] No test code mentions (#7)
- [ ] No prefix (fix:, feat:, docs:, etc.) (#8)
- [ ] Starts with uppercase (or justified lowercase identifier) (#9)
- [ ] No branding/promotional content (#10)
If validation fails, revise the message.
Note: commit standards #11-13 (staged-only, ensure staging, separate git commands) are workflow constraints enforced in Step 1 and the Constraints section, not message format rules.
Step 7: Execute Commit
git commit -m "{message}"
Step 8: Report
"Committed:
{short hash}{subject line}"
Constraints
- Never run
git add-- only operate on already-staged changes - Never modify the staging area -- the user controls what is staged
- If the diff is too large to summarize in 50 characters, focus on the primary change
04 同仓库更多 Skills
hp-shared
Shared conventions for every homepage-plugin agent and skill — stack, code conventions, state-file writes, check commands and how to report them. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
fe-shared
Shared conventions for every frontend-react-plugin agent and skill — code conventions, state files and locks, accepted deviations, design principles, build working directory, router-mode command matrix, TypeScript check. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
be-spring-shared
Shared conventions for every backend-springboot-plugin agent and skill — tech stack, CQRS architecture, naming, coding standards, TDD, commit and build rules, state files. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
pp-translate
Use after directly editing the working language spec to sync changes to other supported languages.
pp-sync-stitch
Use when wireframes were manually edited on the Stitch website and need to be re-fetched to the local project.
pp-sync-notion
Use when a specification needs to be published or re-synced to Notion after finalization or manual edits.