Skip to content
Agentmart
Submit a tool

fix-to-merge

PRのコードレビューを別コンテキストで実施し、A評価になるまで修正を繰り返します。コンフリクト解消も行い、マージ可能な状態にします。

Skill by ohzono

IndexedMIT★ 3
Write a review

Chalk Labs

Need help deploying fix-to-merge?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ohzono-fix-to-merge

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

PRのコードレビューを別コンテキストで実施し、A評価になるまで修正を繰り返します。コンフリクト解消も行い、マージ可能な状態にします。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/fix-to-merge

Tools it pre-approves 9

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read,
  • Glob,
  • Grep,
  • Edit,
  • Write,
  • Bash,
  • WebSearch,
  • Skill,
  • Task

What's inside

Skill name
fix-to-merge
Description
PRのコードレビューを別コンテキストで実施し、A評価になるまで修正を繰り返します。コンフリクト解消も行い、マージ可能な状態にします。
License
MIT
Allowed tools
Read,, Glob,, Grep,, Edit,, Write,, Bash,, WebSearch,, Skill,, Task
Instructions
380 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Fix to Merge

PRを「A評価 + コンフリクトなし + CI通過」の状態にするまで、レビューと修正を自動で繰り返します。

## 引数について

- **$ARGUMENTS**: 対象PRの指定
  - **PR番号**: `#123` または `123`
  - **指定なし**: 現在のブランチに紐づくPRを自動検出

## 実行フロー

```
┌─────────────────┐
│ 1. PR特定        │
└────────┬────────┘
         ▼
┌─────────────────┐
│ 2. レビュー方式  │
│    判定          │
└────────┬────────┘
         ▼
┌─────────────────┐
│ 3. コンフリクト  │──── あり ──→ 解消してコミット
│    チェック      │
└────────┬────────┘
         ▼ なし
┌─────────────────┐
│ 4. コードレビュー │◄──────────────────┐
│   (別コンテキスト)│                    │
└────────┬────────┘                    │
         ▼                             │
┌─────────────────┐                    │
│ 5. 評価判定      │                    │
│   A → Step 8     │                    │
│   B/C → Step 6   │                    │
│   D → 中止       │                    │
└────────┬────────┘                    │
         ▼ B/C                         │
┌─────────────────┐                    │
│ 6. 指摘修正      │                    │
│   + コミット&push │  (最大5回ループ) │
└────────┬────────┘                    │
         ▼                             │
┌─────────────────┐                    │
│ 7. CI結果待機    │────────────────────┘
│  (最大10分)     │  pass→8, fail→修正→4
└─────────────────┘
         
┌─────────────────┐
│ 8. 最終確認      │
│   + マージ準備完了 │
└─────────────────┘
```

## Step 1: PR特定と既存フィードバックの収集

```bash
# 引数からPR番号を取得、なければ現在のブランチから検出
PR_NUMBER=$ARGUMENTS
if [ -z "$PR_NUMBER" ]; then
  PR_NUMBER=$(gh pr view --json number -q '.number')
fi

# PR情報を取得
gh pr view $PR_NUMBER --json title,body,baseRefName,headRefName,additions,deletions,changedFiles,mergeable,mergeStateStatus
```

PR が見つからない場合はエラーメッセージを表示して終了。

### 既存のレビューフィードバックを取得(必須)

**重要**: ローカルで再レビューする前に、PR上に既に投稿されているコメント・レビュースレッドを必ず取得する。人間レビュアーや CodeRabbit / Copilot などが既に指摘している内容を見落として「ユーザーに確認してください」と返すのを防ぐため。

```bash
# Issue風コメント(PR本文へのコメント)
gh pr view $PR_NUMBER --json comments \
  --jq '.comments[] | "[" + .author.login + "] " + .body'

# Review本体(approve/request_changes/comment のサマリーボディ)
gh api repos/{owner}/{repo}/pulls/$PR_NUMBER/reviews \
  --jq '.[] | select(.body != "") | "[" + .user.login + ":" + .state + "] " + .body'

# 行単位のレビューコメント(diff上にぶら下がる指摘)
gh api repos/{owner}/{repo}/pulls/$PR_NUMBER/comments \
  --jq '.[] | "[" + .user.login + "] " + .path + ":" + (.line|tostring) + " - " + .body'
```

`{owner}/{repo}` は `gh repo view --json nameWithOwner -q '.nameWithOwner'` で取得できる。

取得したコメントは Step 4 のレビュー前にチェックリスト化し、「未対応の指摘」として後続のレビュー結果とマージする。既に PR 上で指摘済みの内容を見落とさないこと。

## Step 2: レビュー方式の判定

CI に AI PR reviewer が設定されているか確認する:

```bash
gh pr checks $PR_NUMBER 2>/dev/null | grep -iE '(ai.review|code.review|pr.review)' || echo "NOT_FOUND"
```

| 結果 | レビュー方式 |
|------|-------------|
| AI reviewer チェックが存在 | CI の AI reviewer 結果を待ち、その指摘を修正 |
| `NOT_FOUND` | **ローカルで Task を使い `app-reviewer` を別コンテキスト起動**(デフォルト) |

大半のプロジェクトでは CI に AI reviewer は未設定のため、ローカル Task によるレビューがデフォルト動作です。

## Step 3: コンフリクトチェック&解消

```bash
# マージ可能性を確認
gh pr view $PR_NUMBER --json mergeable,mergeStateStatus
```

**mergeable が CONFLICTING の場合:**

`Skill` ツールで `pr-conflict-resolution` スキルを読み込み、コンフリクトを解消する。

```bash

From ohzono/native-app-fullcycle, MIT.

More from ohzono/native-app-fullcycle

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Jun 18, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ohzono

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get fix-to-merge running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying fix-to-merge?

CallGet help
Cite this page

fix-to-merge skill. Agent Mart. https://agentmart.dev/skills/ohzono-fix-to-merge (last updated 2026-10-24)