pr-shepherd 0.56.6 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +150 -280
- package/bin/api.d.mts +25 -3
- package/bin/api.mjs +51 -13
- package/bin/checks/classify.d.mts +1 -0
- package/bin/checks/classify.mjs +1 -1
- package/bin/checks/conclusions.d.mts +5 -1
- package/bin/checks/conclusions.mjs +8 -2
- package/bin/checks/superseded.d.mts +8 -2
- package/bin/checks/superseded.mjs +24 -7
- package/bin/classify/loader.d.mts +2 -0
- package/bin/classify/loader.mjs +15 -0
- package/bin/classify/standard/author.d.mts +3 -0
- package/bin/classify/standard/author.mjs +10 -0
- package/bin/classify/standard/codecov-report.d.mts +4 -0
- package/bin/classify/standard/codecov-report.mjs +10 -0
- package/bin/classify/standard/coderabbit-notices.d.mts +8 -0
- package/bin/classify/standard/coderabbit-notices.mjs +38 -0
- package/bin/classify/standard/codex-notices.d.mts +8 -0
- package/bin/classify/standard/codex-notices.mjs +34 -0
- package/bin/classify/standard/dependabot-notices.d.mts +4 -0
- package/bin/classify/standard/dependabot-notices.mjs +15 -0
- package/bin/classify/standard/gemini-notices.d.mts +4 -0
- package/bin/classify/standard/gemini-notices.mjs +13 -0
- package/bin/classify/standard/index.d.mts +7 -0
- package/bin/classify/standard/index.mjs +21 -0
- package/bin/classify/standard/kilo-no-issues.d.mts +4 -0
- package/bin/classify/standard/kilo-no-issues.mjs +17 -0
- package/bin/classify/standard/sourcery-notices.d.mts +8 -0
- package/bin/classify/standard/sourcery-notices.mjs +20 -0
- package/bin/cli/api-usage-formatter.mjs +6 -1
- package/bin/cli/apply-merge-handler.d.mts +3 -0
- package/bin/cli/apply-merge-handler.mjs +73 -0
- package/bin/cli/arg-flags.d.mts +2 -0
- package/bin/cli/arg-flags.mjs +47 -0
- package/bin/cli/args.mjs +10 -41
- package/bin/cli/clean-handler.d.mts +1 -0
- package/bin/cli/clean-handler.mjs +71 -0
- package/bin/cli/default-poll.mjs +3 -0
- package/bin/cli/event-state-scope.d.mts +19 -0
- package/bin/cli/event-state-scope.mjs +60 -0
- package/bin/cli/fix-formatter.mjs +5 -11
- package/bin/cli/handlers.d.mts +0 -1
- package/bin/cli/handlers.mjs +8 -64
- package/bin/cli/help-command-pages.d.mts +62 -18
- package/bin/cli/help-command-pages.mjs +59 -15
- package/bin/cli/help-iterate-poll-pages.d.mts +2 -2
- package/bin/cli/help-iterate-poll-pages.mjs +6 -0
- package/bin/cli/help-log-file-page.d.mts +1 -1
- package/bin/cli/help-log-file-page.mjs +4 -1
- package/bin/cli/help-top-page.d.mts +1 -1
- package/bin/cli/help-top-page.mjs +5 -0
- package/bin/cli/help.d.mts +63 -19
- package/bin/cli/help.mjs +2 -0
- package/bin/cli/iterate-branch-segment.d.mts +2 -0
- package/bin/cli/iterate-branch-segment.mjs +12 -7
- package/bin/cli/iterate-flags.d.mts +7 -1
- package/bin/cli/iterate-flags.mjs +38 -0
- package/bin/cli/iterate-formatter.d.mts +6 -6
- package/bin/cli/iterate-formatter.mjs +56 -22
- package/bin/cli/iterate-instructions.mjs +45 -15
- package/bin/cli/iterate-lean.mjs +39 -14
- package/bin/cli/iterate-merge-formatter.d.mts +6 -0
- package/bin/cli/iterate-merge-formatter.mjs +24 -14
- package/bin/cli/iterate-verbose.mjs +3 -6
- package/bin/cli/list-formatters.mjs +3 -1
- package/bin/cli/mutate-formatter.mjs +10 -5
- package/bin/cli/next-check-format.d.mts +7 -0
- package/bin/cli/next-check-format.mjs +10 -0
- package/bin/cli/playbook-handler.d.mts +5 -0
- package/bin/cli/playbook-handler.mjs +40 -0
- package/bin/cli/poll-handler.mjs +7 -6
- package/bin/cli/poll-summary-formatter.mjs +11 -2
- package/bin/cli/poll-targets.mjs +2 -0
- package/bin/cli/resolve-validators.mjs +2 -2
- package/bin/cli/runner.mjs +6 -1
- package/bin/cli/stack-layer-view.d.mts +33 -0
- package/bin/cli/stack-layer-view.mjs +1 -0
- package/bin/cli/stack-overview.d.mts +10 -28
- package/bin/cli/stack-overview.mjs +39 -14
- package/bin/cli/transport-args.d.mts +5 -0
- package/bin/cli/transport-args.mjs +23 -0
- package/bin/cli/transport-formatter.d.mts +9 -0
- package/bin/cli/transport-formatter.mjs +13 -0
- package/bin/cli-parser.mjs +62 -7
- package/bin/commands/apply-merge-options.d.mts +4 -0
- package/bin/commands/apply-merge-options.mjs +34 -0
- package/bin/commands/apply-merge-output.d.mts +7 -0
- package/bin/commands/apply-merge-output.mjs +20 -0
- package/bin/commands/apply-merge-pull.d.mts +20 -0
- package/bin/commands/apply-merge-pull.mjs +15 -0
- package/bin/commands/apply-merge.d.mts +18 -0
- package/bin/commands/apply-merge.mjs +126 -0
- package/bin/commands/apply-queue-removal.mjs +7 -0
- package/bin/commands/check-annotations.mjs +28 -18
- package/bin/commands/check-execution-context.d.mts +5 -0
- package/bin/commands/check-execution-context.mjs +16 -1
- package/bin/commands/check-fingerprint.d.mts +26 -2
- package/bin/commands/check-fingerprint.mjs +64 -28
- package/bin/commands/check-terminal-report.mjs +11 -1
- package/bin/commands/check-unreported.d.mts +6 -2
- package/bin/commands/check-unreported.mjs +32 -12
- package/bin/commands/check-wait-detectors.d.mts +35 -0
- package/bin/commands/check-wait-detectors.mjs +107 -0
- package/bin/commands/check.d.mts +4 -2
- package/bin/commands/check.mjs +130 -40
- package/bin/commands/event-instructions.d.mts +11 -0
- package/bin/commands/event-instructions.mjs +27 -0
- package/bin/commands/event-mode.d.mts +14 -0
- package/bin/commands/event-mode.mjs +138 -0
- package/bin/commands/iterate/api-usage.mjs +4 -2
- package/bin/commands/iterate/base.mjs +4 -0
- package/bin/commands/iterate/check-blocker-gate.mjs +14 -2
- package/bin/commands/iterate/check-instructions.d.mts +9 -10
- package/bin/commands/iterate/check-instructions.mjs +23 -22
- package/bin/commands/iterate/classify.mjs +19 -5
- package/bin/commands/iterate/escalate.mjs +13 -3
- package/bin/commands/iterate/fix-code.mjs +26 -9
- package/bin/commands/iterate/fix-instruction-threads.d.mts +0 -8
- package/bin/commands/iterate/fix-instruction-threads.mjs +0 -16
- package/bin/commands/iterate/fix-loop-instruction.d.mts +9 -0
- package/bin/commands/iterate/fix-loop-instruction.mjs +35 -0
- package/bin/commands/iterate/helpers.mjs +15 -2
- package/bin/commands/iterate/index.mjs +57 -16
- package/bin/commands/iterate/mark-ready.mjs +50 -10
- package/bin/commands/iterate/merge-plan.d.mts +19 -0
- package/bin/commands/iterate/merge-plan.mjs +88 -0
- package/bin/commands/iterate/merge-state.mjs +3 -0
- package/bin/commands/iterate/merge.d.mts +4 -15
- package/bin/commands/iterate/merge.mjs +18 -51
- package/bin/commands/iterate/merged-base-pull-requests.d.mts +2 -6
- package/bin/commands/iterate/merged-base-pull-requests.mjs +15 -11
- package/bin/commands/iterate/native-stack-rebase.mjs +11 -0
- package/bin/commands/iterate/render.d.mts +8 -2
- package/bin/commands/iterate/render.mjs +28 -42
- package/bin/commands/iterate/stack-trunk-conflict.mjs +17 -1
- package/bin/commands/iterate/stale-ancestry.mjs +4 -1
- package/bin/commands/iterate/stall.d.mts +5 -1
- package/bin/commands/iterate/stall.mjs +19 -7
- package/bin/commands/iterate/thread-mutation-routing.d.mts +1 -0
- package/bin/commands/iterate/thread-mutation-routing.mjs +4 -2
- package/bin/commands/iterate/unreported-required.mjs +5 -2
- package/bin/commands/mark-files-as-viewed.mjs +7 -0
- package/bin/commands/next-check.d.mts +31 -0
- package/bin/commands/next-check.mjs +46 -0
- package/bin/commands/playbook.d.mts +13 -0
- package/bin/commands/playbook.mjs +48 -0
- package/bin/commands/poll-mode.d.mts +8 -0
- package/bin/commands/poll-mode.mjs +14 -0
- package/bin/commands/poll-progress.d.mts +1 -0
- package/bin/commands/poll-progress.mjs +6 -3
- package/bin/commands/poll-quota.d.mts +3 -2
- package/bin/commands/poll-quota.mjs +7 -3
- package/bin/commands/poll-summary-explicit-instructions.d.mts +2 -0
- package/bin/commands/poll-summary-explicit-instructions.mjs +10 -1
- package/bin/commands/poll-summary-instructions.mjs +16 -17
- package/bin/commands/poll-summary.mjs +42 -17
- package/bin/commands/poll.d.mts +0 -1
- package/bin/commands/poll.mjs +11 -19
- package/bin/commands/quota-selection.d.mts +2 -1
- package/bin/commands/quota-selection.mjs +12 -7
- package/bin/commands/resolve-mutate.mjs +33 -5
- package/bin/commands/rest-stack-merge-readiness.d.mts +4 -0
- package/bin/commands/rest-stack-merge-readiness.mjs +74 -0
- package/bin/commands/rule-auto-resolve.mjs +9 -3
- package/bin/commands/shepherd-journal.d.mts +5 -4
- package/bin/commands/shepherd-journal.mjs +9 -8
- package/bin/commands/stack-drain.d.mts +1 -9
- package/bin/commands/stack-drain.mjs +50 -37
- package/bin/commands/stack-handoffs.d.mts +10 -0
- package/bin/commands/stack-handoffs.mjs +25 -0
- package/bin/commands/stack-stall.d.mts +5 -0
- package/bin/commands/stack-stall.mjs +11 -0
- package/bin/commands/stack-work.d.mts +5 -0
- package/bin/commands/stack-work.mjs +32 -0
- package/bin/comments/existing-reply-scan.d.mts +17 -0
- package/bin/comments/existing-reply-scan.mjs +41 -0
- package/bin/comments/rate-limit.mjs +2 -2
- package/bin/comments/resolve.d.mts +7 -1
- package/bin/comments/resolve.mjs +108 -18
- package/bin/comments/rest-reply.d.mts +9 -0
- package/bin/comments/rest-reply.mjs +95 -0
- package/bin/comments/rest-review-mutations.d.mts +22 -0
- package/bin/comments/rest-review-mutations.mjs +125 -0
- package/bin/comments/review-visibility.d.mts +1 -1
- package/bin/comments/review-visibility.mjs +3 -2
- package/bin/comments/sha-poll.mjs +7 -3
- package/bin/comments/thread-visibility.mjs +10 -5
- package/bin/comments/uncertain-replies.d.mts +11 -0
- package/bin/comments/uncertain-replies.mjs +121 -0
- package/bin/comments/uncertain-reply-guards.d.mts +10 -0
- package/bin/comments/uncertain-reply-guards.mjs +94 -0
- package/bin/comments/visible-comments.d.mts +1 -1
- package/bin/comments/visible-comments.mjs +4 -2
- package/bin/config/load.d.mts +37 -1
- package/bin/config/load.mjs +73 -1
- package/bin/config.json +6 -2
- package/bin/exit-codes.d.mts +3 -0
- package/bin/exit-codes.mjs +8 -0
- package/bin/github/api-telemetry-aggregate.d.mts +15 -4
- package/bin/github/api-telemetry-aggregate.mjs +57 -18
- package/bin/github/api-telemetry.d.mts +4 -0
- package/bin/github/api-telemetry.mjs +22 -8
- package/bin/github/apply-review-preflight.d.mts +20 -0
- package/bin/github/apply-review-preflight.mjs +61 -0
- package/bin/github/base-behind-cache.d.mts +15 -0
- package/bin/github/base-behind-cache.mjs +18 -0
- package/bin/github/batch-parse-suites.d.mts +4 -2
- package/bin/github/batch-parse-suites.mjs +6 -1
- package/bin/github/batch-parser-helpers.mjs +40 -2
- package/bin/github/batch-parsers.mjs +1 -0
- package/bin/github/batch-raw-rules.d.mts +26 -0
- package/bin/github/batch-raw-types.d.mts +8 -6
- package/bin/github/batch-stack-evidence.d.mts +28 -0
- package/bin/github/batch-stack-evidence.mjs +62 -0
- package/bin/github/batch.d.mts +15 -2
- package/bin/github/batch.mjs +34 -17
- package/bin/github/captured-proxy-agent.d.mts +3 -0
- package/bin/github/captured-proxy-agent.mjs +8 -0
- package/bin/github/check-annotations-batch.d.mts +0 -5
- package/bin/github/check-annotations-batch.mjs +25 -4
- package/bin/github/check-annotations.mjs +3 -1
- package/bin/github/client.d.mts +8 -19
- package/bin/github/client.mjs +45 -13
- package/bin/github/fingerprint-fields.d.mts +8 -0
- package/bin/github/fingerprint-fields.mjs +6 -1
- package/bin/github/fingerprint.d.mts +4 -2
- package/bin/github/fingerprint.mjs +6 -38
- package/bin/github/github-fetch.d.mts +2 -0
- package/bin/github/github-fetch.mjs +32 -0
- package/bin/github/gql/base-behind.gql +3 -0
- package/bin/github/gql/batch-pr-page.gql +16 -0
- package/bin/github/gql/batch-pr.gql +57 -0
- package/bin/github/gql/commit-check-contexts.gql +17 -0
- package/bin/github/gql/get-pr-body.gql +1 -0
- package/bin/github/gql/poll-stack-summary.gql +1 -0
- package/bin/github/gql/poll-summary-check-contexts.gql +5 -0
- package/bin/github/gql/poll-summary-fragment.gql +65 -15
- package/bin/github/gql/stack-handoff-check-runs.gql +42 -0
- package/bin/github/graphql-http.mjs +9 -4
- package/bin/github/graphql-internal-retry.d.mts +2 -0
- package/bin/github/graphql-internal-retry.mjs +1 -1
- package/bin/github/graphql-quota-probe.d.mts +6 -0
- package/bin/github/graphql-quota-probe.mjs +56 -0
- package/bin/github/graphql-session-refusal.d.mts +8 -0
- package/bin/github/graphql-session-refusal.mjs +14 -0
- package/bin/github/http-request.d.mts +1 -1
- package/bin/github/http-request.mjs +22 -6
- package/bin/github/http-utils.mjs +6 -0
- package/bin/github/legacy-dispatcher.d.mts +6 -0
- package/bin/github/legacy-dispatcher.mjs +44 -0
- package/bin/github/merge-target-rules.d.mts +12 -3
- package/bin/github/merge-target-rules.mjs +71 -34
- package/bin/github/mutation-policy.d.mts +6 -0
- package/bin/github/mutation-policy.mjs +21 -0
- package/bin/github/poll-summary-annotation-probe.mjs +17 -10
- package/bin/github/poll-summary-check-blockers.d.mts +1 -1
- package/bin/github/poll-summary-check-blockers.mjs +2 -2
- package/bin/github/poll-summary-check-hydration.mjs +25 -10
- package/bin/github/poll-summary-checks.d.mts +2 -2
- package/bin/github/poll-summary-checks.mjs +9 -6
- package/bin/github/poll-summary-command.d.mts +2 -0
- package/bin/github/poll-summary-command.mjs +24 -0
- package/bin/github/poll-summary-fingerprint.d.mts +1 -1
- package/bin/github/poll-summary-fingerprint.mjs +4 -2
- package/bin/github/poll-summary-handoff-fields.d.mts +3 -0
- package/bin/github/poll-summary-handoff-fields.mjs +73 -0
- package/bin/github/poll-summary-projector.d.mts +1 -1
- package/bin/github/poll-summary-projector.mjs +17 -24
- package/bin/github/poll-summary-raw.d.mts +70 -10
- package/bin/github/poll-summary-readiness.d.mts +6 -1
- package/bin/github/poll-summary-readiness.mjs +13 -4
- package/bin/github/poll-summary-rest-queue.d.mts +3 -0
- package/bin/github/poll-summary-rest-queue.mjs +12 -0
- package/bin/github/poll-summary-review.d.mts +1 -1
- package/bin/github/poll-summary-review.mjs +35 -20
- package/bin/github/poll-summary-route.mjs +19 -3
- package/bin/github/poll-summary-stack-page.d.mts +11 -0
- package/bin/github/poll-summary-stack-page.mjs +27 -0
- package/bin/github/poll-summary-unreported.d.mts +3 -1
- package/bin/github/poll-summary-unreported.mjs +6 -3
- package/bin/github/poll-summary.d.mts +4 -1
- package/bin/github/poll-summary.mjs +47 -33
- package/bin/github/queries.d.mts +7 -3
- package/bin/github/queries.mjs +8 -4
- package/bin/github/rate-limit-sample.d.mts +7 -0
- package/bin/github/rate-limit-sample.mjs +12 -0
- package/bin/github/reply-recovery-read.d.mts +50 -0
- package/bin/github/reply-recovery-read.mjs +118 -0
- package/bin/github/reply-thread-transcripts.d.mts +0 -1
- package/bin/github/reply-thread-transcripts.mjs +24 -1
- package/bin/github/rest-annotation-read.d.mts +5 -0
- package/bin/github/rest-annotation-read.mjs +44 -0
- package/bin/github/rest-batch-read.d.mts +12 -0
- package/bin/github/rest-batch-read.mjs +57 -0
- package/bin/github/rest-batch-snapshot.d.mts +30 -0
- package/bin/github/rest-batch-snapshot.mjs +115 -0
- package/bin/github/rest-batch-unavailable.d.mts +5 -0
- package/bin/github/rest-batch-unavailable.mjs +16 -0
- package/bin/github/rest-check-read.d.mts +34 -0
- package/bin/github/rest-check-read.mjs +124 -0
- package/bin/github/rest-comment-authorship.d.mts +7 -0
- package/bin/github/rest-comment-authorship.mjs +11 -0
- package/bin/github/rest-conditional-scope.d.mts +20 -0
- package/bin/github/rest-conditional-scope.mjs +44 -0
- package/bin/github/rest-explicit-summary-read.d.mts +3 -0
- package/bin/github/rest-explicit-summary-read.mjs +8 -0
- package/bin/github/rest-feedback-read.d.mts +36 -0
- package/bin/github/rest-feedback-read.mjs +147 -0
- package/bin/github/rest-feedback-validation.d.mts +5 -0
- package/bin/github/rest-feedback-validation.mjs +28 -0
- package/bin/github/rest-http.d.mts +12 -0
- package/bin/github/rest-http.mjs +108 -23
- package/bin/github/rest-identities.d.mts +22 -0
- package/bin/github/rest-identities.mjs +134 -0
- package/bin/github/rest-merge-stack-guard.d.mts +14 -0
- package/bin/github/rest-merge-stack-guard.mjs +41 -0
- package/bin/github/rest-merge.d.mts +29 -0
- package/bin/github/rest-merge.mjs +56 -0
- package/bin/github/rest-merged-base-read.d.mts +9 -0
- package/bin/github/rest-merged-base-read.mjs +48 -0
- package/bin/github/rest-pr-core.d.mts +52 -0
- package/bin/github/rest-pr-core.mjs +60 -0
- package/bin/github/rest-reader-core.d.mts +16 -0
- package/bin/github/rest-reader-core.mjs +154 -0
- package/bin/github/rest-review-read.d.mts +11 -0
- package/bin/github/rest-review-read.mjs +47 -0
- package/bin/github/rest-rules-read.d.mts +9 -0
- package/bin/github/rest-rules-read.mjs +154 -0
- package/bin/github/rest-session-refusal.d.mts +5 -0
- package/bin/github/rest-session-refusal.mjs +21 -0
- package/bin/github/rest-snapshot-context.d.mts +10 -0
- package/bin/github/rest-snapshot-context.mjs +1 -0
- package/bin/github/rest-stack-read.d.mts +21 -0
- package/bin/github/rest-stack-read.mjs +47 -0
- package/bin/github/rest-stack-summary.d.mts +8 -0
- package/bin/github/rest-stack-summary.mjs +62 -0
- package/bin/github/rest-summary-read.d.mts +7 -0
- package/bin/github/rest-summary-read.mjs +112 -0
- package/bin/github/rest-terminal-batch.d.mts +14 -0
- package/bin/github/rest-terminal-batch.mjs +45 -0
- package/bin/github/rest-text.mjs +7 -3
- package/bin/github/rest-thread-read.d.mts +4 -0
- package/bin/github/rest-thread-read.mjs +35 -0
- package/bin/github/rest-viewer-read.d.mts +2 -0
- package/bin/github/rest-viewer-read.mjs +41 -0
- package/bin/github/stack-bottom.d.mts +3 -0
- package/bin/github/stack-bottom.mjs +14 -0
- package/bin/github/stack-handoff-context.d.mts +25 -0
- package/bin/github/stack-handoff-context.mjs +12 -0
- package/bin/github/stack-handoff-page.d.mts +17 -0
- package/bin/github/stack-handoff-page.mjs +306 -0
- package/bin/github/stack-handoff.d.mts +16 -0
- package/bin/github/stack-handoff.mjs +115 -0
- package/bin/github/stack-order.d.mts +6 -0
- package/bin/github/stack-order.mjs +13 -0
- package/bin/github/stack-read.d.mts +7 -5
- package/bin/github/stack-read.mjs +22 -24
- package/bin/github/stack-size-hint.d.mts +3 -0
- package/bin/github/stack-size-hint.mjs +14 -0
- package/bin/github/suggestion-thread.mjs +27 -1
- package/bin/github/thread-comments.mjs +9 -1
- package/bin/github/transport-evidence.d.mts +20 -0
- package/bin/github/transport-evidence.mjs +26 -0
- package/bin/github/transport-mode.d.mts +2 -0
- package/bin/github/transport-mode.mjs +5 -0
- package/bin/github/transport.d.mts +19 -0
- package/bin/github/transport.mjs +126 -0
- package/bin/github/unsupported-rest.d.mts +4 -0
- package/bin/github/unsupported-rest.mjs +7 -0
- package/bin/mcp/server.mjs +52 -3
- package/bin/merge-status/derive.d.mts +2 -0
- package/bin/merge-status/derive.mjs +17 -13
- package/bin/merge-status/required-check-requirements.d.mts +7 -0
- package/bin/merge-status/required-check-requirements.mjs +15 -0
- package/bin/merge-status/requirements-format.d.mts +5 -0
- package/bin/merge-status/requirements-format.mjs +41 -12
- package/bin/merge-status/requirements.mjs +18 -7
- package/bin/state/base.mjs +41 -0
- package/bin/state/durable-state.d.mts +6 -0
- package/bin/state/durable-state.mjs +41 -0
- package/bin/state/graphql-quota-policy.mjs +23 -16
- package/bin/state/merge-request.d.mts +25 -0
- package/bin/state/merge-request.mjs +145 -0
- package/bin/state/pr-fingerprint.d.mts +15 -0
- package/bin/state/pr-fingerprint.mjs +22 -7
- package/bin/state/rest-cache.d.mts +3 -0
- package/bin/state/rest-cache.mjs +1 -0
- package/bin/state/rest-snapshot-report.d.mts +21 -0
- package/bin/state/rest-snapshot-report.mjs +52 -0
- package/bin/state/seen-comments.d.mts +3 -0
- package/bin/state/seen-comments.mjs +18 -0
- package/bin/types/api-usage.d.mts +9 -1
- package/bin/types/escalate.d.mts +1 -1
- package/bin/types/github.d.mts +23 -9
- package/bin/types/iterate.d.mts +24 -2
- package/bin/types/merge-action.d.mts +1 -1
- package/bin/types/merge-requirements.d.mts +7 -7
- package/bin/types/next-check.d.mts +12 -0
- package/bin/types/next-check.mjs +1 -0
- package/bin/types/poll-summary.d.mts +21 -0
- package/bin/types/report.d.mts +13 -1
- package/bin/types/review-thread.d.mts +1 -1
- package/bin/types.d.mts +1 -0
- package/bin/types.mjs +1 -0
- package/package.json +4 -3
- package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -1
- package/plugins/pr-shepherd/.codex.mcp.json +1 -1
- package/plugins/pr-shepherd/.mcp.json +1 -1
- package/plugins/pr-shepherd/skills/mark-files-as-viewed/SKILL.md +1 -1
- package/plugins/pr-shepherd/skills/pr-shepherd/SKILL.md +14 -51
- package/plugins/pr-shepherd/skills/pr-shepherd/references/ci-failure-triage.md +12 -16
- package/plugins/pr-shepherd/skills/pr-shepherd/references/cloud-event-loop.md +14 -0
- package/plugins/pr-shepherd/skills/pr-shepherd/references/create-pr.md +10 -0
- package/plugins/pr-shepherd/skills/pr-shepherd/references/fix-code-loop.md +10 -0
- package/plugins/pr-shepherd/skills/pr-shepherd/references/mcp-fallback.md +9 -0
- package/plugins/pr-shepherd/skills/reduce-pr-noise/references/classifiers.md +3 -1
- package/bin/github/gql/pr-fingerprint.gql +0 -75
- package/plugins/pr-shepherd/skills/pr-shepherd/references/journal.md +0 -7
- package/plugins/pr-shepherd/skills/pr-shepherd/references/review-mutations.md +0 -9
- package/plugins/pr-shepherd/skills/pr-shepherd/references/stack-merge.md +0 -7
package/README.md
CHANGED
|
@@ -1,358 +1,228 @@
|
|
|
1
1
|
# pr-shepherd
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Drive a pull request to merge-ready with a coding agent. It works with Claude Code, Codex, Grok, and any stdio MCP client.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Estimated per PR session: −42% cost and −19% turns vs. `gh`, −77% cost vs. the GitHub MCP server. While waiting on CI: ~60 GraphQL points an hour vs. ~360 for `gh pr checks --watch`.**
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Outcomes
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
| Outcome | Headline | Evidence |
|
|
10
|
+
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
11
|
+
| [Context and correctness](#context-and-correctness) | 60 GitHub edge cases cataloged, backed by 147 scenario fixtures; on 8 of them, evals show the agent does worse without the plugin | [Handled cases](docs/handled-cases.md) |
|
|
12
|
+
| [Fewer tokens, lower cost](#fewer-tokens-and-lower-cost) | Cost −42% vs. `gh` and −77% vs. MCP per PR session; turns −19% / −70% (estimates) | [Token bench](evals/tokens/README.md) |
|
|
13
|
+
| [Clearer agent direction](#clearer-agent-direction) | GitHub gotchas (cancelled runs, merge queues, stacks): eval score 0.82 → 0.94, about two-thirds fewer misses | [Behavior evals](evals/README.md) |
|
|
14
|
+
| [Lower GitHub API quota use](#lower-github-api-quota-use) | ~60 GraphQL points per CI-wait hour vs. ~360 for `gh`; ~4 when idle. REST core per PR session 4.8 vs. 9 (`gh`), 78.3 (MCP) | [GitHub API](docs/github-api.md), [GraphQL usage](docs/graphql-usage.md) |
|
|
15
|
+
| [Safe by construction](#safe-by-construction) | 0 git mutations; human handoff limited to 10 escalation triggers for a single PR | [Escalations](docs/escalations.md) |
|
|
16
|
+
| [Works across agents and stacks](#works-across-agents-and-environments) | 3 agent plugins plus any stdio MCP client; GraphQL and REST transports; native stacked PRs | [MCP](docs/mcp.md), [cloud](docs/cloud.md) |
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
1. **Gather all context for a PR** in one invocation: review threads, comments, replies, summaries, CI, mergeability, merge requirements, first-look / outdated / edited items, and author provenance.
|
|
14
|
-
2. **Provide deterministic actions for the agent**: exactly one of `WAIT`, `MARK_READY`, `FIX_CODE`, `MERGE`, `CANCEL`, or `ESCALATE`, plus numbered `## Instructions` and explicit commands. The agent still decides whether a comment or CI failure needs a code change. Shepherd does not classify signal vs noise and does not mutate git.
|
|
15
|
-
|
|
16
|
-
Highlights:
|
|
17
|
-
|
|
18
|
-
- Batched GraphQL reads and writes (plus REST where GraphQL cannot) so one poll replaces a tool-call fan-out. MCP `iterate` is one tick and the client owns recurrence; `--debounce` is a poll-dispatcher settle window, not an MCP tool.
|
|
19
|
-
- CI summaries include failed checks, and the failed job/step plus a log excerpt when triage can fetch them. Job and log details are omitted for `STARTUP_FAILURE` and `CANCELLED`; agents may still inspect logs.
|
|
20
|
-
- Handles GitHub comment types (comments, threads, replies) and their states, including first-look, outdated, resolved, minimized, and edited.
|
|
21
|
-
- `apply` batches resolve / reply / minimize / dismiss. `build_suggestion_patches` validates and returns ordered diffs without mutating git.
|
|
22
|
-
- `BEHIND` is mergeability information, not a rebase or a guarantee that the next push is at the default-branch tip. The agent can update the branch before pushing.
|
|
23
|
-
|
|
24
|
-
Full reference: [docs/README.md](docs/README.md). Feature matrix: [docs/features.md](docs/features.md).
|
|
25
|
-
|
|
26
|
-
## How It Works
|
|
27
|
-
|
|
28
|
-
`pr-shepherd` moves deterministic PR orchestration into a local MCP server, with a CLI for shells and CI. Both interfaces fetch the same GitHub state, emit raw-enough context, and return a numbered plan for the calling agent to follow.
|
|
29
|
-
|
|
30
|
-
The MCP server exposes `iterate`, `apply`, `build_suggestion_patches`, `extract_journal`, and `get_journal`. `apply` accepts ordered review mutations, file-view mutations, and journal entries; the deprecated singular suggestion tool remains temporarily as an adapter. PR-targeted MCP calls require a repository-qualified `pr`: a GitHub PR URL or `owner/repo#N`; the explicit repository is the target for GitHub I/O, even when it differs from the local checkout. `extract_journal` takes a Markdown body string and performs no I/O. The CLI and programmatic API also retain bare-number and current-branch PR discovery. The shipped skills are thin dispatchers for those tools.
|
|
31
|
-
|
|
32
|
-
Each tick returns exactly one action:
|
|
33
|
-
|
|
34
|
-
- `WAIT` — no immediate action; continue with the next poll.
|
|
35
|
-
- `MARK_READY` — the CLI converted an eligible draft PR to ready; continue polling.
|
|
36
|
-
- `FIX_CODE` — agent work is required; complete it, push when needed, then continue polling. Push access to the PR head branch is a usage precondition.
|
|
37
|
-
- `MERGE` — run the emitted head-pinned auto-merge or queue command. Ordinary merges include a plain-merge fallback; queue merges include a GraphQL enqueue fallback. GitHub is authoritative for the result and reports any authorization failure.
|
|
38
|
-
- `CANCEL` — stop polling this pull request because it merged, closed, or completed its ready-delay. Continue any remaining pull requests or issues from the original request.
|
|
39
|
-
- `ESCALATE` — stop polling until a human provides direction. Native stacks reach this only after their autonomous one-PR sessions are exhausted.
|
|
40
|
-
|
|
41
|
-
Native-stack summaries additionally use stack-level `SHEPHERD`: run the listed one-PR sessions,
|
|
42
|
-
then recheck the stack. It is not a per-PR `FIX_CODE` action.
|
|
18
|
+
**[jongleberry.com/pr-shepherd](https://jongleberry.com/pr-shepherd/)** covers the why and the design principles.
|
|
43
19
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
> pr-shepherd 123
|
|
48
|
-
|
|
49
|
-
# PR #123 [FIX_CODE]
|
|
50
|
-
|
|
51
|
-
**status** `UNRESOLVED_COMMENTS` · **merge** `CLEAN` · **state** `OPEN` · **repo** `owner/repo`
|
|
52
|
-
**summary** 3 passing
|
|
53
|
-
Approvals: None [Not Required]
|
|
54
|
-
Conversations Resolved: No [Not Required]
|
|
55
|
-
|
|
56
|
-
## Review threads
|
|
57
|
-
|
|
58
|
-
### `threadId=PRRT_kwDOSGizTs58XB1L` — `src/commands/iterate/index.mts:42` (@alice · User · MEMBER)
|
|
59
|
-
|
|
60
|
-
> The variable name is misleading.
|
|
61
|
-
|
|
62
|
-
## Failing checks
|
|
63
|
-
|
|
64
|
-
- `24697658766` — `CI › lint / typecheck / test (22.x)` [conclusion: FAILURE]
|
|
65
|
-
> oxfmt
|
|
66
|
-
|
|
67
|
-
## Post-fix actions
|
|
68
|
-
|
|
69
|
-
- base: `main`
|
|
70
|
-
- apply review: `pr-shepherd apply review 123 --reply-thread-ids PRRT_kwDOSGizTs58XB1L --message "$DISMISS_MESSAGE" --require-sha "$HEAD_SHA"`
|
|
20
|
+
## What it does
|
|
71
21
|
|
|
72
|
-
|
|
22
|
+
- Gathers the PR's review items, CI failures, and merge requirements in one call.
|
|
23
|
+
- Returns one action with numbered instructions and exact commands. `CANCEL` ends the loop and carries none.
|
|
24
|
+
- Never mutates git. The agent edits, commits, pushes, and decides what each comment deserves.
|
|
73
25
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
8. `[FIX_CODE]` is non-terminal. Iterate immediately with the same options.
|
|
26
|
+
```mermaid
|
|
27
|
+
flowchart LR
|
|
28
|
+
A[Agent] -->|iterate PR| S[pr-shepherd]
|
|
29
|
+
S -->|batched, conditional reads| G[(GitHub)]
|
|
30
|
+
G --> S
|
|
31
|
+
S -->|one action + numbered instructions| A
|
|
32
|
+
A -->|fix, push, run the printed commands| G
|
|
82
33
|
```
|
|
83
34
|
|
|
84
|
-
|
|
35
|
+
Without Shepherd, an agent fans out across `gh`, the GitHub MCP server, and GraphQL to rebuild PR state, then guesses the next step. Details for each outcome follow; more features are in [docs/features.md](docs/features.md).
|
|
85
36
|
|
|
86
|
-
##
|
|
37
|
+
## Outcome details
|
|
87
38
|
|
|
88
|
-
|
|
39
|
+
### Context and correctness
|
|
89
40
|
|
|
90
|
-
|
|
91
|
-
- Detected bots, configured `botUsernames`, and viewer-authored human review threads are returned until resolved when the required mutation is authorized. Reply and resolve mutations use the thread ID, so they still run when GitHub has cleared the source line. Unauthorized threads are surfaced once and then marker-gated until edited. Bot/non-human threads, PR comments, and review summaries can be resolved or minimized when eligible. Review summaries are not minimized while known inline child threads from that review remain unresolved.
|
|
92
|
-
- Shepherd identifies its own latest reply only when that comment begins `<!-- pr-shepherd -->`, not from author equality. A marked viewer-authored thread can be resolved without another reply as a retry.
|
|
93
|
-
- Every review thread/comment/review summary is surfaced at least once, even if already outdated, resolved, or minimized; edited items re-surface through seen markers.
|
|
94
|
-
- Draft PRs can be marked ready automatically when clean; disable with `actions.autoMarkReady: false` or `--no-auto-mark-ready`.
|
|
95
|
-
- With `--merge`, actionable review threads/comments/reviews/summaries are held back (`WAIT`, with raw deferred-work counts) while a PR sits in the merge queue, since a Shepherd-initiated push would eject it; set `actions.workWhileQueued: true` to act on them immediately instead. Failing checks and merge conflicts are never deferred.
|
|
96
|
-
- The CLI never performs git mutations itself — it only emits commit/push instructions for the agent to run. Push access to the PR head is a usage precondition; GitHub viewer fields do not create a separate push-authorization handoff.
|
|
97
|
-
- Generated iterate mutations and automatic actions are capability-aware and omit unauthorized commands. Explicit `apply` operations forward the caller's requested IDs without iterate's author or capability policy and surface GitHub's result.
|
|
98
|
-
- `build_suggestion_patches` turns one or more ordered GitHub suggestion threads into checked patches and commit metadata, but never edits the working tree or git history. Local HEAD may be ahead when the live PR head is its ancestor.
|
|
41
|
+
One `iterate` call returns everything the agent needs about the PR:
|
|
99
42
|
|
|
100
|
-
|
|
43
|
+
- review threads with replies, PR comments, and review summaries;
|
|
44
|
+
- each CI failure, with its failed step and a log excerpt when triage can fetch them;
|
|
45
|
+
- mergeability and the actual merge requirements;
|
|
46
|
+
- first-look, outdated, and edited items, and stack topology.
|
|
101
47
|
|
|
102
|
-
|
|
48
|
+
One exception: a `COMMENTED` review that was already minimized before the first tick is not fetched.
|
|
103
49
|
|
|
104
|
-
|
|
50
|
+
The agent reasons less and misses less. [docs/handled-cases.md](docs/handled-cases.md) catalogs the GitHub edge cases this covers. These are the gotchas where the [behavior evals](evals/README.md) measured the agent going wrong without the plugin (score with vs. without):
|
|
105
51
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
52
|
+
| GitHub gotcha | With | Without |
|
|
53
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---: | ------: |
|
|
54
|
+
| On a stack layer, the latest run of a required check was cancelled while an older run passed. GitHub still blocks the merge ([#567](https://github.com/jonathanong/pr-shepherd/pull/567), [gh-stack#466](https://github.com/github/gh-stack/issues/466)) | 1.00 | 0.44 |
|
|
55
|
+
| A bot `CHANGES_REQUESTED` review and a human thread arrive together | 0.89 | 0.33 |
|
|
56
|
+
| A cancelled run needs a rerun, not a code fix | 1.00 | 0.50 |
|
|
57
|
+
| Every stack layer is merged, so the loop must stop | 1.00 | 0.50 |
|
|
58
|
+
| GitHub denied a reply: skip it once instead of retrying | 0.72 | 0.33 |
|
|
59
|
+
| A maintainer removed the PR from the merge queue | 1.00 | 0.67 |
|
|
60
|
+
| A required run was cancelled in the merge queue: escalate, don't requeue | 0.75 | 0.42 |
|
|
61
|
+
| The REST transport cannot run the queue recovery | 1.00 | 0.83 |
|
|
110
62
|
|
|
111
|
-
|
|
63
|
+
### Fewer tokens and lower cost
|
|
112
64
|
|
|
113
|
-
|
|
114
|
-
/goal $pr-shepherd # infer PR from current branch
|
|
115
|
-
/goal $pr-shepherd 42
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Grok:
|
|
65
|
+
Batching, noise filtering, fingerprint skips, seen markers, and lean output cut tokens and agent turns. Estimated cost per session from the [token bench](evals/tokens/README.md) ([report](evals/tokens/REPORT.md)):
|
|
119
66
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
67
|
+
| Session | Cost vs. `gh` | Cost vs. GitHub MCP |
|
|
68
|
+
| --------- | ------------: | ------------------: |
|
|
69
|
+
| Single PR | **−42%** | **−77%** |
|
|
70
|
+
| PR stack | **−45%** | **−63%** |
|
|
124
71
|
|
|
125
|
-
|
|
72
|
+
These are offline estimates at 3.5 characters per token over recorded sessions, not measured billing. Two cases do not save money:
|
|
126
73
|
|
|
127
|
-
|
|
74
|
+
- A single fresh read-and-reply tick is roughly even with `gh`.
|
|
75
|
+
- Confirming an already-merged PR costs about 5% more ([report](evals/tokens/REPORT.md)).
|
|
128
76
|
|
|
129
|
-
|
|
130
|
-
pr-shepherd 42 # poll until non-WAIT or timeout
|
|
131
|
-
pr-shepherd 42 --interval 60s --timeout 270s
|
|
132
|
-
pr-shepherd 42 --quiet-status # print only changed WAIT status snapshots
|
|
133
|
-
pr-shepherd 42 --until-terminal # continue through WAIT/MARK_READY until work or terminal state
|
|
134
|
-
pr-shepherd 42 --debounce 5m # wait 5m after first FIX_CODE or stack SHEPHERD, then return one batched tick
|
|
135
|
-
pr-shepherd 42 --ready-delay 15m
|
|
136
|
-
pr-shepherd 42 --merge # request head-pinned auto-merge/queue; GitHub reports the result
|
|
137
|
-
pr-shepherd iterate 42 # single tick
|
|
138
|
-
pr-shepherd owner/repo#42 # poll a PR in an explicit repository
|
|
139
|
-
pr-shepherd https://github.com/owner/repo/pull/42
|
|
140
|
-
pr-shepherd 42 43 44 # summarize an explicit same-repository set
|
|
141
|
-
pr-shepherd --stack 43 # summarize every PR in a native GitHub stack
|
|
142
|
-
```
|
|
77
|
+
### Clearer agent direction
|
|
143
78
|
|
|
144
|
-
A
|
|
145
|
-
selected PRs or stack without another conversational confirmation. Host permission checks still apply.
|
|
79
|
+
For a single PR, each tick returns exactly one action: `WAIT`, `READY`, `MARK_READY`, `FIX_CODE`, `MERGE`, `CANCEL`, or `ESCALATE`. A `--stack` poll can also return `SHEPHERD`, which starts one-PR sessions for owned layers. Every action except `CANCEL` comes with numbered `## Instructions` and exact commands, so the agent does not invent policy. In the [behavior evals](evals/README.md), Sonnet 5.5 at low effort scores **0.94** with the plugin and **0.82** without it on the 36 GitHub-gotcha cases, so it misses about two-thirds fewer graded checks (0.18 → 0.06). On the eight gotchas listed under [Context and correctness](#context-and-correctness) it goes from 0.50 to 0.92. Weighted toward those gotchas, the mean Δ over all 52 cases is **+0.14**, and no case has a regression whose interval excludes 0. See [docs/actions.md](docs/actions.md) for the output contract.
|
|
146
80
|
|
|
147
|
-
|
|
148
|
-
needed, every selected PR is complete, the bounded timeout expires, or `--until-terminal` crosses a
|
|
149
|
-
configured GraphQL quota-warning band. Explicit PR sets give each actionable row an exact single-PR
|
|
150
|
-
`pollCommand`, so independent rows can proceed before the next aggregate poll.
|
|
81
|
+
### Lower GitHub API quota use
|
|
151
82
|
|
|
152
|
-
|
|
153
|
-
layer that still has work gets its own one-PR session on the same tick, including a clean draft
|
|
154
|
-
whose session marks it ready. Layers do not wait for a lower layer's READY receipt, so their
|
|
155
|
-
ready-delays overlap. With automatic mark-ready disabled, the instructions ask the agent to mark
|
|
156
|
-
a clean draft ready after its probe. A queued stack, or one whose remaining layers can only wait,
|
|
157
|
-
returns `WAIT`; an idle `WAIT` that stays unchanged past the stall timeout returns `ESCALATE` with
|
|
158
|
-
`stall-timeout`. A terminal READY or fully merged stack returns `CANCEL`. Closed or unverified
|
|
159
|
-
topology returns `ESCALATE` for human direction after any other shepherdable PRs are handled;
|
|
160
|
-
until then, `SHEPHERD` remains the immediate action and lists the human blockers too.
|
|
83
|
+
GitHub meters two tiers ([details](docs/github-api.md#github-metering)):
|
|
161
84
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
with `gh stack merge <that PR number> --yes` and the allowed method flag (`--squash` unless config or the repository selects another). That lands the named layer and every
|
|
165
|
-
unmerged layer below it. When the base uses a merge queue, the same command queues the prefix
|
|
166
|
-
together and GitHub evaluates each layer from the bottom; a failure ejects that layer and those
|
|
167
|
-
above it. For a `failed_checks` removal on the layer's first ejection, the one-PR session emits a head-, queue-commit-, and timestamp-pinned local acknowledgment command; run it only when the failure does not reproduce after updating from the latest base, the head did not change, and no source changes or other blockers remain. Fresh source checks and a new READY receipt then let the aggregate selector recover the eligible prefix. Manual or stale removals cannot use this path. Layers above the prefix keep their one-PR sessions. After the merge, GitHub retargets
|
|
168
|
-
the next layer, so the rerun continues until the stack returns `CANCEL`. API and MCP aggregate
|
|
169
|
-
calls perform one summary tick and leave recurrence to the caller.
|
|
85
|
+
- Primary hourly budgets: GraphQL points and REST `core` requests.
|
|
86
|
+
- Secondary limits: per-minute points, where each GraphQL query or REST `GET` costs 1 and each mutation costs 5, plus concurrency and content-creation limits.
|
|
170
87
|
|
|
171
|
-
|
|
88
|
+
Waiting is where most quota goes, and where Shepherd saves the most. By default `gh pr checks --watch` refreshes every 10 seconds, at 1 GraphQL point per refresh. That is about 360 points an hour for each watched PR, so a few agents waiting on CI can drain the shared 5,000-point hourly budget. Shepherd polls every 60 seconds by default:
|
|
172
89
|
|
|
173
|
-
|
|
90
|
+
- A typical tick is one batched GraphQL query (1 point). Large or paginated PRs add supplement queries. When nothing changed, the fingerprint skip returns the stored report from that same query.
|
|
91
|
+
- While CI runs, that is about 60 points an hour for a typical PR, against about 360 for `gh pr checks --watch` at its default interval. The token bench models `gh` refreshing every 60 seconds, which ties Shepherd at 60 ([report](evals/tokens/REPORT.md)).
|
|
92
|
+
- When no check is running, conditional REST change detectors run first. A `304` consumes no primary quota. An hour of unchanged idle waiting costs about 4 GraphQL points instead of 60 ([graphql-usage.md](docs/graphql-usage.md)). That holds only when the stored report is eligible for the detectors. Native-stack layers, `READY` reports, incomplete snapshots, and detector failures still run the batched query each tick ([graphql.md](docs/graphql.md#idle-wait-change-detectors)).
|
|
174
93
|
|
|
175
|
-
|
|
94
|
+
Fewer requests help on both tiers. The GitHub MCP server issues one or more REST requests per tool call, so unbatched calls drain `core` and the per-minute pool faster.
|
|
176
95
|
|
|
177
|
-
|
|
96
|
+
Per session, assumed and deterministic, from the [token bench](evals/tokens/README.md):
|
|
178
97
|
|
|
179
|
-
|
|
98
|
+
| Session | GraphQL points: Shepherd / `gh` / MCP | REST core: Shepherd / `gh` / MCP |
|
|
99
|
+
| --------- | ------------------------------------: | -------------------------------: |
|
|
100
|
+
| Single PR | 30.8 / 36.5 / 12 | 4.8 / 9 / 78.3 |
|
|
101
|
+
| PR stack | 11 / 27 / 12 | 2 / 6 / 74 |
|
|
180
102
|
|
|
181
|
-
|
|
182
|
-
|
|
103
|
+
- On the default GraphQL transport, Shepherd spends fewer GraphQL points than `gh`. It makes fewer REST requests than `gh` and far fewer than MCP.
|
|
104
|
+
- On a single PR, MCP spends fewer GraphQL points but about 16× the REST requests.
|
|
105
|
+
- The REST transport used in cloud sessions spends no GraphQL points. It does spend more `core` requests than `gh` or MCP (175 single PR, 432 stack).
|
|
183
106
|
|
|
184
|
-
|
|
185
|
-
if (!result.ok) throw new Error(result.error);
|
|
107
|
+
See [docs/graphql-usage.md](docs/graphql-usage.md) and [docs/rest-usage.md](docs/rest-usage.md).
|
|
186
108
|
|
|
187
|
-
|
|
188
|
-
```
|
|
109
|
+
### Safe by construction
|
|
189
110
|
|
|
190
|
-
The
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
111
|
+
- The CLI runs read-only git only. It emits patches and commit commands for the agent to run ([AGENTS.md](AGENTS.md#git-operations)).
|
|
112
|
+
- Shepherd never merges by itself. With `--merge`, it emits a merge or queue command for the agent to run. The command is head-pinned for a single PR and guarded by READY receipts for a stack.
|
|
113
|
+
- Human handoff is a [finite escalation list](docs/escalations.md).
|
|
114
|
+
- The shipped skill tells the agent to treat review titles, comments, and CI logs as untrusted data. Shell and other MCP callers must apply that rule themselves.
|
|
115
|
+
- A denied reply or resolve is a one-look skip, not a retry loop.
|
|
194
116
|
|
|
195
|
-
|
|
196
|
-
file, or `get_journal({ pr: "owner/repo#123" })` to fetch a PR body through GraphQL and extract it.
|
|
197
|
-
Both return the typed extraction JSON in `structuredContent` and `content`; neither mutates the PR.
|
|
117
|
+
### Works across agents and environments
|
|
198
118
|
|
|
199
|
-
|
|
119
|
+
- The plugin ships [skills](docs/skills.md) for Claude Code, Codex, and Grok.
|
|
120
|
+
- Cursor and other stdio clients use the [MCP server](docs/mcp.md).
|
|
121
|
+
- Shell and CI use the [CLI](docs/cli-usage.md).
|
|
122
|
+
- In Claude Code cloud sessions, Shepherd switches to the [REST transport](docs/rest.md) and [event mode](docs/cloud.md).
|
|
123
|
+
- `--stack` reports every layer of a native GitHub stacked PR and shepherds the layers you own.
|
|
200
124
|
|
|
201
|
-
|
|
202
|
-
pr-shepherd journal extract --body-file pr-body.md
|
|
203
|
-
```
|
|
125
|
+
## Use cases
|
|
204
126
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
file in a trusted parent directory; symlinks, FIFOs, and devices are rejected with exit code 66.
|
|
208
|
-
Unsupported platforms fail closed with that same exit code.
|
|
127
|
+
- **Autonomous agents.** An agent opens a PR and drives it to merge-ready, or merged when you allow it. Nobody has to watch CI and reviews.
|
|
128
|
+
- **Exhaustive AI code review.** Some PRs get many bot reviews (CodeRabbit, Codex, Copilot, and others). Shepherd shows every thread and comment once and tracks first-look, edited, and outdated items. It batches the replies, resolves, and minimizes.
|
|
209
129
|
|
|
210
|
-
|
|
130
|
+
## How to use
|
|
211
131
|
|
|
212
|
-
|
|
132
|
+
1. **Install the MCP server and the CLI.** See [Install](#install) below.
|
|
133
|
+
2. **Write your policy into a skill or agent instruction.** Examples: "skip non-blocking review comments", "reply instead of fixing nits", "never merge". Shepherd reports state and the next action. Your instructions decide how the agent treats each comment. The shipped `pr-shepherd` skill is a thin dispatcher you can wrap ([docs/skills.md](docs/skills.md)).
|
|
134
|
+
3. **Configure Shepherd.** In `.pr-shepherdrc.yml`, turn on the bundled classification rules. They drop known bot noise before it reaches the agent, which saves more tokens and tool calls. With the default `actions.autoMinimizeSuppressed: true`, several rules also minimize matching comments on GitHub and log a Shepherd Journal entry; set it to `false` to keep comments untouched. See [docs/configuration.md](docs/configuration.md#classifystandard--default-).
|
|
213
135
|
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
```
|
|
136
|
+
```yaml
|
|
137
|
+
classify:
|
|
138
|
+
standard:
|
|
139
|
+
all: true
|
|
140
|
+
```
|
|
220
141
|
|
|
221
142
|
## Install
|
|
222
143
|
|
|
223
|
-
The plugin
|
|
224
|
-
|
|
225
|
-
To register the MCP server without the plugin, or to wire a local checkout, see [docs/mcp.md](docs/mcp.md).
|
|
226
|
-
|
|
227
|
-
### Claude Code
|
|
144
|
+
The plugin starts the version-matched `pr-shepherd-mcp` server automatically.
|
|
228
145
|
|
|
229
146
|
```bash
|
|
147
|
+
# Claude Code
|
|
230
148
|
claude /plugin marketplace add jonathanong/pr-shepherd
|
|
231
149
|
claude /plugin install pr-shepherd
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Codex
|
|
235
150
|
|
|
236
|
-
|
|
151
|
+
# Codex (then enable the pr-shepherd plugin)
|
|
237
152
|
codex plugin marketplace add jonathanong/pr-shepherd
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
Or pin a ref:
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
codex plugin marketplace add jonathanong/pr-shepherd --ref main
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
For local development:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
git clone https://github.com/jonathanong/pr-shepherd ~/.codex/plugin-sources/pr-shepherd
|
|
250
|
-
codex plugin marketplace add ~/.codex/plugin-sources/pr-shepherd
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
After adding the marketplace, install/enable the `pr-shepherd` plugin from Codex. The marketplace root must contain `.agents/plugins/marketplace.json` and `plugins/pr-shepherd/`.
|
|
254
153
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
```bash
|
|
154
|
+
# Grok
|
|
258
155
|
grok plugin marketplace add jonathanong/pr-shepherd
|
|
259
156
|
grok plugin install pr-shepherd --trust
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Grok starts a plugin's MCP server only after the plugin is trusted. Confirm with `grok mcp list` or `/mcps`.
|
|
263
|
-
|
|
264
|
-
### MCP server only
|
|
265
157
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
claude mcp add --transport stdio --scope user pr-shepherd -- \
|
|
270
|
-
npx --yes --package pr-shepherd@<version> pr-shepherd-mcp
|
|
271
|
-
codex mcp add pr-shepherd -- \
|
|
272
|
-
npx --yes --package pr-shepherd@<version> pr-shepherd-mcp
|
|
273
|
-
grok mcp add pr-shepherd -- \
|
|
274
|
-
npx --yes --package pr-shepherd@<version> pr-shepherd-mcp
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Replace `<version>` with a published version. Full config-file examples, tool schemas, and local-checkout wiring are in [docs/mcp.md](docs/mcp.md).
|
|
278
|
-
|
|
279
|
-
## Configuration
|
|
280
|
-
|
|
281
|
-
Create `.pr-shepherdrc.yml` in your project root, an ancestor directory, or `$HOME`. Every file on the walk is deep-merged; closer directories override farther ones.
|
|
282
|
-
|
|
283
|
-
```yaml
|
|
284
|
-
cliCommand: [pnpm, exec, pr-shepherd] # launcher for emitted commands; defaults to [pr-shepherd]
|
|
285
|
-
ignoreChecks:
|
|
286
|
-
- "Kilo Code Review"
|
|
287
|
-
iterate:
|
|
288
|
-
fixAttemptsPerThread: 5
|
|
289
|
-
stallTimeoutMinutes: 60
|
|
290
|
-
minimizeApprovals: false
|
|
291
|
-
minimizeComments: all # all | bots | none
|
|
292
|
-
checks:
|
|
293
|
-
ciTriggerEvents:
|
|
294
|
-
- pull_request
|
|
295
|
-
- pull_request_target
|
|
296
|
-
merge:
|
|
297
|
-
method: squash
|
|
298
|
-
commandArgs:
|
|
299
|
-
- --delete-branch
|
|
300
|
-
actions:
|
|
301
|
-
autoMinimizeSuppressed: true
|
|
302
|
-
autoMarkReady: false
|
|
158
|
+
# CLI, for shells and CI
|
|
159
|
+
npm install -g pr-shepherd
|
|
303
160
|
```
|
|
304
161
|
|
|
305
|
-
|
|
162
|
+
For the MCP server without the plugin, or a local checkout, see [docs/mcp.md](docs/mcp.md).
|
|
306
163
|
|
|
307
|
-
|
|
308
|
-
- `PR_SHEPHERD_STATE_DIR` to override state and log location.
|
|
309
|
-
- `PR_SHEPHERD_LOG_DISABLED=1` to disable per-worktree debug logging.
|
|
164
|
+
Requirements:
|
|
310
165
|
|
|
311
|
-
|
|
166
|
+
- Node.js >= 22.19.0, Bun, or Deno
|
|
167
|
+
- `git`
|
|
168
|
+
- A GitHub token or an authenticated `gh` CLI with [the required access](docs/authentication.md)
|
|
312
169
|
|
|
313
|
-
|
|
170
|
+
## Quick start
|
|
314
171
|
|
|
315
|
-
|
|
172
|
+
```text
|
|
173
|
+
/goal /pr-shepherd:pr-shepherd 42 # Claude Code
|
|
174
|
+
/goal $pr-shepherd 42 # Codex
|
|
175
|
+
/pr-shepherd 42 # Grok
|
|
176
|
+
```
|
|
316
177
|
|
|
317
|
-
|
|
178
|
+
```sh
|
|
179
|
+
pr-shepherd 42 # shell: poll for work (270s cap; --until-terminal removes it)
|
|
180
|
+
```
|
|
318
181
|
|
|
319
|
-
|
|
320
|
-
// .pr-shepherd/classification/gemini-quota.mts
|
|
321
|
-
import type { ClassifyRule } from "pr-shepherd/classify";
|
|
182
|
+
Leave out the PR number to use the current branch. Example `FIX_CODE` output:
|
|
322
183
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (!/You have reached your daily quota limit/i.test(item.body)) return null;
|
|
326
|
-
return { suppress: true, autoResolve: true };
|
|
327
|
-
};
|
|
328
|
-
export default rule;
|
|
329
|
-
```
|
|
184
|
+
```text
|
|
185
|
+
# PR #123 [FIX_CODE]
|
|
330
186
|
|
|
331
|
-
|
|
187
|
+
**status** `UNRESOLVED_COMMENTS` · **repo** `owner/repo`
|
|
188
|
+
**summary** 3 passing
|
|
332
189
|
|
|
333
|
-
|
|
190
|
+
## Review threads
|
|
334
191
|
|
|
335
|
-
|
|
192
|
+
### `threadId=PRRT_kwDOSGizTs58XB1L` — `src/commands/iterate/index.mts:42` (@alice · MEMBER)
|
|
336
193
|
|
|
337
|
-
|
|
194
|
+
> The variable name is misleading.
|
|
338
195
|
|
|
339
|
-
|
|
196
|
+
## Failing checks
|
|
340
197
|
|
|
341
|
-
|
|
198
|
+
- `24697658766` — `CI › lint / typecheck / test (22.x)` [conclusion: FAILURE]
|
|
199
|
+
> oxfmt
|
|
342
200
|
|
|
343
|
-
|
|
344
|
-
- A GitHub token or authenticated `gh` CLI with the [required repository access](docs/authentication.md). A classic PAT needs the `repo` scope for complete operation.
|
|
345
|
-
- `git`
|
|
201
|
+
## Instructions
|
|
346
202
|
|
|
347
|
-
|
|
203
|
+
1. Fix each warranted item.
|
|
204
|
+
2. Triage `## Failing checks`. Playbook: "CI failure triage".
|
|
205
|
+
3. Commit and push any changes.
|
|
206
|
+
4. Journal key decisions or rejections with URLs or IDs: `pr-shepherd apply journal 123 '- <decision>'`
|
|
207
|
+
5. `$DISMISS_MESSAGE`: one sentence on what changed. Run even if no code changed: `pr-shepherd apply review 123 --reply-thread-ids PRRT_kwDOSGizTs58XB1L --message "$DISMISS_MESSAGE" --require-sha HEAD`
|
|
208
|
+
6. Rerun Shepherd now.
|
|
209
|
+
```
|
|
348
210
|
|
|
349
|
-
|
|
211
|
+
## Documentation
|
|
350
212
|
|
|
351
|
-
|
|
213
|
+
| Topic | Doc |
|
|
214
|
+
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
215
|
+
| Index of every doc | [docs/README.md](docs/README.md) |
|
|
216
|
+
| Features, workflow assumptions, limits | [docs/features.md](docs/features.md) |
|
|
217
|
+
| Commands, flags, stacks, polling | [docs/cli-usage.md](docs/cli-usage.md) |
|
|
218
|
+
| Actions and exit codes | [docs/actions.md](docs/actions.md), [docs/exit-codes.md](docs/exit-codes.md) |
|
|
219
|
+
| Configuration and classification rules | [docs/configuration.md](docs/configuration.md), [examples/classification/](examples/classification/) |
|
|
220
|
+
| Journal, library API | [docs/api.md](docs/api.md) |
|
|
221
|
+
| Compared with Cursor, Copilot, CodeRabbit, … | [docs/comparison.md](docs/comparison.md) |
|
|
352
222
|
|
|
353
|
-
|
|
223
|
+
## Harness ecosystem
|
|
354
224
|
|
|
355
|
-
- [auto-harness](https://github.com/jonathanong/auto-harness)
|
|
356
|
-
- [agent-blackboard](https://github.com/jonathanong/agent-blackboard)
|
|
357
|
-
- [pr-shepherd](https://github.com/jonathanong/pr-shepherd)
|
|
358
|
-
- [no-mistakes](https://github.com/jonathanong/no-mistakes)
|
|
225
|
+
- [auto-harness](https://github.com/jonathanong/auto-harness): non-interactive agent CLI orchestration across sandboxes
|
|
226
|
+
- [agent-blackboard](https://github.com/jonathanong/agent-blackboard): session-scoped telemetry for autonomous agents
|
|
227
|
+
- [pr-shepherd](https://github.com/jonathanong/pr-shepherd): autonomous pull request shepherd
|
|
228
|
+
- [no-mistakes](https://github.com/jonathanong/no-mistakes): deterministic AST-based codebase intelligence, test selection, and linting for agents
|