name: commit description: Prepare and commit code changes with full verification, pre-commit checks, and tests. Runs verification skill, fixes issues using TDD, executes all test suites, and creates atomic commits. Use when ready to commit changes, before committing, or when asked to prepare a commit.
Commit Workflow
Prepare, verify, and commit code changes following project standards.
Workflow Overview
Verify → Fix Issues (TDD) → Pre-commit Checks → Commit → Tests → [Push]
Quick Start Checklist
Copy and track progress:
Commit Progress:
- [ ] Step 1: Run verification skill
- [ ] Step 2: Fix issues using TDD
- [ ] Step 3: Run pre-commit checks
- [ ] Step 4: Create atomic commit
- [ ] Step 5: Run ALL test suites (3 REQUIRED):
- [ ] make test
- [ ] INTEG_TESTS=1 make test
- [ ] SMOKE_TESTS=1 make test
- [ ] Step 6: Push (optional, ask first)
CRITICAL: Step 5 has THREE mandatory test suites. Skipping any is FORBIDDEN.
Step 1: Run Verification Skill
Execute the verification skill to analyze code changes:
Verification Progress:
- [ ] Load project rules and standards
- [ ] Trace code paths for modified files
- [ ] Check for semantic changes
- [ ] Identify code smells
- [ ] Run security scans
- [ ] Review PR feedback (if PR exists)
Read and follow: .cursor/skills/verification/SKILL.md
Output: List of issues found, categorized by severity.
Step 2: Fix Issues Using TDD
For each issue identified by verification:
TDD Gate (MANDATORY)
Before ANY fix:
- Write failing test first
- Confirm test fails without fix
- Implement minimal fix
- Confirm test passes
Never skip TDD. Use implementation skill for complex fixes.
Issue Priority
- Security vulnerabilities - Fix immediately (except test data)
- Breaking changes - Confirm intentional, add tests
- Code smells - Fix immediately
- PR feedback - Address blockers first
Step 3: Pre-commit Checks
Run:
make format
make test
INTEG_TESTS=1 make test
SMOKE_TESTS=1 make test
Security Scans
Get absolute path first:
pwd
Then run:
snyk_sca_scanwith absolute project pathsnyk_code_scanwith absolute project path
Fix any security issues (skip test data false positives).
Step 4: Create Atomic Commit
Pre-commit Verification
- [ ] Linting clean (make format shows no changes)
- [ ] Security scans clean
- [ ] No implementation plan files staged
- [ ] Documentation updated (if needed)
Commit Format
type(scope): description [XXX-XXXX]
Body explaining what and why.
Types: feat, fix, refactor, test, docs, chore, perf
Extract issue ID from branch:
git branch --show-current
Staged Files Check
# Review what will be committed
git status
git diff --staged
Never commit:
- Implementation plan files (
*_implementation_plan/) - Secrets or credentials
- Generated diagram source (commit PNGs only if needed)
Execute Commit
git add <files>
git commit -m "$(cat <<'EOF'
type(scope): description [XXX-XXXX]
Body explaining what and why.
EOF
)"
NEVER use --no-verify. NEVER amend commits.
Step 5: Run All Test Suites (After Commit, Before Push)
CRITICAL: ALL three test suites MUST be executed after commit but before push. Skipping ANY test suite is FORBIDDEN.
Execution Order
Run these commands IN ORDER and wait for each to complete:
make test
INTEG_TESTS=1 make test
SMOKE_TESTS=1 make test
Test Gate Enforcement
Before proceeding to Step 6, verify:
- Did
SMOKE_TESTS=1 make testcomplete with all tests passing? - Did
INTEG_TESTS=1 make testcomplete with all tests passing? - Did
make testcomplete with all tests passing?
If ANY answer is "no" or "I didn't run it", STOP and run the missing tests.
Test Failure Protocol
CRITICAL: If tests fail, do not check if they are related to our changes. Identify the root cause and fix it.
If tests fail:
- Do not proceed to push
- Identify root cause
- Apply TDD fix (test first, then implementation)
- Create new commit with fix
- Re-run ALL test suites (not just the one that failed)
- Continue only when ALL three test suites pass
Step 6: Push (Optional)
Mandatory Test Checklist
You MUST run each test suite and check it off. Do NOT proceed to push until ALL boxes are checked:
Test Suite Checklist (ALL REQUIRED):
- [ ] SMOKE_TESTS=1 make test → Smoke tests PASSED
Always ask before pushing.
If approved:
git push --set-upstream origin $(git branch --show-current)
After Push
Offer to:
- Create draft PR (if none exists)
- Update PR description (if PR exists)
- Check snyk-pr-review-bot comments
- Run
sleepfor 60s - Read and run verification skill
Command Reference
| Task | Command |
|---|---|
| Format & lint | make format |
| Unit tests | make test |
| Integration tests | INTEG_TESTS=1 make test |
| Smoke tests | SMOKE_TESTS=1 make test |
| Generate code | make generate |
| SCA scan | snyk_sca_scan with absolute path |
| Code scan | snyk_code_scan with absolute path |
| Current branch | git branch --show-current |
| Push | git push --set-upstream origin $(git branch ...) |
Red Flags (STOP)
- Tests failing
- Any test suite skipped
- Security vulnerabilities unfixed
- Implementation plan files staged
- Unresolved PR blockers
- TDD not followed for fixes
- --no-verify being considered