merge
Intelligently merge branches with context-aware conflict resolution
- License 许可
- MIT
- 所属仓库
- zuzu59/z-skills
- 最近更新
- 2026-09-30
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- merge
- description
- Intelligently merge branches with context-aware conflict resolution
- allowed-tools
- Bash(git :*), Bash(gh :*), Read, Edit, MultiEdit, Task
- argument-hint
- <branch-name>
- disable-model-invocation
- true
- allow_implicit_invocation
- false
02 资源文件 2
- 参考文档agents/openai.yaml322 B
- 资产文件assets/codex-icon.svg431 B
03 SKILL.md 正文
Merge
Merge branches intelligently by understanding feature context and resolving conflicts efficiently.
Context
- Current branch: !
git branch --show-current - Working tree status: !
git status --short - Target branch: $1
- Recent commits: !
git log --oneline -5
Workflow
-
CONTEXT GATHERING:
git branch --show-currentto identify current branchgit statusto ensure clean working tree- CRITICAL: Abort if uncommitted changes exist
-
FEATURE ANALYSIS:
- Search PR with
gh pr list --head <branch-name> - Get PR details with
gh pr view <number> --json title,body,files - Use Task agents to gather context from PR/issue descriptions
- Search PR with
-
MERGE ATTEMPT:
git fetch origin <branch-name>git merge origin/<branch-name> --no-commit- Check status with
git status --porcelain
-
CONFLICT DETECTION:
- Clean merge:
git commitwith descriptive message - Conflicts: Parse
git diff --name-only --diff-filter=U
- Clean merge:
-
SMART RESOLUTION: For each conflicted file:
- Read file to understand conflict markers
- Apply resolution based on context:
- Feature additions: Keep both if non-overlapping
- Bug fixes: Prefer incoming if fixing known issue
- Refactors: Analyze intent and merge carefully
- Use MultiEdit to resolve all conflicts
- STOP: If >10 files conflicted, ask user
-
VERIFICATION:
git diff --cachedto review changes- Check no conflict markers remain:
grep -r "<<<<<<< HEAD" git add -Aand commit
Conflict Resolution by Type
- package.json: Merge dependencies, prefer higher versions
- Config files: Combine settings unless mutually exclusive
- Source code: Use PR/issue context to understand intent
- Tests: Keep all tests unless duplicates
- Imports: Merge all, deduplicate
Rules
- ALWAYS gather context before merging
- NEVER blindly accept theirs/ours without analysis
- ABORT if conflicts exceed 10 files
- Max 3 resolution attempts per file
- If stuck:
git merge --abortand report blockers
04 同仓库更多 Skills
writing-great-skills
Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
use-style
Apply named visual style guides to landing pages, app shells, and UI. Use for $use-style, /useskill, list styles, or styles like ios-app, grid, vercel, black-grid, stripe, linear, raycast, gumroad, dusk, or luma.
use-goal
Use when the user asks to create, draft, set, start, or refine a Codex or Claude Code `/goal` objective for persistent multi-turn work.
use-fable
Orchestrator mode for Fable: Fable thinks, plans, and reviews while Codex CLI and subagents execute all heavy work. Use when the user invokes /use-fable, says 'use fable', 'fable mode', 'orchestrator mode', or wants to save Fable tokens/rate limits.
use-delegate
Delegation mode: the host agent (Claude or Codex) plans and reviews while heavy work runs on cheap executors: OpenCode Kimi K3, Codex GPT-5.6 terra/sol. Use when the user invokes /use-delegate, says 'use delegate', 'delegate mode', 'orchestrator mode', or wants to save tokens/rate limits.
use-artifacts
Create Claude-style local HTML artifacts under ~/.agents/artifacts. Use for plans, prototypes, visualizations, dashboards, diagrams, options, or substantial reusable content, with a portable local runtime and no Anthropic API.