agentleFS
buildpad-aibuildpad-ai/skills/git-workflow-and-versioning/SKILL.md

git-workflow-and-versioning

Skill1 starsChanged 4 months agoMITView on GitHub

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

  • Reads credentials
  • Installs packages

34 other projects use a version of this, 30 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, deprecation-and-migration and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 18 projects that use this

  • borhen68Skill

    observability-and-instrumentation

    Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

    Also in 10 projects that use this

  • mycelium-hqSkill

    doubt-driven-development

    Use when correctness matters more than speed: about to commit non-trivial code, make an architectural call under uncertainty, work in unfamiliar code, or assert what the compiler cannot check (''this is safe'', ''thread-safe'', ''this scales'', ''matches the spec''). Strongest on high-stakes surfaces (production deploys, security-sensitive logic, data migrations, irreversible operations) and when the user asks to sanity-check, red-team, double-check, or get a second opinion on a decision.

    Also in 15 projects that use this

  • galandoSkill

    source-driven-development

    Version-aware, source-driven development — fetch official docs before writing framework code

    Also in 18 projects that use this

  • luischanciSkill

    interview-me

    Interactive interview to formalize a research idea into a structured specification with hypotheses and empirical strategy.

    Also in 15 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 5 are common, 5 are distinctive, and 1 is very specific to this project.

  • 5

    Common

    Most of the 34 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Always. Every code change flows through git.

    line 14
  2. Distinctive:

    Keep main always deployable.

    line 20
  3. Distinctive:

    Don't combine formatting changes with behavior changes.

    line 65
  4. Common:

    Keep branches short-lived (merge within 1-3 days)

    line 86
  5. Common:

    Delete branches after merge

    line 87
  6. Common:

    Prefer feature flags over long-lived branches

    line 88
  7. Distinctive:

    After any modification, provide a structured summary:

    line 113
  8. Distinctive:

    Verify with git remote -v and git branch before pushing

    line 150
  9. Very specific:

    Always validate locally before merging to main: pnpm install && pnpm build && pnpm test

    line 151
  10. Distinctive:

    Use PRs and require CI/build checks before merging to main

    line 152
  11. Common:

    Commit messages like "fix", "update", "misc"

    line 167

“Common” is measured: kept by at least 6 in 10 of the 34 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Workflow and Versioning

Overview

Git is your safety net. Treat commits as save points, branches as sandboxes, and history as documentation. With AI agents generating code at high speed, disciplined version control keeps changes manageable, reviewable, and reversible.

When to Use

Always. Every code change flows through git.

Core Principles

Trunk-Based Development

Keep main always deployable. Work in short-lived feature branches that merge back within 1-3 days. Pushes to main trigger AWS Amplify builds.

main ──●──●──●──●──●──●──  (always deployable, triggers Amplify)
        ╲      ╱  ╲    ╱
         ●──●─╱    ●──╱    ← short-lived feature branches (1-3 days)

1. Commit Early, Commit Often

Work pattern:
  Implement slice → Test → Verify → Commit → Next slice

Not this:
  Implement everything → Hope it works → Giant commit

2. Atomic Commits

Each commit does one logical thing:

# Good: Each commit is self-contained
a1b2c3d feat: add task creation endpoint with validation
d4e5f6g feat: add task creation form component
h7i8j9k feat: connect form to API and add loading state
m1n2o3p test: add task creation tests (unit + integration)

# Bad: Everything mixed
x1y2z3a Add task feature, fix sidebar, update deps, refactor utils

3. Descriptive Messages

<type>: <short description>

<optional body explaining why, not what>

Types: feat, fix, refactor, test, docs, chore

4. Keep Concerns Separate

Don't combine formatting changes with behavior changes. Don't combine refactors with features.

5. Size Your Changes

~100 lines  → Easy to review, easy to revert
~300 lines  → Acceptable for a single logical change
~1000 lines → Split into smaller changes

Branching Strategy

main (always deployable, Amplify deploys on push)
  │
  ├── feature/task-creation    ← One feature per branch
  ├── feature/user-settings    ← Parallel work
  └── fix/duplicate-tasks      ← Bug fixes
  • Branch from main
  • Keep branches short-lived (merge within 1-3 days)
  • Delete branches after merge
  • Prefer feature flags over long-lived branches

Branch Naming

feature/<short-description>   → feature/task-creation
fix/<short-description>       → fix/duplicate-tasks
chore/<short-description>     → chore/update-deps
refactor/<short-description>  → refactor/auth-module

The Save Point Pattern

Agent starts work
    │
    ├── Makes a change
    │   ├── Test passes? → Commit → Continue
    │   └── Test fails? → Revert to last commit → Investigate
    │
    └── Feature complete → All commits form a clean history

Change Summaries

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 similar validation gap but out of scope

POTENTIAL CONCERNS:
- The Zod schema is strict — rejects extra fields. Confirm this is desired.

Pre-Commit Hygiene

# 1. Check what you're about to commit
git diff --staged

# 2. Ensure no secrets
git diff --staged | grep -i "password\|secret\|api_key\|token"

# 3. Run tests
pnpm test

# 4. Run linting and type checking
pnpm lint && pnpm tsc --noEmit

# 5. Run build
pnpm build

DaaS/Amplify-Specific

  • The starter repo includes amplify.yml — pushes to main trigger Amplify builds
  • Initial branch from starter is temporary-local — create a feature branch before working
  • Verify with git remote -v and git branch before pushing
  • Always validate locally before merging to main: pnpm install && pnpm build && pnpm test
  • Use PRs and require CI/build checks before merging to main

Common Rationalizations

RationalizationReality
"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 you will need to understand what changed.
"I'll squash it all later"Squashing destroys the development narrative. Prefer clean incremental commits.
"Branches add overhead"Short-lived branches are free. Long-lived branches are the problem.
"I don't need a .gitignore"Until .env with production secrets gets committed. Set it up immediately.

Red Flags

  • Large uncommitted changes accumulating
  • Commit messages like "fix", "update", "misc"
  • Formatting changes mixed with behavior changes
  • No .gitignore in the project
  • Committing node_modules/, .env, or build artifacts
  • Long-lived branches that diverge significantly from main
  • Force-pushing to shared branches

Verification

For every commit:

  • Commit does one logical thing
  • Message explains the why, follows type conventions
  • Tests pass before committing
  • No secrets in the diff
  • No formatting-only changes mixed with behavior changes
  • .gitignore covers standard exclusions

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.