AgentSkillsCN

finishing-a-development-branch

当实施工作已完成,您需要决定如何整合、保留或弃用开发分支时,运用此技能。

SKILL.md
--- frontmatter
name: finishing-a-development-branch
description: >
  Use this skill when implementation is complete and you need to decide how to
  integrate, keep, or discard a development branch.

Finishing a Development Branch

Intent

Close out work safely by verifying tests, presenting integration options, and cleaning up worktrees consistently.


When to Use

  • After plan execution is complete.
  • Before merging, creating a PR, or discarding work.

Precondition Failure Signal

  • Tests have not been run in the branch before integration.
  • A merge or PR is created without verification evidence.
  • Work is discarded without explicit confirmation.

Postcondition Success Signal

  • Tests pass with fresh evidence.
  • One of the approved integration options is chosen.
  • Worktrees are cleaned up appropriately.

Process

  1. Verify Tests: Run the project test suite and record results.
  2. Determine Base Branch: Confirm merge base (usually main).
  3. Present Options:
    • Merge locally.
    • Push and create PR.
    • Keep branch as-is.
    • Discard work (requires explicit confirmation).
  4. Execute Choice: Follow the selected path precisely.
  5. Cleanup: Remove worktree for options that discard or merge work.

Example Test / Validation

  • Tests pass on the branch before presenting options.

Common Red Flags / Guardrail Violations

  • Skipping verification because "it passed earlier".
  • Automatically deleting worktrees without user confirmation.
  • Forcing a merge without tests on the merged result.

Recommended Review Personas

  • Tech Lead - validates readiness for integration.
  • Release Manager / SRE - validates release/traceability implications.

Skill Priority

P2 - Consistency & Governance


Conflict Resolution Rules

  • If tests fail, return to systematic-debugging.
  • Discarding work requires explicit user confirmation.

Conceptual Dependencies

  • verification-and-handover
  • change-risk-rollback

Classification

Governance
Operational


Notes

Branch closure is a release decision, not a formality.