-
-
Notifications
You must be signed in to change notification settings - Fork 19
PR Skills #8017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hatton
wants to merge
7
commits into
master
Choose a base branch
from
PR-Skills
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PR Skills #8017
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f88b964
Add PR-status sync scripts for Orca/GitHub/YouTrack alignment
hatton 1fbcd1c
Add pr-kanban-sync skill; update pr-ready-for-human to use sync scripts
hatton 5723f76
Update PR review skills: revise devin-review, replace reviewable-thre…
hatton 4d97a91
Potential fix for pull request finding
hatton 2ec0d2b
Apply suggestions from code review
hatton c50eacb
sync-pr-status: reconcile YouTrack even when Orca status already matches
hatton 15743d8
Address PR review: shared sync constants, sync-move limit + YouTrack …
hatton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| name: pr-kanban-sync | ||
| description: State machine and scripts for keeping Orca board, GitHub Projects board, and YouTrack in sync as PRs move through review stages. Use these scripts instead of raw GraphQL or direct CLI calls whenever moving a PR between stages. | ||
| argument-hint: "status to move to: waiting-ai | in-review | has-comments | completed" | ||
| user-invocable: true | ||
| --- | ||
|
|
||
| # PR Kanban Sync | ||
|
|
||
| ## Overview | ||
|
|
||
| Three systems track the same PRs. They must stay aligned: | ||
|
|
||
| | State key | Orca column | GitHub board | YouTrack | | ||
| |---|---|---|---| | ||
| | `waiting-ai` | Waiting on AI Review | Waiting for AI-Review | In Progress | | ||
| | `in-review` | In human review | Ready for Human | Ready For Code Review | | ||
| | `has-comments` | Has Comments | Has Comments | Has Comments | | ||
| | `completed` | completed (archived) | auto-hidden on merge | leave for human | | ||
|
|
||
| ## Scripts | ||
|
|
||
| Both scripts live at `scripts/` in the repo root and require Node.js 18+. | ||
|
|
||
| ### `sync-move.mjs` — move one item manually | ||
|
|
||
| ```bash | ||
| # Move all three systems at once (preferred): | ||
| node scripts/sync-move.mjs all <pr-number> <status-key> | ||
|
|
||
| # Individual systems: | ||
| node scripts/sync-move.mjs gh <pr-number> <status-key> | ||
| node scripts/sync-move.mjs orca <worktree-path> <status-key> | ||
| node scripts/sync-move.mjs yt <BL-xxxxx> <status-key> | ||
| ``` | ||
|
|
||
| `all` resolves the Orca worktree via `linkedPR` and the YouTrack issue via BL# from branch → display name → PR title → PR body. If either lookup fails it warns and skips that system; use the individual subcommands as fallback. | ||
|
|
||
| Requires env var `YOUTRACK` (YouTrack permanent token). | ||
|
|
||
| ### `sync-pr-status.mjs` — polling reconciler (zero tokens) | ||
|
|
||
| ```bash | ||
| node scripts/sync-pr-status.mjs | ||
| ``` | ||
|
|
||
| Reads all Orca worktrees with `linkedPR` set, fetches GitHub board status in one batch call, and updates any Orca worktrees + YouTrack issues that are out of sync. Intended to run every 15 minutes via Orca automation (see **Automation** below). Also safe to run manually to force a re-sync. | ||
|
|
||
| ## State Machine | ||
|
|
||
| ``` | ||
| [PR opened / first push] | ||
| → node scripts/sync-move.mjs all <pr> waiting-ai | ||
|
|
||
| [Devin and CI finish cleanly → ready for human] | ||
| → node scripts/sync-move.mjs all <pr> in-review | ||
|
|
||
| [Human reviewer: CHANGES_REQUESTED] | ||
| → node scripts/sync-move.mjs all <pr> has-comments | ||
|
|
||
| [Author pushes new commits while in has-comments or in-review] | ||
| → node scripts/sync-move.mjs all <pr> waiting-ai (restart bot-wait) | ||
|
|
||
| [PR merged or closed] | ||
| → node scripts/sync-move.mjs all <pr> completed | ||
| (YouTrack is skipped for completed — type-dependent, leave for human) | ||
| ``` | ||
|
|
||
| ## GitHub Board Reference | ||
|
|
||
| Project: **PR Review Tracker** — https://github.com/orgs/BloomBooks/projects/2 | ||
|
|
||
| GraphQL IDs (hardcoded in `sync-move.mjs` — do not re-query unless they stop working): | ||
| - Project ID: `PVT_kwDOAFlSFM4Bawkp` | ||
| - Status field ID: `PVTSSF_lADOAFlSFM4BawkpzhVl0_w` | ||
| - Option IDs: `97860183` (Waiting for AI-Review), `05eedb52` (Ready for Human), `99a3f545` (Has Comments) | ||
|
|
||
| ## Adding a PR to the Board | ||
|
|
||
| `sync-move.mjs` only updates items already on the board. To add a new PR: | ||
|
|
||
| ```bash | ||
| PR_NODE_ID=$(gh pr view <number> --repo BloomBooks/BloomDesktop --json id --jq '.id') | ||
| gh api graphql -f query="mutation { | ||
| addProjectV2ItemById(input: { | ||
| projectId: \"PVT_kwDOAFlSFM4Bawkp\" | ||
| contentId: \"$PR_NODE_ID\" | ||
| }) { item { id } } | ||
| }" | ||
| # Then immediately set its status: | ||
| node scripts/sync-move.mjs gh <pr-number> waiting-ai | ||
| ``` | ||
|
|
||
| ## Automation (15-minute polling) | ||
|
|
||
| Register once per machine (the automation targets the `master-2` worktree as a stable shell host): | ||
|
|
||
| ```powershell | ||
| orca automations create ` | ||
| --name "Sync PR Status" ` | ||
| --trigger "*/15 * * * *" ` | ||
| --workspace "path:D:/orca-worktrees/bloom/master-2" ` | ||
| --reuse-session ` | ||
| --prompt "Run this command and report its output: node scripts/sync-pr-status.mjs" ` | ||
| --provider claude ` | ||
| --json | ||
| ``` | ||
|
|
||
| To list or remove: | ||
| ```bash | ||
| orca automations list --json | ||
| orca automations remove <automationId> --json | ||
| ``` | ||
|
|
||
| ## Known Limitations | ||
|
|
||
| - `all` and the polling script only update Orca if `linkedPR` is set on the worktree. Orca sets this automatically when a PR is opened through its UI. If you created the PR via `gh pr create`, link it manually: | ||
| ```bash | ||
| # Not yet supported by orca CLI — use individual subcommands as fallback | ||
| node scripts/sync-move.mjs gh <pr> <status> | ||
| orca worktree set --worktree active --workspace-status <orca-status> | ||
| node scripts/sync-move.mjs yt <BL-xxxxx> <status> | ||
| ``` | ||
| - YouTrack is skipped if no `BL-xxxxx` appears anywhere in the branch name, display name, PR title, or PR body. | ||
| - The `completed` transition leaves YouTrack alone (bug vs feature determines the final state there). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.