Commit
Usage
| Command |
What it does |
/commit |
Commit staged files; if none staged, infer related changes |
/commit <file> |
Scope to a specific file's changes |
/commit <folder>/ |
Scope to a folder's changes |
/commit <description> |
Infer scope from free-text intent |
/commit <scope> <description> |
Scope + explicit intent |
/commit amend |
Amend the last commit (re-use message) |
/commit amend <scope/description> |
Amend with additional scope or new message |
| (sequence mode) |
Deferred — sub-skills skip, caller commits once at the end |
Argument Parsing
Parse the raw argument string into scope, intent, and flags:
- Amend flag: If the first word is
amend, set amend mode and strip it. The remainder is parsed normally.
- Scope (file or folder): Any token that matches a real path in the repo (file or directory) — whether provided via
@-reference or plain text. Multiple scopes are allowed.
- Intent (free-text description): Whatever remains after extracting scopes. Used to guide the commit message.
- Nothing: No arguments at all — default mode.
Examples:
| Input |
Scope |
Intent |
Amend |
| (empty) |
— |
— |
no |
Meetings/Engineering/ |
Meetings/Engineering/ |
— |
no |
.gitignore |
.gitignore |
— |
no |
my awesome refactor |
— |
my awesome refactor |
no |
Meetings/ wrap up notes |
Meetings/ |
wrap up notes |
no |
amend |
— |
— |
yes |
amend .obsidian/ |
.obsidian/ |
— |
yes |
amend fixed typo |
— |
fixed typo |
yes |
Workflow
1. Gather state
Run in parallel:
git diff --staged --stat — staged changes
git diff --stat — unstaged changes
git status --short — untracked files
git log --oneline -5 — recent commits (for style and amend safety)
2. Determine file set
Resolve which files will be committed, based on parsed arguments:
| Scenario |
File set |
| Scope provided |
Only changed/untracked files under the given path(s). Ignore everything else. |
| Intent provided, no scope |
Analyze all changed files; select only those whose diffs relate to the described intent. Present the selection for confirmation. |
| No args + staged files exist |
Use exactly what's staged. Do NOT add unstaged files — the user intentionally staged those. |
| No args + nothing staged |
Analyze all changed/untracked files. Group related changes and propose a sensible set. Ask for confirmation. |
If nothing matches (no changes in scope, or no related files for intent), tell the user and stop.
3. Stage files
- If the file set is already fully staged, skip.
- If unrelated files are staged, unstage them first (
git restore --staged <path>).
- Stage the resolved file set with explicit paths — never broad patterns.
4. Craft the commit message
Analyze the staged diff (git diff --staged) and write:
- Title: ≤72 chars, conventional format —
type: summary.
- Common types:
add (new files), update (modify existing), fix (corrections), chore (config/tooling), feat (new capability), refactor, docs, rename.
- Body (optional): 1–3 lines explaining "why" if not obvious. Omit for trivial changes.
- If the user provided intent, use it to guide the message but still ground it in the actual diff.
5. Present and confirm
Show:
- The list of files that will be committed (or amended).
- The proposed commit message.
Wait for user confirmation before proceeding.
6. Commit
- Normal mode:
git commit with the confirmed message.
- Amend mode:
git commit --amend (see safety rules below). If the user provided new intent, replace the message; otherwise keep the existing message (--no-edit).
Do not push.
Amend Safety
Before amending, verify ALL of these conditions:
- HEAD was created by you in this conversation — check
git log -1.
- HEAD has not been pushed —
git status should show "Your branch is ahead" or the commit should not exist on the remote.
- The user explicitly said
amend.
If any condition fails, refuse and explain why. Suggest creating a new commit instead.
Sequence Mode
When called as part of a sequenced workflow (e.g. /meeting wrap), the caller owns the commit. Individual sub-skills skip their commit step.
How to detect: the calling workflow explicitly states it is running sub-skills in sequence. Do not offer to commit — just proceed. The sequence owner commits once at the end with a combined message.
Sub-skill commit format
When committing on behalf of a sequence:
- Message:
update: /{workflow-name} {argument} (e.g. update: /meeting wrap Meetings/Engineering/Some Meeting.md).
- Stage only files modified by the current skill invocation (or full sequence). Use explicit paths.
- Present and confirm before committing.
Important Notes
- This workspace may not be a git repo. If
git status fails, skip entirely without error.
- Always use explicit file paths for staging — never broad patterns.
- If no files were actually modified, skip the commit offer.
- Never commit files that likely contain secrets (
.env, credentials, tokens).
- When the scope is a folder, include all changed files recursively under it.
1---2name: commit3description: Stage and commit with flexible intent parsing. Accepts file/folder scope, free-text description, amend, or any combination.4license: MIT5---67# Commit89## Usage1011| Command | What it does |12| --- | --- |13| `/commit` | Commit staged files; if none staged, infer related changes |14| `/commit <file>` | Scope to a specific file's changes |15| `/commit <folder>/` | Scope to a folder's changes |16| `/commit <description>` | Infer scope from free-text intent |17| `/commit <scope> <description>` | Scope + explicit intent |18| `/commit amend` | Amend the last commit (re-use message) |19| `/commit amend <scope/description>` | Amend with additional scope or new message |20| *(sequence mode)* | Deferred — sub-skills skip, caller commits once at the end |2122## Argument Parsing2324Parse the raw argument string into **scope**, **intent**, and **flags**:25261. **Amend flag**: If the first word is `amend`, set amend mode and strip it. The remainder is parsed normally.272. **Scope** (file or folder): Any token that matches a real path in the repo (file or directory) — whether provided via `@`-reference or plain text. Multiple scopes are allowed.283. **Intent** (free-text description): Whatever remains after extracting scopes. Used to guide the commit message.294. **Nothing**: No arguments at all — default mode.3031Examples:3233| Input | Scope | Intent | Amend |34| --- | --- | --- | --- |35| *(empty)* | — | — | no |36| `Meetings/Engineering/` | `Meetings/Engineering/` | — | no |37| `.gitignore` | `.gitignore` | — | no |38| `my awesome refactor` | — | `my awesome refactor` | no |39| `Meetings/ wrap up notes` | `Meetings/` | `wrap up notes` | no |40| `amend` | — | — | yes |41| `amend .obsidian/` | `.obsidian/` | — | yes |42| `amend fixed typo` | — | `fixed typo` | yes |4344## Workflow4546### 1. Gather state4748Run in parallel:4950- `git diff --staged --stat` — staged changes51- `git diff --stat` — unstaged changes52- `git status --short` — untracked files53- `git log --oneline -5` — recent commits (for style and amend safety)5455### 2. Determine file set5657Resolve which files will be committed, based on parsed arguments:5859| Scenario | File set |60| --- | --- |61| **Scope provided** | Only changed/untracked files under the given path(s). Ignore everything else. |62| **Intent provided, no scope** | Analyze all changed files; select only those whose diffs relate to the described intent. Present the selection for confirmation. |63| **No args + staged files exist** | Use exactly what's staged. Do NOT add unstaged files — the user intentionally staged those. |64| **No args + nothing staged** | Analyze all changed/untracked files. Group related changes and propose a sensible set. Ask for confirmation. |6566If nothing matches (no changes in scope, or no related files for intent), tell the user and stop.6768### 3. Stage files6970- If the file set is already fully staged, skip.71- If unrelated files are staged, unstage them first (`git restore --staged <path>`).72- Stage the resolved file set with explicit paths — never broad patterns.7374### 4. Craft the commit message7576Analyze the staged diff (`git diff --staged`) and write:7778- **Title**: ≤72 chars, conventional format — `type: summary`.79 - Common types: `add` (new files), `update` (modify existing), `fix` (corrections), `chore` (config/tooling), `feat` (new capability), `refactor`, `docs`, `rename`.80- **Body** (optional): 1–3 lines explaining "why" if not obvious. Omit for trivial changes.81- If the user provided **intent**, use it to guide the message but still ground it in the actual diff.8283### 5. Present and confirm8485Show:86- The list of files that will be committed (or amended).87- The proposed commit message.8889Wait for user confirmation before proceeding.9091### 6. Commit9293- **Normal mode**: `git commit` with the confirmed message.94- **Amend mode**: `git commit --amend` (see safety rules below). If the user provided new intent, replace the message; otherwise keep the existing message (`--no-edit`).9596Do **not** push.9798## Amend Safety99100Before amending, verify ALL of these conditions:1011021. **HEAD was created by you** in this conversation — check `git log -1`.1032. **HEAD has not been pushed** — `git status` should show "Your branch is ahead" or the commit should not exist on the remote.1043. The user explicitly said `amend`.105106If any condition fails, **refuse** and explain why. Suggest creating a new commit instead.107108## Sequence Mode109110When called as part of a **sequenced workflow** (e.g. `/meeting wrap`), the caller owns the commit. Individual sub-skills **skip** their commit step.111112How to detect: the calling workflow explicitly states it is running sub-skills in sequence. Do not offer to commit — just proceed. The sequence owner commits once at the end with a combined message.113114### Sub-skill commit format115116When committing on behalf of a sequence:117118- **Message**: `update: /{workflow-name} {argument}` (e.g. `update: /meeting wrap Meetings/Engineering/Some Meeting.md`).119- **Stage only** files modified by the current skill invocation (or full sequence). Use explicit paths.120- Present and confirm before committing.121122## Important Notes123124- This workspace may not be a git repo. If `git status` fails, skip entirely without error.125- Always use explicit file paths for staging — never broad patterns.126- If no files were actually modified, skip the commit offer.127- Never commit files that likely contain secrets (`.env`, credentials, tokens).128- When the scope is a folder, include all changed files recursively under it.