compose:merge

A workflow for finishing development work after implementation and tests are complete. It checks the repository state and presents choices such as merging the branch, opening a pull request, or cleaning up.

In plain words
What is it for?
Verifying tests, detecting whether work uses a normal branch or a separate worktree, carrying out the chosen merge or pull-request workflow, and cleaning up when appropriate.
Why use it?
It prevents unfinished branches from being merged without passing tests and makes the final integration decision explicit.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lfyxhappy/lfcode/merge
Any agent
npx skills add lfyxhappy/lfcode --skill merge
Clone the repo
git clone --depth 1 https://github.com/lfyxhappy/lfcode

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.02047
Opus 5 $0.00020 $0.01024
Sonnet 5 $0.00008 $0.00409
Haiku 4.5 $0.00004 $0.00205

Measured yesterday against content hash 2454974bfe26, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compose:merge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to compose:merge — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

packages/lfcode/src/skill/compose/.bundle/merge/SKILL.md · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Finishing a Development Branch

Overview

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

Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up.

Announce at start: "I'm using the compose:merge skill to complete this work."

The Process

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 with merge/PR until tests pass.

Stop. Don't proceed to Step 2.

If tests pass: Continue to Step 2.

Step 2: Detect Environment

Determine workspace state before presenting options:

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)

This determines which menu to show and how cleanup works:

State Menu Cleanup
GIT_DIR == GIT_COMMON (normal repo) Standard 4 options No worktree to clean up
GIT_DIR != GIT_COMMON, named branch Standard 4 options Provenance-based (see Step 6)
GIT_DIR != GIT_COMMON, detached HEAD Reduced 3 options (no merge) No cleanup (externally managed)

Step 3: Determine Base Branch

# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

If the base branch is ambiguous, confirm through compose:ask:

  • header: Base Branch
  • question: This branch appears to have split from <detected>. Correct?
  • options:
    • label: Yes, <detected>, description: Use <detected> as merge target
    • label: Different branch, description: I'll specify the correct base branch

If no user is available, use the detected base branch and proceed.

Step 4: Present Options

Normal repo / named-branch worktree — use compose:ask:

  • header: Complete Work
  • question: Implementation complete. What would you like to do?
  • options:
    • label: Merge locally, description: Merge back to <base-branch>
    • label: Create PR, description: Push branch and open a Pull Request
    • label: Keep as-is, description: Leave the branch — I'll handle it later
    • label: Discard, description: Delete branch and all commits

Read the full file on GitHub · 253 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 253 lines · 41 tokens per session scan A 2454974bfe26

Subscribe to this mod's changes

compose:merge is a skill published in the GitHub repository lfyxhappy/lfcode (2 stars, last pushed 1mo ago), licensed MIT. It adds 41 tokens to every session and 2,047 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to compose:merge, differing in 0 lines, and is treated as a copy.