| name | commit |
| description | Create a git commit following project conventions. Enforces PREFIX-#.# prefix, imperative mood, no Co-Authored-By. TRIGGER when the user says "commit this", "commit the changes", "let's commit", "make a commit", "save this progress", "check in the code", "snapshot this", "git commit", or any request to create a git commit. |
Project Commit
Create a commit following project conventions.
Current State
- Branch: !
git branch --show-current
- Staged changes: !
git diff --cached --stat
- Unstaged changes: !
git diff --stat
- Untracked files: !
git status --short
Commit Rules
- Detect identifier from current branch name using
.claude/skills/_shared/milestone-format.sh:
- Legacy M-format:
feature/M9.16-description → M9.16 (format: M)
- New OpenSpec change-id:
feature/architecture-compliance-sweep → architecture-compliance-sweep (format: kebab)
- The shared utility normalizes both; commit prefix uses whichever format the branch uses.
- Stage specific files — never use
git add . or git add -A (risk of committing secrets or large binaries)
- Format commit message:
- First line:
<identifier>: Brief description (imperative mood, e.g., "Add", "Fix", "Update")
- Blank line
- Bullet points of specific changes
- NO Co-Authored-By line — this is a project convention
- Use HEREDOC for multi-line messages
Message Format
Legacy M-format branch:
M9.16: Brief imperative description
- Detail 1
- Detail 2
New OpenSpec change-id branch:
architecture-compliance-sweep: Brief imperative description
- Detail 1
- Detail 2
Process
Step 0: Doc Freshness Check
Before staging, verify core docs are current. For each issue found, fix it before proceeding:
- current-story.md: Verify active milestone matches branch. If stale, update milestone status and progress.
- next-prompt.md: Verify hub has pointer for current milestone. Scaffold if missing.
- next-prompt-PREFIX-#.md: Verify file exists for branch's milestone. Scaffold if missing.
- development-journal.md: Check today's date in first 20 lines. If stale, run
/dev-journal via Agent (background).
- insights-log.md: Verify file exists. Create if missing.
- requirements.md: Verify current milestone has a section.
Prompt the user about insights: "Any technical insights worth logging from this session?" (optional, not blocking).
Include doc updates in the same commit as code changes — stage them alongside the code.
Step 1: Review and Stage
- Review all changes (staged + unstaged + untracked)
- Identify which files should be committed (ask user if unclear)
- Stage the appropriate files by name (including any doc updates from Step 0)
- Draft the commit message and show it to the user
- Commit using HEREDOC format
- Do NOT push unless explicitly asked
Commit Message Quality
Good:
M10.3: Add photo import OCR service
M8.4: Fix confidence routing threshold
M7.5: Refactor service ownership pattern
Bad:
Fixed stuff (no milestone prefix)
M10.3: Updated files (vague)
WIP (not descriptive)
Post-Commit
After committing, automatically run these via Agents (background) for efficiency:
- Journal: Read the top of
docs/development-journal.md — if the latest entry doesn't reference today's date or the current milestone, invoke /dev-journal via an Agent to update it
- Insights: Ask the user if there are any unlogged technical insights from this session. If yes, invoke
/log-insight via an Agent
- Status line: Check whether the branch-keyed status file still reflects the current focus. If this commit represents a transition (phase complete, sub-task done, moving from build to review), refresh it:
bash .claude/skills/_shared/status-line.sh write "[<identifier>] <new focus>"
Typical post-commit transitions: phase 1 — scaffolding → phase 2 — wiring, or implementation → review / testing, or after the final commit ready for PR.