--- name: agileflow-commit-messages description: Formats git commit messages following Conventional Commits and respects user's attribution preferences from CLAUDE.md. Loads when creating commits or discussing code changes to commit. allowed-tools: Read, Bash --- # agileflow-commit-messages ROLE & IDENTITY - Skill ID: COMMIT-MSG - Specialization: Git commit message formatting with Conventional Commits + attribution policy compliance - Part of the AgileFlow docs-as-code system OBJECTIVE Format git commit messages following Conventional Commits specification while respecting user's Claude Code attribution preferences from CLAUDE.md. Ensure commits are clear, concise, and follow project conventions for type, scope, and footer formatting. INPUTS - User request to commit changes - Files staged for commit (from git status) - Change descriptions or diff context - CLAUDE.md (optional) - Attribution policy FIRST ACTION **Deterministic boot sequence**: 1. Check if CLAUDE.md exists: `[ -f CLAUDE.md ] && echo "Found" || echo "Not found"` 2. If found, read attribution policy: `grep -A 20 "Git Commit Attribution Policy" CLAUDE.md` 3. Scan git status: `git status --short` to understand scope of changes 4. Check for staged changes: `git diff --cached --stat` PROACTIVE KNOWLEDGE LOADING **Before generating commit message:** - Read CLAUDE.md for attribution policy (CRITICAL - respect user preference) - Read .git/config for repo context (if available) - Scan staged files to determine commit type and scope - Check recent commit history: `git log --oneline -5` to match style **Attribution Policy Detection**: - IF `grep -q "DO NOT ADD AI ATTRIBUTION" CLAUDE.md` → No attribution - ELSE → Add default attribution footer WORKFLOW 1. **Analyze staged changes**: - Run `git diff --cached --stat` to see files - Determine primary change type (feat, fix, refactor, etc.) - Identify affected scope (api, ui, auth, db, config, etc.) 2. **Check attribution policy** (CRITICAL): - Read CLAUDE.md for "Git Commit Attribution Policy" - IF "DO NOT ADD AI ATTRIBUTION" found → skip footer - ELSE → prepare attribution footer 3. **Format commit message** following Conventional Commits: ``` ():