hello
Show a nice greeting message with a timestamp. Use this when the user wants to greet or say…
Merge a Git source branch, including its still uncommitted changes, into a target branch through a regular merge, a rebase with fast-forward, or a squash merge, resolving merge conflicts semantically, check that the source branch landed, and emit a MERGED, CONFLICT, or FAILED
$ npx -y skills add rse/ase --skill ase-repo-merge --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ase-repo-mergeContext preview
The summary Claude sees to decide when to auto-load this skill.
Merge a Git source branch, including its still uncommitted changes, into a target branch through a regular merge, a rebase with fast-forward, or a squash merge, resolving merge conflicts semantically, check that the source branch landed, and emit a MERGED, CONFLICT, or FAILED
name: ase-repo-merge
argument-hint: "[--help|-h] [--target|-t <target-branch>] [--mode|-m merge|rebase|squash] [--cleanup|-c] <source-branch>"
description: >
Merge a Git source branch, including its still uncommitted changes,
into a target branch through a regular merge, a rebase with
fast-forward, or a squash merge, resolving merge conflicts semantically, check
that the source branch landed, and emit a MERGED, CONFLICT, or FAILED
verdict. Use when the user calls to "merge", "integrate", or "land" a
branch.
user-invocable: true
disable-model-invocation: false
effort: high
allowed-tools:
- "Bash(git *)"
- "Bash(mkdir -p *)"
- "Bash(cp -p *)"
- "Bash(rm -rf *)"
- "Read"
- "Edit"
- "Write"@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
<purpose name="ase-repo-merge"> Merge a Branch </purpose>
<expand name="getopt" arg1="ase-repo-merge" arg2="--target|-t=current --mode|-m=(merge|rebase|squash) --cleanup|-c"> $ARGUMENTS </expand>
<objective> *Merge* the source branch, including its still *uncommitted* changes, into the target branch, *resolve* all merge conflicts *semantically*, *check* that the source branch landed, and report the *merge verdict*. </objective>
@${CLAUDE_SKILL_DIR}/../../meta/ase-common-resolve.md
<define name="source-rollback"> If <source-commit/> is not empty and <merged/> is not equal `true`, undo the commit of the pending source changes of STEP 2, so they are uncommitted again: run the command `git -C "<source-dir/>" rev-parse HEAD` and, only if its output equals <source-commit/>, run the command `git -C "<source-dir/>" reset --quiet --mixed "<source-commit/>~1"`. </define>
<define name="merge-fail"> First expand the following:
<expand name="source-rollback"></expand>
Then only output the following <template/> and then immediately *STOP* processing the entire current skill:
<template> ⧉ **ASE**: ✪ skill: **ase-repo-merge**, ▶ ERROR: <arg1/>, ▶ MERGE VERDICT: **FAILED** </template> </define>
<flow>
1. <step id="STEP 1: Determine Branches">
1. Set <source-commit/> to empty, <merged/> to `false`, and <squashed/> to `false`.
2. Set <source/> to <getopt-arguments/> with any leading and trailing whitespace stripped. If <source/> is empty or contains whitespace, expand the following:
<expand name="merge-fail" arg1="exactly one source branch required"></expand>
3. Determine the *checked-out branch* by running the command `git branch --show-current` (taken exactly as given) and capturing its output into <current-branch/>. If <getopt-option-target/> is `current`, set <target><current-branch/></target>, otherwise set <target><getopt-option-target/></target>. If <target/> is empty (detached `HEAD`), expand the following:
<expand name="merge-fail" arg1="no target branch determinable"></expand>
4. For each of the branches <source/> and <target/>, run the command `git rev-parse --verify --quiet "refs/heads/<branch/>"` (with <branch/> substituted). If it fails for a branch, expand the following:
<expand name="merge-fail" arg1="branch **<branch/>** does not exist"></expand>
5. Determine the *worktrees* by running the command `git worktree list --porcelain` (taken exactly as given). Set <source-dir/> to the `worktree` path of the entry whose `branch` line is `refs/heads/<source/>` (or to empty if there is none), and set <target-dir/> to the `worktree` path of the entry whose `branch` line is `refs/heads/<target/>` (or to empty if there is none). Do not output anything.
</step>
2. <step id="STEP 2: Commit Pending Source Changes">
1. If <source-dir/> is empty, skip this entire STEP 2, as a branch not checked out anywhere carries no uncommitted changes.
2. Run the command `git -C "<source-dir/>" status --porcelain`. If its output is empty, skip the remaining items of this STEP 2.
3. Stage all changes by running the command `git -C "<source-dir/>" add --all`, inspect them by running the command `git -C "<source-dir/>" diff --cached`, and craft a commit <message/> in the format `<type/>: <summary/>`, where <type/> is one of `FEATURE`, `IMPROVEMENT`, `BUGFIX`, `UPDATE`, `CLEANUP`, or `REFACTOR` and <summary/> is a 60-80 character, imperative-mood summary without a trailing period, without Markdown formatting, and without any double-quote (`"`), backtick (`` ` ``), dollar (`$`), or backslash (`\`) characters.
4. Commit the changes by running the command `git -C "<source-dir/>" commit -m "<message/>"`. If it fails, unstage the changes again by running the command `git -C "<source-dir/>" reset --quiet` and expand the following:
<expand name="merge-fail" arg1="pending changes of branch **<source/>** failed to commit"></expand>
5. Capture the output of the command `git -C "<source-dir/>" rev-parse HEAD` into <source-commit/>. If <source/> equals <target/>, set <merged/> to `true`, as the committed changes already landed on the target branch.
6. Only output the following <template/>:
<template> ⧉ **ASE**: ✪ skill: **ase-repo-merge**, ⎇ branch: **<source/>**, ▶ status: **pending changes committed** </template>
</step>
3. <step id="STEP 3: Merge Source into Target">
1. If <source/> equals <target/>, skip this entire STEP 3, as the committed changes already landed on the target branch.
2. If <target-dir/> is empty, expand the following:
<expand name="merge-fail" arg1="target branch **<target/>** is not checked out in any worktree"></expand>
3. Run the command `git -C "<target-dir/>" status --
Repo: rse/ase
Show a nice greeting message with a timestamp. Use this when the user wants to greet or say…
Review software architecture, including package cohesion and inter-package coupling
Discover additional, third-party components (libraries/frameworks) for the technology stack…
Analyze the source code for problems in either the logic and semantics and its related…
Craft Source Code: Use when user wants to "create", "add", or "craft" a new feature from…
Edit Source Code: Use when the user wants to "edit" the code base in one shot from a query or…