github.get_pr_ready_to_merge
Get the current PR to a state where it can be reviewed and merged
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- model
- sonnet
- description
- Get the current PR to a state where it can be reviewed and merged
03 SKILL.md 正文
Goal
- Run the AI lint, the standard linter, the local tests, and GitHub CI for the current PR, fixing anything that comes up, so the PR is ready to be reviewed and merged
Workflow
Create and Update a Plan
-
Create a file
plan-github.get_pr_ready_to_merge.mdwith a plan in the form of a bullet list of actions and maintain it updated, by marking each action- [.] when something is in progress
- [x] when something is done
- [F] when something failed
-
E.g.,
# Plan: get PR #... ready to merge - [ ] Get PR number and branch name - [ ] Make sure PR is ready (not draft) - [ ] Run AI lint with --add_todos, commit TODOs - [ ] Resolve added TODO(ai_gp) items - [ ] Run standard linter, fix issues - [ ] Make Sure The Affected Local Tests Pass - [ ] Make local tests pass - [ ] Run and monitor GitHub CI - [ ] Report status on PR - [ ] Fix any CI failures
Get the PR Number and Branch Name
-
Get the PR number
> GH_PR_NUM=$(gh pr view --json number -q .number) -
Get the branch name
> BRANCH_NAME=$(git branch --show-current)
Run the AI Lint and Add TODOs
-
Run the AI-based linter on the branch, asking it to leave
TODOs instead of silently rewriting the code> linters2/cc_lint.py --branch --add_todos -
Commit the added
TODOs together with any other pending changes, following "Never Commit Junk Files" below
Resolve the Added TODOs
- For each file that
cc_lint.pyannotated, use/coding.todoai_gpto implement theTODO(ai_gp)items it added - Commit the fixes, following "Never Commit Junk Files" below
Run the Standard Linter
-
Run the repo's standard linter on the branch
> linters2/lint.py --branch -
Commit any resulting changes, following "Never Commit Junk Files" below
Fix Pyright Issues
- Fix the pyright warnings and errors in the branch
> linters2/lint.py --clear_actions --action "pyright" --branch - Commit any resulting changes, following "Never Commit Junk Files" below
Make Sure The Affected Local Tests Pass
- Run the subset of tasks that are affected by the change, using
to iterate on the tests and then> pytest <TEST_NAMES>pytest_multi_build.pyto check all the different builds> pytest_multi_build.py --target <TEST_NAMES>
Make Sure Local Tests Pass
- Use
/github.get_pr_to_pass_local_teststo run and fix the local unit tests for the branch, even if it's a long task
Make Sure GitHub CI Passes
- Use
/github.get_pr_to_pass_ci_teststo run and monitor GitHub CI, fix any failures
Never Commit Junk Files
- Never run
git add -Aorgit add .to stage a fix: it sweeps in every untracked file sitting in the working tree (logs,tmp.*scratch files, test-run artifacts like.pkl/.jsoncaches, etc.), not just the files you intended to fix - Always stage files explicitly by path, e.g.
git add <file1> <file2> - Before committing, run
git status --shortand review every listed file; drop anything that is not part of the intended fix - If junk files were already committed and pushed, fix it by amending the commit to
contain only the intended files and force-pushing (
git push --force-with-lease), rather than leaving the junk in history
Loop
- Keep repeating until the branch has no outstanding
cc_lint.pyTODOs, the standard linter is clean, and the local tests and the GitHub CI checks are all passing
Constraints
- This skill runs both when executed locally on a dev computer and remotely on cloud (e.g., on GitHub or Anthropic infrastructure)
Verification
- [ ]
linters2/cc_lint.py --branch --add_todosadds no newTODOs - [ ] No unresolved
TODO(ai_gp)items remain in the branch's modified files - [ ]
linters2/lint.py --branchreports no issues - [ ] Local unit tests pass (per
/github.get_pr_to_pass_local_tests) - [ ]
gh pr checks --watch $GH_PR_NUMreports all checks successful (per/github.get_pr_to_pass_ci_tests) - [ ] A PR comment reports the final CI status
- [ ]
git status --shortshows only the intended files staged before commit
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage