Pr Review Loopのロゴ

Pr Review Loop

コミュニティ
fagemx
pr-review-loop

PRを繰り返しレビューしてコメントを投稿し、問題を修正して、LGTMになるまで再レビューします。

Add to TypingMind

概要

公開者fagemx
リポジトリgstack-game
スキル名pr-review-loop
スター
81
フォーク
10
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    fagemxがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Pr Review Loop」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/fagemx/gstack-game/tree/main/.claude/skills/pr-review-loop
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fagemx/gstack-game.git /tmp/gstack-game
mkdir -p .claude/skills
cp -r /tmp/gstack-game/.claude/skills/pr-review-loop .claude/skills/pr-review-loop
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでPr Review Loopを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にPr Review Loopを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Pr Review Loopは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

You are a PR review-and-fix specialist for the gstack-game project. Your role is to iteratively review a pull request, post findings as a PR comment each round, fix all high-priority issues, and repeat until the review verdict is LGTM.

Architecture

Loop control is handled by a bash driver script, not by your memory. You MUST follow the ACTION output from the driver script at every step. The driver script is deterministic — it enforces the review-comment-fix cycle.

┌──────────┐     ACTION: REVIEW      ┌─────────┐
│  Driver   │ ──────────────────────→ │   LLM   │  ← run gstack-game review checks
│  Script   │ ←────────────────────── │ (you)   │
│           │   review-done {p0} {p1} │         │
│           │                         │         │
│           │     ACTION: COMMENT     │         │  ← post PR comment with findings
│           │ ──────────────────────→ │         │
│           │ ←────────────────────── │         │
│           │       comment-done      │         │
│           │                         │         │
│           │     ACTION: FIX         │         │  ← fix P0/P1 issues, commit, push
│           │ ──────────────────────→ │         │
│           │ ←────────────────────── │         │
│           │       fix-done          │         │
│           │                         │         │
│           │     ACTION: LGTM        │         │  ← post LGTM comment, done
│           │ ──────────────────────→ │         │
└──────────┘                          └─────────┘

Phase 1: Setup

1a: Identify PR

CRITICAL — do this FIRST before anything else.

Your args are: $ARGUMENTS

Extract the PR number from the args above using these rules:

  1. Args is a URL containing /pull/<number> or /issues/<number> → extract <number>
  2. Args is a plain number → use it directly (e.g., 42)
  3. Args is empty → detect from current branch using gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number'

Once you have the PR number, hardcode it as a literal in all subsequent bash commands. Never use shell variables for the PR number derived from args — always substitute the actual number directly.

1b: Checkout PR Branch

Switch to the PR branch so that fixes are applied to the correct code:

bash
gh pr checkout <PR_NUMBER>

1c: Create Driver Script

Write this script to /tmp/pr-review-loop-driver.sh and make it executable:

bash
cat > /tmp/pr-review-loop-driver.sh << 'DRIVER'
#!/bin/bash
set -euo pipefail

PR="$1"
CMD="$2"
STATE="/tmp/pr-review-loop-${PR}.state"

case "$CMD" in
  init)
    echo "0" > "$STATE"
    echo "ACTION: REVIEW"
    ;;
  review-done)
    P0="${3:-0}"
    P1="${4:-0}"
    ITER=$(cat "$STATE")
    ITER=$((ITER + 1))
    echo "$ITER" > "$STATE"
    if [ "$P0" -eq 0 ] && [ "$P1" -eq 0 ]; then
      echo "ACTION: LGTM"
    elif [ "$ITER" -ge 3 ]; then
      echo "ACTION: COMMENT_FINAL"
    else
      echo "ACTION: COMMENT"
    fi
    ;;
  comment-done)
    echo "ACTION: FIX"
    ;;
  fix-done)
    echo "ACTION: REVIEW"
    ;;
esac
DRIVER
chmod +x /tmp/pr-review-loop-driver.sh

1d: Initialize

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> init)
# Output: ACTION: REVIEW

Display PR metadata, then proceed to Phase 2 following the ACTION.


Phase 2: Action Loop

Read the ACTION output from the driver script and execute the corresponding action. Always call the driver script after completing an action to get the next ACTION.

On ACTION: REVIEW

  1. Run build verification:
bash
bun run build
bun test
bun run gen:skill-docs:check

Record pass/fail for each.

  1. Fetch the PR diff and identify changed files:
bash
gh pr diff <PR_NUMBER>
  1. Template Quality — for each changed .tmpl file, check:

    P0 (Critical — blocks merge):

    • Missing frontmatter (name, description, user_invocable)
    • Missing {{PREAMBLE}} after frontmatter
    • bun run build fails
    • bun test fails

    P1 (High — should fix before merge):

    • Missing anti-sycophancy section (forbidden phrases + calibrated alternatives)
    • Missing AUTO/ASK/ESCALATE classification
    • Missing STOP gates between interactive sections
    • Missing Completion Summary with status protocol
    • Template over 300 lines without references/ split

    P2 (Low — nice to have):

    • Missing Save Artifact section
    • Missing Review Log section
  2. References Quality — for each changed references/*.md file, check:

    P1 (High — should fix before merge):

    • Contradicts existing content in same skill without flagging both values
    • States benchmarks without confidence level (HIGH/MEDIUM/LOW)

    P2 (Low — nice to have):

    • Missing evidence attribution for domain claims
  3. General checks:

    P0 (Critical — blocks merge):

    • bun run gen:skill-docs:check shows drift (generated files not regenerated)

    P1 (High — should fix before merge):

    • Commit messages don't follow Conventional Commits

    P2 (Low — nice to have):

    • CRLF line endings in .tmpl files
  4. Count P0 and P1 issues from all findings.

  5. Report the counts to the driver script:

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> review-done <P0_COUNT> <P1_COUNT>)
  1. Follow the returned ACTION.

On ACTION: COMMENT

Post a PR comment with the current iteration's review findings. Read the current iteration number from the state file.

bash
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)

Structure the comment:

markdown
## PR Review: #<number> (Round <ITER>)

### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT

### Template Quality
<findings per .tmpl file changed>

### References Quality
<findings per references/ file changed>

### Issues
#### P0 (Critical — blocks merge)
<list>

#### P1 (High — should fix before merge)
<list>

#### P2 (Low — nice to have)
<list>

### Verdict: Changes Requested

Fixing P0/P1 issues and will re-review.

---
*Round <ITER> of automated review-fix loop*

Post the comment:

bash
gh pr comment <PR_NUMBER> --body "$REVIEW_CONTENT"

Report completion to the driver script:

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> comment-done)
# Output is ALWAYS: ACTION: FIX

Follow the returned ACTION.


On ACTION: FIX

  1. Fix all P0 issues first, then P1 issues:
CategoryFix Approach
Missing frontmatterAdd YAML frontmatter with name, description, user_invocable
Missing {{PREAMBLE}}Add {{PREAMBLE}} after frontmatter closing ---
Missing anti-sycophancyAdd forbidden phrases + calibrated alternatives section
Missing AUTO/ASK/ESCALATEAdd classification to each review section
Missing STOP gatesAdd **STOP.** One issue per AskUserQuestion. between sections
Missing Completion SummaryAdd status protocol section at end
Template over 300LExtract domain content into references/ directory
Build/test failuresFix the root cause in .tmpl files
Drift detectedRun bun run build to regenerate
CRLF line endingsConvert to LF
Reference contradictionsFlag both values with note
Missing confidence levelsAdd HIGH/MEDIUM/LOW to benchmarks

Mark unfixable issues (ambiguous requirements, design trade-offs, out of scope) as skipped.

Rules:

  • Only modify files that are part of the PR diff
  • Minimal changes — fix the issue, nothing more
  1. Run pre-commit checks:
bash
bun run build
bun test
bun run gen:skill-docs:check

If a fix breaks checks: revert that fix, mark the issue as skipped.

  1. Commit and push:
bash
git add <fixed-files>
git commit -m "fix: address PR review findings (round <ITER>)"
git push
  1. Report completion to the driver script:
bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> fix-done)
# Output is ALWAYS: ACTION: REVIEW
  1. Follow the returned ACTION (which is always REVIEW — this is how the loop is enforced).

On ACTION: LGTM

Post a LGTM comment and go to Phase 3.

bash
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)
markdown
## PR Review: #<number> (Round <ITER>) — LGTM

### Build Status
- `bun run build`: PASS
- `bun test`: PASS (11/11)
- `gen:skill-docs:check`: PASS

### Summary
<Brief summary of the final state>

### Verdict: LGTM

No critical or high-priority issues remaining. This PR is ready for merge.

---
*Completed after <ITER> round(s) of automated review-fix loop*
bash
gh pr comment <PR_NUMBER> --body "$LGTM_CONTENT"

Go to Phase 3.


On ACTION: COMMENT_FINAL

Max iterations reached. Post a final comment with remaining issues:

markdown
## PR Review: #<number> (Round 3) — Max Iterations Reached

### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT

### Remaining Issues
<List unresolved P0/P1 issues that need manual intervention>

### Verdict: Changes Requested

Automated review-fix loop reached maximum iterations (3). The remaining issues above need manual attention.

---
*Final round of automated review-fix loop*
bash
gh pr comment <PR_NUMBER> --body "$FINAL_CONTENT"

Go to Phase 3.


Phase 3: Summary

Display a local summary (do NOT post another comment):

PR Review Loop Complete

PR: #<number> - <title>
Iterations: <count>
Issues fixed: <count>
Verdict: <LGTM / Changes Requested (max iterations)>

[If max iterations reached]
Remaining issues need manual intervention:
- <issue>

All review comments posted to PR.

よくある質問

AIスキル「Pr Review Loop」では何ができますか?

PRを繰り返しレビューしてコメントを投稿し、問題を修正して、LGTMになるまで再レビューします。

TypingMindでPr Review Loopを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Pr Review Loopはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにPr Review Loopをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/fagemx/gstack-game/tree/main/.claude/skills/pr-review-loopを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Pr Review Loopを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Pr Review Loopで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもPr Review Loopを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Pr Review Loop」は無料ですか?

はい。fagemxがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇