.cursor/skills/git-helper/SKILL.md
--- name: git-helper description: Git operations helper: Conventional Commits message generation from staged changes, branch naming and creation, merge vs rebase guidance, stash, cherry-pick, bisect, tags, and conflict resolution. Use when generating commit messages, committing changes, creating branches, resolving conflicts, undoing commits, or investigating history. Do NOT use for code implementation. --- # Git Helper Skill ## Capabilities ### 1. Generate Commit Messages Analyze staged chan
npx skillsauth add softmg/product-tracker .cursor/skills/git-helperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze staged changes and generate Conventional Commits message.
# Check staged changes
git diff --cached --stat
git diff --cached
Conventional Commits format:
<type>(<scope>): <subject>
<optional body>
Types:
feat - New featurefix - Bug fixrefactor - Code restructuring without behavior changedocs - Documentation onlytest - Tests onlychore - Tooling, configs, dependenciesperf - Performance improvementsExamples:
feat(auth): add JWT token refresh
fix(api): handle null response in user endpoint
refactor(db): extract query builders to separate file
docs(readme): update installation steps
Create feature branch:
git checkout main
git pull origin main
git checkout -b feature/description
Clean up merged branches:
git branch --merged | grep -v "main\|master" | xargs git branch -d
Update branch with main:
git fetch origin
git rebase origin/main
# OR
git merge origin/main
When conflicts occur:
git statusgit add <file>git rebase --continue or git commitUndo last commit (keep changes):
git reset --soft HEAD~1
Undo staged files:
git restore --staged <file>
Discard local changes:
git restore <file>
Undo pushed commit (creates new commit):
git revert <commit-hash>
Find when bug was introduced:
git bisect start
git bisect bad # current commit is bad
git bisect good <hash> # known good commit
# Git will checkout middle commit
# Test and mark: git bisect good/bad
# Repeat until found
Find who changed a line:
git blame <file>
Search commit messages:
git log --grep="keyword"
Search code changes:
git log -p -S "function_name"
Save work temporarily:
git stash push -m "description"
git stash list
git stash show stash@{0}
Restore stashed work:
git stash pop # apply and remove
git stash apply # apply and keep
git stash drop # discard
Create and push tags:
git tag -a v1.0.0 -m "Release 1.0.0"
git push origin v1.0.0
git push origin --tags # push all tags
List and delete tags:
git tag -l
git tag -d v1.0.0 # local
git push origin :refs/tags/v1.0.0 # remote
Apply specific commit to current branch:
git cherry-pick <commit-hash>
git cherry-pick <hash1> <hash2> # multiple commits
When asked to generate commit message:
git diff --cached --stat to see changed filesgit diff --cached to see actual changesfeatfixrefactortestdocschoregit push -u origin HEAD
gh pr create --title "feat: description" --body "..."
# OR provide GitHub link
git rebase -i HEAD~<number>
# In editor: change 'pick' to 'squash' for commits to combine
Warning: Don't use interactive rebase on shared/public branches.
# Save the commit
git log -1 # note the hash
# Go to correct branch
git checkout correct-branch
git cherry-pick <hash>
# Remove from wrong branch
git checkout wrong-branch
git reset --hard HEAD~1
Use rebase for:
Use merge for:
main/mastergit status before any operationNote: Project may have git hooks in .cursor/hooks/ for auto-linting/validation.
documentation
Task tracking and plan management. Used by planner to create plans and persist tasks, by orchestrator to read tasks and update progress, by documenter to create completion reports, and by any agent to log non-critical issues.
development
Create, edit, evaluate, and package agent skills. Use when building a new skill from scratch, improving an existing skill, running evals to test a skill, benchmarking skill performance, optimizing a skill's description for better triggering, reviewing third-party skills for quality, or packaging skills for distribution. Not for using skills or general coding tasks.
development
Simple implementation workflow - code, test, document. Use when user invokes /implement, wants to create code with automatic testing and documentation, or for simple single-purpose tasks that don't need planning.
development
Security best practices covering authentication, input validation, API security, secrets management, data protection, and OWASP Top 10. Use when implementing auth flows, API endpoints, file uploads, or any feature touching passwords, tokens, PII, or sensitive data. Do NOT use for code style reviews or architecture decisions.