Ask Commit Assistance
This skill assists in the "pre-commit" phase: scanning for secrets, reviewing new code, and staging files.
Rule: The commit message body MUST wrap at 72 characters to conform with Git log standards.
Option 1 (detailed): subject + body explaining why/what + optional footer (e.g., Fixes #123)
Option 2 (short): just subject line
1---2name: ask-commit-assistance3description: Code review, staging, and Conventional Commit message generation. MUST NOT COMMIT.4---56# Ask Commit Assistance78This skill assists in the "pre-commit" phase: scanning for secrets, reviewing new code, and staging files.910<critical_constraints>11❌ **NEVER AUTO-COMMIT**: Execution of `git commit` is strictly forbidden for the agent. DO NOT execute it under any circumstance, even if requested.12❌ NO `git add .` → stage specific files only.13❌ NO committing secrets/debug code without explicit user confirmation.14✅ **BRANCH CHECK**: MUST verify the current branch. If on `release` (or a branch containing `release`), MUST stop and prompt user to confirm if they need to change branches.15✅ **DOC UPDATES**: You are authorized to automatically edit files in `wiki/` and `AGENTS.md` during the documentation audit phase. Do NOT modify any other source code.16✅ **ATOMIC COMMITS**: If changes span multiple unrelated domains, you MUST suggest splitting them into separate atomic commits.17✅ MUST scan for API keys, tokens, passwords before staging.18✅ MUST use Conventional Commits format for suggested messages.19✅ MUST offer detailed and short message options.20✅ **USER FINALIZATION**: Always provide the final `git commit` command for the user to execute manually.21</critical_constraints>2223<workflow>241. **Check Current Branch**: Run `git branch --show-current`. If the current branch is `release` (or contains `release`), **STOP immediately** and ask the user if they need to change branches before proceeding.252. **Review Unstaged Changes**: Run `git status`, `git diff`, and `git ls-files --others --exclude-standard` to inspect the full contents of all modified and untracked files before staging them. 263. **Documentation Audit & Update**: Analyze if the changes warrant updates to project guidelines (`AGENTS.md`) or persistent knowledge (`wiki/`). If updates are needed, automatically write those changes using your file editing tools.274. **Safety scan**: Scan code and new documentation for API keys, debug code (print/console.log/dd), and TODO/FIXME markers.285. **Code Review**: Check for bugs, naming conventions, and refactoring opportunities. Suggest atomic splits if the scope is too broad.296. **Stage**: Run `git add <file>` specifically for reviewed and approved files, including any documentation updates you made.307. **Ticket Linking**: Ask the user if this commit relates to an active Issue or Jira Ticket (e.g., `#123`).318. **Draft message**: Propose two Conventional Commits options (Detailed and Short). Ensure the body text wraps at 72 characters.329. **Handover**: Provide the final `git commit -m "..."` command to the user. **DO NOT run it yourself.**33</workflow>3435<safety_scan>36Check for:37- Secrets: API keys, tokens, passwords38- Debug: print(), console.log(), dd()39- Markers: TODO, FIXME, HACK40→ Warn user before staging if found. No automated cleanup unless requested.41</safety_scan>4243<commit_format>44Types: feat, fix, docs, style, refactor, test, chore45Format: `type(scope): description`4647Rule: The commit message body MUST wrap at 72 characters to conform with Git log standards.4849Option 1 (detailed): subject + body explaining why/what + optional footer (e.g., Fixes #123)50Option 2 (short): just subject line51</commit_format>5253<commands>54```bash55git branch --show-current56git status57git diff58git diff --cached59git ls-files --others --exclude-standard60git add <file>61# FOR USER ONLY:62# git commit -m "feat(scope): description"63```64</commands>