/sdlc:commit
Commit your work with a message in the style of your project, after you see the full commit plan.
Why use it
You have changes ready, and the message must follow the commit style and the commit rules of your project.
A message that breaks a rule, or a file that is missing from the commit, costs you a second commit.
/sdlc:commit writes the message from your staged diff and your recent commits, and shows the message with the files.
It commits after you answer yes.
Example
Stage at least one file with git add <files>, then run:
/sdlc:commit
The skill shows the commit plan and asks Commit as shown?. The plan has the message, then these file lists:
Staged:the files that you staged.Also staged by commit_apply:the other tracked files that have changes. They go into the commit too.Left out (.sdlc-v2/):andNot committed (untracked):the files that stay out of the commit.
Answer yes, edit or cancel. After yes, the skill shows the short SHA of the new commit and names each path that it did not commit.
What you get
- A message in the style of your project. The skill finds the style in your recent commits and writes the message from the staged diff only.
- Commit rules applied for you. The message follows the subject pattern, the allowed types and scopes, the required body and the required trailers of your project config.
- No surprise in the commit. You see the files that go in and the files that stay out before you answer.
- Control of each commit. The skill commits nothing before your
yes. Only--autoskips the question. - Bad links stopped before the commit. The skill checks the links in the message body and stops when a link fails the check.
More examples
Commit with no question:
/sdlc:commit --auto
The skill shows the commit plan, then commits with no question. Use it in an unattended workflow, for example with /sdlc:ship.
Give a hint for the type and the scope:
/sdlc:commit --type fix --scope auth
The message generator gets fix as the type hint and auth as the scope hint. The skill drops a hint that your commit rules do not allow, and tells you.
Commit only a part of your changes:
git stash push -- <paths>
Staging a subset does not narrow the commit: each tracked file with changes goes in. Move the edits that must stay out with this command, then run /sdlc:commit.
Reference
- Flags and limits: the 6 flags, the files that go into the commit, the commit plan, the errors and the limits.
- Message rules: the style detection, the commit rules of the project config, the checks on each message and the two gates before the commit.
- Follow-up instructions: the
[instructions]config, the merge rule, the question rules and the summary line.
Related skills
- /sdlc:setup: sets the commit rules of your project.
- /sdlc:execute: makes the WIP commits that this skill reports.
- /sdlc:review: reviews the changes after the commit.
- /sdlc:pr: opens a pull request after the commit.
- /sdlc:ship: runs execute, commit, review and the pull request as one pipeline.