[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754X21RA239XF2S2767D1Z1":3,"skill-same:01M754X21RA239XF2S2767D1Z1":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":50},"01M754X21RA239XF2S2767D1Z1","x-merge-branches",null,"Merges a source branch into a target branch locally with configurable strategy (merge\u002Fsquash\u002Frebase), automatic conflict detection + rollback, and idempotent no-op when target already contains source HEAD. Centralizes the ~120 lines of inline Bash previously in x-implement-epic Phase 1.4e auto-rebase.","review-bench\u002Federcnj_ia-dev-environment","review-bench","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F286778065?v=4","01M7517F9NTEPDZDAXJBR30FWT","ReviewBench","01M7517FAC9F4P7TGWCNJ8VYVW",0,"MIT","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-fintech-pci\u002F.claude\u002Fskills\u002Fx-merge-branches\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: x-merge-branches\ndescription: \"Merges a source branch into a target branch locally with configurable strategy (merge\u002Fsquash\u002Frebase), automatic conflict detection + rollback, and idempotent no-op when target already contains source HEAD. Centralizes the ~120 lines of inline Bash previously in x-implement-epic Phase 1.4e auto-rebase.\"\nuser-invocable: true\nallowed-tools: Bash, Read\nargument-hint: \"--source \u003Cbranch> --target \u003Cbranch> [--strategy merge|squash|rebase] [--message \u003Cmsg>] [--no-push]\"\ncontext-budget: medium\nrequires-capabilities: []\n---\n\n## Global Output Policy\n\n- **Language**: English ONLY.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: Local Git Merge with Conflict Rollback (x-merge-branches)\n\n## Purpose\n\nSingle, idempotent entry point for merging one local branch into another with three strategies (`merge` \u002F `squash` \u002F `rebase`), automatic conflict detection and rollback, and a structured result payload. Replaces ~120 lines of inline Bash in `x-implement-epic` Phase 1.4e (auto-rebase between parallel stories + `develop → epic\u002FXXXX` sync). Callers receive either `{mergeSha, conflicts:false}` or `{conflicts:true, rolledBack:true, conflictedFiles:[...]}` — never a half-merged working tree.\n\n## Triggers\n\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049` — default `merge` strategy, push after success\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049 --strategy squash --message \"sync develop\"` — squash with custom message\n- `\u002Fx-merge-branches --source feat\u002Ffoo --target develop --strategy rebase` — linear history via rebase\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049 --no-push` — merge locally only\n\n## Parameters\n\n| Argument | Type | Required | Default | Description |\n|----------|------|----------|---------|-------------|\n| `--source` | string | Yes | — | Source branch to merge from. Must exist locally. |\n| `--target` | string | Yes | — | Target branch that receives the merge. Must exist locally. |\n| `--strategy` | enum | No | `merge` | One of `merge` (default, `git merge --no-ff`), `squash` (`git merge --squash` + commit), `rebase` (`git rebase`). |\n| `--message` | string | No | auto | Commit message for `merge` \u002F `squash`. Ignored for `rebase`. Max 255 chars. |\n| `--no-push` | boolean | No | `false` | Skip `git push origin \u003Ctarget>` after a successful merge. |\n\n## Workflow\n\n```\n1. PARSE FLAGS     -> extract --source, --target, --strategy, --message, --no-push\n2. PRE-CHECKS      -> working tree clean; source exists; target exists\n3. CHECKOUT TARGET -> git checkout \u003Ctarget>\n4. IDEMPOTENCY     -> git merge-base --is-ancestor \u003Csource> \u003Ctarget> → noOp\n5. ATTEMPT MERGE   -> dispatch on strategy (merge | squash | rebase)\n6. DECIDE          -> success → capture mergeSha; conflict → abort + collect paths\n7. PUSH (OPT)      -> git push origin \u003Ctarget> when not --no-push and not noOp\n8. EMIT RESULT     -> structured JSON: mergeSha, conflicts, conflictedFiles, rolledBack, noOp\n```\n\n### Step 1 — Parse Flags\n\n```bash\nSOURCE=\"\"; TARGET=\"\"; STRATEGY=\"merge\"; MESSAGE=\"\"; NO_PUSH=\"false\"\nwhile [ $# -gt 0 ]; do\n  case \"$1\" in\n    --source)   SOURCE=\"$2\";   shift 2 ;;\n    --target)   TARGET=\"$2\";   shift 2 ;;\n    --strategy) STRATEGY=\"$2\"; shift 2 ;;\n    --message)  MESSAGE=\"$2\";  shift 2 ;;\n    --no-push)  NO_PUSH=\"true\"; shift ;;\n    *) echo \"ERROR: unknown flag: $1\" >&2; exit 1 ;;\n  esac\ndone\n[ -z \"$SOURCE\" ] && { echo \"ERROR: --source is required\" >&2; exit 1; }\n[ -z \"$TARGET\" ] && { echo \"ERROR: --target is required\" >&2; exit 1; }\ncase \"$STRATEGY\" in\n  merge|squash|rebase) ;;\n  *) echo \"ERROR: INVALID_STRATEGY — must be merge|squash|rebase\" >&2; exit 1 ;;\nesac\n```\n\n### Step 2 — Pre-Checks\n\n```bash\n# Working tree must be clean (RULE-004 preserves history; dirty tree risks loss)\nif [ -n \"$(git status --porcelain)\" ]; then\n  echo \"ERROR: WORKING_TREE_DIRTY — Working tree must be clean before merge\" >&2\n  exit 1\nfi\n\n# Source branch must exist locally\nif ! git rev-parse --verify --quiet \"$SOURCE\" >\u002Fdev\u002Fnull; then\n  echo \"ERROR: SOURCE_NOT_FOUND — Source branch '$SOURCE' not found\" >&2\n  exit 2\nfi\n\n# Target branch must exist locally\nif ! git rev-parse --verify --quiet \"$TARGET\" >\u002Fdev\u002Fnull; then\n  echo \"ERROR: TARGET_NOT_FOUND — Target branch '$TARGET' not found\" >&2\n  exit 3\nfi\n```\n\n### Step 3 — Checkout Target\n\n```bash\ngit checkout \"$TARGET\"\n```\n\n### Step 4 — Idempotency (No-Op Check)\n\n```bash\n# If target already contains source HEAD, nothing to merge\nif git merge-base --is-ancestor \"$SOURCE\" \"$TARGET\"; then\n  printf '{\"mergeSha\":null,\"conflicts\":false,\"conflictedFiles\":[],\"rolledBack\":false,\"noOp\":true}\\n'\n  exit 0\nfi\n```\n\n### Step 5 — Attempt Merge (Dispatch on Strategy)\n\n```bash\nCONFLICTS=\"false\"\ncase \"$STRATEGY\" in\n  merge)\n    if [ -n \"$MESSAGE\" ]; then\n      git merge --no-ff --no-edit -m \"$MESSAGE\" \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    else\n      git merge --no-ff --no-edit \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    fi\n    ;;\n  squash)\n    if ! git merge --squash \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err; then\n      CONFLICTS=\"true\"\n    else\n      MSG=\"${MESSAGE:-squash: merge $SOURCE into $TARGET}\"\n      git commit -m \"$MSG\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    fi\n    ;;\n  rebase)\n    git rebase \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    ;;\nesac\n```\n\n### Step 6 — Decide (Success or Conflict Rollback)\n\n```bash\nif [ \"$CONFLICTS\" = \"true\" ]; then\n  # Capture unmerged paths BEFORE aborting (diff-filter=U)\n  FILES=$(git diff --name-only --diff-filter=U 2>\u002Fdev\u002Fnull | tr '\\n' ' ' | sed 's\u002F $\u002F\u002F')\n  CONFLICTED_FILES=$(printf '%s' \"$FILES\" | awk 'BEGIN{printf \"[\"} \\\n    {for(i=1;i\u003C=NF;i++){if(i>1)printf \",\";printf \"\\\"%s\\\"\",$i}} END{print \"]\"}')\n\n  # Abort the partial operation\n  ABORT_CMD=\"git merge --abort\"\n  [ \"$STRATEGY\" = \"rebase\" ] && ABORT_CMD=\"git rebase --abort\"\n  if ! $ABORT_CMD 2>\u002Ftmp\u002Fabort.err; then\n    echo \"ERROR: ROLLBACK_FAILED — $ABORT_CMD failed; manual cleanup needed\" >&2\n    cat \u002Ftmp\u002Fabort.err >&2\n    exit 11\n  fi\n  printf '{\"mergeSha\":null,\"conflicts\":true,\"conflictedFiles\":%s,\"rolledBack\":true,\"noOp\":false}\\n' \\\n    \"$CONFLICTED_FILES\"\n  exit 10\nfi\n\nMERGE_SHA=$(git rev-parse HEAD)\n```\n\n### Step 7 — Optional Push\n\n```bash\nif [ \"$NO_PUSH\" != \"true\" ]; then\n  git push origin \"$TARGET\" || {\n    echo \"WARN: push failed; merge is committed locally but not pushed\" >&2\n  }\nfi\n```\n\n### Step 8 — Emit Structured Result\n\n```bash\nprintf '{\"mergeSha\":\"%s\",\"conflicts\":false,\"conflictedFiles\":[],\"rolledBack\":false,\"noOp\":false}\\n' \\\n  \"$MERGE_SHA\"\n```\n\n## Outputs\n\n| Field | Type | Always | Description |\n|-------|------|--------|-------------|\n| `mergeSha` | string(40) \\| null | Yes | SHA of the resulting merge \u002F squash \u002F rebase-HEAD commit; `null` on conflict or no-op |\n| `conflicts` | boolean | Yes | `true` when any conflict was detected during the merge attempt |\n| `conflictedFiles` | string[] | Yes | List of unmerged paths captured before rollback; `[]` on success \u002F no-op |\n| `rolledBack` | boolean | Yes | `true` when `git merge --abort` \u002F `git rebase --abort` executed successfully |\n| `noOp` | boolean | Yes | `true` when target already contained source HEAD (ancestor check) |\n\n## Error Codes\n\n| Exit | Code | Condition | Message |\n|------|------|-----------|---------|\n| 1 | `WORKING_TREE_DIRTY` | `git status --porcelain` non-empty | `Working tree must be clean before merge` |\n| 1 | `INVALID_STRATEGY` | `--strategy` not in {merge, squash, rebase} | `--strategy must be one of: merge, squash, rebase` |\n| 2 | `SOURCE_NOT_FOUND` | source branch missing locally | `Source branch '\u003Cname>' not found` |\n| 3 | `TARGET_NOT_FOUND` | target branch missing locally | `Target branch '\u003Cname>' not found` |\n| 10 | `MERGE_CONFLICT_ROLLED_BACK` | conflict detected, rollback succeeded | `Conflict in N files; merge aborted` |\n| 11 | `ROLLBACK_FAILED` | `git merge --abort` \u002F `git rebase --abort` failed | `Rollback failed; manual cleanup needed` |\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| `--source` or `--target` missing | exit 1; print usage hint |\n| `--strategy` invalid | exit 1 `INVALID_STRATEGY`; print accepted values |\n| Dirty working tree | exit 1 `WORKING_TREE_DIRTY`; no side effects |\n| Source\u002Ftarget branch missing | exit 2 \u002F 3 with suggestion `git fetch origin` |\n| Target already contains source HEAD | exit 0 with `noOp:true`; no commit, no push |\n| Conflict during merge\u002Fsquash\u002Frebase | capture `conflictedFiles`, abort, exit 10 `MERGE_CONFLICT_ROLLED_BACK` |\n| `git merge --abort` \u002F `git rebase --abort` fails | exit 11 `ROLLBACK_FAILED`; stderr carried verbatim; manual cleanup |\n| `git push` fails | WARN only; local merge is preserved; caller can retry push |\n\n## Examples\n\n```\n# Happy path — merge develop into epic\u002F0049, push after\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":\"abc123...\",\"conflicts\":false,...,\"noOp\":false}\n\n# No-op — target already contains source HEAD\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":null,...,\"noOp\":true}\n\n# Conflict with automatic rollback (exit 10)\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":null,\"conflicts\":true,\"conflictedFiles\":[\"a.md\"],\"rolledBack\":true,...}\n\n# Squash with custom commit message\n\u002Fx-merge-branches --source feat\u002Ffoo --target develop --strategy squash --message \"feat(foo): batch\"\n\n# Rebase feature branch onto develop (linear history, no push)\n\u002Fx-merge-branches --source develop --target feat\u002Ffoo --strategy rebase --no-push\n```\n\n## Rule References\n\n- **Rule 09** (Branching Model) — merge-direction rules and target-branch conventions.\n- **RULE-004** (EPIC-0049 — Estratégia de merge: preserva history) — default strategy `merge` with `--no-ff` preserves per-task TDD commits for bisect.\n- **RULE-005** (EPIC-0049 — Thin orchestrator) — `x-implement-epic` and `x-implement-story` delegate local merges here; no inline `git merge` blocks.\n- **RULE-010** (EPIC-0049 — Skills internas pequenas) — this SKILL.md stays under 250 lines.\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|--------------|---------|\n| `x-implement-epic` | caller (future refactor — story-0049-0018) | Phase 1.4e auto-rebase between parallel stories; `develop → epic\u002FXXXX` sync |\n| `x-implement-story` | caller (future refactor — story-0049-0019) | Optional auto-sync of story branch with parent epic branch |\n| `x-internal-ensure-epic-branch` | related (story-0049-0008) | Ensures `epic\u002FXXXX` exists before this skill merges `develop` into it |\n| `x-merge-pr` | sibling (story-0049-0003) | Remote PR merge via `gh pr merge`; this skill handles local-only merges |\n| `x-create-git-branch` | sibling (story-0049-0001) | Bare branch creation; this skill assumes both branches exist |\n","## Global Output Policy\n\n- **Language**: English ONLY.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: Local Git Merge with Conflict Rollback (x-merge-branches)\n\n## Purpose\n\nSingle, idempotent entry point for merging one local branch into another with three strategies (`merge` \u002F `squash` \u002F `rebase`), automatic conflict detection and rollback, and a structured result payload. Replaces ~120 lines of inline Bash in `x-implement-epic` Phase 1.4e (auto-rebase between parallel stories + `develop → epic\u002FXXXX` sync). Callers receive either `{mergeSha, conflicts:false}` or `{conflicts:true, rolledBack:true, conflictedFiles:[...]}` — never a half-merged working tree.\n\n## Triggers\n\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049` — default `merge` strategy, push after success\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049 --strategy squash --message \"sync develop\"` — squash with custom message\n- `\u002Fx-merge-branches --source feat\u002Ffoo --target develop --strategy rebase` — linear history via rebase\n- `\u002Fx-merge-branches --source develop --target epic\u002F0049 --no-push` — merge locally only\n\n## Parameters\n\n| Argument | Type | Required | Default | Description |\n|----------|------|----------|---------|-------------|\n| `--source` | string | Yes | — | Source branch to merge from. Must exist locally. |\n| `--target` | string | Yes | — | Target branch that receives the merge. Must exist locally. |\n| `--strategy` | enum | No | `merge` | One of `merge` (default, `git merge --no-ff`), `squash` (`git merge --squash` + commit), `rebase` (`git rebase`). |\n| `--message` | string | No | auto | Commit message for `merge` \u002F `squash`. Ignored for `rebase`. Max 255 chars. |\n| `--no-push` | boolean | No | `false` | Skip `git push origin \u003Ctarget>` after a successful merge. |\n\n## Workflow\n\n```\n1. PARSE FLAGS     -> extract --source, --target, --strategy, --message, --no-push\n2. PRE-CHECKS      -> working tree clean; source exists; target exists\n3. CHECKOUT TARGET -> git checkout \u003Ctarget>\n4. IDEMPOTENCY     -> git merge-base --is-ancestor \u003Csource> \u003Ctarget> → noOp\n5. ATTEMPT MERGE   -> dispatch on strategy (merge | squash | rebase)\n6. DECIDE          -> success → capture mergeSha; conflict → abort + collect paths\n7. PUSH (OPT)      -> git push origin \u003Ctarget> when not --no-push and not noOp\n8. EMIT RESULT     -> structured JSON: mergeSha, conflicts, conflictedFiles, rolledBack, noOp\n```\n\n### Step 1 — Parse Flags\n\n```bash\nSOURCE=\"\"; TARGET=\"\"; STRATEGY=\"merge\"; MESSAGE=\"\"; NO_PUSH=\"false\"\nwhile [ $# -gt 0 ]; do\n  case \"$1\" in\n    --source)   SOURCE=\"$2\";   shift 2 ;;\n    --target)   TARGET=\"$2\";   shift 2 ;;\n    --strategy) STRATEGY=\"$2\"; shift 2 ;;\n    --message)  MESSAGE=\"$2\";  shift 2 ;;\n    --no-push)  NO_PUSH=\"true\"; shift ;;\n    *) echo \"ERROR: unknown flag: $1\" >&2; exit 1 ;;\n  esac\ndone\n[ -z \"$SOURCE\" ] && { echo \"ERROR: --source is required\" >&2; exit 1; }\n[ -z \"$TARGET\" ] && { echo \"ERROR: --target is required\" >&2; exit 1; }\ncase \"$STRATEGY\" in\n  merge|squash|rebase) ;;\n  *) echo \"ERROR: INVALID_STRATEGY — must be merge|squash|rebase\" >&2; exit 1 ;;\nesac\n```\n\n### Step 2 — Pre-Checks\n\n```bash\n# Working tree must be clean (RULE-004 preserves history; dirty tree risks loss)\nif [ -n \"$(git status --porcelain)\" ]; then\n  echo \"ERROR: WORKING_TREE_DIRTY — Working tree must be clean before merge\" >&2\n  exit 1\nfi\n\n# Source branch must exist locally\nif ! git rev-parse --verify --quiet \"$SOURCE\" >\u002Fdev\u002Fnull; then\n  echo \"ERROR: SOURCE_NOT_FOUND — Source branch '$SOURCE' not found\" >&2\n  exit 2\nfi\n\n# Target branch must exist locally\nif ! git rev-parse --verify --quiet \"$TARGET\" >\u002Fdev\u002Fnull; then\n  echo \"ERROR: TARGET_NOT_FOUND — Target branch '$TARGET' not found\" >&2\n  exit 3\nfi\n```\n\n### Step 3 — Checkout Target\n\n```bash\ngit checkout \"$TARGET\"\n```\n\n### Step 4 — Idempotency (No-Op Check)\n\n```bash\n# If target already contains source HEAD, nothing to merge\nif git merge-base --is-ancestor \"$SOURCE\" \"$TARGET\"; then\n  printf '{\"mergeSha\":null,\"conflicts\":false,\"conflictedFiles\":[],\"rolledBack\":false,\"noOp\":true}\\n'\n  exit 0\nfi\n```\n\n### Step 5 — Attempt Merge (Dispatch on Strategy)\n\n```bash\nCONFLICTS=\"false\"\ncase \"$STRATEGY\" in\n  merge)\n    if [ -n \"$MESSAGE\" ]; then\n      git merge --no-ff --no-edit -m \"$MESSAGE\" \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    else\n      git merge --no-ff --no-edit \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    fi\n    ;;\n  squash)\n    if ! git merge --squash \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err; then\n      CONFLICTS=\"true\"\n    else\n      MSG=\"${MESSAGE:-squash: merge $SOURCE into $TARGET}\"\n      git commit -m \"$MSG\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    fi\n    ;;\n  rebase)\n    git rebase \"$SOURCE\" 2>\u002Ftmp\u002Fmerge.err || CONFLICTS=\"true\"\n    ;;\nesac\n```\n\n### Step 6 — Decide (Success or Conflict Rollback)\n\n```bash\nif [ \"$CONFLICTS\" = \"true\" ]; then\n  # Capture unmerged paths BEFORE aborting (diff-filter=U)\n  FILES=$(git diff --name-only --diff-filter=U 2>\u002Fdev\u002Fnull | tr '\\n' ' ' | sed 's\u002F $\u002F\u002F')\n  CONFLICTED_FILES=$(printf '%s' \"$FILES\" | awk 'BEGIN{printf \"[\"} \\\n    {for(i=1;i\u003C=NF;i++){if(i>1)printf \",\";printf \"\\\"%s\\\"\",$i}} END{print \"]\"}')\n\n  # Abort the partial operation\n  ABORT_CMD=\"git merge --abort\"\n  [ \"$STRATEGY\" = \"rebase\" ] && ABORT_CMD=\"git rebase --abort\"\n  if ! $ABORT_CMD 2>\u002Ftmp\u002Fabort.err; then\n    echo \"ERROR: ROLLBACK_FAILED — $ABORT_CMD failed; manual cleanup needed\" >&2\n    cat \u002Ftmp\u002Fabort.err >&2\n    exit 11\n  fi\n  printf '{\"mergeSha\":null,\"conflicts\":true,\"conflictedFiles\":%s,\"rolledBack\":true,\"noOp\":false}\\n' \\\n    \"$CONFLICTED_FILES\"\n  exit 10\nfi\n\nMERGE_SHA=$(git rev-parse HEAD)\n```\n\n### Step 7 — Optional Push\n\n```bash\nif [ \"$NO_PUSH\" != \"true\" ]; then\n  git push origin \"$TARGET\" || {\n    echo \"WARN: push failed; merge is committed locally but not pushed\" >&2\n  }\nfi\n```\n\n### Step 8 — Emit Structured Result\n\n```bash\nprintf '{\"mergeSha\":\"%s\",\"conflicts\":false,\"conflictedFiles\":[],\"rolledBack\":false,\"noOp\":false}\\n' \\\n  \"$MERGE_SHA\"\n```\n\n## Outputs\n\n| Field | Type | Always | Description |\n|-------|------|--------|-------------|\n| `mergeSha` | string(40) \\| null | Yes | SHA of the resulting merge \u002F squash \u002F rebase-HEAD commit; `null` on conflict or no-op |\n| `conflicts` | boolean | Yes | `true` when any conflict was detected during the merge attempt |\n| `conflictedFiles` | string[] | Yes | List of unmerged paths captured before rollback; `[]` on success \u002F no-op |\n| `rolledBack` | boolean | Yes | `true` when `git merge --abort` \u002F `git rebase --abort` executed successfully |\n| `noOp` | boolean | Yes | `true` when target already contained source HEAD (ancestor check) |\n\n## Error Codes\n\n| Exit | Code | Condition | Message |\n|------|------|-----------|---------|\n| 1 | `WORKING_TREE_DIRTY` | `git status --porcelain` non-empty | `Working tree must be clean before merge` |\n| 1 | `INVALID_STRATEGY` | `--strategy` not in {merge, squash, rebase} | `--strategy must be one of: merge, squash, rebase` |\n| 2 | `SOURCE_NOT_FOUND` | source branch missing locally | `Source branch '\u003Cname>' not found` |\n| 3 | `TARGET_NOT_FOUND` | target branch missing locally | `Target branch '\u003Cname>' not found` |\n| 10 | `MERGE_CONFLICT_ROLLED_BACK` | conflict detected, rollback succeeded | `Conflict in N files; merge aborted` |\n| 11 | `ROLLBACK_FAILED` | `git merge --abort` \u002F `git rebase --abort` failed | `Rollback failed; manual cleanup needed` |\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| `--source` or `--target` missing | exit 1; print usage hint |\n| `--strategy` invalid | exit 1 `INVALID_STRATEGY`; print accepted values |\n| Dirty working tree | exit 1 `WORKING_TREE_DIRTY`; no side effects |\n| Source\u002Ftarget branch missing | exit 2 \u002F 3 with suggestion `git fetch origin` |\n| Target already contains source HEAD | exit 0 with `noOp:true`; no commit, no push |\n| Conflict during merge\u002Fsquash\u002Frebase | capture `conflictedFiles`, abort, exit 10 `MERGE_CONFLICT_ROLLED_BACK` |\n| `git merge --abort` \u002F `git rebase --abort` fails | exit 11 `ROLLBACK_FAILED`; stderr carried verbatim; manual cleanup |\n| `git push` fails | WARN only; local merge is preserved; caller can retry push |\n\n## Examples\n\n```\n# Happy path — merge develop into epic\u002F0049, push after\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":\"abc123...\",\"conflicts\":false,...,\"noOp\":false}\n\n# No-op — target already contains source HEAD\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":null,...,\"noOp\":true}\n\n# Conflict with automatic rollback (exit 10)\n\u002Fx-merge-branches --source develop --target epic\u002F0049\n# -> {\"mergeSha\":null,\"conflicts\":true,\"conflictedFiles\":[\"a.md\"],\"rolledBack\":true,...}\n\n# Squash with custom commit message\n\u002Fx-merge-branches --source feat\u002Ffoo --target develop --strategy squash --message \"feat(foo): batch\"\n\n# Rebase feature branch onto develop (linear history, no push)\n\u002Fx-merge-branches --source develop --target feat\u002Ffoo --strategy rebase --no-push\n```\n\n## Rule References\n\n- **Rule 09** (Branching Model) — merge-direction rules and target-branch conventions.\n- **RULE-004** (EPIC-0049 — Estratégia de merge: preserva history) — default strategy `merge` with `--no-ff` preserves per-task TDD commits for bisect.\n- **RULE-005** (EPIC-0049 — Thin orchestrator) — `x-implement-epic` and `x-implement-story` delegate local merges here; no inline `git merge` blocks.\n- **RULE-010** (EPIC-0049 — Skills internas pequenas) — this SKILL.md stays under 250 lines.\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|--------------|---------|\n| `x-implement-epic` | caller (future refactor — story-0049-0018) | Phase 1.4e auto-rebase between parallel stories; `develop → epic\u002FXXXX` sync |\n| `x-implement-story` | caller (future refactor — story-0049-0019) | Optional auto-sync of story branch with parent epic branch |\n| `x-internal-ensure-epic-branch` | related (story-0049-0008) | Ensures `epic\u002FXXXX` exists before this skill merges `develop` into it |\n| `x-merge-pr` | sibling (story-0049-0003) | Remote PR merge via `gh pr merge`; this skill handles local-only merges |\n| `x-create-git-branch` | sibling (story-0049-0001) | Bare branch creation; this skill assumes both branches exist |\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":25,"context-budget":26,"user-invocable":27,"requires-capabilities":28},"Bash, Read","--source \u003Cbranch> --target \u003Cbranch> [--strategy merge|squash|rebase] [--message \u003Cmsg>] [--no-push]","medium",true,[],"main","952a630c6f38d193a349d86fa18db1de8843e837","src\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-fintech-pci\u002F.claude\u002Fskills\u002Fx-merge-branches",1,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment","https:\u002F\u002Fgithub.com\u002Freview-bench","https:\u002F\u002Freview-bench.ai","An open benchmark for AI code review.","2026-10-27 06:56:37",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":27},[40,43,46],{"tool":41,"command":42},"npx","npx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-merge-branches",{"tool":44,"command":45},"bunx","bunx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-merge-branches",{"tool":47,"command":48},"pnpm","pnpm dlx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-merge-branches","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-fintech-pci\u002F.claude\u002Fskills\u002Fx-merge-branches\u002FSKILL.md",[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M757M8J48TQ1Y3X25GSJBXAS","x-parallel-eval","Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan \u002F x-story-plan, applies the parallelism-heuristics knowledge pack (hard \u002F regen \u002F soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fx-parallel-eval\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M757M57XMR9546S69466HDWT","parallelism-heuristics","Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard \u002F regen \u002F soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fparallelism-heuristics\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M757M11SZ8P1VCQABT08QVYA","x-watch-pr-ci","Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-watch-pr-ci\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M757KW53K8KFPGADFB4PH949","x-validate-docs","Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared\u002Fauto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-validate-docs\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M757KQZHSA10MKC0CR571D60","x-update-system-architecture","Incrementally updates docs\u002Farchitecture\u002Fsystem.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component\u002Fintegration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-update-system-architecture\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M757KKBT5Q1SVF8DMJBVF46M","x-update-architecture","Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-update-architecture\u002FSKILL.md",[],[]]