plugins/smedjen/skills/git-advanced-workflows/SKILL.md
Advanced git workflows: branching strategies, interactive rebase, bisect, cherry-pick, stashing, worktrees, and conflict resolution patterns.
npx skillsauth add hjemmesidekongen/ai git-advanced-workflowsInstall 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.
git bisect start HEAD v2.1.0 && git bisect run npm test — fully automated regression finder. The test command must exit 0 (good) or 1 (bad). Exit 125 means "skip this commit" (useful for broken builds unrelated to the bug).
For frontend regressions: git bisect run bash -c "npm run build && node check-bundle-size.js". Any scriptable assertion works.
Write bisect test scripts as standalone files (scripts/bisect-check.sh) so they survive checkout across commits.
Sparse checkout: git sparse-checkout set packages/my-app packages/shared — clone the full repo but only materialize relevant paths. Cuts working tree by 90% in large monorepos.
Path-scoped hooks: lint-staged config per package — lint-staged supports package-level configs. In the root .lintstagedrc, use "packages/app-a/**/*.ts": "eslint" patterns to scope checks.
CODEOWNERS by path: packages/payments/ @payments-team — enforces review boundaries. Combine with branch protection rules for path-based approval requirements.
Selective CI: trigger pipelines only for changed paths. GitHub Actions: paths: filter. GitLab: rules: changes:. Skip full-repo CI on every commit.
lint-staged + husky: npx husky init, add npx lint-staged to .husky/pre-commit. Runs linters only on staged files. Commit message validation: commitlint in .husky/commit-msg with @commitlint/config-conventional. Type checking: tsc --noEmit is slow — use tsc-files --noEmit to check only staged .ts files.
Git LFS: binary assets (images, fonts, models) under ~1GB total. git lfs track "*.psd" adds to .gitattributes. Externalize: assets >100MB or frequently changing media belong in S3/CDN — LFS bandwidth costs add up. BFG Repo Cleaner: already committed large files? bfg --strip-blobs-bigger-than 10M rewrites history. Coordinate before force-pushing.
| Command | Risk | Safe alternative |
|---------|------|-----------------|
| git push --force | Overwrites remote history | --force-with-lease (fails if remote changed) |
| git reset --hard | Destroys uncommitted work | git stash first, or git reset --keep |
| git clean -fd | Deletes untracked files permanently | git clean -fdn (dry run) first |
| git checkout -- . | Discards all unstaged changes | git stash to preserve, restore if needed |
| git branch -D | Deletes branch without merge check | -d (lowercase) fails if unmerged |
Before any destructive command: git stash && git log --oneline -5 to verify state.
See references/process.md for interactive rebase, cherry-pick, worktrees, stash, and conflict resolution.
development
Creates a brand from scratch through market research and interactive sparring. Runs competitive research via Perplexity, then guides the user through positioning, audience, voice, values, and content pillars. Produces the full brand guideline set at .ai/brand/{name}/. Use when building a new brand, defining brand strategy for a product, or when /våbenskjold:create is invoked.
testing
Loads brand guidelines from .ai/brand/{name}/ and makes them available to the current context. Progressive disclosure: L1 confirms brand exists, L2 loads summary, L3 loads specific files on demand. Use when a downstream skill or user needs brand context, or when /våbenskjold:apply is invoked.
documentation
Guided reinvention of an existing brand guideline. Loads current brand from .ai/brand/{name}/, identifies what to keep vs change, and walks the user through targeted evolution. Preserves brand equity while updating positioning, voice, or values. Use when refreshing a brand or when /våbenskjold:evolve is invoked.
development
Codifies an existing brand from materials, samples, and references. Analyzes provided content to extract voice patterns, values, and positioning. Produces the same guideline format as brand-strategy. Use when a brand already exists but isn't documented, or when /våbenskjold:audit is invoked.