agentleFS
yuanJewelyuanJewel/skills/branch-lifecycle/SKILL.md

branch-lifecycle

Skill2 starsChanged 4 days agoMITView on GitHub

When a session creates, integrates or closes a task branch or worktree, verify the project branch contract, candidate identity, integration evidence and safe removal conditions. Session takeover and handover use context-handoff; material retention and recovery use archive-maintenance. Ordinary implementation commits use task-implementation and release acceptance uses release-readiness.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 20 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Keep task history reachable and integration traceable under the project's authorised branch model.

    line 10
  2. Distinctive:

    Use context-handoff for session recovery, write transfer and continuation records.

    line 28
  3. Distinctive:

    Use task-implementation for implementation, checks and local resource cleanup.

    line 30
  4. Distinctive:

    Use release-readiness for acceptance and the release decision.

    line 31
  5. Distinctive:

    Use archive-maintenance for task materials, register retention and historical recovery.

    line 32
  6. Distinctive:

    Use only the input contract's branch names and integration topology.

    line 37
  7. Very specific:

    Never assume that main means deployed code or that dev must exist.

    line 39
  8. Distinctive:

    Do not commit on detached HEAD.

    line 41
  9. Distinctive:

    Do not rebase pushed branches, rewrite published history, move immutable release/archive tags or force push.

    line 43
  10. Distinctive:

    Before any fetch, pull or push, verify the actual destination against the supplied central address.

    line 44
  11. Distinctive:

    Use fast-forward-only pulls.

    line 45
  12. Distinctive:

    Verify the allowed worktree location and actual baseline commit/tree before creating the task branch.

    line 51
  13. Distinctive:

    Use the project's naming convention and register only this task's worktree, branch and writer association.

    line 52
  14. Distinctive:

    Read the project's requirements for security and compatibility review.

    line 60
  15. Distinctive:

    Use an authorised abort only when returning an in-progress operation to its prior clean state is required.

    line 66
  16. Distinctive:

    Run required integration checks and record any authorised push's actual outcome.

    line 67
  17. Distinctive:

    Verify all associated executions have ended, all required checks passed and the intended result remains reachable at the required …

    line 71
  18. Very specific:

    After cherry-picking, verify the source-to-result mapping.

    line 72
  19. Distinctive:

    Remove only this task's registered clean worktrees with ordinary git worktree remove.

    line 74
  20. Distinctive:

    Delete only the verified integrated branch under the project's Git policy.

    line 75
  21. Distinctive:

    Never move an existing release tag to represent another release.

    line 97
  22. Very specific:

    Keep incomplete steps in their actual state.

    line 102
  23. Very specific:

    Do not stash, discard, force-remove or label those files archived automatically.

    line 107
  24. Distinctive:

    No directly adopted external source.

    line 116
  25. Very specific:

    No third-party license file is required.

    line 119

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Branch and worktree lifecycle

Keep task history reachable and integration traceable under the project's authorised branch model. This method grants no Git, deletion, dispatch or release permission. It does not choose a new branch model for an existing repository.

Inputs and boundaries

Take these values from the consuming project's contract:

  • Repository, primary working copy, central repository address and permitted Git operations.
  • Task ID, baseline commit/tree, branch names and the authorised file scope.
  • Worktree layout, existing register and the permitted writers for task, integration and release refs.
  • Current branch/worktree inventory, uncommitted and untracked files, execution state and pinned review evidence.
  • Any closure deadline, inactivity threshold, register retention policy and reporting destination.

Missing repository, path or authority -> locate the contract before the dependent write. Missing timing or retention parameters -> keep them unknown; do not invent expiry periods. A branch-model mismatch -> report it before changing refs; this package does not authorise migration. Unknown or active conflicting execution -> preserve the worktree and branch. Use context-handoff for session recovery, write transfer and continuation records.

Use task-implementation for implementation, checks and local resource cleanup. Use release-readiness for acceptance and the release decision. Use archive-maintenance for task materials, register retention and historical recovery. An archive tag preserves a commit graph; it cannot preserve uncommitted or untracked files.

Ref safety

Use only the input contract's branch names and integration topology. A repository with a separate integration branch and a repository integrating directly to its primary branch need different targets. Never assume that main means deployed code or that dev must exist.

  • Do not commit on detached HEAD; a read-only reviewer may inspect a pinned detached commit.
  • Integrate with an authorised ordinary merge or cherry-pick -x, retaining the source relationship.
  • Do not rebase pushed branches, rewrite published history, move immutable release/archive tags or force push.
  • Before any fetch, pull or push, verify the actual destination against the supplied central address.
  • Use fast-forward-only pulls; divergence or non-fast-forward rejection leaves the step pending.
  • Push only explicitly authorised refs; branch creation or successful local integration does not imply push permission.

Execute the lifecycle

  1. Create and register. Verify the allowed worktree location and actual baseline commit/tree before creating the task branch. Use the project's naming convention and register only this task's worktree, branch and writer association. A name collision or different existing baseline -> preserve it and resolve ownership first. On re-entry, recover the existing object through context-handoff; do not create a duplicate task branch.
  2. Freeze a candidate. The task writer accounts for intended tracked, untracked and deleted files before recording HEAD/tree. A commit identity does not cover residual working-tree changes. Independent checks bind to that candidate; changed bytes require a new candidate and affected checks. Read the project's requirements for security and compatibility review; this method does not self-sign them.
  3. Integrate verified results. The authorised integrator verifies source identity, review scope and the current target state. Record source and resulting commits for both merge and cherry-pick integration. On conflicts, stop integration and report the affected files; do not silently choose a side or change unrelated files. Use an authorised abort only when returning an in-progress operation to its prior clean state is required. Run required integration checks and record any authorised push's actual outcome. Rejection or unknown outcome remains pending and blocks claims that the central result is delivered.
  4. Close registered objects safely. Verify all associated executions have ended, all required checks passed and the intended result remains reachable at the required destination. After cherry-picking, verify the source-to-result mapping; ancestry alone is insufficient. Preserve task materials and residual files under archive-maintenance before any destructive removal. Remove only this task's registered clean worktrees with ordinary git worktree remove. Delete only the verified integrated branch under the project's Git policy. A failed safe deletion check -> keep the object and report the blocker; do not force removal. Record actual closure time only after closure succeeds.
  5. Preserve abandoned history. Confirm the abandonment decision and preservation requirements through archive-maintenance. Where the contract uses archive refs, create the immutable ref at the exact retained tip and verify required central reachability before branch deletion. A same-name tag pointing elsewhere -> stop; never move it. Apply the same stopped-writer and clean-worktree conditions as normal closure. Dirty or untracked material needs separate preservation; a tag is insufficient.
  6. Assess inactivity. Compare age only with the supplied threshold and record actual execution state. Age alone never authorises deletion or proves the task is abandoned. Report the task identity, worktree, history identity and uncertainty for the authorised decision maker. Missing threshold -> give the inventory without classifying it as expired.

Release refs and completion evidence

Release acceptance remains in release-readiness; this package only updates the refs authorised by the project's release contract. Pin the accepted and, where relevant, actually deployed identity before moving a release ref. Unknown identity, missing acceptance or a required fast-forward that fails -> stop those ref changes. Never move an existing release tag to represent another release.

Reuse the existing task register rather than creating a second state store. Record task/worktree/branch, baseline, writer association, frozen candidate, source-to-integration mapping, review locators, actual ref/push outcomes, removed and retained objects, closure time and blockers. Keep incomplete steps in their actual state; report blocked closure before any project deadline. Material retention and removal of expired closed register rows follow archive-maintenance and the supplied retention contract.

A dirty worktree discovered after integration stays in place. Record the already integrated result and residual changes separately, then resolve preservation within authorised scope. Do not stash, discard, force-remove or label those files archived automatically. Other local resources use the cleanup rules of task-implementation; never run global cleanup.

Routine inventory suits low/low; integration conflicts and uncertain history mapping suit normal/high. Grade words map to actual execution configuration through the project resource mapping. Executor availability and environment limits come from the project; this method does not launch sessions.

Sources

  1. No directly adopted external source; this package is own-authored.
  2. The parameterised ref/worktree lifecycle, integration mapping and safety decisions are own-authored, pending host behaviour verification. Branch names, topology, deadlines and register states are project inputs; handover and material retention remain in their named packages.
  3. No third-party license file is required; the root LICENSE applies. The library's third-party summary is THIRD_PARTY_NOTICES.md.

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.