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
- ArcanEdge-AI/coding-agent-playbook-codexedited, first seen Aug 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- ArcanEdge-AI/coding-agent-playbook-codex★ 320% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- aws-local-preflightSkill
- handoffSkill
- legacy-path-retirementSkill
- local-ci-preflightSkill
- multi-role-repo-reviewSkill
- multi-session-coordinationSkill
- platform-documentationSkill
- production-api-integrationSkill
- production-architecture-reviewSkill
- production-code-qualitySkill
- production-database-integritySkill
- production-devops-releaseSkill
- production-documentation-onboardingSkill
- production-pass-orchestratorSkill
- production-performance-reviewSkill
- production-readiness-reportSkill
- production-reliability-observabilitySkill
- production-security-reviewSkill
- production-testing-qaSkill
- production-ux-accessibilitySkill
- reference-doc-routingSkill
- senior-code-reviewSkill
- session-cleanupSkill
- subagent-orchestrationSkill
- task-graph-orchestrationSkill
- technical-debt-auditorSkill
- worktree-lifecycleSkill
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
- Distinctive: line 8
Keep feature assembly out of long-lived branches, and make promotion and cleanup explicit rather than assumed.
- Very specific: line 21
Use the repository's real branch names.
- Distinctive: line 64
When a gate fails or the deletion is not authorized, preserve the branch and report the exact blocker and the next action.
≈ “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.
Files
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.mdand 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| Invariant | Why 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
| Concern | Skill |
| A branch is checked out in an auxiliary worktree, or a checkout needs isolating, integrating, or removing | worktree-lifecycle |
| Independent Claude Code sessions or other people own related branches | multi-session-coordination |
| Integration, validation, promotion, and cleanup are nodes in a wider dependency graph | task-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
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
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.

