Pm Pr Workflowのロゴ

Pm Pr Workflow

コミュニティ
bobmatnyc
pm-pr-workflow

ブランチ保護とPR作成のワークフロー

Add to TypingMind

概要

公開者bobmatnyc
リポジトリclaude-mpm
スキル名pm-pr-workflow
スター
152
フォーク
34
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

PR Workflow and Branch Protection

Branch Protection Enforcement

CRITICAL: PM must enforce branch protection for main branch.

Detection (run before any main branch operation)

bash
git config user.email

Routing Rules

  • User is bobmatnyc@users.noreply.github.com → Can push directly to main (if explicitly requested)
  • Any other user → MUST use feature branch + PR workflow

User Request Translation

When non-privileged users request main branch operations:

User RequestPM Action
"commit to main""Creating feature branch workflow instead"
"push to main""Branch protection requires PR workflow"
"merge to main""Creating PR for review"

Error Prevention: PM proactively guides non-privileged users to correct workflow (don't wait for git errors).

Worktree-First Branch Setup

Check workflow.worktree.enabled (default: true) before starting any issue branch.

When enabled (default)

Replace the plain branch checkout with a git worktree:

bash
# Create the worktree and branch in one step
git worktree add .claude/worktrees/issue-N-<slug> -b feat/N-<slug>

# All engineering work happens inside the worktree
cd .claude/worktrees/issue-N-<slug>

The source directory (repo/) stays on main throughout; only the worktree directory advances on the feature branch.

Post-merge cleanup (after squash-merge lands on main):

bash
# Remove the worktree
git worktree remove .claude/worktrees/issue-N-<slug>
git branch -d feat/N-<slug>   # delete the local tracking branch

# Pull latest main in the source dir
git pull
  • Only run after confirming the squash-merge has landed on main.
  • If the worktree has untracked files git will refuse removal — inspect with git -C .claude/worktrees/issue-N-<slug> status first.
  • After inspecting: commit or stash any work you want to keep, then retry git worktree remove; or use --force only if you are certain the files are disposable.

When disabled (opt-out)

Set workflow.worktree.enabled: false in .claude-mpm/config.yaml to fall back to the standard branch checkout approach below:

bash
git checkout -b feat/N-<slug>

PR Workflow Delegation

Default: Main-based PRs (unless user explicitly requests stacked)

When User Requests PRs

  • Single ticket → One PR (no question needed)
  • Independent features → Main-based (no question needed)
  • User says "stacked" or "dependent" → Stacked PRs (no question needed)

Recommend Main-Based When

  • User doesn't specify preference
  • Independent features or bug fixes
  • Multiple agents working in parallel
  • Simple enhancements

Recommend Stacked PRs When

  • User explicitly requests "stacked" or "dependent" PRs
  • Large feature with clear phase dependencies
  • User is comfortable with rebase workflows

Always delegate to version-control agent with strategy parameters.

PR Creation Workflow

Footer Branding (required)

Always append the canonical MPM footer to PR bodies and commit messages:

🤖👥 Generated with [Claude MPM](https://github.com/bobmatnyc/claude-mpm)

Never use Claude Code's default 🤖 Generated with [Claude Code] footer. MPM only overrides the commit trailer (Co-Authored-By), so the "Generated with" footer must be set explicitly to the canonical MPM string — otherwise the Claude Code default leaks into GitHub PRs and issues. The Co-Authored-By: Claude MPM <https://github.com/bobmatnyc/claude-mpm> trailer is separate and stays as-is.

When creating PRs, delegate to version-control agent with:

Task:
  agent: "version-control"
  task: "Create PR for {feature}"
  context: |
    Work completed: {summary}
    Files changed: {file_list}
    Tests: {test_status}
    QA verification: {qa_evidence}
  acceptance_criteria:
    - Create feature branch from main
    - Push all commits to feature branch
    - Create PR with proper description
    - Link ticket if applicable
    - Request reviews if needed

Code Review (If Available)

After the PR is created and CI passes, the PM checks whether trusty-review is available before proceeding to squash-merge.

Availability Check

Call mcp__trusty-review__review_health. Treat trusty-review as available if and only if:

  • status == "ok" AND
  • reviewer_model is set (non-empty string)

If the health call throws an exception, returns a non-ok status, or returns an empty reviewer_model, skip the review step entirely — never block or warn the user about trusty-review being unavailable.

Note: Once the upstream health endpoint exposes an inference field, also require inference == "ok" as part of the availability check.

When Available

The PM calls mcp__trusty-review__review_pr(owner, repo, pr_number) directly (PM has MCP tool access). Route the verdict as follows:

VerdictAction
APPROVE or APPROVE*Proceed to squash-merge
REQUEST_CHANGESDelegate findings to Engineer for remediation; re-run CI before merge
BLOCKDo not merge; escalate immediately to the user
UNKNOWN or tool errorFail open — proceed to squash-merge with a note that review was inconclusive

When Unavailable

Skip silently. Do not surface any message to the user about trusty-review being down. The PR workflow continues to squash-merge as normal.

Common Patterns

Single Feature PR

bash
# Feature branch → PR → Main
feature/user-auth → PR #123 → main

Stacked PRs (when requested)

bash
# Stacked feature development
feature/auth-base → PR #123 → main
feature/oauth (based on auth-base) → PR #124 → feature/auth-base
feature/session (based on oauth) → PR #125 → feature/oauth

Bug Fix PR

bash
# Hotfix branch → PR → Main
fix/login-error → PR #126 → main

Branch Protection Checklist

Before any main branch operation:

  • Check git user email
  • Verify user has main branch access
  • If not privileged user, route to feature branch workflow
  • Create clear user messaging about branch protection

Integration with Git File Tracking

All file tracking should happen on feature branches before PR creation:

  1. Agent creates files
  2. PM tracks files immediately (git add + commit)
  3. PM delegates PR creation to version-control
  4. version-control pushes branch and creates PR

This ensures all work is tracked before entering PR workflow.

よくある質問

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

ブランチ保護とPR作成のワークフロー

TypingMindでPm Pr Workflowを使うメリットは何ですか?

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

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

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

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

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

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

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

AIスキル「Pm Pr Workflow」は無料ですか?

bobmatnycがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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