1.7 KiB
1.7 KiB
name: commit description: Group all pending file changes by conventional type and feature, then commit each group as {type}({scope}): {message}. Message style is full (What/Why/How/Who), brief (one line from git diff), or custom, chosen via decision tree. Use whenever changes must be committed; not for push or PR creation.
commit — group and commit file changes
Steps
- Track every file change: inspect all changes with
git status --porcelainfirst, thengit addgroup by group. Nevergit add -Aand commit everything at once. - Group the changes by same type plus same requirement or feature. One group is one commit.
- Commit each group with the format
{type}({requirement or feature}): {message}.
Type table
| Type | Purpose |
|---|---|
| feat | add or change a feature |
| fix | fix a bug |
| docs | documentation |
| style | formatting; no change to how the code runs |
| refactor | code change that neither adds a feature nor fixes a bug |
| perf | improve performance |
| test | add tests |
| chore | build process or tooling change |
| revert | revert an earlier commit |
Message format (pick one of three)
Ask the user per the jsc-ask:ask rules. Skip the question when the question record or this session already holds a convention.
- Full: covers What, Why, How, and Who (which feature).
- Brief: one sentence summarized from
git diff. - Custom: the user types the message.
Rules
- The grouping and message drafting details MUST run as a sub agent. The main agent only confirms the grouping and runs the commits.
- Write messages in UTF-8 Traditional Chinese (the type and scope stay in English), per the STE100 output rule.
- Never push. Push and PR belong to
jsc-git:pr.