git-best-practices/SKILL.md
Enforces Git workflow best practices including trunk-based development, conventional commits, atomic commits, small pull requests, and Git hooks. Use when choosing a branching strategy, writing commit messages, structuring pull requests, configuring Git hooks and CI pipelines, managing feature flags, or setting up semantic versioning automation.
npx skillsauth add kayaman/skills git-best-practicesInstall 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.
Reference: Pro Git (Chacon & Straub), Continuous Delivery (Humble & Farley), Accelerate (Forsgren et al.)
All developers collaborate on a single branch (trunk/main). Two variants:
| Variant | Team Size | Branch Lifetime | Merge Method | |---------|-----------|----------------|--------------| | Direct to trunk | Small (≤5 developers) | No branches | Direct push | | Short-lived feature branches | Any size | 1–2 days maximum | PR + merge |
| Strategy | Best For | Avoid When | |----------|----------|------------| | Trunk-Based | SaaS, continuous deployment, high-cadence teams | N/A — suitable for most teams | | GitHub Flow | Simple — main + short-lived branches + PRs | Multiple supported release versions | | GitLab Flow | Teams needing environment branches (staging, production) | Teams doing continuous deployment | | GitFlow | Versioned software with multiple supported releases | Continuous delivery — Driessen himself (2020): "adopt a simpler workflow" |
Feature flags decouple deployment from release. MUST use them when incomplete features need to ship to production.
| Flag Type | Purpose | Lifetime | |-----------|---------|----------| | Release Toggle | Hide incomplete features in production | Days to weeks — remove after launch | | Ops Toggle | Runtime circuit breakers and operational controls | Permanent or long-lived | | Experiment Toggle | A/B testing and gradual rollout | Days to weeks — remove after decision | | Permission Toggle | Feature access by user segment (beta, premium) | Long-lived |
<type>(scope): description
[optional body]
[optional footer(s)]
Core types and their SemVer mapping:
| Type | SemVer | Purpose |
|------|--------|---------|
| feat | MINOR | New user-facing functionality |
| fix | PATCH | Bug fix |
| feat! or BREAKING CHANGE: footer | MAJOR | Breaking API change |
| docs | — | Documentation only |
| style | — | Formatting, whitespace (no logic change) |
| refactor | — | Code restructuring (no behavior change) |
| perf | PATCH | Performance improvement |
| test | — | Adding or correcting tests |
| build | — | Build system or dependency changes |
| ci | — | CI configuration changes |
| chore | — | Other maintenance (no production code) |
| revert | — | Reverts a previous commit |
| PR Size | Review Time | Defect Detection | Recommendation | |---------|-------------|-----------------|----------------| | < 200 lines | Fast (~30 min) | Highest (~40% more defects found) | Ideal | | 200–400 lines | Moderate | Good | Acceptable | | 400–1000 lines | Slow | Declining | Split if possible | | > 1000 lines | Very slow | Drops by ~70% | MUST split |
For features too large for a single small PR, use stacked PRs — a chain of small dependent PRs that build on each other.
| Hook | Stage | Purpose | Tooling |
|------|-------|---------|---------|
| pre-commit | Before commit is created | Lint, format, type-check staged files | lint-staged, prettier, eslint |
| commit-msg | After message is entered | Validate conventional commit format | commitlint |
| pre-push | Before push to remote | Run tests, check for secrets | jest, detect-secrets |
| prepare-commit-msg | Before editor opens | Pre-populate commit template | commitizen |
| Tool | Ecosystem | Key Feature | |------|-----------|-------------| | Husky | Node.js | Simple setup with package.json scripts | | pre-commit | Python (language-agnostic) | Large plugin ecosystem, runs hooks in isolation | | Lefthook | Go binary (no runtime dependency) | Parallel execution, fast, no Node required |
pre-commit:
1. lint-staged (format + lint only changed files)
2. type-check (TypeScript, mypy)
3. detect-secrets (prevent accidental credential commits)
commit-msg:
1. commitlint (validate Conventional Commits format)
pre-push:
1. test suite (unit tests, fast integration tests)
Conventional Commits enable fully automated semantic versioning:
| Tool | Approach | Best For | |------|----------|----------| | semantic-release | Fully automated: version, changelog, publish on merge | CI/CD pipelines with continuous release | | release-please (Google) | Creates and maintains release PRs; merge to release | Teams wanting human approval before release; monorepo support | | changesets | Developers describe changes; bot creates release PR | Monorepos with multiple packages | | commitizen | Interactive CLI for crafting conventional commits | Teams onboarding to conventional commits |
The Accelerate research (Forsgren, Humble, Kim) shows four key metrics that distinguish high-performing teams:
| Metric | Elite Performance | Connection to Git Practices | |--------|------------------|---------------------------| | Lead Time for Changes | < 1 hour | Small PRs, trunk-based development, CI/CD | | Deployment Frequency | Multiple per day | Feature flags, automated release | | Change Failure Rate | 0–15% | Atomic commits, comprehensive tests, small PRs | | Time to Restore Service | < 1 hour | Fast rollback via revert commits, feature flag kill switches |
When setting up or reviewing Git workflows, verify:
| Book | Author(s) | Publisher | Year | |------|-----------|-----------|------| | Pro Git (2nd ed.) | Scott Chacon, Ben Straub | Apress | 2014 | | Head First Git | Raju Gandhi | O'Reilly | 2022 | | Continuous Delivery | Jez Humble, David Farley | Addison-Wesley | 2010 | | The DevOps Handbook (2nd ed.) | Kim, Humble, Debois, Willis, Forsgren | IT Revolution | 2021 | | Accelerate | Forsgren, Humble, Kim | IT Revolution | 2018 | | Software Engineering at Google | Winters, Manshreck, Wright | O'Reilly | 2020 |
tools
Guidance for designing charts, graphs, plots, dashboards, and data visualizations that communicate clearly and persuade. Use when creating or reviewing a visualization, choosing a chart type, picking a color palette, decluttering a busy graphic, fixing misleading axes or proportions, building a dashboard, annotating a figure, or turning data into a presentation, report, or data-driven story. Grounded in the standard data-visualization literature (Knaflic, Tufte, Cleveland & McGill, Cairo, Wilke, Munzner, Few, Berinato). Covers chart selection, graphical perception and encoding, color and accessibility, decluttering, graphical integrity, dashboards, and narrative. Does NOT cover building data pipelines or ETL, statistical modeling or analysis methods, BI tool/vendor selection, or general UI/UX layout (see ux-design-principles). Tool-agnostic, with optional Python recipes.
development
Architect and implement production-grade microservices systems in TypeScript (NestJS) and Python (FastAPI), including resilience, observability, testing, deployment, and migration guidance.
development
--- name: databricks-genie-spaces-best-practices description: Design, configure, curate, govern, monitor, and integrate Databricks AI/BI Genie Spaces — the natural-language-to-SQL surface over Unity Catalog. Covers space scoping, general instructions, parameterized example SQL, SQL functions, trusted assets, JOIN configuration, knowledge store, certified queries, benchmarks, monitoring tab, feedback loops, the Genie Conversation API, governance via Unity Catalog (row filters, column masks, embed
tools
Implement OTP and passwordless authentication on AWS for TypeScript projects using Cognito CUSTOM_AUTH triggers (default) or a custom DynamoDB-backed flow, with SES (email) and SNS (SMS) delivery. Use when the user mentions OTP, one-time password, passwordless login, magic link, Cognito custom auth, DefineAuthChallenge, CreateAuthChallenge, VerifyAuthChallengeResponse, SES verification email, SNS SMS code, or MFA over email/SMS. Covers architecture decision (Cognito vs custom), Lambda trigger handlers, SES/SNS notifiers, DynamoDB schema with TTL, rate limiting, constant-time comparison, threat model (enumeration, replay, brute force), and aws-sdk-client-mock testing.