Skip to content

feat(pr-management): add the shepherd skill for a maintainer's own open PRs - #2109

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/pr-management-shepherd
Nov 15, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:feat/pr-management-shepherd

Conversation

@potiuk

@potiuk potiuk commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

  • New skill pr-management-shepherd: gets the maintainer's own open PRs to a mergeable state and keeps the default branch green. Step 3 picks one action per PR from a fixed table: rebase, rerun a job cancelled at its time limit, fix a failure in a changed file, fix a red default branch, fix an open code-scanning or reviewer comment, wait, or enable auto-merge. Everyone else's PRs go to pr-management-code-review.
  • Before every push it runs the whole-tree check, because a PR's CI checks only its own diff; a dependency bump's new lint finding, or a reference left stale elsewhere, otherwise surfaces only on the default branch after the merge.
  • It never merges: a direct merge is Agentic Autonomous (merge-candidates/why-not-merge.md). It prints gh pr merge for an approved CLEAN PR, and enables auto-merge only on confirmation. Force pushes carry a lease on the SHA last pushed; a contributor's branch is pushed to only when the maintainer asks and maintainerCanModify is true.
  • It reads a failed job's step list (a few hundred tokens) instead of the whole log (about 20k tokens on the runs that motivated it), and reads a log only for the failed step.

Written with write-skill and passed through optimize-skill. The body is about 2,000 tokens excluding pre-flight, and description + when_to_use about 130.

Type of change

  • Skill change — eval fixtures added

Test plan

  • tools/skill-evals/evals/pr-management-shepherd/: 6/6 passed (two live runs, journaled).
  • skill-and-tool-validate: no violations, no warnings for the new skill.
  • prek run --all-files --skip workspace-pytest --skip lychee, then the tests for changed members: passed.

Linked issues

None.

Generative AI disclosure: prepared with Claude Code (Opus 5).

🤖 Generated with Claude Code

…en PRs

`pr-management-shepherd` gets the viewer's open PRs to a mergeable state and
keeps the default branch green: it re-runs CI jobs cancelled at their time
limit, fixes real failures and code-scanning notes on the branch, rebases
stale branches behind a whole-tree pre-push gate, repairs a red default
branch, and hands everyone else's PRs to `pr-management-code-review`.
Every push, rerun, post and auto-merge is a proposal; it never merges.

Step 3 decides one action per PR from a fixed table; its eval suite covers
a timeout, a lint failure in a changed file, an open CodeQL note, a failure
only in untouched files, an all-green PR without auto-merge, and an
injection attempt in a review comment.

It reads a failed job's step list rather than its whole log, which keeps
the timeout check to a few hundred tokens.

Generated-by: Claude Opus 5
Claude-Session: https://claude.ai/code/session_01NyQq9UgHu7T8a8DfcfyP2M
@potiuk potiuk added family:pr-management pr-management-* skills capability:review Deep per-item code review or contributor mentoring capability:fix Implement code change to resolve an issue labels Nov 15, 2026
@potiuk
potiuk enabled auto-merge (squash) November 15, 2026 15:04
@github-actions github-actions Bot added family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs family:ci .github workflows, prek, validators capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) substrate:framework-dev Tool substrate: build / validate / eval the framework itself family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json labels Nov 15, 2026
@potiuk
potiuk merged commit 89074eb into apache:main Nov 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:review Deep per-item code review or contributor mentoring family:ci .github workflows, prek, validators family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json family:docs Docs, MISSION.md, READMEs family:pr-management pr-management-* skills family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant