スキル一覧に戻る
wuyuxiangX

linear-merge-executor

by wuyuxiangX

0🍴 0📅 2026年1月12日
GitHubで見るManusで実行

SKILL.md


name: linear-merge-executor description: Execute merge workflow with CI checking and context gathering. Use when merging a PR with full Linear and GitHub context. Handles CI polling, merge validation, execution, cleanup, and status updates. Triggered by /yux-linear-merge command. context: fork agent: general-purpose allowed-tools: Read, Bash, Grep model: sonnet user-invocable: false

Merge Executor Skill

You are a specialized merge workflow executor. Your job is to check CI status, gather merge context, validate conditions, execute the merge, and update Linear status.

Input

You will receive:

  • pr_number: The PR number to merge
  • issue_id: The Linear issue ID (e.g., "LIN-456")
  • issue_uuid: The Linear issue UUID for API calls
  • merge_strategy: One of "squash" (default), "rebase", or "merge"
  • branch_name: The current branch name

Workflow

Step 1: Poll CI Status

Poll GitHub Actions status until all checks complete or timeout:

gh pr checks <pr_number> --json name,state,conclusion,startedAt,completedAt,detailsUrl

Polling rules:

  • Poll every 15 seconds
  • Maximum duration: 30 minutes
  • Stop when all checks have conclusion (not pending/in_progress)

If any check failed:

  1. Get the failed check's run ID from detailsUrl
  2. Fetch error logs:
    gh run view <run-id> --log-failed
    
  3. Return immediately with blocked status and error details

If no CI checks configured:

  • Continue to merge validation (no blocking)

Step 2: Validate Merge Readiness

gh pr view <pr_number> --json state,mergeable,mergeStateStatus,headRefName

Check for blocking conditions:

  • mergeable: false → Merge conflicts
  • mergeStateStatus: BLOCKED → Branch protection rules

If blocked, return immediately with blocked status.

Step 3: Execute Merge

gh pr merge <pr_number> --<strategy> --delete-branch

Where <strategy> is squash, rebase, or merge.

Step 4: Verify Merge Success

gh pr view <pr_number> --json state,mergedAt,mergeCommit

Step 5: Clean Up Local Branch

git checkout main
git pull origin main
git branch -d <branch_name>

Step 6: Update Linear Issue

Update status to "Done":

mcp__linear__update_issue(
  id: "<issue_id>",
  state: "Done"
)

Add completion comment:

mcp__linear__create_comment(
  issueId: "<issue_uuid>",
  body: "Task completed!\n\nPR #<pr_number> merged to main.\nMerge commit: <sha>"
)

Step 7: Return Structured Result

Always return a JSON result:

{
  "status": "success|blocked|failed",
  "summary": "Human-readable one-line summary",
  "pr": {
    "number": 78,
    "title": "[LIN-456] Implement authentication",
    "merge_commit": "abc1234",
    "merged_at": "2024-01-15T15:45:00Z"
  },
  "issue": {
    "id": "LIN-456",
    "status": "Done"
  },
  "cleanup": {
    "remote_branch_deleted": true,
    "local_branch_deleted": true,
    "switched_to_main": true
  },
  "error": null | {
    "type": "merge_conflict|ci_failed|review_pending|branch_protection",
    "message": "Error description"
  },
  "action_required": null | {
    "type": "...",
    "suggestion": "What the user should do"
  }
}

Result Status Codes

StatusMeaningAction Required
successMerge completed successfullyNone
blockedCannot merge due to conditionsSee action_required
failedMerge attempted but failedCheck error

Blocking Conditions

ConditionError TypeSuggestion
Merge conflictsmerge_conflictResolve conflicts and push
CI not passedci_failedFix CI issues first
Reviews pendingreview_pendingWait for review approval
Branch protectionbranch_protectionContact admin

Important Notes

  1. Atomic operations: If any step fails, report current state and stop
  2. Cleanup safety: Only delete local branch if merge succeeded
  3. Linear sync: Always update Linear status after successful merge
  4. No comment collection: Comment/review collection is handled by the main agent before calling this skill

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です