agentleFS
ArcanEdge-AIArcanEdge-AI/coding-agent-playbook-claude-code/skills/feature-branch-lifecycle/SKILL.md

feature-branch-lifecycle

Skill0 starsChanged 4 months agoMITView on GitHub

Use when a feature, change, or update may use one or more development branches and has to be assembled, validated, promoted through long-lived integration and production branches, and cleaned up safely. Covers branch-model detection, the promotion sequence, complete-feature validation, the gates that must pass before any temporary branch is deleted, and the authority each step needs. Not for worktree isolation, session ownership, or dependency planning.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Keep feature assembly out of long-lived branches, and make promotion and cleanup explicit rather than assumed.

    line 8
  2. Very specific:

    Use the repository's real branch names.

    line 21
  3. Distinctive:

    When a gate fails or the deletion is not authorized, preserve the branch and report the exact blocker and the next action.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Feature Branch Lifecycle

Keep feature assembly out of long-lived branches, and make promotion and cleanup explicit rather than assumed.

Read references/branching-rule.md, packaged with this skill, before you create the branch structure, open a promotion pull request, or delete anything. This file is the decision surface; that one is the procedure.

First, decide whether the model applies

This lifecycle is for repositories that already run a long-lived integration branch and a long-lived production branch. Before using it, resolve from the repository itself:

  • the applicable CLAUDE.md and any release or contribution documentation
  • the default branch, the current branch, and which branches are the integration and production branches
  • remotes, open pull requests, branch protections, and worktrees
  • active work that may still depend on a branch you would touch

Use the repository's real branch names. The examples here say staging and main because they are easy to read, not because they are correct anywhere.

If the repository has no such model, do not create one because this skill is installed. Follow the more specific repository workflow, or ask for a maintainer decision. Inventing a missing long-lived branch, renaming a permanent branch, or overriding an incompatible workflow is a maintainer's call, not yours.

The sequence, when it applies

development branches
        ↓
feature integration branch
        ↓
long-lived integration branch, for example staging
        ↓
long-lived production branch, for example main
InvariantWhy it exists
The feature integration branch is cut from the current integration branch.It starts from what is actually released next, not from a stale base.
Development branches are cut from the feature integration branch.They combine cleanly, because they share the feature's base.
A development branch merges only into its feature integration branch.A half-feature never reaches a long-lived branch.
The complete feature is assembled and validated on the feature integration branch.The long-lived integration branch is not a workspace.
One pull request promotes the feature integration branch to the integration branch.The promotion unit is the whole reviewable feature.
Production is promoted only from the integration branch, under separate authority.Release is its own decision.
Permanent integration and production branches are never deleted.They are the repository, not task scaffolding.
Every temporary branch ends with a verified disposition.Removed under passing gates, or preserved with an exact blocker.

Development branches are optional. When one feature integration branch implements the whole feature cleanly, use just that. The feature integration branch stays the promotion unit either way.

Before promoting, validate the whole feature

Run what the repository and the change actually warrant: build, lint, format, typecheck, static analysis, E2E tests of the combined flows, contracts, integrations, meaningful failures, and boundary cases, manual checks where they help, and a final review of the combined diff. Then confirm no required development work is still outstanding.

Retain E2E behavioral tests only. Every unit test created for the feature is temporary; before promotion, remove each one and its exclusive support code once passing E2E coverage carries its still-required assertions. Required repository gates stay, and existing non-E2E suites migrate only within authorized scope.

A passing subset is not evidence that the assembled feature works. Say what you ran and what it produced, and name anything you did not run.

Cleanup is gated, and the gates are not optional

Cleanup begins only after the promotion pull request has merged into the exact long-lived integration branch. Immediately before deleting any branch, verify every gate in the packaged reference: incorporation, required checks, no unique unpreserved work, no remaining dependency, no active worktree holding it, exact local and remote targets, and authority for each deletion.

A clean working tree, an old date, quiet activity, or a name that looks merged is not evidence.

When a gate fails or the deletion is not authorized, preserve the branch and report the exact blocker and the next action. Never force-delete, reset, sweep broadly, or rewrite history to get there.

This skill's boundary

The sequence tells you what order things must happen in. It grants no authority of its own. Creating remote branches, opening or merging pull requests, deleting local or remote branches, and promoting production each need the authority the task actually carries. A request to build or integrate a feature is not a request to release it.

Route these elsewhere

ConcernSkill
A branch is checked out in an auxiliary worktree, or a checkout needs isolating, integrating, or removingworktree-lifecycle
Independent Claude Code sessions or other people own related branchesmulti-session-coordination
Integration, validation, promotion, and cleanup are nodes in a wider dependency graphtask-graph-orchestration

A branch is not a worktree, a branch is not a session, and a feature integration branch is not automatically a graph node. Keep the lifecycles separate.

What to report

  • the resolved branch roles and their exact names
  • each temporary branch, with its base and its permitted merge target
  • the complete-feature validation you ran, and its results
  • pull-request and merge state
  • cleanup eligibility and the final disposition of every temporary branch
  • any missing authority, failed gate, or live dependency that forced preservation

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.