|
| 1 | +--- |
| 2 | +name: project-pipeline |
| 3 | +description: Pick a Ready issue from the GitHub Project board, move it through In Progress -> issue-to-pr -> review-agentic |
| 4 | +--- |
| 5 | + |
| 6 | +# Project Pipeline |
| 7 | + |
| 8 | +Pick a "Ready" issue from the [GitHub Project board](https://github.com/orgs/CodingThrust/projects/8/views/1), move it to "In Progress", run `issue-to-pr --execute`, then move it to "review-agentic". The separate `review-pipeline` handles Copilot comments, CI fixes, and agentic testing. |
| 9 | + |
| 10 | +## Invocation |
| 11 | + |
| 12 | +- `/project-pipeline` -- pick the next Ready issue (first Model, then Rule, by issue number) |
| 13 | +- `/project-pipeline 97` -- process a specific issue number from the Ready column |
| 14 | +- `/project-pipeline --all` -- batch-process all Ready issues (Models first, then Rules) |
| 15 | + |
| 16 | +## Constants |
| 17 | + |
| 18 | +GitHub Project board IDs (for `gh project item-edit`): |
| 19 | + |
| 20 | +| Constant | Value | |
| 21 | +|----------|-------| |
| 22 | +| `PROJECT_ID` | `PVT_kwDOBrtarc4BRNVy` | |
| 23 | +| `STATUS_FIELD_ID` | `PVTSSF_lADOBrtarc4BRNVyzg_GmQc` | |
| 24 | +| `STATUS_READY` | `61e4505c` | |
| 25 | +| `STATUS_IN_PROGRESS` | `47fc9ee4` | |
| 26 | +| `STATUS_REVIEW_AGENTIC` | `b2f16561` | |
| 27 | +| `STATUS_IN_REVIEW` | `df73e18b` | |
| 28 | +| `STATUS_DONE` | `98236657` | |
| 29 | + |
| 30 | +## Autonomous Mode |
| 31 | + |
| 32 | +This skill runs **fully autonomously** — no confirmation prompts, no user questions. It picks the next issue and processes it end-to-end. All sub-skills (`issue-to-pr`, `check-issue`, `add-model`, `add-rule`, etc.) should also auto-approve any confirmation prompts. |
| 33 | + |
| 34 | +## Steps |
| 35 | + |
| 36 | +### 0. Discover Ready Issues |
| 37 | + |
| 38 | +```bash |
| 39 | +gh project item-list 8 --owner CodingThrust --format json |
| 40 | +``` |
| 41 | + |
| 42 | +Filter items where `status == "Ready"`. Partition into `[Model]` and `[Rule]` buckets, sort each by issue number ascending. Final order: **all Models first, then all Rules** (so dependencies are satisfied). |
| 43 | + |
| 44 | +Print the list for visibility (no confirmation needed): |
| 45 | + |
| 46 | +``` |
| 47 | +Ready issues: |
| 48 | + Models: |
| 49 | + #129 [Model] MultivariateQuadratic |
| 50 | + #117 [Model] GraphPartitioning |
| 51 | + Rules: |
| 52 | + #97 [Rule] BinPacking to ILP |
| 53 | + #110 [Rule] LCS to ILP |
| 54 | + #126 [Rule] KSatisfiability to SubsetSum |
| 55 | + #130 [Rule] MultivariateQuadratic to ILP |
| 56 | +``` |
| 57 | + |
| 58 | +**If a specific issue number was provided:** verify it is in the Ready column. If not, STOP with a message. |
| 59 | + |
| 60 | +**If `--all`:** proceed immediately with all Ready issues in order (no confirmation). |
| 61 | + |
| 62 | +**Otherwise (no args):** pick the first issue in the ordered list (Models before Rules, lowest number first) and proceed immediately (no confirmation). |
| 63 | + |
| 64 | +### 1. Create Worktree |
| 65 | + |
| 66 | +Create an isolated git worktree for this issue so the main working directory stays clean: |
| 67 | + |
| 68 | +```bash |
| 69 | +git fetch origin main |
| 70 | +BRANCH="issue-<number>-<slug>" |
| 71 | +WORKTREE_DIR=".worktrees/$BRANCH" |
| 72 | +mkdir -p .worktrees |
| 73 | +git worktree add "$WORKTREE_DIR" -b "$BRANCH" origin/main |
| 74 | +cd "$WORKTREE_DIR" |
| 75 | +``` |
| 76 | + |
| 77 | +All subsequent steps run inside the worktree. This ensures the user's main checkout is never modified. |
| 78 | + |
| 79 | +### 2. Move to "In Progress" |
| 80 | + |
| 81 | +Extract the project item ID for the chosen issue from the JSON output (the `id` field of the matching item). |
| 82 | + |
| 83 | +```bash |
| 84 | +gh project item-edit \ |
| 85 | + --id <ITEM_ID> \ |
| 86 | + --project-id PVT_kwDOBrtarc4BRNVy \ |
| 87 | + --field-id PVTSSF_lADOBrtarc4BRNVyzg_GmQc \ |
| 88 | + --single-select-option-id 47fc9ee4 |
| 89 | +``` |
| 90 | + |
| 91 | +### 3. Run issue-to-pr --execute |
| 92 | + |
| 93 | +Invoke the `issue-to-pr` skill with `--execute` (working directory is the worktree): |
| 94 | + |
| 95 | +``` |
| 96 | +/issue-to-pr <number> --execute |
| 97 | +``` |
| 98 | + |
| 99 | +This handles the full pipeline: fetch issue, verify Good label, research, write plan, create PR, implement, review, fix CI. |
| 100 | + |
| 101 | +**If `issue-to-pr` fails:** record the failure, but still move the issue to "In Review" so it's visible for human triage. Report the failure to the user. |
| 102 | + |
| 103 | +### 4. Move to "review-agentic" |
| 104 | + |
| 105 | +After `issue-to-pr` completes (success or failure with a PR created), move the issue to the `review-agentic` column for the second-stage review pipeline: |
| 106 | + |
| 107 | +```bash |
| 108 | +gh project item-edit \ |
| 109 | + --id <ITEM_ID> \ |
| 110 | + --project-id PVT_kwDOBrtarc4BRNVy \ |
| 111 | + --field-id PVTSSF_lADOBrtarc4BRNVyzg_GmQc \ |
| 112 | + --single-select-option-id b2f16561 |
| 113 | +``` |
| 114 | + |
| 115 | +**If no PR was created** (issue-to-pr failed before creating a PR): move the issue back to "Ready" instead: |
| 116 | + |
| 117 | +```bash |
| 118 | +gh project item-edit \ |
| 119 | + --id <ITEM_ID> \ |
| 120 | + --project-id PVT_kwDOBrtarc4BRNVy \ |
| 121 | + --field-id PVTSSF_lADOBrtarc4BRNVyzg_GmQc \ |
| 122 | + --single-select-option-id 61e4505c |
| 123 | +``` |
| 124 | + |
| 125 | +### 5. Clean Up Worktree |
| 126 | + |
| 127 | +After the issue is processed (success or failure), clean up the worktree: |
| 128 | + |
| 129 | +```bash |
| 130 | +cd /Users/liujinguo/rcode/problemreductions |
| 131 | +git worktree remove "$WORKTREE_DIR" --force |
| 132 | +``` |
| 133 | + |
| 134 | +### 6. Report (single issue) |
| 135 | + |
| 136 | +Print a summary: |
| 137 | + |
| 138 | +``` |
| 139 | +Pipeline complete: |
| 140 | + Issue: #97 [Rule] BinPacking to ILP |
| 141 | + PR: #200 |
| 142 | + Status: Awaiting agentic review |
| 143 | + Board: Moved Ready -> In Progress -> review-agentic |
| 144 | +``` |
| 145 | + |
| 146 | +### 7. Batch Mode (`--all`) |
| 147 | + |
| 148 | +If `--all` was specified, repeat Steps 1-6 for each issue in order. Each issue gets its own worktree (created and cleaned up per issue). |
| 149 | + |
| 150 | +After all issues, print a batch report: |
| 151 | + |
| 152 | +``` |
| 153 | +=== Project Pipeline Batch Report === |
| 154 | +
|
| 155 | +| Issue | Title | PR | Status | Board | |
| 156 | +|-------|------------------------------------|------|-------------|-------------| |
| 157 | +| #129 | [Model] MultivariateQuadratic | #201 | CI green | review-agentic | |
| 158 | +| #97 | [Rule] BinPacking to ILP | #202 | CI green | review-agentic | |
| 159 | +| #110 | [Rule] LCS to ILP | #203 | fix failed | review-agentic | |
| 160 | +| #126 | [Rule] KSat to SubsetSum | - | plan failed | Ready | |
| 161 | +
|
| 162 | +Completed: 2/4 | In Review: 3 | Returned to Ready: 1 |
| 163 | +``` |
| 164 | + |
| 165 | +## Common Mistakes |
| 166 | + |
| 167 | +| Mistake | Fix | |
| 168 | +|---------|-----| |
| 169 | +| Issue not in Ready column | Verify status before processing; STOP if not Ready | |
| 170 | +| Missing project scopes | Run `gh auth refresh -s read:project,project` | |
| 171 | +| Forgetting to move back to Ready on total failure | Only move to In Review if a PR exists | |
| 172 | +| Processing Rules before Models | Always sort Models first — Rules may depend on them | |
| 173 | +| Not syncing main between batch issues | Each issue gets a fresh worktree from `origin/main` | |
| 174 | +| Worktree left behind on failure | Always clean up with `git worktree remove` in Step 5 | |
| 175 | +| Working in main checkout | All work happens in `.worktrees/` — never modify the main checkout | |
0 commit comments