gh owned does the deterministic work: roles, via teams, and the solo-merge
verdict per repo. This skill adds the judgment: which broad teams to ignore,
which PRs need the user, and what to hand to other skills.
Run gh owned --help for flags and the meaning of every role and verdict.
0. Setup
gh extension list | grep gh-owned. If missing, ask before runninggh extension install jackchuka/gh-owned.gh auth statusmust listread:org. If not, tell the user to rungh auth refresh -s read:orgthemselves (it is interactive).
1. Scan
gh owned <targets> --format json > /tmp/owned.json
Run it with --format json: through a pipe, table prints bare tab-separated
rows without the summary.
Targets come from the user: --enterprise, --org, or --repo. Do not guess
an org. Ask before scanning a large sandbox or playground org; offer
--exclude-org. If --enterprise fails, the user likely cannot read the
enterprise; retry with --org.
By default the PR is assumed to be opened by someone else. Add --as-author
when the user wrote the PR, or --as-pusher when they pushed its latest commit.
2. Decide which teams to ignore
Count repos per handle in .repos[] | select(.role == "owner" or .role == "path-owner") | .via[].
Company-wide or department-wide teams near the top make the user
"responsible" for repos they never look at. Ask the user which teams
to ignore, recommending the broadest ones, then rerun with --ignore-team for
each. Remember the choice for the rest of the session.
3. Find the PRs that need the user
gh owned <targets> --ignore-team ... --format gh-dash > /tmp/owned.yml
Each filters: value is a search query in the legacy syntax, where repeated
repo: qualifiers are ORed. Run each one with the REST search API, not
gh search prs (its advanced syntax ANDs them):
gh api -X GET search/issues -f q="is:pr <filters>" -f per_page=100 \
--jq '.items[] | [.repository_url, .number, .title, .user.login, .updated_at] | @tsv'
4. Report
Lead with counts per role, then:
- PRs in Review requested and Owned: needs review, oldest first. Mark PRs not updated in 90 days as stale candidates to close.
- Owned: approved PRs: ready to merge if the repo's
soloallows. - Bot PRs (
dependabot,renovate) grouped by repo, offered to a dependency-PR triage skill with the repo list if one is installed. - Supplementary PRs last. Say that nobody named the user there: approving overrides the named owners in practice.
Mention repos whose solo is blocked or partial when the user plans to
merge there, with the note explaining why.
Caveats to state when they apply:
- Only the default branch is evaluated; status checks and merge queues are not.
- Notes saying
not visible without adminmean branch protection was only partly readable: a bypass the user has may be missing (verdict too strict), and a last-push rule may be missing (verdict too lenient with--as-pusher). Say so rather than presenting the verdict as certain.
5. Optional: install the gh-dash sections
If the user uses gh-dash, offer to merge the generated prSections into
~/.config/gh-dash/config.yml. Confirm before writing; keep their existing
sections.