skills/git-workflow-and-versioning/SKILL.md
Use when making any code change. Use when committing, branching, resolving conflicts, setting up worktrees for parallel agent work, or when you need to organise work across multiple parallel streams.
npx skillsauth add paulund/skills git-workflow-and-versioningInstall 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.
Keep main always deployable. Work in short-lived feature branches that merge back within 1–3 days. Long-lived branches are hidden costs — they diverge, create conflicts, and delay integration. Prefer feature flags over long-lived branches for incomplete features.
feat: add email validation to registration endpoint
Prevents invalid email formats from reaching the database.
Uses Zod schema validation at the route handler level,
consistent with existing patterns in auth.ts.
Types: feat, fix, refactor, test, docs, chorefeature/<short-description> → feature/task-creation
fix/<short-description> → fix/duplicate-tasks
chore/<short-description> → chore/update-deps
refactor/<short-description> → refactor/auth-module
Before every commit:
git diff --staged # Review what you're about to commit
git diff --staged | grep -i "password\|secret\|api_key\|token" # No secrets
npm test && npm run lint # Tests and lint pass
Create isolated worktrees so multiple agents can work on different branches simultaneously without interfering:
git worktree add ../project-feature-a feature/task-creation
git worktree add ../project-feature-b feature/user-settings
# When done, merge/push then clean up:
git worktree remove ../project-feature-a
Each worktree has its own working directory and branch. If an experiment fails, delete the worktree — nothing is lost.
After each successful increment, commit immediately. If the next change breaks something, git reset --hard HEAD restores the last known-good state instantly. Never accumulate large uncommitted changes.
After any modification, provide a structured summary:
CHANGES MADE:
- src/routes/tasks.ts: Added validation middleware to POST endpoint
- src/lib/validation.ts: Added TaskCreateSchema using Zod
THINGS I DIDN'T TOUCH (intentionally):
- src/routes/auth.ts: Has a similar validation gap — out of scope for this task
POTENTIAL CONCERNS:
- Zod schema is strict and rejects extra fields. Confirm this is desired.
| Rationalization | Reality | |---|---| | "I'll commit when the feature is done" | One giant commit is impossible to review, debug, or revert. Commit each slice. | | "The message doesn't matter" | Messages are documentation. Future agents will need to understand what changed and why. | | "I'll split this change later" | Large changes are harder to review and riskier to deploy. Split before submitting, not after. | | "Branches add overhead" | Short-lived branches are free. Long-lived branches are the problem — merge within 1–3 days. |
.gitignore in the projectmainFor every commit:
.gitignore covers standard exclusions (node_modules/, .env, build artifacts)feat:, fix:, refactor:, etc.)..env, node_modules/, or build output.development
Use when implementing any logic, fixing any bug, or changing any behaviour. Use when you need to prove code works, when a bug report arrives, or when modifying existing functionality. Do NOT use for config changes, data migrations, or dependency updates.
development
Use when starting a new feature, when requirements are unclear, when asked to write code without a clear spec, or before any non-trivial implementation. Do NOT use for trivial bug fixes or one-line changes.
development
Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters. Detects the stack from dependency files, fetches official documentation, implements following documented patterns, and cites sources for every framework-specific decision.
development
Use when preparing to ship a feature, release, or deployment. Use before merging to main, creating a release, or deploying to production. Do NOT use for CI-only changes or internal refactors that don't reach production.