本文へ移動
cccskills
無料GitHub で公開

land

Land a PR by monitoring conflicts, resolving them, waiting for checks, and squash-merging when green; use when asked to land, merge, or shepherd a PR to completion.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md4.7 KB
  • land_watch.py19.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Land

Goals

  • Ensure the PR is conflict-free with main.
  • Keep CI green and fix failures when they occur.
  • Squash-merge the PR once checks pass.
  • Do not yield to the user until the PR is merged; keep the watcher loop running unless blocked.
  • No need to delete remote branches after merge; the repo auto-deletes head branches.

Preconditions

  • gh CLI is authenticated.
  • You are on the PR branch with a clean working tree.

Steps

  1. Locate the PR for the current branch.
  2. Confirm validation passes locally before any push:
    • npm run compile
    • npm run lint
    • npm run test:unit
  3. If the working tree has uncommitted changes, commit with the commit skill and push with the push skill before proceeding.
  4. Check mergeability and conflicts against main.
  5. If conflicts exist, use the pull skill to fetch/merge origin/main and resolve conflicts, then use the push skill to publish the updated branch.
  6. Ensure review comments (if present) are acknowledged and any required fixes are handled before merging.
  7. Watch checks until complete.
  8. If checks fail, pull logs, fix the issue, commit with the commit skill, push with the push skill, and re-run checks.
  9. When all checks are green and review feedback is addressed, squash-merge and delete the branch using the PR title/body for the merge subject/body.
  10. Context guard: Before implementing review feedback, confirm it does not conflict with the user's stated intent or task context. If it conflicts, respond inline with a justification and ask the user before changing code.
  11. Pushback template: When disagreeing, reply inline with: acknowledge + rationale + offer alternative.
  12. Ambiguity gate: When ambiguity blocks progress, use the clarification flow (assign PR to current GH user, mention them, wait for response). Do not implement until ambiguity is resolved.
  13. Per-comment mode: For each review comment, choose one of: accept, clarify, or push back. Reply inline stating the mode before changing code.
  14. Reply before change: Always respond with intended action before pushing code changes.

Commands

# Ensure branch and PR context
branch=$(git branch --show-current)
pr_number=$(gh pr view --json number -q .number)
pr_title=$(gh pr view --json title -q .title)
pr_body=$(gh pr view --json body -q .body)

# Check mergeability and conflicts
mergeable=$(gh pr view --json mergeable -q .mergeable)

if [ "$mergeable" = "CONFLICTING" ]; then
  # Run the `pull` skill to handle fetch + merge + conflict resolution.
  # Then run the `push` skill to publish the updated branch.
fi

# Preferred: use the Async Watch Helper below.
while true; do
  sleep 10
done

# Watch checks
if ! gh pr checks --watch; then
  gh pr checks
  exit 1
fi

# Squash-merge (remote branches auto-delete on merge in this repo)
gh pr merge --squash --subject "$pr_title" --body "$pr_body"

Async Watch Helper

Preferred: use the asyncio watcher to monitor review comments, CI, and head updates in parallel:

python3 .codex/skills/land/land_watch.py

Exit codes:

  • 2: Review comments detected (address feedback)
  • 3: CI checks failed
  • 4: PR head updated (autofix commit detected)

Failure Handling

  • If checks fail, pull details with gh pr checks and gh run view --log, then fix locally, commit with the commit skill, push with the push skill, and re-run the watch.
  • Use judgment to identify flaky failures. If a failure is a flake (e.g., a timeout on only one platform), you may proceed without fixing it.
  • Ubuntu test timeouts are a known issue for this project — if tests pass on other platforms, treat the Ubuntu timeout as a flake.
  • If mergeability is UNKNOWN, wait and re-check.
  • Do not merge while review comments are outstanding.
  • Do not enable auto-merge; use the watcher loop instead.

Review Handling

  • Human review comments are blocking and must be addressed before merging.
  • All GitHub comments generated by this agent must be prefixed with [codex].
  • If feedback requires changes:
    • Reply with intended fixes ([codex] ...) as an inline reply.
    • Implement fixes, commit, push.
    • Reply with the fix details and commit sha.
  • Use review comment endpoints (not issue comments) to find inline feedback:
    • List PR review comments:
      gh api repos/{owner}/{repo}/pulls/<pr_number>/comments
      
    • Reply to a specific review comment:
      gh api -X POST /repos/{owner}/{repo}/pulls/<pr_number>/comments \
        -f body='[codex] <response>' -F in_reply_to=<comment_id>
      

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Design, review, and improve Claude/Codex skills based on Anthropic's "The Complete Guide to Building Skills for Claude". Use when creating a new skill, rewriting SKILL.md frontmatter and workflows, fixing under-triggering or over-triggering, designing scripts/references/assets, building test cases, or preparing a skill for upload/distribution.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

This skill enables web searching using Brave Search API directly via curl. Use when searching for current information, news, articles, or web content. MCP server not required - calls API directly.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Run code quality checks (ruff, mypy, pytest) and optionally simplify code. This skill should be used when the user wants to check code quality, run linters, run tests, or simplify recently modified code. Triggered by /lint, /check, or /code-quality commands.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Perform structured code reviews focusing on correctness, readability, security, and maintainability. Use this skill when reviewing pull requests, evaluating code changes, or establishing review standards for a team.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise. This skill should be used when code-quality checks pass but the code would benefit from structural cleanup — deduplication, branching simplification, naming improvements, or dead-code removal. Invoked as a subagent from /code-quality or directly via the Task tool.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. This skill should be used after implementing features or bug fixes to clean up code, when refactoring for readability, or when reducing unnecessary complexity. It launches the code-simplifier subagent provided by the code-simplifier@claude-plugins-official plugin.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

s-hiraoku のスキルをすべて見る

このスキルの問題を報告する