manage-prs
Manage and maintain GitHub pull requests end-to-end. Use when Codex is asked to fix PR review comments, unresolved review threads, top-level PR conversation comments, requested changes, merge conflicts, or CI/CD failures; when the user says to manage, maintain, clean up, unblock, get green, finish, or prepare a PR; or when a PR must have no unresolved actionable comments and no failing checks.
What this skill does
# Manage PRs
## Operating Rule
Treat GitHub as the source of truth. Do not rely on stale browser state, old summaries, local guesses, or a previous agent's report.
Only mark review threads resolved after:
1. The related code/doc/test fix is committed.
2. The branch is pushed.
3. The live PR state is re-read and the fixed thread IDs are still the threads being resolved.
Top-level PR conversation comments do not have review-thread resolution. Address them by fixing the issue, pushing the fix, and replying only when a reply is useful or explicitly requested.
## Quick Start
From the target repo:
```bash
python3 "<skill-dir>/scripts/inspect_pr_state.py" --repo "." --pr "<number-or-url>"
```
If the current branch has exactly one PR, omit `--pr`.
After fixes are pushed and the live thread IDs are confirmed:
```bash
python3 "<skill-dir>/scripts/resolve_review_threads.py" --repo "." --thread-id "<thread-id>"
```
## Workflow
1. Confirm the target PR.
- Use a provided PR number/URL when present.
- Otherwise run `gh pr view --json number,url,headRefName,headRepositoryOwner`.
- Run `git status --short` before editing. Preserve unrelated user changes.
2. Refresh from GitHub.
- Run `git fetch --all --prune`.
- Inspect mergeability with `gh pr view <pr> --json number,url,headRefName,baseRefName,mergeable,mergeStateStatus,reviewDecision`.
- If the branch is behind or conflicted, update from the PR base using the repo's normal merge/rebase pattern before calling the PR clean.
3. Inventory every blocker.
- Run `inspect_pr_state.py`.
- Read unresolved review threads.
- Read top-level PR conversation comments.
- Read review summary bodies, especially `CHANGES_REQUESTED`.
- Read failing and pending checks.
- For failing GitHub Actions checks, fetch logs with `gh run view <run-id> --log` or use the existing `gh-fix-ci` skill/script if available.
- For external CI providers, open the details URL if tooling is available; otherwise report the exact external URL and continue with local reproduction where possible.
4. Cluster comments by root cause.
- Multiple comments often point at one bug. Fix the bug once instead of making one-off edits for each comment.
- Separate actionable requests from stale, duplicate, or already-addressed comments.
- Do not resolve a stale-looking thread until live code proves it is obsolete and the branch has been pushed.
5. Fix with tests.
- Reproduce failing CI locally when feasible.
- Add or update focused tests for review-comment fixes that affect behavior.
- Run the narrowest meaningful verification first, then broader gates when the PR touches shared code.
- Do not weaken lint, typecheck, tests, snapshots, coverage, security checks, or required workflows to get green.
6. Commit and push.
- Use the repo's commit conventions.
- If push is rejected, fetch/rebase or merge the remote branch, rerun the relevant checks, then push again.
- Never resolve review threads before this push succeeds.
7. Re-check GitHub.
- Re-run `inspect_pr_state.py`.
- Re-run `gh pr checks <pr>` or the provider-specific status command.
- If checks are pending, wait or watch them when practical. Do not claim there are no failing checks while required checks are still red.
8. Resolve completed review threads.
- Resolve only the exact thread IDs whose requested changes were fixed and pushed.
- Use `resolve_review_threads.py` or the GraphQL mutation directly.
- Re-run `inspect_pr_state.py` and confirm unresolved actionable review threads are zero.
9. Final report.
- Include the PR URL/number.
- List the comments fixed, top-level comments addressed, and CI failures cleared.
- State the exact verification run.
- If anything remains pending or externally blocked, say exactly which check/comment and link the details.
## Comment Handling Rules
- Review threads: fix, push, then resolve via GraphQL `resolveReviewThread`.
- Top-level PR conversation comments: fix the underlying issue. Reply only when a human needs a note; do not pretend they can be resolved.
- Review summary bodies: treat `CHANGES_REQUESTED` as actionable even when there is no inline thread.
- Bot comments: handle if they identify a real blocker. Ignore noise only after proving it is non-actionable.
- Duplicates: mention they are duplicates in the final report, but still verify there is no separate unresolved request.
## CI/CD Handling Rules
- Required checks must not be failing when done.
- A local green test does not replace a red GitHub check. Use logs to connect the local fix to the failing workflow.
- Treat pending checks as pending, not green.
- Treat skipped/neutral checks as their own bucket. They are not failures unless branch protection or the PR UI marks them as blockers.
- If a failure is environmental or third-party, gather the run URL, error text, and retry status before reporting it as blocked.
- If several PRs share the same failing workflow, fix the shared workflow once and verify each affected PR state separately.
## Useful GraphQL Mutation
Use this only after the fix is pushed:
```bash
gh api graphql \
-f threadId="<thread-id>" \
-f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{id isResolved}}}'
```
## Bundled Scripts
- `scripts/inspect_pr_state.py`: prints unresolved review threads, top-level PR comments, review summaries, and status checks for a PR.
- `scripts/resolve_review_threads.py`: resolves explicit review-thread IDs after the branch has been fixed and pushed.
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.