AGENT SKILL

finishing-a-development-branch-lite

Use when implementation is complete and you need to merge a worktree branch back into the original base branch with build/compile verification (no tests)

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 1.6k
Forks
491

01 前言 Front Matter

name
finishing-a-development-branch-lite
description
Use when implementation is complete and you need to merge a worktree branch back into the original base branch with build/compile verification (no tests)

03 SKILL.md 正文

Finishing a Development Branch Lite

Overview

Finish development work by verifying a build/compile check, presenting merge options, and cleaning up the worktree.

Core principle: Build/compile first → confirm base branch → present options → execute → cleanup.

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

The Process

Step 1: Verify Build/Compile (No Tests)

  1. Check AGENTS.md for build/compile commands. If present, follow it.
  2. Otherwise use default build/compile commands:
# Node.js (requires build script)
if [ -f package.json ]; then npm run -s build; fi

# Rust
if [ -f Cargo.toml ]; then cargo build; fi

# Go
if [ -f go.mod ]; then go build ./...; fi

# Python
if [ -f pyproject.toml ] || [ -f requirements.txt ]; then python -m compileall .; fi

# Java (Maven)
if [ -f pom.xml ]; then mvn -q clean compile; fi

If no build command is available (e.g., no npm build script), ask the user for the correct command.

If build fails:

Build/compile failing (<N> failures). Must fix before completing.

[Show failures]

Stop. Do not proceed to Step 2.

Step 2: Determine Base Branch (Merge Target)

Prefer extracting the base branch from the worktree branch name using the delimiter:

__wt__

Example:

feature/auth__wt__login -> base branch: feature/auth

If extracted, verify the local branch exists:

git show-ref --verify refs/heads/<base-branch>

If it exists, confirm with the user before merging. If it does not exist, ask the user to provide the base branch.

Step 3: Present Options

Present exactly these 4 options:

Implementation complete. What would you like to do?

1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Which option?

Step 4: Execute Choice

Option 1: Merge Locally

Important: Run the merge from the base-branch worktree (the directory where the base branch is checked out), not from the worktree branch directory.

# Switch to base branch
git checkout <base-branch>

# Pull latest (if appropriate)
git pull

# Merge feature branch
git merge <feature-branch>

# Verify build/compile on merged result
<build command>

# If build passes
git branch -d <feature-branch>

Then: Cleanup worktree (Step 5)

Option 2: Push and Create PR

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

# Create PR
gh pr create --title "<title>" --body "<summary and build steps>"

Then: Cleanup worktree (Step 5)

Option 3: Keep As-Is

Report: "Keeping branch <name>. Worktree preserved at <path>."

Do not cleanup worktree.

Option 4: Discard

Confirm first:

This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>

Type 'discard' to confirm.

Wait for exact confirmation.

If confirmed:

git checkout <base-branch>
git branch -D <feature-branch>

Then: Cleanup worktree (Step 5)

Step 5: Cleanup Worktree

For Options 1, 2, 4:

Before removing a worktree, change into a directory that will remain (e.g., the base-branch worktree). Removing the current directory will break the session.

git worktree list | grep $(git branch --show-current)

If yes:

git worktree remove <worktree-path>

For Option 3: Keep worktree.

Quick Reference

Option Merge Push Keep Worktree Cleanup Branch
1. Merge locally ✓ - - ✓
2. Create PR - ✓ ✓ -
3. Keep as-is - - ✓ -
4. Discard - - - ✓ (force)

Common Mistakes

Assuming main/master as base branch

  • Problem: Merges into the wrong branch
  • Fix: Confirm the original base branch

Skipping build verification

  • Problem: Merge broken code
  • Fix: Build/compile must pass before proceeding

Discarding without confirmation

  • Problem: Permanent data loss
  • Fix: Require typed 'discard'

Skipping base-branch confirmation because "it should be obvious"

  • Problem: Merge target drifts
  • Fix: Ask, then proceed

Rationalization Table

Excuse Reality
"I'll merge this into main, it's fine" Merge into the original base branch unless user says otherwise
"Build is optional" Build/compile is the gate for completion
"Discard is reversible" Discard is permanent and requires confirmation

Red Flags

  • "I'll just merge to main/master"
  • "Build can wait until after merge"
  • "Discard without asking is faster"

Example

# Build/compile
mvn -q clean compile

# Merge to base branch
base_branch=feature/auth
feature_branch=feature/auth-impl

git checkout "$base_branch"
git pull
git merge "$feature_branch"

# Verify build/compile again
mvn -q clean compile

04 同仓库更多 Skills

hashgraph-online
hashgraph-online/awesome-codex-plugins

migrate-to-e2e

Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

e2e

Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

create-verification-skill

Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-search

deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-reflect

End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

revid

Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.

图像与多媒体Skill与智能体开发
★ 1.6k