pi-odd-worktree 3.9.2 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -40
  3. package/extensions/odd-worktree-tools.ts +1028 -17
  4. package/lib/gh-issues.js +65 -10
  5. package/lib/gh-prs.js +2011 -0
  6. package/lib/issue-preview.js +70 -4
  7. package/lib/issues-cache-store.js +4 -1
  8. package/lib/issues-section.js +346 -23
  9. package/lib/issues-view.js +116 -5
  10. package/lib/pr-preview.js +353 -0
  11. package/lib/prs-rail-store.js +317 -0
  12. package/lib/prs-view.js +2896 -0
  13. package/lib/user-prompt-card.js +477 -0
  14. package/package.json +1 -1
  15. package/tools/files-bridge.test.js +2 -2
  16. package/tools/files-command.test.js +1 -1
  17. package/tools/fixtures/gh-pr-connection-page.json +84 -0
  18. package/tools/fixtures/gh-pr-metadata.json +29 -0
  19. package/tools/fixtures/gh-pr-rail.json +61 -0
  20. package/tools/fixtures/gh-pr-search-page.json +82 -0
  21. package/tools/fixtures/gh-pr-view.json +159 -0
  22. package/tools/gh-issues.test.js +4 -2
  23. package/tools/gh-prs.test.js +1828 -0
  24. package/tools/issue-preview.test.js +119 -0
  25. package/tools/issues-cache-store.test.js +2 -2
  26. package/tools/issues-command.test.js +10 -3
  27. package/tools/issues-open-guard.test.js +15 -0
  28. package/tools/issues-section.test.js +618 -9
  29. package/tools/issues-view.test.js +297 -0
  30. package/tools/package-surface.test.js +21 -5
  31. package/tools/pr-preview.test.js +281 -0
  32. package/tools/prs-command.test.js +1280 -0
  33. package/tools/prs-rail-store.test.js +343 -0
  34. package/tools/prs-t10-safety.test.js +326 -0
  35. package/tools/prs-t12-safety.test.js +348 -0
  36. package/tools/prs-t13-independent.test.js +378 -0
  37. package/tools/prs-t14-safety.test.js +340 -0
  38. package/tools/prs-t15-independent.test.js +259 -0
  39. package/tools/prs-t18-safety.test.js +217 -0
  40. package/tools/prs-t7-safety.test.js +127 -0
  41. package/tools/prs-view.test.js +1462 -0
  42. package/tools/user-prompt-card.test.js +963 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jonathan Soto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # pi-odd-worktree
2
2
 
3
- A Pi extension that gives an agent session worktrees, ODD documents and GitHub issues, with `git` as its only external requirement.
3
+ A Pi package that gives an agent session Git worktrees, ODD documents, GitHub issues and pull requests, and draws their cards inside Gentle Shell.
4
4
 
5
5
  ## What It Does
6
6
 
7
- Two agent tools, four panels, one background-explorer command, one sidebar section and two tool designs, loaded from one extension entry point. Each ODD feature gets its own checkout beside the clone, and you move between checkouts and read your ODD documents, files and issues without leaving Pi.
7
+ Two agent tools, five panels, one background-explorer command, one sidebar section and two tool designs, loaded from one extension entry point. Each ODD feature gets its own checkout beside the clone, and you move between checkouts and read your ODD documents, files, issues and pull requests without leaving Pi.
8
8
 
9
9
  | Surface | Kind | What it does |
10
10
  | --- | --- | --- |
@@ -13,45 +13,63 @@ Two agent tools, four panels, one background-explorer command, one sidebar secti
13
13
  | `/warp` | panel | Moves this session to another checkout, creates one, and removes one. |
14
14
  | `/odd` | panel | Reads this checkout's `odd/tasks/*.md`: list on the left, styled markdown on the right. |
15
15
  | `/files` | panel | Browses one checkout's files with a live, language-coloured preview: `enter` pastes the chosen paths into your prompt, `ctrl+e` opens the file in `$EDITOR`. |
16
- | `/issues` | panel | Reads this checkout's GitHub issues — the three scoped tabs on open, every open issue behind `g` — and, when your role allows it, edits them. |
17
- | `GITHUB` rail section | sidebar section | Lists the open issues of this checkout's repository assigned to you, seven at a time plus a count of the rest; a click opens that issue in `/issues` on `Assigned` and the overflow row opens `/issues`. Needs `gh` and gentle-shell-bridge with its rail; without `gh` on `PATH` it is never added to the rail at all. |
18
- | `activity` tags design | design on the bridge's `Card activity` line | Optional: `/gentle:customize` → `Cards` → `Card activity`, with `default` (the host's own card) and `activity`, which is selected for you on the first run. It covers `bash`, the read-only shell tools `grep`, `find`, `ls`, and `read`, `write` and `edit`: a bash card's heading names what the command does, each family in its own theme colour (`⌕ exploring`, `✓ checking`, …; an unnamed command reads `$ bash`), those three are always `⌕ exploring`, and a `read` — which runs no shell command — is left exactly as the host drew it. `read`, `write` and `edit` are covered so that the file card can ask about them too, `write` and `edit` through a scope limited to skill and ODD paths (gentle-shell-bridge 0.9.0): the design draws nothing of its own for any of the three, so a read, a write or an edit on a skill or an ODD artifact is the file card's row and everything else stays the host's. A finished call shows its duration on the closing rule and the frame turns `warning` while the call runs and `error` when it fails. Needs gentle-shell-bridge 0.6.0 or newer for the one `Card activity` row over the six tools, and 0.9.0 for `edit` and the scope that claims a write or an edit; on 0.5.0 the row is `Card bash`, covers bash alone and keeps everything above for bash cards. Registered through gentle-shell-bridge's `registerToolDesign`; the bridge owns the choice, remembers it and repaints cards already on screen. |
19
- | `color` diff design | design on the bridge's `Card diff` line | Optional: `/gentle:customize` → `Cards` → `Card diff`, with `default` (the host's own card) and `color`, which is selected for you on the first run. It covers `write` and `edit` and redraws them as an IDE pane: a write's content behind a line-number gutter, and an edit's diff, both in the active theme's own syntax roles from Pi's highlighter — the same one `/files` previews with. A write or an edit on a skill or an ODD artifact stays the file card's row, because the `Card activity` line claims exactly those calls and a specific claim wins over this generic one. Needs gentle-shell-bridge 0.9.0 or newer; on anything older nothing is registered and `Card diff` never appears. |
16
+ | `/issues` | panel | Reads this checkout's GitHub issues — the three scoped tabs on open, every open issue behind `g` — and, when your role allows it, edits them. `enter` inserts the focused issue into the chat input as `ISSUE #63`, and each linked pull request in the pane is its own click that opens that pull request in `/prs`. |
17
+ | `/prs` | panel | The same reader for pull requests: `My Pull Request`, `Needs My Review` and `Involved` on open, every open pull request of the repository behind `g`, the pane's `Changes` and `Checks` summaries, and — when your role allows it — comment, labels, assignees, the linked issues, merge (after a confirmation naming the method and the commit message) and close. `enter` inserts the focused pull request as `PR #87`, and each linked issue in the pane is its own click that opens that issue in `/issues`. |
18
+ | `GITHUB` rail section | sidebar section | Lists the open issues of this checkout's repository you authored or are assigned, seven at a time plus a count of the rest, and its header counts the pull requests beside them (`7 issues · 3 pr`: your own plus the ones awaiting your review). A click opens that issue in `/issues` on `Assigned` — or, when the issue carries a linked pull request, that pull request in `/prs` on the bucket it belongs to; the overflow row opens `/issues`. Needs `gh`. |
19
+ | `activity` card design | design on the bridge's `Card activity` line | Optional, and selected for you on the first run: a bash card's heading names the activity its command does, each family in its own theme colour, and — while that line answers for the tool being painted — the skill/ODD file cards, the background-job cards and the two advisory messages follow it. |
20
+ | `color` diff design | design on the bridge's `Card diff` line | Optional, and selected for you on the first run: redraws `write` and `edit` as an IDE pane — a write's content behind a line-number gutter, an edit's diff — in the active theme's own syntax roles. |
20
21
 
21
22
  Moving the session and removing a checkout are human actions: only `/warp` does either, and no agent tool can. A checkout has one identity, its ODD: the directory name is the ODD it serves, and `branch` is only the git branch.
22
23
 
23
- The `activity` design is not a preference of this package: it adds that value to the bridge's own line, `Card activity` on a bridge that can put several tools on one (0.6.0 and later) and `Card bash` on anything older, which keeps `default` (the host's own card, stored as `native`) available. The bridge names that row after the line's own key, so the grouped row was `Card tools` and is `Card activity` now — the older single row was always `Card bash`, and it was never renamed. The rename is one-time, and no choice is lost with it: a value you already stored on `Card tools` is carried over to `Card activity` before the design registers, so a `default` you picked stays `default` (a stored value the bridge could not read as a choice — anything but a non-empty, non-blank id string, `native` included — is left exactly where it is, and the document is not written at all). On the first run, and only when you have not chosen yet, the package selects `activity` once — before it registers the design, so a 0.6.0 bridge carries that choice over to the grouped line — and a later choice of `default` is never undone. The colours are theme roles, so a theme that gives two roles the same colour draws those two families alike. Load order does not matter. See [the cards the `activity` design paints](docs/reference.md#the-cards-the-activity-design-paints).
24
-
25
- The diff card is a design of the same kind, on a line of its own: `Card diff`, with `default` (the host's own card, stored as `native`) kept available and `color` selected once on the first run that finds no choice. It registers nothing at all on a bridge older than `0.9.0`, because its line needs the per-`(line, tool)` claim that release introduced, and the `Card activity` line claims a write and an edit on a skill or an ODD artifact through a scope, so that specific claim wins and those stay the file card's. See [the diff card](docs/reference.md#the-diff-card).
26
-
27
- The file cards are not a preference of this package either: they belong to that same `activity` value. While the bridge answers that `activity` draws the tool being painted, a `read`, `edit` or `write` call on a skill or an ODD artifact heads as that file — its own mark and label, the tool, the path and a read's line range, each in the theme role the reference design gives it — instead of a bare tool row, and its Markdown body is drawn by Pi's own renderer with the theme's Markdown roles. Choosing `default` on `Card activity`, or any other design on that line, gives every one of those calls back to the host. The question is asked of the bridge on every paint, so a mid-session switch repaints cards already on screen, and a bridge older than 0.7.0 — which cannot answer it — keeps the card it always had. See [the file cards](docs/reference.md#the-file-cards).
28
-
29
- The jobs card follows the same value. Gentle Shell registers `bash_background`, `monitor`, `job_stop` and `job_list` with no renderer of their own, so Pi draws them in a plain box and neither `neon` nor `float` ever reaches them. While the bridge answers that `activity` draws the tool being painted, they are drawn on the same card substrate in the style the shell has chosen: the job's mark and name (its label, else the first line of its command), the whole command when expanded, and the job's own answer below. Under the `minimal` card content level the call is drawn alone, and a failure still says why. Any other answer on `Card activity`, no bridge, or a bridge older than 0.7.0 leaves Pi's own box exactly as it was — the host's fallback row (`bash_background command=…`) inside the host's own padded box, reproduced by this package because these tools have no renderer to hand the row back to. The answer is read on every paint, inside the card the host already mounted, so flipping `Card activity` between `default` and `activity` repaints the job cards already on screen, exactly as it does for `bash`. See [the jobs card](docs/reference.md#the-jobs-card).
30
-
31
- The two advisory messages Gentle Shell sends follow that same value, through the bridge's message-design surface rather than a tool renderer: `gentle-pi.exploration-budget` heads as `⌕ Exploration budget` and `gentle-pi.verifier-settle-reminder` as `⚑ Verifier reminder`, each with the numbers the message states as its detail, drawn on the same card substrate in the style the shell has chosen. Their body is never clipped — both are instructions the agent must read, so every row is drawn at any card content level, with no preview and no expand hint — and the bridge's own `[customType]` label row is dropped because the card's heading already names the alert. There is no second switch: each design FOLLOWS the `Card activity` line, so `activity` paints both alerts, live — flipping that line repaints the messages on screen and turns them off again — and `/gentle:customize` gains no row for them. A bridge older than `0.12.1` cannot keep that follow promise — `0.12.0` let a leftover stored value veto it — and gets no registration at all, so Pi's own box stays byte-identical; only a clean numeric release is trusted, and there is no capability probe. An inactive alert costs a registry walk and at most one tool-document read, and paints nothing. See [the message cards](docs/reference.md#the-message-cards).
32
-
33
24
  ## Quick Start
34
25
 
26
+ ### Requirements
27
+
35
28
  | Requirement | Why it is needed |
36
29
  | --- | --- |
30
+ | [`gentle-shell-bridge`](https://github.com/jonasotoaguilar/gentle-shell-bridge), installed **first** | Every surface this package registers. Without it the package loads nothing at all — no command, no tool, no card, no rail — and only names that install line, in a primary session. |
37
31
  | Pi (`@earendil-works/pi-coding-agent`, `@earendil-works/pi-tui`) | Peer dependencies supplied by the host; the package installs no runtime dependencies. |
38
32
  | Node.js >= 18 and `git` | Every repository operation is a `git` child process. |
39
- | `gh`, authenticated (`gh auth login`) | `/issues` and the `GITHUB` rail section, and them alone. Without it neither is registered at all — `/issues` never loads and the section is never added to the rail, so there is nothing to refuse and no line to draw — and every other surface keeps working. |
40
- | Gentle Shell (recommended) | Supplies the session records the deletion guard reads to see other sessions. |
41
- | Gentle Shell with `gentle-shell-bridge` (and its rail, for the section) | Every surface this package registers. The `activity` value of the `Card activity` line (or `Card bash`, on a bridge older than 0.6.0) in `/gentle:customize` → `Cards` — which the skill/ODD file cards obey too — and the `GITHUB` rail section, which needs the rail too. The file picker's `alt+p` and the issues panel's `alt+i` are not the bridge's: both are bound directly on the host, and `GENTLE_PI_FILES_KEY` / `GENTLE_PI_ISSUES_KEY` override the keys. Install it with `pi install npm:gentle-shell-bridge`, or `gentle-shell install npm:gentle-shell-bridge` inside a Gentle Shell session. Without it the package loads nothing at all — no command, no tool, no card, no rail — and only names that install line, in a primary session. |
33
+ | Gentle Shell (recommended) | Supplies the session records the deletion guard reads to see other sessions, and the rail the `GITHUB` section is drawn in. |
34
+ | `gh`, authenticated (`gh auth login`) | `/issues`, `/prs` and the `GITHUB` rail section, and them alone. Without `gh` on `PATH` none of the three is registered at all — `/issues` and `/prs` never load and the section is never added to the rail, so there is nothing to refuse and no line to draw — and every other surface keeps working. |
35
+
36
+ ### Install
37
+
38
+ `gentle-shell-bridge` goes first: it is the API every surface of this package is registered through.
42
39
 
43
40
  ```bash
44
- # plain Pi
41
+ # 1. the bridge, a prerequisite for every surface here
42
+ pi install npm:gentle-shell-bridge
43
+
44
+ # 2. this package
45
45
  pi install npm:pi-odd-worktree
46
+ ```
46
47
 
47
- # inside a Gentle Shell session: its launcher, same place
48
- # (the bridge above is the prerequisite for every Gentle Shell surface)
48
+ Inside a Gentle Shell session use its launcher, in the same order:
49
+
50
+ ```bash
51
+ gentle-shell install npm:gentle-shell-bridge
49
52
  gentle-shell install npm:pi-odd-worktree
50
53
  ```
51
54
 
52
55
  From a local clone, `pi install .` installs the working copy, and `gentle-shell install .` does the same from inside a Gentle Shell session.
53
56
 
54
- Expected result: `/warp`, `/odd`, `/files` and `/issues` are available as commands — `/issues` only where `gh` is on `PATH` — the agent is offered `worktree_create` and `worktree_list`, a Gentle Shell whose `gentle-shell-bridge` is installed and whose rail is drawn shows a `GITHUB` section for this checkout, and its `/gentle:customize` → `Cards` page offers `activity` on its `Card activity` line — `Card bash` on a bridge older than 0.6.0.
57
+ ### Expected result
58
+
59
+ `/warp`, `/odd`, `/files`, `/issues` and `/prs` are available as commands — `/issues` and `/prs` only where `gh` is on `PATH` — the agent is offered `worktree_create` and `worktree_list`, a Gentle Shell whose rail is drawn shows a `GITHUB` section for this checkout, and its `/gentle:customize` → `Cards` page offers `activity` on its `Card activity` line.
60
+
61
+ ### Bridge versions
62
+
63
+ Older bridges register less, never something different:
64
+
65
+ | Bridge | What it can hold |
66
+ | --- | --- |
67
+ | `0.5.0` | One `Card bash` row, bash alone; `activity` still heads a bash card with the family its command names. |
68
+ | `0.6.0` | One `Card activity` row over `bash`, `grep`, `find`, `ls` and `read`; the file card's question arrives in `0.7.0`. |
69
+ | `0.9.0` | The scoped claim that puts `write` and `edit` on the `activity` line, and the `Card diff` line itself. |
70
+ | `0.12.1` | The two advisory message cards, which follow the `Card activity` line with no row of their own. |
71
+
72
+ Below a row's floor the surface registers nothing and Pi's own card stays byte-identical. The `Card activity` line and, with it, every card that follows it are documented in [the reference](docs/reference.md#the-cards-the-activity-design-paints).
55
73
 
56
74
  ## Core Workflow
57
75
 
@@ -62,35 +80,41 @@ Expected result: `/warp`, `/odd`, `/files` and `/issues` are available as comman
62
80
 
63
81
  The full rules of each step, including every refusal, are in [Create, list, move and delete, in detail](docs/reference.md#create-list-move-and-delete-in-detail).
64
82
 
65
- ## Key Features You Should Know About
83
+ ## Key Capabilities
66
84
 
67
85
  - **Two halves are optional.** With `gentle-shell-bridge`, `/gentle:customize` has a `Tools` page with an Off/On line for `Codegraph+` (the CodeGraph prompt text, reminders and wiring; its card follows the `Card activity` line like every other card) and one for `Worktrees+` (the worktree tools, `/warp`, the worktree guards and prompt text). Both are On by default; a change needs `/reload` and a new session. See [the module switches](docs/reference.md#the-module-switches).
68
86
  - **A create is instant and writes no state.** The directory is the whole record; there is no list file and no lock file.
69
87
  - **Deleting refuses on a live session.** The guard reads Gentle Shell's presence records, discloses what it could not resolve, and never auto-warps. Removal is `git worktree remove` and the branch is kept. See [the deletion guard](docs/reference.md#the-deletion-guard-and-its-honest-limit).
70
88
  - **A warp is queued, never dropped.** While this session's tools, agent tasks or background jobs are still running, `/warp` keeps the request pending and moves when they finish. See [the queued warp](docs/reference.md#a-warp-waits-for-this-sessions-own-tools-agent-tasks-and-background-jobs).
71
- - **`/files` lists one checkout's files and pastes them.** It always asks for a checkout first — `main` included, even with nothing else registered — offering `main`, the current checkout and the worktrees this session registered, with `a` widening the list to every worktree Git lists for the clone; `ctrl+o` cycles `files`, `tree` and `ext` (the trees open folded, `space` folds the focused group and `shift+space` collapses or expands every group), and the preview is read-only, bounded and coloured from your active theme. `enter` inserts `@`-prefixed paths — a file of another checkout travels as its absolute path instead, because `@` would resolve against the wrong directory — and `ctrl+e` opens the highlighted file in `$VISUAL`/`$EDITOR`. `alt+p` opens the picker from anywhere: the shortcut is bound directly on the host, and `GENTLE_PI_FILES_KEY` overrides the key. See [the file picker](docs/reference.md#files-the-picker-its-scopes-and-its-orders).
72
- - **`/issues` opens on three tabs, not four.** The bar is `My issues`, `Assigned` and `Involved`; `All` is the `g` shortcut's own view, read the first time you enter it and reused after that, with the footer saying `g all issues` outside it and `g related issues` inside. A typed filter spans the three tabs and travels with you into `All`, which then reads a capped search and says so instead of claiming an exact total. `alt+i` opens the panel from anywhere: the shortcut is bound directly on the host, and `GENTLE_PI_ISSUES_KEY` overrides the key. See [the tabs, the shortcut and the filter](docs/reference.md#issues-three-tabs-one-shortcut-one-filter).
73
- - **`/issues` can open on one issue.** `/issues 42` (or `/issues #42`) opens the panel on `Assigned` with that issue selected, and a number that tab cannot find says so instead of guessing a row.
74
- - **`/issues` pins the repository.** Every read, mutation and browser open is bound to the repository that was loaded, and capabilities fail closed. See [the repository pin](docs/reference.md#issues-pins-the-repository).
75
- - **The issues rail is checkout-scoped and optional.** When a Gentle Shell has `gentle-shell-bridge` installed and draws its rail, a `GITHUB` rail section lists the open issues of this checkout's repository assigned to you — that one repository, not every issue across every repository you touch — seven at a time, with `and N more issues` for the rest and a pull-request mark on the issues that already have one. A click opens that issue in the `/issues` panel on `Assigned`, not in a browser: the click first proves the number belongs to this checkout, so a row left over from another checkout — or a checkout whose repository cannot be proven — opens nothing instead of guessing, and `/issues`' own `o` key is still the browser. The overflow row opens `/issues` with no number. While the rail's cache holds this repository, `/issues` paints its first frame from it and reads one tab at mount instead of three, the other two reading the first time you open them; the cache outlives both the session and the process — one document under `$XDG_CACHE_HOME/odd-worktree/` — so a warm checkout's first read is already a delta. A frame never waits on `gh`, and neither does a session start: the `gh` gate is dispatched, never awaited, so no child process and no network call sits on opening or switching a session. While the section is drawn it re-reads on its own 20 s timer, keeps no timer while hidden and stops the moment it is no longer drawn, and a `bash` command that mutates an issue or a pull request forces one read behind a 5 s cap; a failed refresh keeps the rows and marks them `stale` rather than emptying the list. Without `gh` on `PATH` neither the section nor `/issues` exists at all — the command is never registered and the section is never added to the rail — and every other surface keeps working. With no bridge the section simply never appears; the one thing you get is a single warning naming the install command, in a primary session only. See [the rail section](docs/reference.md#the-github-rail-section).
89
+ - **`/files` lists one checkout's files and pastes them.** It always asks for a checkout first — `main` included, even with nothing else registered — with `a` widening the list to every worktree Git lists for the clone; `ctrl+o` cycles `files`, `tree` and `ext`. The preview is read-only, bounded and coloured from your active theme, `enter` inserts `@`-prefixed paths (a file of another checkout travels as its absolute path), and `ctrl+e` opens the highlighted file in `$VISUAL`/`$EDITOR`. `alt+p` opens the picker from anywhere, and `GENTLE_PI_FILES_KEY` overrides the key. See [the file picker](docs/reference.md#files-the-picker-its-scopes-and-its-orders).
90
+ - **`/issues` opens on three tabs, not four.** The bar is `My issues`, `Assigned` and `Involved`; `All` is the `g` shortcut's own view, with the footer saying `g all issues` outside it and `g related issues` inside. A typed filter spans the three tabs and travels with you into `All`. `alt+i` opens the panel from anywhere, and `GENTLE_PI_ISSUES_KEY` overrides the key. See [the tabs, the shortcut and the filter](docs/reference.md#issues-three-tabs-one-shortcut-one-filter).
91
+ - **`/prs` is the same reader for pull requests.** Its three tabs are `My Pull Request`, `Needs My Review` and `Involved`, `All` is again the `g` shortcut's own view (there the footer reads `g related prs`), the search box reads the server like `/issues`, and `enter` inserts the focused pull request into the chat input as `PR #87` and closes the panel — nothing is sent to the agent. The pane opens with the state, labels, assignees, reviewers with their review state, author and ages, the linked issues and the two summaries `Changes` (`3 files changed +40 -5`, `7 commits`) and `Checks` (`5 checks · 1 failed`, `failing: build`). See [the `/prs` panel](docs/reference.md#prs-the-pull-request-panel).
92
+ - **`/prs` writes only what your role allows.** Commenting needs read access alone; labels and assignees need triage; closing, merging and editing the linked issues need write, and `m` is offered only for a pull request that is not a draft and a repository that allows at least one merge method. Anything but a confirmed capability paints no hint and refuses the key on screen. Merge is its own step — type (only the methods the repository allows), commit message, description, `Confirm merge #N` / `Cancel` — prefilled with GitHub's own proposals, and a rebase merge takes neither the message nor the description. See [the actions, gated by capability](docs/reference.md#the-prs-actions-gated-by-capability).
93
+ - **`/issues` and `/prs` link to each other.** In the issues pane every linked pull request number is its own click that opens `/prs` on it; in the pull request pane every linked issue number is its own click that opens `/issues` on it. The panel you clicked in closes first, so two panels never stack, and a line's label, its separators and a `#N` in a title or a body are not click targets. A linked reference is identified by repository AND number, so one that belongs to another repository is painted as `owner/repo#N` and is not a click at all: a same-numbered lookalike here is never opened by mistake. See [the cross-links](docs/reference.md#the-cross-links-between-the-two-panels).
94
+ - **`/issues` can open on one issue.** `/issues 42` (or `/issues #42`) opens the panel on `Assigned` with that issue selected, and a number that tab cannot find says so instead of guessing a row. `prs`'s sibling form is `/prs 42` (or `/prs #42`), which opens on `My Pull Request` with that pull request selected — on `Needs My Review` when a rail click named that bucket, saying `#42 is not in My Pull Request` when neither holds it.
95
+ - **`/issues` and `/prs` pin the repository.** Every read, mutation and browser open is bound to the repository that was loaded, and capabilities fail closed. See [the repository pin](docs/reference.md#issues-pins-the-repository).
96
+ - **The GitHub rail is checkout-scoped and optional.** When a Gentle Shell draws its rail, a `GITHUB` rail section lists the open issues of this checkout's repository you authored or are assigned — that one repository, not every issue across every repository you touch — seven at a time, with `and N more issues` for the rest and a pull-request mark on the issues that already have one, and its header counts the pull requests beside them (`7 issues · 3 pr`, the distinct rows of your own and the ones awaiting your review; the segment appears once that read lands, and a stalled list still reads `· stale`). A click on an issue that carries a linked pull request opens `/prs` on that pull request — `Needs My Review` winning when it belongs to both buckets, `My Pull Request` next, and the `all` view when the rail's read places it in neither — instead of the issue; every other row opens that issue in `/issues` on `Assigned`, in no case a browser. The click does not prove the repository itself — the panel it opens pins and proves the checkout, so a row left over from another checkout still dispatches its number and the panel decides — and `/issues`' own `o` key is still the browser. The overflow row opens `/issues` with no number. While the rail's cache holds this repository, `/issues` paints its first frame from it and reads one tab at mount instead of three, the other two reading the first time you open them; the cache outlives both the session and the process — one document under `$XDG_CACHE_HOME/odd-worktree/` — so a warm checkout's first read is already a delta, and the rail's pull requests are persisted the same way (`prs-rail.json`) so a cold start paints `N issues · M pr` at once. A frame never waits on `gh`, and neither does a session start: the `gh` gate is dispatched, never awaited, so no child process and no network call sits on opening or switching a session. While the section is drawn it re-reads on its own 20 s timer — the issues and the pull requests behind the same floor — keeps no timer while hidden, stops the moment it is no longer drawn, and a `bash` command that mutates an issue or a pull request forces one read behind a 5 s cap; a failed refresh keeps the rows and marks them `stale`, and a failed pull-request read keeps the count already painted. Without `gh` on `PATH` neither the section nor `/issues`/`/prs` exists at all — the commands are never registered and the section is never added to the rail — and every other surface keeps working. With no bridge the section simply never appears. See [the rail section](docs/reference.md#the-github-rail-section).
76
97
  - **Cards follow your shell.** Tool and warp cards use the card style Gentle Shell publishes, and a click expands that card only. See [card style](docs/reference.md#card-style-follows-your-shell).
77
- - **Tool headings can name the activity.** With `activity` chosen on the `Card activity` line, a bash card whose heading shows the whole command is headed with the family its command names (mark and word) instead of `$`, and a `grep`, `find` or `ls` card is headed `⌕ exploring` instead of its own glyph and name, while a `read` — which runs no shell command — keeps the host's own card, colour and width; a bash command the classifier cannot name, or a heading that hides part of it, keeps the host's `$`. See [the cards the `activity` design paints](docs/reference.md#the-cards-the-activity-design-paints).
78
- - **File calls on a skill or an ODD are cards too.** While `Card activity` answers with `activity` for the tool being painted, a `read`, `edit` or `write` call whose path names a skill (anything below a `skills` folder) or an ODD (anything below an `odd` folder) heads as that file, with the tool, the path and a read's line range; its Markdown body — the whole document when expanded, the first rows when collapsed — is drawn by Pi's own renderer in the theme's Markdown roles — for an `edit`, the fragment it leaves behind, never its diff, and a call that leaves no fragment falls back to its own rows. Any other file call, and every call while that line answers anything else, is the host's own row. See [the file cards](docs/reference.md#the-file-cards).
79
- - **Background-job tools are cards too.** While `Card activity` answers with `activity` for the tool being painted, `bash_background`, `monitor`, `job_stop` and `job_list` are drawn in the shell's own card style instead of Pi's plain box. Any other answer leaves Pi's box untouched. See [the jobs card](docs/reference.md#the-jobs-card).
80
- - **The two advisory messages are cards too.** While `Card activity` answers with `activity`, `gentle-pi.exploration-budget` and `gentle-pi.verifier-settle-reminder` are drawn as `⌕ Exploration budget` and `⚑ Verifier reminder` in the shell's own card style, the whole body at every content level. They follow that line — no second switch, no row added to `Cards`, and a flip repaints the messages on screen and turns them off again. Any other answer hands the message back as Pi drew it, for the price of a registry walk and at most one tool-document read, and a bridge older than `0.12.1` — or one whose release string is not a clean numeric release — registers nothing at all. See [the message cards](docs/reference.md#the-message-cards).
81
- - **`edit` and `write` cannot land in the principal checkout's default branch.** A write whose path is inside the principal checkout of the session's repository, while that checkout is on the default branch, is refused with one line pointing at `worktree_list` and `worktree_create`. Paths outside the repository, anything under the OS temp directories, ODD artifacts (any path below an `odd/` folder, on any branch), other repositories and linked worktrees are never blocked. See [the guard](docs/reference.md#the-edit-and-write-guard).
98
+ - **Tool headings can name the activity.** With `activity` chosen on the `Card activity` line, a bash card whose heading shows the whole command is headed with the family its command names instead of `$`, and a `grep`, `find` or `ls` card is headed `⌕ exploring`; a command the classifier cannot name, or a heading that hides part of it, keeps the host's `$`. See [the cards the `activity` design paints](docs/reference.md#the-cards-the-activity-design-paints).
99
+ - **File calls on a skill or an ODD are cards too.** While that line answers with `activity` for the tool being painted, a `read`, `edit` or `write` whose path names a skill or an ODD heads as that file — its own mark and label, the tool, the path and a read's line range — and its Markdown body is drawn by Pi's own renderer in the theme's Markdown roles. Any other file call is the host's own row. See [the file cards](docs/reference.md#the-file-cards).
100
+ - **Background-job tools are cards too.** While that line answers with `activity`, `bash_background`, `monitor`, `job_stop` and `job_list` are drawn in the shell's own card style instead of Pi's plain box, with the job's label, its command and its own answer. See [the jobs card](docs/reference.md#the-jobs-card).
101
+ - **The two advisory messages are cards too.** `gentle-pi.exploration-budget` and `gentle-pi.verifier-settle-reminder` are drawn as `⌕ Exploration budget` and `⚑ Verifier reminder`, the whole body at every content level. They follow that `Card activity` line, with no second switch and no row added to `Cards`. See [the message cards](docs/reference.md#the-message-cards).
102
+ - **Your own prompt can be a card too.** While that `Card activity` line answers `activity`, the message you sent is drawn as a `✿ You` card — the title and the whole frame in the accent role, in whichever card style your shell uses — instead of Pi's plain background block. It is the one host class this package patches, because Pi offers no hook for a `role: "user"` entry: switch the line to `default` and the prompt is Pi's own again, live, byte for byte. It adds no switch of its own. See [the user prompt card](docs/reference.md#the-user-prompt-card).
103
+ - **The diff card is a design of the same kind.** `Card diff` keeps `default` available and selects `color` once on the first run that finds no choice, so a write or an edit on a skill or an ODD stays the file card's row, because a specific claim wins over a generic one. See [the diff card](docs/reference.md#the-diff-card).
104
+ - **`edit` and `write` cannot land in the principal checkout's default branch.** A write whose path is inside the principal checkout of the session's repository, while that checkout is on the default branch, is refused with one line pointing at `worktree_list` and `worktree_create`. Paths outside the repository, anything under the OS temp directories, ODD artifacts, other repositories and linked worktrees are never blocked. See [the guard](docs/reference.md#the-edit-and-write-guard).
82
105
  - **A skill or an ODD is read whole.** A `read` of a `.md` below a `skills/` or an `odd/` folder drops its `offset` and `limit` before the tool runs, so the call delivers the whole document and never half a procedure. It follows the `Worktrees+` module, like the guards.
83
106
  - **`bash` cannot leave the principal checkout's default branch.** A `git worktree add` is refused in any cwd and pointed at `worktree_create`; in the principal checkout, a switch that would leave the branch it is on is refused while that branch is the repository's default, and creating a branch is not blocked. See [the guards](docs/reference.md#the-bash-guards).
84
- - **Two blocks in the system prompt.** `## ODD worktrees` tells the agent how worktrees and ODDs work. `## CodeGraph` tells a session that already holds a CodeGraph tool how to use it, with one text per role. Both are appended after the host's own text, and `ODD_WORKTREE_PROMPT=0` suppresses them. See [the prompt blocks](docs/reference.md#the--odd-worktrees-block-in-the-system-prompt).
85
- - **CodeGraph stays fresh, only when its CLI is installed.** At session start the package creates or syncs the checkout's index and warms its daemon, and makes sure your global `mcp.json` has the `codegraph` entry (it adds it or fixes only the differing fields and keeps the rest). It also syncs after a compaction, after a native `codegraph init` and after an `edit` or `write`, in the background and without ever blocking you. See [CodeGraph](docs/reference.md#codegraph-index-daemon-and-mcp-entry). Its tool rows are drawn as a card.
86
- - **Two reminders keep a session on the CodeGraph rule.** The first `grep`, `find`, `ls`, `read` or `bash` search in a checkout gets one sentence appended to its result: use `codegraph` first, or — for another checkout — call `mcp__codegraph__codegraph_explore` with that path as `projectPath`. Each message that starts with a search instead of the graph gets the one about your own checkout once, on its first search, and no later search of it repeats it (a new request re-arms it, a compaction starts it from zero); the one about another checkout stays once per checkout; neither is ever a block. See [the reminders](docs/reference.md#the-two-codegraph-reminders).
87
- - **Deliberately absent.** No customize panel, no plugin-tools toggles, no companion-app integration and no worktree-to-issue association. There is nothing to configure here: the tools design — and, with it, the skill/ODD file cards — is chosen on the bridge's own `Card activity` line (or `Card bash`, on an older bridge), so this package owns no preference of its own.
107
+ - **Two blocks in the system prompt.** `## ODD worktrees` tells the agent how worktrees and ODDs work. `## CodeGraph` tells a session that already holds a CodeGraph tool how to use it, with one text per role. Both are appended after the host's own text, and `ODD_WORKTREE_PROMPT=0` suppresses them. See [the prompt block](docs/reference.md#the--odd-worktrees-block-in-the-system-prompt).
108
+ - **CodeGraph stays fresh, only when its CLI is installed.** At session start the package creates or syncs the checkout's index and warms its daemon, and makes sure your global `mcp.json` has the `codegraph` entry. It also syncs after a compaction, after a native `codegraph init` and after an `edit` or `write`, in the background and without ever blocking you. See [CodeGraph](docs/reference.md#codegraph-index-daemon-and-mcp-entry).
109
+ - **Two reminders keep a session on the CodeGraph rule.** The first `grep`, `find`, `ls`, `read` or `bash` search in a checkout gets one sentence appended to its result: use `codegraph` first, or — for another checkout — call `mcp__codegraph__codegraph_explore` with that path as `projectPath`. Neither is ever a block. See [the reminders](docs/reference.md#the-two-codegraph-reminders).
110
+ - **Deliberately absent.** No customize panel of its own, no plugin-tools toggles, no companion-app integration and no worktree-to-issue association. There is nothing to configure here: the card designs are chosen on the bridge's own lines, so this package owns no preference of its own. See [deliberately absent](docs/reference.md#deliberately-absent).
88
111
 
89
112
  ## Documentation
90
113
 
91
114
  | Your task | Start here |
92
115
  | --- | --- |
93
116
  | Look up a panel key | [Panel keys](docs/reference.md#panel-keys) |
117
+ | Read, merge or close a pull request | [`/prs`](docs/reference.md#prs-the-pull-request-panel) |
94
118
  | Understand a create, a warp or a delete in detail | [Reference](docs/reference.md) |
95
119
  | Run the suite or see what CI and releases do | [Tests](docs/reference.md#tests), [CI and releases](docs/reference.md#ci-and-releases) |
96
120
  | Change the package, follow its invariants or cut a release | [`docs/codebase/mental-model.md`](docs/codebase/mental-model.md) |
@@ -100,5 +124,9 @@ The full rules of each step, including every refusal, are in [Create, list, move
100
124
  ## Next Steps
101
125
 
102
126
  - Run `/warp` in a repository with at least one other checkout to see the selector, then `worktree_list` from the agent to confirm both surfaces agree.
103
- - Install `gh` and run `gh auth login` once if you want `/issues`.
104
- - Install Gentle Shell if the deletion guard should see sessions other than the one you are in.
127
+ - Install `gh` and run `gh auth login` once if you want `/issues`, `/prs` and the `GITHUB` rail section.
128
+ - Read [the reference](docs/reference.md) before changing a panel key, a guard or a card.
129
+
130
+ ## License
131
+
132
+ [MIT](LICENSE) © 2026 Jonathan Soto.