git-workflow-and-versioning

Structures git commits, branching, and worktree workflows for disciplined version control.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill git-workflow-and-versioning-duccuong159
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow-and-versioning
Source: https://github.com/DucCuong159/Realtime-chatapp/tree/main/.agent/skills/git-workflow-and-versioning
Command: npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill git-workflow-and-versioning-duccuong159

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents and developers generating code at high speed often produce giant unreviewable commits, vague messages, and diverging long-lived branches, making changes hard to review, debug, or revert. ## Core Features & Use Cases - Atomic Commit Discipline: Enforces small, single-purpose commits with conventional message types (feat, fix, refactor, test, docs, chore) that explain the why behind each change. - Trunk-Based Branching Strategy: Keeps main deployable with short-lived feature branches merged within 1-3 days, plus naming conventions and worktree setups for parallel agent work. - Pre-Commit Hygiene & Debugging: Provides checklists for staged diff review, secret scanning, tests, linting, and git bisect/blame workflows for tracking down regressions. - Use Case: An AI coding agent completes a feature slice, runs tests, commits with a descriptive conventional message, and uses the save point pattern to revert instantly if the next change breaks. ## Quick Start Ask the agent to commit the current changes following the git workflow skill with an atomic commit and a descriptive conventional message.

Frequently Asked Questions about git-workflow-and-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write good git commit messages?

Use the format type: short description, where type is feat, fix, refactor, test, docs, or chore. Add a body explaining why the change was made rather than what changed, since the diff already shows the what.

What is trunk-based development and how does it work?

Trunk-based development keeps the main branch always deployable while work happens on short-lived feature branches merged back within 1-3 days. Long-lived branches are avoided because they diverge, create merge conflicts, and delay integration.

How do I use git worktrees for parallel development?

Run git worktree add with a target directory and branch name to create a separate working directory per branch. Each worktree lets agents or developers work in parallel without branch switching, and you remove them with git worktree remove when done.

How large should a git commit or pull request be?

Target around 100 lines per commit or PR for easy review and reverts. Changes approaching 1000 lines should be split into smaller logical commits before submitting, not squashed afterward.

How do I find which commit introduced a bug?

Use git bisect start, mark the current HEAD as bad and a known-good commit as good, then test each midpoint checkout until git narrows down the offending commit. Git blame and git log --grep also help trace specific line changes.

What files should never be committed to git?

Never commit environment files like .env, build output such as dist/ or .next/, node_modules/, or private keys like *.pem. Set up a .gitignore covering these immediately, and scan staged diffs for passwords, secrets, and API keys before committing.