Commit Summary
Generate accurate Conventional Commits from real git diffs.
Authorized Scope
Apply this engine only within the user's requested task and existing explicit
authorization. Loading or delegating to it grants no additional authority.
Preserve report-only restrictions and the caller's target, host, provider, and
cost limits. Existing approval satisfies a gate only for the same actions and
scope; obtain approval before expanding them. Forward these limits to delegates.
Contract
Inputs:
- Repository root
- Staged changes, unstaged changes, or approved paths to stage
- Optional commit type, scope, and breaking-change context
Outputs:
- Commit message candidate
- Logical commit grouping when changes are mixed
- Created commit hash after approval, if requested
Creates/Modifies:
- No changes in message-only mode
- May stage files and create commits after approval
External Side Effects:
- None unless another workflow pushes the commit later
Confirmation Required:
- Before staging files
- Before creating a commit
- Before amending or squashing existing commits
Delegates To:
github-pr-publish when the commit should be pushed and opened as a PR
git-safety when secrets or sensitive files appear in the diff
Workflow
Inspect repository state:
git status -sb
git log --oneline -5
git diff --stat
git diff --cached --stat
Determine whether changes are already staged:
- If staged changes exist, generate the message from
git diff --staged.
- If nothing is staged, inspect unstaged changes and propose logical groups.
- If unrelated changes are mixed, recommend separate commits.
Guard against unsafe commits:
- Do not stage secrets,
.env, credentials, private keys, local databases,
build caches, or large generated artifacts.
- If sensitive files appear, stop and delegate to
git-safety.
- Do not include unrelated formatting churn in a feature/fix commit unless
it is required by the change.
Choose the Conventional Commit type:
feat: user-visible feature or capability
fix: bug fix
docs: documentation only
style: formatting only, no behavior change
refactor: code restructuring without behavior change
perf: performance improvement
test: tests only
build: build system, package manager, dependencies
ci: CI/CD workflow changes
chore: maintenance with no user-facing behavior
revert: revert a previous commit
Detect scope:
- Prefer package, app, domain, or subsystem names already used in history.
- Omit scope if it would be vague (
misc, stuff, changes).
Detect breaking changes:
- Public API contract changes
- CLI flags or output changes
- Database/schema migrations requiring user action
- Removed config keys, env vars, routes, events, or exported symbols
Format as type(scope)!: summary and include a BREAKING CHANGE: footer.
Generate the commit message:
type(scope): imperative summary
Optional body explaining why and any non-obvious implementation detail.
Optional footer such as:
BREAKING CHANGE: migration required because ...
Refs: #123
If the user asked to commit, show the exact message and proceed within that
authorization. Obtain approval only if the selected files or operation exceed
the request:
git add <approved-paths>
git diff --staged --stat
git commit -m "<subject>" -m "<body-or-footer>"
Quality Bar
- Subject is imperative and under 72 characters.
- Body explains why when the diff alone is not enough.
- Message does not overstate behavior.
- Commit contains one logical change.
- Verification commands are not placed in the commit message unless the repo
convention asks for them.
Gotchas
git add . can stage unintended files. If .gitignore does not exclude node_modules, .env*, or build artifacts, always prefer git add <specific-paths>. Verify with git diff --staged --stat before committing.
- Breaking-change footer is case-sensitive. The token must be exactly
BREAKING CHANGE: (with a space, all caps) for tools like semantic-release and conventional-changelog to detect it. BREAKING-CHANGE: is not equivalent.
- Amended commits rewrite history. Never amend a commit that has already been pushed to a shared branch. If the commit exists on the remote, create a new fix commit instead.
- Co-authored-by trailers conflict with repo conventions. Some repos (including this project) explicitly forbid
Co-Authored-By trailers. Check the repo's agent instruction file (AGENTS.md, CLAUDE.md, or equivalent) or recent commit history for the project convention before adding them.
Examples
feat(auth): add password reset flow
fix(api): handle null provider response
ci(actions): restrict pull request token permissions
refactor(utils): extract date formatting helper
docs: update GitHub project board workflow
What Did I Get Done procedure
Read what-did-i-get-done procedure when compiling an activity summary over a requested date range.
Apply the authorized scope and mode of this entry point to every step.
Resolve other skills through this distribution’s active catalog; resolve
resources relative to the installed skill directory.
1---
2name: commit-summary
3description: "Generate Conventional Commit messages from staged or unstaged git changes, split unrelated changes into logical commits, detect breaking changes, and optionally create commits after approval. Use when writing commit messages, preparing commits, or committing local work."
4compatibility: Requires git.
5allowed-tools: Bash(git *)
6metadata:
7 portable_source: "https://github.com/ericlitman/open-pstack"
8 portable_commit: "56bfd14418fa733e34d98f714f357d28788470e3"
9 version: "1.2.0"
10 tags: "git, workflow, commits, productivity"
11---
12
13# Commit Summary
14
15Generate accurate Conventional Commits from real git diffs.
16
17## Authorized Scope
18
19Apply this engine only within the user's requested task and existing explicit
20authorization. Loading or delegating to it grants no additional authority.
21Preserve report-only restrictions and the caller's target, host, provider, and
22cost limits. Existing approval satisfies a gate only for the same actions and
23scope; obtain approval before expanding them. Forward these limits to delegates.
24
25## Contract
26
27Inputs:
28
29- Repository root
30- Staged changes, unstaged changes, or approved paths to stage
31- Optional commit type, scope, and breaking-change context
32
33Outputs:
34
35- Commit message candidate
36- Logical commit grouping when changes are mixed
37- Created commit hash after approval, if requested
38
39Creates/Modifies:
40
41- No changes in message-only mode
42- May stage files and create commits after approval
43
44External Side Effects:
45
46- None unless another workflow pushes the commit later
47
48Confirmation Required:
49
50- Before staging files
51- Before creating a commit
52- Before amending or squashing existing commits
53
54Delegates To:
55
56- `github-pr-publish` when the commit should be pushed and opened as a PR
57- `git-safety` when secrets or sensitive files appear in the diff
58
59## Workflow
60
611. Inspect repository state:
62
63 ```bash
64 git status -sb
65 git log --oneline -5
66 git diff --stat
67 git diff --cached --stat
68 ```
69
702. Determine whether changes are already staged:
71 - If staged changes exist, generate the message from `git diff --staged`.
72 - If nothing is staged, inspect unstaged changes and propose logical groups.
73 - If unrelated changes are mixed, recommend separate commits.
74
753. Guard against unsafe commits:
76 - Do not stage secrets, `.env`, credentials, private keys, local databases,
77 build caches, or large generated artifacts.
78 - If sensitive files appear, stop and delegate to `git-safety`.
79 - Do not include unrelated formatting churn in a feature/fix commit unless
80 it is required by the change.
81
824. Choose the Conventional Commit type:
83
84 - `feat`: user-visible feature or capability
85 - `fix`: bug fix
86 - `docs`: documentation only
87 - `style`: formatting only, no behavior change
88 - `refactor`: code restructuring without behavior change
89 - `perf`: performance improvement
90 - `test`: tests only
91 - `build`: build system, package manager, dependencies
92 - `ci`: CI/CD workflow changes
93 - `chore`: maintenance with no user-facing behavior
94 - `revert`: revert a previous commit
95
965. Detect scope:
97 - Prefer package, app, domain, or subsystem names already used in history.
98 - Omit scope if it would be vague (`misc`, `stuff`, `changes`).
99
1006. Detect breaking changes:
101 - Public API contract changes
102 - CLI flags or output changes
103 - Database/schema migrations requiring user action
104 - Removed config keys, env vars, routes, events, or exported symbols
105
106 Format as `type(scope)!: summary` and include a `BREAKING CHANGE:` footer.
107
1087. Generate the commit message:
109
110 ```text
111 type(scope): imperative summary
112
113 Optional body explaining why and any non-obvious implementation detail.
114
115 Optional footer such as:
116 BREAKING CHANGE: migration required because ...
117 Refs: #123
118 ```
119
1208. If the user asked to commit, show the exact message and proceed within that
121 authorization. Obtain approval only if the selected files or operation exceed
122 the request:
123
124 ```bash
125 git add <approved-paths>
126 git diff --staged --stat
127 git commit -m "<subject>" -m "<body-or-footer>"
128 ```
129
130## Quality Bar
131
132- Subject is imperative and under 72 characters.
133- Body explains why when the diff alone is not enough.
134- Message does not overstate behavior.
135- Commit contains one logical change.
136- Verification commands are not placed in the commit message unless the repo
137 convention asks for them.
138
139## Gotchas
140
141- **`git add .` can stage unintended files.** If `.gitignore` does not exclude `node_modules`, `.env*`, or build artifacts, always prefer `git add <specific-paths>`. Verify with `git diff --staged --stat` before committing.
142- **Breaking-change footer is case-sensitive.** The token must be exactly `BREAKING CHANGE:` (with a space, all caps) for tools like `semantic-release` and `conventional-changelog` to detect it. `BREAKING-CHANGE:` is not equivalent.
143- **Amended commits rewrite history.** Never amend a commit that has already been pushed to a shared branch. If the commit exists on the remote, create a new fix commit instead.
144- **Co-authored-by trailers conflict with repo conventions.** Some repos (including this project) explicitly forbid `Co-Authored-By` trailers. Check the repo's agent instruction file (`AGENTS.md`, `CLAUDE.md`, or equivalent) or recent commit history for the project convention before adding them.
145
146## Examples
147
148- `feat(auth): add password reset flow`
149- `fix(api): handle null provider response`
150- `ci(actions): restrict pull request token permissions`
151- `refactor(utils): extract date formatting helper`
152- `docs: update GitHub project board workflow`
153
154## What Did I Get Done procedure
155
156Read [what-did-i-get-done procedure](references/what-did-i-get-done-procedure.md) when compiling an activity summary over a requested date range.
157Apply the authorized scope and mode of this entry point to every step.
158Resolve other skills through this distribution’s active catalog; resolve
159resources relative to the installed skill directory.