pr

pr is a command for Claude Code from synaptiai/synapti-marketplace. It costs 27 tokens per session (6,022 once invoked), scanned A, original, Apache-2.0.

A command for creating a GitHub pull request, a request for teammates to review and merge a set of code changes.

In plain words
What is it for?
Use it to review a branch, run quality gates, prepare a pull-request body, and suggest appropriate reviewers.
Why use it?
It combines code review, quality checks, and a clear description of the changes before the request is opened.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; built for gstack.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the flow plugin — 31 skills, 21 commands, 9 agents shipped together

Good fit Use it to review a branch, run quality gates, prepare a pull-request…

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add synaptiai/synapti-marketplace
Claude Code
/plugin install flow

Made for: Claude Code.

Or install flow, the plugin that ships this one along with the rest of its 31 skills, 21 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/synaptiai/synapti-marketplace/pr.svg)](https://agentmods.dev/commands/synaptiai/synapti-marketplace/pr)
Your own site
<a href="https://agentmods.dev/commands/synaptiai/synapti-marketplace/pr"><img src="https://agentmods.dev/badge/commands/synaptiai/synapti-marketplace/pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,022 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.06022
Opus 5 $0.00014 $0.03011
Sonnet 5 $0.00005 $0.01204
Haiku 4.5 $0.00003 $0.00602

Measured 3d ago against content hash 0b8531ca3d1f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/flow/commands/pr.md · 403 lines

How it starts

The opening of the file, as written. The whole thing — 403 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create Pull Request

Full PR creation workflow with multi-faceted review, quality gates, and structured PR body. Follows Explore > Plan > Code > Verify loop.

Required Skills

  • llm-operator-principles — foundational operator stance: convergence = zero findings, in-PR fixes by default, no calendar-time estimates, narrow escalation triggers. MUST be consulted before any other phase
  • pr-lifecycle — pre-flight, PR body, reviewer suggestion
  • code-review-methodology — 6-facet review synthesis
  • capability-discovery — detect quality commands and agents
  • holdout-validation — cross-reference self-review claims against file state (Phase 3)

References

  • references/escalation-format.md — canonical six-field structure used by Phase 4's visual-verification BLOCKED escalation and any other Proactive-Autonomy escalation surfaced during PR creation
  • references/finding-schema.md — canonical row shape every reviewer agent dispatched in Phase 3 emits

Phase 1: EXPLORE

# Output: `###`-headed sections + KEY=value per
# `references/command-output-format.md`. STATE=blocked when on default branch
# (can't create a PR from main); STATE=ok otherwise.

echo "### Branch Context"
BRANCH=$(git branch --show-current 2>/dev/null)
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null || echo "main")
echo "BRANCH=$BRANCH"
echo "DEFAULT_BRANCH=$DEFAULT_BRANCH"

if [ "$BRANCH" = "$DEFAULT_BRANCH" ]; then
  echo "STATE=blocked"
  echo "ERROR=Cannot create PR from default branch"
else
  echo "STATE=ok"

  # Section: Branch Delta vs Default
  echo ""
  echo "### Branch Delta"
  echo "COMMITS_AHEAD=$(git rev-list --count "$DEFAULT_BRANCH"..HEAD 2>/dev/null || echo "0")"
  # Cache the porcelain count once — previously invoked twice in adjacent
  # lines (count + gate on the UNCOMMITTED_LINE listing).
  UNCOMMITTED_COUNT=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
  echo "UNCOMMITTED_COUNT=$UNCOMMITTED_COUNT"
  [ "$UNCOMMITTED_COUNT" != "0" ] && git status --short 2>/dev/null | head -20 | sed 's/^/UNCOMMITTED_LINE=/'
  echo ""
  echo "#### Diff stat"
  DIFF_STAT=$(git diff --stat "$DEFAULT_BRANCH"...HEAD 2>/dev/null)
  if [ -z "$DIFF_STAT" ]; then
    echo "STATE=empty"
  else
    printf '%s\n' "$DIFF_STAT" | sed 's/^/DIFF_STAT=/'
  fi

  # Section: Issue Context (extracted from branch name `feature/issue-N-...`)
  echo ""
  echo "### Issue Context"
  ISSUE_NUM=$(echo "$BRANCH" | grep -oE 'issue-[0-9]+' | grep -oE '[0-9]+')
  # Quote parenthesized fallback per command-output-format.md rule 2 (values
  # with whitespace/parens must be double-quoted scalars).
  echo "ISSUE_NUM=${ISSUE_NUM:-\"(none)\"}"
  if [ -n "$ISSUE_NUM" ]; then
    gh issue view "$ISSUE_NUM" --json title,body,labels --jq '
      "ISSUE_TITLE=\"\(.title)\"\nISSUE_LABELS=\([.labels[].name] | join(","))\nISSUE_BODY_LENGTH=\(.body | length)"
    ' 2>/dev/null
  fi

  # Section: Existing PR Check
  echo ""
  echo "### Existing PR Check"
  # Capture gh exit separately. The `|| echo "0"` fallback fails to fire when
  # gh succeeds but returns "" (impossible here — gh returns [] for empty
  # success) OR when jq receives empty input from a failed gh call (jq 1.8
  # produces no output + exit 0, so `||` doesn't trigger and the section
  # silently leaks `EXISTING_PR_COUNT=`).
  EXISTING=$(gh pr list --head "$BRANCH" --state open --json number,url 2>/dev/null); GH_EXIT=$?
  if [ $GH_EXIT -ne 0 ]; then
    echo "EXISTING_PR_COUNT=0"
    echo "STATE=unavailable"
  else
    EXISTING_COUNT=$(echo "$EXISTING" | jq 'length' 2>/dev/null)
    [ -z "$EXISTING_COUNT" ] && EXISTING_COUNT=0
    echo "EXISTING_PR_COUNT=$EXISTING_COUNT"
    if [ "$EXISTING_COUNT" = "0" ]; then
      echo "STATE=empty"
    else
      echo "$EXISTING" | jq -r '.[] | "EXISTING_PR=number=\(.number) url=\(.url)"' 2>/dev/null
    fi
  fi

  # Section: Decision Journal
  echo ""
  echo "### Decision Journal"
  JOURNAL_DIR=".decisions"
  if [ -n "$ISSUE_NUM" ] && [ -f "$JOURNAL_DIR/issue-$ISSUE_NUM.md" ]; then
    echo "JOURNAL_FILE=$JOURNAL_DIR/issue-$ISSUE_NUM.md"
    echo "JOURNAL_BYTES=$(wc -c < "$JOURNAL_DIR/issue-$ISSUE_NUM.md" | tr -d ' ')"
    echo ""
    echo "#### Journal contents"
    cat "$JOURNAL_DIR/issue-$ISSUE_NUM.md"
  else
    echo "STATE=empty"
  fi

  # Section: FlowGoal State (v3) — gate on goal existence.
  # Surface the active goal's lifecycle so Phase 4 can gate PR creation on goal
  # achievement WHEN a goal exists; a branch with no goal is not blocked. The
  # gate is disabled when flow.goals.enabled is false or goalCreation is off,
  # preserving the v2 (requireGoalForStart:false) UX.
  echo ""
  echo "### FlowGoal State"
  HELPER="$(__fr="${CLAUDE_PLUGIN_ROOT:-}";[ -x "$__fr/bin/cascade-resolve.sh" ]||__fr=$({ echo plugins/flow;ls -d "$HOME"/.claude/plugins/cache/synapti-marketplace/flow/*/ 2>/dev/null|sort -Vr;echo "$HOME/.claude/plugins/marketplaces/synapti-marketplace/plugins/flow"; }|while read -r __p;do [ -x "${__p%/}/bin/cascade-resolve.sh" ]&&{ echo "${__p%/}";break;};done);echo "$__fr")/bin/cascade-resolve.sh"
  # Migration-aware: goalCreation wins; else map legacy requireGoalForStart
  # (true->always, false->off); else null so the cascade default (auto) applies.
  GOAL_MODE=$("$HELPER" --default "auto" '.flow.goals.goalCreation // (if .flow.goals.requireGoalForStart == true then "always" elif .flow.goals.requireGoalForStart == false then "off" else null end)' 2>/dev/null)
  case "$GOAL_MODE" in auto|always|off) ;; *) GOAL_MODE="auto" ;; esac
  ENABLED=$("$HELPER" --default "true" '.flow.goals.enabled' 2>/dev/null)
  # Empty means cascade-resolve itself failed — honor enabled-by-default intent
  # rather than fail-open to a silently disabled gate.
  [ -z "$ENABLED" ] && ENABLED="true"
  if [ "$ENABLED" != "true" ] || [ "$GOAL_MODE" = "off" ]; then
    echo "STATE=disabled"
    echo "REASON=flow.goals.enabled is false or goalCreation is off"
  else
    ACTIVE_GOAL_HELPER="$(__fr="${CLAUDE_PLUGIN_ROOT:-}";[ -x "$__fr/bin/cascade-resolve.sh" ]||__fr=$({ echo plugins/flow;ls -d "$HOME"/.claude/plugins/cache/synapti-marketplace/flow/*/ 2>/dev/null|sort -Vr;echo "$HOME/.claude/plugins/marketplaces/synapti-marketplace/plugins/flow"; }|while read -r __p;do [ -x "${__p%/}/bin/cascade-resolve.sh" ]&&{ echo "${__p%/}";break;};done);echo "$__fr")/bin/flow-active-goal.sh"
    if [ ! -x "$ACTIVE_GOAL_HELPER" ]; then
      echo "STATE=unavailable"
      echo "REASON=flow-active-goal.sh missing or non-executable"
    else
      # --allow-terminal: surface an already-`achieved` goal so the GATE=pass
      # branch below is reachable (the helper is active-only otherwise).
      # --branch-strict: resolve ONLY a goal owning the current branch, never a
      # stale active goal on another branch.
      GOAL_STATUS=$("$ACTIVE_GOAL_HELPER" --status --allow-terminal --branch-strict 2>/dev/null); GOAL_EXIT=$?
      case "$GOAL_EXIT" in
        0)
          GOAL_ID=$("$ACTIVE_GOAL_HELPER" --id --allow-terminal --branch-strict 2>/dev/null)
          echo "STATE=ok"
          echo "GOAL_ID=$GOAL_ID"
          echo "GOAL_LIFECYCLE=$GOAL_STATUS"
          if [ "$GOAL_STATUS" = "achieved" ]; then
            echo "GATE=pass"
          else
            echo "GATE=block"
          fi
          ;;
        1)
          # No active goal on this branch — gate not applicable: the gate keys
          # on goal existence. PR creation proceeds; a goal-less PR is not blocked.
          echo "STATE=none"
          echo "GATE=pass"
          echo "REASON=no active FlowGoal for this branch — gate not applicable"
          ;;
        3)
          echo "STATE=degenerate"
          echo "GATE=block"
          echo "REASON=multiple active goals on the current branch — run /flow:goal history and clear extras"
          ;;
        *)
          echo "STATE=unavailable"
          echo "GATE=block"
          echo "REASON=flow-active-goal.sh exited $GOAL_EXIT"
          ;;
      esac
    fi
  fi
fi

true

Read the full file on GitHub · 403 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 403 lines · 27 tokens per session scan A 0b8531ca3d1f

Subscribe to this mod's changes

pr is a command published in the GitHub repository synaptiai/synapti-marketplace (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 27 tokens to every session and 6,022 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.