From skills-by-amrit
Use when performing any git operations — branching, committing, merging, rebasing, resolving conflicts. Ensures clean history, atomic commits, and proper branch management.
npx claudepluginhub boparaiamrit/skills-by-amritThis skill uses the workspace's default tool permissions.
Git is the record of your project's evolution. Every commit should be atomic, meaningful, and reversible.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Generates or updates index.md listing all files and subdirectories in a target folder with 3-10 word descriptions from file contents. Use for indexing documentation directories.
Git is the record of your project's evolution. Every commit should be atomic, meaningful, and reversible.
Core principle: Clean history enables clean debugging. Every commit tells a story.
NO COMMIT WITHOUT PASSING TESTS. NO MERGE WITHOUT REVIEW.
brainstorming)writing-plans)YOU CANNOT:
- Commit directly to main — always use feature branches
- Use git add . without reviewing staged files — stage interactively (git add -p)
- Force push to shared branches — only force push YOUR branches
- Commit with "WIP", "fix", or "update" messages — describe WHAT and WHY
- Commit debug code, console.logs, or TODO comments — clean up first
- Squash without reading the individual commits — understand what you're merging
- Skip tests before committing — failing tests = broken commit
- Resolve conflicts by picking one side without understanding both — merge INTENT
| Rationalization | Reality |
|---|---|
| "I'll clean up the history later" | You won't. Write clean commits now. |
| "It's just a small commit to main" | Small direct commits cause most merge conflicts and regressions. |
| "WIP commit, I'll squash later" | WIP commits become permanent. Write a real message. |
| "Force push is fine, nobody else uses this branch" | Until someone does. Only force push branches YOU own. |
| "I'll review what I staged before pushing" | Review before staging. After is too late — you'll miss things. |
| "The tests passed earlier" | Earlier ≠ now. Run them before every commit. |
1. Does this commit compile and pass tests on its own?
2. If I revert this single commit, does the codebase still work?
3. Does the commit message explain WHY, not just WHAT?
4. Is this exactly ONE logical change? (not two changes in one commit)
5. Have I staged only the files related to this change?
6. Is there any debug code, commented-out code, or TODOs in the staged changes?
7. Would a reviewer understand this commit without additional context?
8. Am I committing to the correct branch?
| Branch | Pattern | Purpose | Lifetime |
|---|---|---|---|
main | main | Production code | Permanent |
| Feature | feat/<description> | New functionality | Until merged |
| Fix | fix/<description> | Bug fixes | Until merged |
| Refactor | refactor/<description> | Code improvements | Until merged |
| Experiment | experiment/<description> | Throw-away exploration | Until discarded |
1. CREATE branch from latest main
git checkout main && git pull
git checkout -b feat/description
2. WORK in small, committed increments
[write test → implement → verify → commit]
3. KEEP branch up to date (rebase on main regularly)
git fetch origin
git rebase origin/main
4. REVIEW before merge (code-review skill)
5. MERGE via PR (squash for feature branches, merge for long-lived)
6. DELETE branch after merge
git checkout main && git pull
git branch -d feat/description
<type>(<scope>): <description>
[optional body — explains WHY, not WHAT]
[optional footer — references issues, breaking changes]
| Type | When |
|---|---|
feat | New feature |
fix | Bug fix |
refactor | Code change that neither fixes a bug nor adds a feature |
test | Adding or correcting tests |
docs | Documentation only |
style | Formatting, semicolons, etc. (no code change) |
chore | Build process, dependencies, tooling |
perf | Performance improvement |
ci | CI/CD changes |
| ✅ Good Commit | ❌ Bad Commit |
|---|---|
feat(auth): add email validation with regex pattern | update stuff |
fix(api): prevent null reference in user lookup | fix bug |
test(cart): add edge cases for empty cart checkout | add tests |
refactor(db): extract query builder to shared util | refactor |
fix(payment): handle timeout when gateway returns 504 | wip |
Each commit should:
1. UNDERSTAND both sides of the conflict — read the diff carefully
2. IDENTIFY the intent of each change — what was each trying to accomplish?
3. MERGE intent, not text — the correct resolution may be different from both sides
4. VERIFY the merged result compiles and tests pass
5. IF unsure → ask the human partner (never guess on conflict resolution)
# Save current work with descriptive message
git stash push -m "description of work in progress"
# Switch to urgent fix
git checkout -b fix/urgent-issue
# ... fix, test, and commit ...
# Return to original work
git checkout original-branch
git stash pop
# Start new work
git checkout main && git pull
git checkout -b feat/description
# Save progress (interactive staging)
git add -p # Stage interactively
git diff --staged # Review staged changes
git commit -m "feat: description"
# Stay current
git fetch origin
git rebase origin/main
# Ready to merge
git push -u origin feat/description
# Create PR, get review, merge
# After merge
git checkout main && git pull
git branch -d feat/description
git add . without reviewing what's stagedbrainstorming or executing-plansexecuting-plans taskcode-review approvalrefactoring-safelyverification-before-completion