AgentSkillsCN

merge-phase

在某一阶段的所有议题全部完成后,将暂存分支合并至主分支。创建包含所有已纳入功能的阶段性合并Pull Request,并附上简要说明。

SKILL.md
--- frontmatter
name: merge-phase
description: Merge the staging branch to main after all issues in a phase are complete. Creates a phase merge PR with a summary of all features included.
disable-model-invocation: true

Merge Phase

Merge Phase $ARGUMENTS from staging to main.

Input

Phase number: $ARGUMENTS

Steps

1. Verify Phase Completion

Check that all issues for this phase are closed:

bash
gh issue list --state open --search "label:phase-$ARGUMENTS" --json number,title

If open issues remain, list them and ask for confirmation before proceeding.

2. Check for Existing Merge

bash
gh pr list --base main --state merged --search "Phase $ARGUMENTS" --json number

If already merged, report and skip.

3. Get the Diff

bash
git diff main...staging

4. Read Phase Issues

Read issues.json and filter for issues with phase == $ARGUMENTS. Summarize what each feature does.

5. Generate Phase PR Description

Create a PR description with:

  • Summary: What Phase $ARGUMENTS delivers as a whole
  • Changes: Grouped by feature area
  • Test Plan: Verification steps for each feature

6. Create Phase Merge PR

bash
gh pr create --base main --head staging \
  --title "Phase $ARGUMENTS complete — merge to main" \
  --body "<generated description>"

7. Merge PR (Non-Squash)

bash
gh pr merge <pr-number> --merge

Non-squash merge preserves the individual feature commit history.

8. Sync Local Branches

bash
git checkout main
git pull origin main
git checkout staging
git pull origin staging
git merge main
git push origin staging

If merge conflicts occur during sync, resolve them (prefer main's version for sync conflicts).

Output

Report the phase merge PR number and confirm main is updated.