agentleFS
FaisalAlqarniFaisalAlqarni/sp-ecc/skills/finishing-a-development-branch/SKILL.md

finishing-a-development-branch

Skill9 starsChanged 10 months agoMITView on GitHub

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for review, delivery, or cleanup

  • Commits and pushes

123 other projects use a version of this, 72 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagnosing-superpowers, testing-anti-patterns 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.
  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 6 projects that use this

  • MicrosoftSkill

    testing-anti-patterns

    Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies

    Also in 5 projects that use this

  • MorningStar0709Skill

    chinese-git-workflow

    Configure Git for domestic platforms and manage branching strategies suitable for Chinese teams. Use when the user asks to configure remotes, set up SSH, or manage Git workflows for Gitee, Coding, Jihu GitLab, or CNB, including requests like "配置国内 Git", "设置 Gitee 远程仓库", "推荐适合小团队的 Git 流程".

    Also in 4 projects that use this

  • shibit-netSkill

    chinese-code-review

    中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • shibit-netSkill

    chinese-commit-conventions

    中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • MorningStar0709Skill

    workflow-runner

    Run an agency-orchestrator style YAML workflow inside the current Trae conversation by simulating or coordinating multiple roles. Use when the user provides a `.yaml` or `.yml` workflow, asks for multi-role collaboration, says things like “用多个角色一起评审这个 PRD”“多角色协作”“先生成工作流再执行”“让产品经理、架构师、QA 一起看一下”, or wants roles such as product manager, architect, reviewer, or QA to work together. Supports layered execution, role prompting, variable interpolation, document-backed inputs, and parallel steps only when the current environment has a clear subagent mapping. Do not use for ordinary implementation plans, simple code changes, or tasks already covered by `writing-plans`, `executing-plans`, `subagent-driven-development`, or single-purpose review/debug skills.

    Also in 4 projects that use this

  • +1 more from shibit-net

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. 1 is common, 16 are distinctive, and 3 are very specific to this project.

  • 1

    Common

    Most of the 114 edited versions we read keep these.

  • 16

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Core principle: Verify tests → Present options → Execute choice.

    line 12
  2. Very specific:

    If this branch was created via sp-ecc:subagent-driven-development:

    line 20
  3. Very specific:

    Read docs/plans/*-pipeline-state.md for this feature

    line 22
  4. Distinctive:

    Check that all required stages are marked complete

    line 23
  5. Distinctive:

    If any required stages are unchecked:

    line 24
  6. Distinctive:

    Stop. Don't proceed to Step 1.

    line 34
  7. Distinctive:

    If no pipeline-state file exists (non-pipeline usage), skip this step.

    line 36
  8. Distinctive:

    Verification status: Test results, lint status, build status

    line 67
  9. Distinctive:

    Ask the user: "Would you like me to extract learned patterns from this session before finishing?"

    line 71
  10. Very specific:

    If yes: Invoke sp-ecc:extract-patterns to save useful patterns to the instinct system

    line 73
  11. Distinctive:

    If no: Skip and continue to Step 3

    line 74
  12. Distinctive:

    Do not auto-invoke: Always ask first.

    line 76
  13. Distinctive:

    Don't add explanation: - keep options concise.

    line 93
  14. Distinctive:

    If in a worktree, clean up:

    line 110
  15. Distinctive:

    If pipeline-state file exists, delete it (pipeline complete).

    line 116
  16. Distinctive:

    Wait for exact confirmation.

    line 158
  17. Distinctive:

    If pipeline-state file exists, delete it (pipeline discarded).

    line 172
  18. Distinctive:

    Fix: Always verify tests before offering options

    line 189
  19. Common:

    Delete work without confirmation

    line 203
  20. Distinctive:

    Verify tests before offering options

    line 208

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

Finishing a Development Branch

Overview

Guide completion of development work by presenting clear options and handling chosen workflow.

Core principle: Verify tests → Present options → Execute choice.

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

The Process

Step 0: Check Pipeline State (if applicable)

If this branch was created via sp-ecc:subagent-driven-development:

  1. Read docs/plans/*-pipeline-state.md for this feature
  2. Check that all required stages are marked complete
  3. If any required stages are unchecked:
Cannot finish — pipeline stages incomplete:

- [ ] <list unchecked required stages>

Complete these stages before finishing.

Stop. Don't proceed to Step 1.

If no pipeline-state file exists (non-pipeline usage), skip this step.

Step 1: Verify Tests

Before presenting options, verify tests pass:

# Run project's test suite
npm test / cargo test / pytest / go test ./...

If tests fail:

Tests failing (<N> failures). Must fix before completing:

[Show failures]

Cannot proceed until tests pass.

Stop. Don't proceed to Step 2.

If tests pass: Continue to Step 2.

Step 2: Summarize Work Done

Prepare a summary of what was implemented:

  • Files changed: List all created, modified, and deleted files
  • Features added: Bullet list of what's new
  • Tests added/updated: Count and brief description
  • Verification status: Test results, lint status, build status

Step 2.5: Extract Patterns (optional, ask user)

Ask the user: "Would you like me to extract learned patterns from this session before finishing?"

  • If yes: Invoke sp-ecc:extract-patterns to save useful patterns to the instinct system
  • If no: Skip and continue to Step 3

Do not auto-invoke. Always ask first.

Step 3: Present Options

Present exactly these 4 options:

Implementation complete. All tests passing. What would you like to do?

1. Merge locally (merge this branch into main/target branch)
2. Push and create PR (push branch to remote, open pull request)
3. Keep as-is (leave branch for later, continue working)
4. Discard this work (delete branch and revert)

Which option?

Don't add explanation - keep options concise.

Step 4: Execute Choice

Option 1: Merge Locally

# Switch to target branch
git checkout main

# Merge the feature branch
git merge <feature-branch> --no-ff -m "Merge: <summary>"

# Delete the feature branch
git branch -d <feature-branch>

If in a worktree, clean up:

# Remove the worktree
git worktree remove <worktree-path>

If pipeline-state file exists, delete it (pipeline complete).

Report: what was merged, target branch, and cleanup status.

Option 2: Push and Create PR

# Push branch to remote
git push -u origin <feature-branch>

# Create PR using gh CLI
gh pr create --title "<summary>" --body "<description>"

If in a worktree, clean up:

# Remove the worktree (branch stays on remote)
git worktree remove <worktree-path>

If pipeline-state file exists, delete it (pipeline complete).

Report: PR URL, branch name, and cleanup status.

Option 3: Keep As-Is

Report: "Understood. Branch <branch-name> preserved. Continuing development. Let me know what to work on next."

Don't change anything. Stay in current session context.

Option 4: Discard

Confirm first:

This will delete branch <branch-name> and all uncommitted changes:

Files modified:
- <list of files>

Type 'discard' to confirm.

Wait for exact confirmation.

If confirmed:

# Switch to main
git checkout main

# Delete the branch
git branch -D <feature-branch>

# If in a worktree, remove it
git worktree remove <worktree-path> --force

If pipeline-state file exists, delete it (pipeline discarded).

Report what was cleaned up.

Quick Reference

OptionActionGit OperationsWorktree Cleanup
1. Merge locallyMerge into mainmerge, branch -dworktree remove
2. Push & PRPush, create PRpush -u, gh pr createworktree remove
3. Keep as-isContinue workingNoneNone
4. DiscardDelete branchcheckout main, branch -Dworktree remove --force

Common Mistakes

Skipping test verification

  • Problem: Mark work complete when tests are broken
  • Fix: Always verify tests before offering options

Open-ended questions

  • Problem: "What should I do next?" → ambiguous
  • Fix: Present exactly 4 structured options

No confirmation for discard

  • Problem: Accidentally delete work
  • Fix: Require typed "discard" confirmation

Red Flags

Never:

  • Proceed with failing tests
  • Delete work without confirmation
  • Assume which branch or remote to target
  • Force push to main/master

Always:

  • Verify tests before offering options
  • Present exactly 4 options
  • Get typed confirmation for Option 4
  • Clean up worktrees after merge/discard

Integration

Called by:

  • subagent-driven-development (Step 6: Finish) - After all tasks and reviews complete
  • executing-plans (Step 5) - After all batches complete

Works with:

  • using-git-worktrees - Handles worktree cleanup for all options
  • requesting-code-review - Can be invoked before choosing an option

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.