agentleFS
LeostrukaLeostruka/devin-bundle/skills/git-workflows/SKILL.md

git-workflows

Skill0 starsChanged 3 months agoMITView on GitHub

Use when managing branches, writing commits, creating isolated worktrees for feature work, or resolving and verifying merge/rebase conflicts.

  • Commits and pushes

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use cloud-api-recipe-authoring, codebuddy-ide-mcp-upgrade and 10 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.
  • TencentCloudBaseSkill

    cloud-api-recipe-authoring

    Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/). Encodes why the long tail of control-plane capabilities is deliberately NOT wrapped as MCP/CLI tools, the API-first admission test for whether a capability deserves a recipe, the negative and positive lists, the fixed recipe structure, the writing rules distilled from writing-for-agents, the user-facing copy red lines, and the product regeneration/verification pipeline. Also routes contributors (and their agents) to the contribution flow and the pre-PR self-test protocol in references/contributing.md. Use when adding a recipe, judging whether a scenario belongs in the recipe set, updating the recipes index, re-checking existing recipes against the admission test, or onboarding someone who wants to submit one.

    Also in 3 projects that use this

  • TencentCloudBaseSkill

    codebuddy-ide-mcp-upgrade

    升级 CodeBuddy IDE(genie 扩展)内置的 CloudBase MCP,以及 MCP 发版时同步 IDE 侧白名单。当用户提到「更新 IDE 里的 MCP」「内置 MCP 版本太老」「IDE 集成的 CloudBase 功能不足」「改工具白名单 toolWhiteList」「把新 bundle 打进 CodeBuddy」「白名单漂移」「MCP 发版要同步什么」时使用。覆盖:解包定位内置 bundle 与内嵌配置、重新构建 mcp bundle、生成新的工具白名单与系统提示词、安全注入 IDE 并备份、用 MCP 协议验证工具清单、人工端到端验收、一键回滚。

    Also in 3 projects that use this

  • zaxbysauceSkill

    pr-review-fix

    Codex adapter for addressing pull request review feedback in opencode-swarm. Use when the user asks to fix PR review comments, requested changes, reviewer findings, CI-review notes, or a pasted review summary with low false-positive tolerance.

    Also in 3 projects that use this

  • DIL8654Skill

    api-contract-review

    Review ASP.NET Core Web API contracts for HTTP semantics, versioning, backward compatibility, and response consistency. Use when the user asks to review an API, check endpoints, validate REST behavior, or before releasing contract changes.

    Also in 3 projects that use this

  • ReinaMacCredySkill

    codebase-audit

    Deep codebase audit that first reads project docs (AGENTS.md, README.md) and investigates the architecture, then systematically finds hardcoded constants that should be dynamic and unfinished code (TODOs, "will"/"would" in comments). Use this skill when the user wants a thorough code review for hygiene issues, asks to find hardcoded values, wants to audit for TODOs or incomplete code, says things like "audit this codebase", "find hardcoded stuff", "what's unfinished", "find tech debt", "code hygiene check", or asks you to look across the whole project for issues. Also use when the user asks to understand a project before making changes, or wants a comprehensive health check of their codebase.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    skill-authoring

    Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.

    Also in 3 projects that use this

  • +6 more from TencentCloudBase

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 2

    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. Distinctive:

    Step 3 — baseline: run project tests; failures → report + ask, passes → "Worktree ready at <path>, <N> tests passing".

    line 53
  2. Very specific:

    Managed ignore blocks: when a project convention tracks worktree dirs in .gitignore, add them inside BEGIN/END managed markers and add only …

    line 77
  3. Distinctive:

    Integration: before merging a lane: run verification proportional to the changed behavior, show the diff against the integration base, and …

    line 84

“Common” is measured: kept by at least 6 in 10 of the 6 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 Workflows

Branches, commits, isolated worktrees, and merge-conflict resolution.

Branches & commits

  • git checkout -b feature/<name> / git push -u origin feature/<name>.
  • Conventional commits: type(scope): description — feat, fix, docs, style, refactor, test, chore. Subject ≤72 chars; atomic commits (one logical change).
  • Pull latest before branching; prefixes: feature/, bugfix/, hotfix/.
  • Cleanup: git remote prune origin, git branch -d <name>.

Worktrees (isolated workspaces)

Core principle: detect existing isolation → prefer native tools → git fallback. Never fight the harness.

Step 0 — detect existing isolation:

GIT_DIR=$(cd "$(git rev-parse --git-dir)" && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" && pwd -P)
git rev-parse --show-superproject-working-tree 2>/dev/null  # submodule guard

GIT_DIR != GIT_COMMON and not a submodule → already in a linked worktree; skip creation. In a submodule → treat as normal repo.

Step 1a — native worktree tool preferred (EnterWorktree, /worktree, --worktree flag): use it — it owns placement, branching, cleanup. Manual git worktree add alongside a native tool creates phantom state.

Step 1b — git fallback (no native tool): pick directory in priority order — explicit user instruction → existing .worktrees/ → worktrees/ → default .worktrees/. MUST git check-ignore -q <dir> first; if not ignored, add to .gitignore and commit. Then:

git worktree add "$path" -b "$BRANCH_NAME" && cd "$path"

Permission error → sandbox fallback: work in place.

Step 2 — setup: auto-detect (package.json→npm install, Cargo.toml→cargo build, requirements.txt/pyproject.toml→pip/poetry, go.mod→go mod download).

Step 3 — baseline: run project tests; failures → report + ask, passes → "Worktree ready at <path>, <N> tests passing".

Rationalizations to reject: "obviously not in a worktree" (run Step 0), "worktree add is quicker" (native tool owns lifecycle), "surely ignored" (run check-ignore), "baseline can wait" (dirty baseline makes later failures ambiguous).

Multiple lanes (parallel agents)

For risky refactors, spikes, or parallel subagents, manage each worktree as a named lane; the controller (orchestrator) owns lane planning, branch/path selection, file ownership, delegation, diff validation, integration, and cleanup. Subagents work inside their assigned lane only.

  • Lane manifest: optional local metadata .devin/worktrees.json tracking slug, branch, path, base, purpose, owner, status, areas (file/folder ownership), createdAt. Treat as local workflow metadata; ask before committing it to the repo.
  • File ownership per lane: record which paths each lane owns so parallel agents do not collide; a lane that needs another lane's area stops and reports instead of editing across boundaries.
  • Subagent isolation: set each subagent's working directory strictly to its lane path; never modify the main checkout for lane work.
  • Managed ignore blocks: when a project convention tracks worktree dirs in .gitignore, add them inside BEGIN/END managed markers and add only missing lines; never duplicate or rewrite unrelated rules.
  • Mandatory confirmation before git mutations: worktree add/remove, branch create/delete/rename, merge, rebase, cherry-pick, prune, and any destructive command (reset --hard, clean, push --force, removing a dirty worktree) each need explicit user confirmation for that operation.
  • Integration: before merging a lane: run verification proportional to the changed behavior, show the diff against the integration base, and get user confirmation. Integrate from the main checkout.
  • Cleanup: confirm no uncommitted changes, get approval, remove the worktree, and mark the lane archived in the manifest.

Skip lanes for: single-file changes, doc updates, minor fixes, and repos with multi-submodule states worktrees cannot express.

Merge conflicts

  1. See the state — merge/rebase status, history, conflicting files.
  2. Find primary sources — why each change was made: commit messages, PRs, original issues (gh for GitHub).
  3. Resolve each hunk — preserve both intents where possible; where incompatible, pick the one matching the merge's stated goal and note the trade-off. Don't invent new behavior. Always resolve; never --abort.
  4. Run the project's checks — typecheck, tests, format. Fix what the merge broke.
  5. Finish — stage, commit; git rebase --continue until done if rebasing.

Cross-skills

  • finishing-a-development-branch — when the branch/worktree is done.
  • handoff — pause and resume in a fresh session.
  • gh — read PRs/issues behind conflicting changes.

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.