Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"authentication": "ON_INSTALL"
},
"description": "Drive Geenee, the Aiden Lab's genome workspace (igv genome browser, Juicebox Hi-C contact maps, Spacewalk 3D chromatin), by chatting: search ENCODE/4DN, load maps, tracks and ensembles, navigate loci, and share views.",
"version": "1.2.0",
"version": "1.3.0",
"category": "science",
"keywords": [
"geenee",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "geenee",
"source": "./plugins/geenee",
"description": "Drive Geenee, the Aiden Lab's genome workspace (igv genome browser, Juicebox Hi-C contact maps, Spacewalk 3D chromatin), by chatting: search ENCODE/4DN, load maps, tracks and ensembles, navigate loci, and share views.",
"version": "1.2.0",
"version": "1.3.0",
"category": "science",
"keywords": [
"geenee",
Expand Down
1 change: 1 addition & 0 deletions docs/maintaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ scripts/check-install-steps.sh fails if the Claude steps in README.md and I
- Validate: `claude plugin validate . && claude plugin validate ./plugins/geenee`; for Codex, `codex plugin marketplace add ./ && codex plugin add geenee@aidenlab`.
- CLI smoke test: `scripts/test-cli.sh`.
- After a tool change: `scripts/gen-tools-md.py` (new tools land under "Other" until added to `GROUPS`).
- Host check, before a version bump merges: install the branch's Plugin version and run the Host check in [aidenlab/geenee `docs/host-check.md`](https://github.com/aidenlab/geenee/blob/main/docs/host-check.md) (written in [aidenlab/geenee#88](https://github.com/aidenlab/geenee/issues/88)) in every Host it lists, ChatGPT desktop (Codex mode) included. Merge only when it passes; record the version and result on the PR.
- Release: `claude plugin tag plugins/geenee --push` pushes `geenee--v<version>`; the workflow attaches `geenee.plugin` to the GitHub release.

## Where installs can and cannot be automated
Expand Down
2 changes: 1 addition & 1 deletion plugins/geenee/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "geenee",
"displayName": "Geenee",
"version": "1.2.0",
"version": "1.3.0",
"description": "Geenee: drive a genome workspace by chatting. One page beside the conversation holds the igv genome browser, the Juicebox Hi-C contact-map viewer and the Spacewalk 3D chromatin viewer. Search ENCODE/4DN, load maps, tracks and 3D ensembles, navigate genes and loci, compare, share. Connects to the Aiden Lab's hosted MCP server; nothing runs locally.",
"author": {
"name": "The Aiden Lab",
Expand Down
2 changes: 1 addition & 1 deletion plugins/geenee/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "geenee",
"version": "1.2.0",
"version": "1.3.0",
"description": "Geenee: drive a genome workspace by chatting. One page beside the conversation holds the igv genome browser, the Juicebox Hi-C contact-map viewer and the Spacewalk 3D chromatin viewer. Search ENCODE/4DN, load maps, tracks and 3D ensembles, navigate genes and loci, compare, share. Connects to the Aiden Lab's hosted MCP server; nothing runs locally.",
"author": {
"name": "The Aiden Lab",
Expand Down
14 changes: 10 additions & 4 deletions plugins/geenee/skills/geenee/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Geenee is one page beside the conversation, the **Workspace**, with three tabs:
Check once, at the start:

- **MCP tools present** (`open_geenee`, `igv_go_to_gene`, `juicebox_load_map`, `spacewalk_load_ensemble`, ... are callable): use them.
- **Not present**: run the bundled CLI from a shell. Same tool names, same JSON arguments, same text results; the CLI remembers the Room and fills `room` in for you.
- **Not in the tool list**: some hosts load tools on demand, so search for `open_geenee` by name with the host's tool search before concluding the tools are absent. Use the tools if the search finds them.
- **Still not present**: run the bundled CLI from a shell. Same tool names, same JSON arguments, same text results; the CLI remembers the Room and fills `room` in for you.

```bash
G="python3 ${CLAUDE_PLUGIN_ROOT}/skills/geenee/scripts/geenee.py" # or node .../geenee.mjs
$G open # Workspace link + Room id (opens a Room the first time)
$G open # Workspace link, Room link, QR code, Room id (opens a Room the first time)
$G status # Juicebox / IGV / Spacewalk: connected, once the page is open
$G call igv_go_to_gene '{"gene":"MYC"}' # any tool: call NAME 'JSON'
$G call juicebox_load_map '{"url":"...hic","locus":"HOXA1"}' juicebox_load_track '{"url":"genes"}' # several in one go
Expand All @@ -29,10 +30,15 @@ Chain calls that do not depend on each other into one `call`, so the user waits
## Session start: one Room per conversation

1. Call `open_geenee` first (or `$G open`), before any other geenee tool and before replying, even when the user only greets geenee or one of its viewers ("hello geenee", "hi igv"). Its reply gives the Workspace link and the **Room id**. Keep the Room id for the whole conversation and pass it as `room` on every later tool call, for all three viewers (the CLI does this itself). Call it first again, without `room`, when a tool replies that the Room has expired; call it when a tool replies that there is no Room, then repeat the refused call.
- To show the Card again so others can join ("show the QR code again", "share geenee", "how do others join", "someone just arrived"): call `share_geenee` with the `room` (`$G share`, which prints the Room link to give the user). It opens no new Room; everyone keeps their link.
- To show the Card again so others can join ("show the QR code again", "share geenee", "how do others join", "someone just arrived"): call `share_geenee` with the `room` (`$G share`, which prints the Room link, the QR code address and the Room id; show them as in step 3). It opens no new Room; everyone keeps their link.
- To get the Workspace back beside the conversation: call `open_geenee` with the same `room`.
2. If a browser pane inside this app is available (Claude's built-in browser), open the link in it right away so Geenee sits beside the conversation. Do not drive the user's own browser with it.
3. Through the MCP tools, the host shows the user a Card with an **Open geenee** button, the link and a QR code; do not repeat the link in your reply. Through the CLI there is no Card: give the user the link as a plain clickable URL, not in a code block, and ask them to open it.
3. Where the host draws geenee's Card (Claude desktop, claude.ai, through the MCP tools), it shows the user an **Open geenee** button, the Room link and a QR code; do not repeat them in your reply. Everywhere else, including every time you used the CLI, show the user these three things after `open_geenee` / `share_geenee` (`$G open` / `$G share`):
- the Room link (`…/r/<Room id>`, the `Room link:` line), as a plain clickable URL, not in a code block; opening it opens the Workspace, and others who open it join the Room;
- the Room id;
- the QR code, as a Markdown image of the address the reply gives (the `QR code:` line, `…/r/<Room id>/qr.png`): `![QR code of the Room link](<QR code address>)`.

After opening, ask the user to open the link (unless step 2 already opened it beside the conversation).
4. Do not send viewer commands until the page is connected: the user confirms, or `$G status` (or `juicebox_get_server_status` showing `Browser Connected: Yes`, `igv_read_session_summary` answering without error, `spacewalk_read_viewer_state` showing `Viewers connected:` above 0) says so.
5. If the user pastes a Workspace link they already have (`…?room=ID` or `…/r/ID`, theirs or a colleague's), call `open_geenee` with that `room` instead of opening a new one (`$G room <link>`). Everyone in a Room sees the same Workspace, which is also how a group looks at one view together.
6. "No page is connected" / "no Viewer is in Room" means the tab is closed, still loading, or on another Room: show the Workspace link again (`share_geenee`, or `$G share`). A Room that has expired stays expired: open a new one and tell the user the link changed.
Expand Down
8 changes: 4 additions & 4 deletions plugins/geenee/skills/geenee/references/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The CLI is an MCP client over plain HTTPS. The Geenee server is stateless Stream
## Commands and options

```
geenee.py open Workspace link for this shell's Room (opens a new Room if none)
geenee.py share Room link for others to join this Room (opens a new Room if none)
geenee.py open Workspace link, Room link, QR code address and Room id (opens a new Room if none)
geenee.py share Room link, QR code address and Room id for others to join (opens a new Room if none)
geenee.py status whether each viewer (Juicebox, IGV, Spacewalk) is connected in the Room
geenee.py tools tool names with one-line descriptions
geenee.py call TOOL [JSON] [TOOL [JSON] ...] one or more tool calls in one process, in order; room filled in
Expand Down Expand Up @@ -50,8 +50,8 @@ Use `python3` when present, else `node`. Nothing to install either way.

- The first command calls `open_geenee`, which mints a Room id (10 letters and digits) and returns the Workspace link `https://<server>/?room=<ID>`; the CLI saves `{url, room}` to `~/.local/state/geenee/room.json` (`GEENEE_STATE` overrides). Later commands, in any shell, reuse it, so the Workspace stays the same for the whole conversation.
- A `call` that had to open a new Room prints the Workspace link first, before the tool results: the user has to open it before anything shows.
- `open` returns the link for the current Room (calling `open_geenee` with that Room, which gives the same Workspace back). `status` reports each viewer's connection from `juicebox_get_server_status`, `igv_read_session_summary` and `spacewalk_read_viewer_state`; exit 2 when none is connected.
- `share` gives the Room link (`https://<server>/r/<ID>`) for Guests to join the same Room, through `share_geenee`: it opens no new Room, everyone keeps their link, and the Room's day starts again. Use it when someone missed the link or just arrived; give the user the link as a plain URL. There is no QR code through the CLI. With `--json` it prints `{"room", "roomUrl"}`. For an expired Room it prints the expired message and exits 2, keeping the saved Room; `reset` then opens a new one. With no Room yet it opens one first, like every other command.
- `open` returns the links for the current Room (calling `open_geenee` with that Room, which gives the same Workspace back): `Geenee link:` (the Workspace link), `Room link:` (`https://<server>/r/<ID>`), `QR code:` (`https://<server>/r/<ID>/qr.png`, a PNG of the Room link's QR code) and `Room id:`. With `--json` it prints `{"room", "workspaceUrl", "roomUrl", "qrUrl"}`. The first-command preamble of `call` and `room <id-or-link>` print the same lines. `status` reports each viewer's connection from `juicebox_get_server_status`, `igv_read_session_summary` and `spacewalk_read_viewer_state`; exit 2 when none is connected.
- `share` gives the Room link (`https://<server>/r/<ID>`) for Guests to join the same Room, through `share_geenee`: it opens no new Room, everyone keeps their link, and the Room's day starts again. Use it when someone missed the link or just arrived. It prints `Room link:`, `QR code:` and `Room id:`; with `--json`, `{"room", "roomUrl", "qrUrl"}`. Give the user the Room link as a plain URL, the Room id, and the QR code as a Markdown image of its address: `![QR code of the Room link](<QR code address>)`. The CLI draws no QR code on the terminal. For an expired Room it prints the expired message and exits 2, keeping the saved Room; `reset` then opens a new one. With no Room yet it opens one first, like every other command.
- `room <id-or-link>` switches to a Room a page already shows or a colleague shared; `room` alone prints the current id.
- A Room expires after a long idle. The server then reports no page or no viewer for it; `reset` (or `open_geenee` without `room`) starts a new one, and the user must open the new link.

Expand Down
26 changes: 19 additions & 7 deletions plugins/geenee/skills/geenee/scripts/geenee.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,22 @@ function printResult(result, asJson) {
return result.isError ? 2 : 0;
}

// The Room link (…/r/ID) and its QR code address (…/r/ID/qr.png), from a reply's structuredContent.
function roomLinks(sc, room) {
let link = sc.roomUrl;
if (!link) {
const origin = /^https?:\/\/[^/]+/.exec(sc.workspaceUrl || '');
link = origin ? `${origin[0]}/r/${room}` : null;
}
return [link, sc.qrUrl || (link ? link + '/qr.png' : null)];
}

// The Workspace link, Room link, QR code address and Room id.
function printOpened(s, asJson) {
const { room, workspaceUrl } = s.opened.structuredContent;
if (asJson) console.log(JSON.stringify({ room, workspaceUrl }));
else console.log(`Geenee link: ${workspaceUrl}\nRoom id: ${room}`);
const [roomUrl, qrUrl] = roomLinks(s.opened.structuredContent, room);
if (asJson) console.log(JSON.stringify({ room, workspaceUrl, roomUrl, qrUrl }));
else console.log(`Geenee link: ${workspaceUrl}\nRoom link: ${roomUrl}\nQR code: ${qrUrl}\nRoom id: ${room}`);
}

// The Room link from share_geenee, without the text meant for a Host that draws the Card.
Expand All @@ -159,10 +171,10 @@ async function share(s, asJson) {
return 2;
}
const sc = result.structuredContent || {};
const link = sc.roomUrl || sc.workspaceUrl;
const room = sc.room || s.room;
if (asJson) console.log(JSON.stringify({ room, roomUrl: link }));
else console.log(`Room link: ${link}\nRoom id: ${room}`);
const [roomUrl, qrUrl] = roomLinks(sc, room);
if (asJson) console.log(JSON.stringify({ room, roomUrl, qrUrl }));
else console.log(`Room link: ${roomUrl}\nQR code: ${qrUrl}\nRoom id: ${room}`);
return 0;
}

Expand Down Expand Up @@ -207,8 +219,8 @@ function parseArgs(argv) {

const HELP = `geenee.mjs - call the Geenee MCP server without an MCP connector.

geenee.mjs open Workspace link for this shell's Room (opens a new Room if none)
geenee.mjs share Room link for others to join this Room (opens a new Room if none)
geenee.mjs open Workspace link, Room link, QR code address and Room id (opens a new Room if none)
geenee.mjs share Room link and QR code address for others to join this Room (opens a new Room if none)
geenee.mjs status whether each viewer is connected in the Room
geenee.mjs tools tool names with one-line descriptions
geenee.mjs call TOOL [JSON] [TOOL [JSON] ...] call one or more tools in one process, in order; room is filled in
Expand Down
27 changes: 19 additions & 8 deletions plugins/geenee/skills/geenee/scripts/geenee.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
Workspace.

Usage:
geenee.py open Workspace link for this shell's Room (opens a new Room if none)
geenee.py share Room link for others to join this Room (opens a new Room if none)
geenee.py open Workspace link, Room link, QR code address and Room id (opens a new Room if none)
geenee.py share Room link and QR code address for others to join this Room (opens a new Room if none)
geenee.py status whether each viewer is connected in the Room
geenee.py tools tool names with one-line descriptions
geenee.py call TOOL [JSON] [TOOL [JSON] ...]
Expand Down Expand Up @@ -190,13 +190,24 @@ def print_result(result, as_json):
return 2 if result.get("isError") else 0


def room_links(sc, room):
"""The Room link (…/r/ID) and its QR code address (…/r/ID/qr.png), from a reply's structuredContent."""
link = sc.get("roomUrl")
if not link:
origin = re.match(r"^https?://[^/]+", sc.get("workspaceUrl") or "")
link = "%s/r/%s" % (origin.group(0), room) if origin else None
qr = sc.get("qrUrl") or (link + "/qr.png" if link else None)
return link, qr


def print_opened(s, as_json):
"""The Workspace link and Room id, in the shape print_result uses."""
"""The Workspace link, Room link, QR code address and Room id."""
sc = s.opened["structuredContent"]
link, qr = room_links(sc, sc["room"])
if as_json:
print(json.dumps({"room": sc["room"], "workspaceUrl": sc["workspaceUrl"]}))
print(json.dumps({"room": sc["room"], "workspaceUrl": sc["workspaceUrl"], "roomUrl": link, "qrUrl": qr}))
else:
print("Geenee link: %s\nRoom id: %s" % (sc["workspaceUrl"], sc["room"]))
print("Geenee link: %s\nRoom link: %s\nQR code: %s\nRoom id: %s" % (sc["workspaceUrl"], link, qr, sc["room"]))


def share(s, as_json):
Expand All @@ -209,12 +220,12 @@ def share(s, as_json):
print(text_of(result))
return 2
sc = result.get("structuredContent") or {}
link = sc.get("roomUrl") or sc.get("workspaceUrl")
room = sc.get("room") or s.room
link, qr = room_links(sc, room)
if as_json:
print(json.dumps({"room": room, "roomUrl": link}))
print(json.dumps({"room": room, "roomUrl": link, "qrUrl": qr}))
else:
print("Room link: %s\nRoom id: %s" % (link, room))
print("Room link: %s\nQR code: %s\nRoom id: %s" % (link, qr, room))
return 0


Expand Down
13 changes: 10 additions & 3 deletions scripts/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ fail=0
for cli in "python3 geenee.py" "node geenee.mjs"; do
echo "== $cli"
rm -f "$GEENEE_STATE"
$cli open | grep -q '?room=' || { echo "FAIL: open"; fail=1; }
out="$($cli open)"
echo "$out" | grep -q '?room=' || { echo "FAIL: open"; fail=1; }
room="$($cli room)"; [[ "$room" =~ ^[0-9A-HJKMNP-TV-Z]{10}$ ]] || { echo "FAIL: room id '$room'"; fail=1; }
echo "$out" | grep -q "^Room link: https://.*/r/$room\$" && echo "$out" | grep -q "^QR code: https://.*/r/$room/qr.png\$" \
&& echo "$out" | grep -q "^Room id: $room\$" || { echo "FAIL: open (Room link, QR code, Room id)"; fail=1; }
$cli --json open | python3 -c 'import json,sys; r=json.load(sys.stdin); assert set(r)=={"room","workspaceUrl","roomUrl","qrUrl"} and r["room"]=="'"$room"'" and r["qrUrl"]==r["roomUrl"]+"/qr.png"' || { echo "FAIL: open --json"; fail=1; }
qr="$(echo "$out" | sed -n 's/^QR code: //p')"
[ "$(curl -fsS -A geenee-cli-test "$qr" | head -c 8 | od -An -tx1 | tr -d ' \n')" = "89504e470d0a1a0a" ] || { echo "FAIL: QR code address is not a PNG"; fail=1; }
$cli status | grep -q '^Juicebox:' || { echo "FAIL: status"; fail=1; }
$cli status | grep -q '^Spacewalk:' || { echo "FAIL: status (spacewalk)"; fail=1; }
[ "$($cli tools | wc -l)" -ge 50 ] || { echo "FAIL: tools"; fail=1; }
Expand All @@ -24,10 +30,11 @@ for cli in "python3 geenee.py" "node geenee.mjs"; do
[ "$($cli room)" = "$room" ] || { echo "FAIL: room switch persisted"; fail=1; }
$cli --room "$room" room | grep -q "$room" || { echo "FAIL: --room"; fail=1; }
out="$($cli share)"; code=$?
[ $code -eq 0 ] && echo "$out" | grep -q "^Room link: https://.*/r/$room\$" && echo "$out" | grep -q "^Room id: $room\$" || { echo "FAIL: share"; fail=1; }
[ $code -eq 0 ] && echo "$out" | grep -q "^Room link: https://.*/r/$room\$" && echo "$out" | grep -q "^QR code: https://.*/r/$room/qr.png\$" \
&& echo "$out" | grep -q "^Room id: $room\$" || { echo "FAIL: share"; fail=1; }
echo "$out" | grep -qi "card" && { echo "FAIL: share printed the Card text"; fail=1; }
[ "$($cli room)" = "$room" ] || { echo "FAIL: share changed the Room"; fail=1; }
$cli --json share | python3 -c 'import json,sys; r=json.load(sys.stdin); assert set(r)=={"room","roomUrl"} and r["room"]=="'"$room"'"' || { echo "FAIL: share --json"; fail=1; }
$cli --json share | python3 -c 'import json,sys; r=json.load(sys.stdin); assert set(r)=={"room","roomUrl","qrUrl"} and r["room"]=="'"$room"'" and r["qrUrl"]==r["roomUrl"]+"/qr.png"' || { echo "FAIL: share --json"; fail=1; }
$cli --room 0000000000 share 2>&1 | grep -q "expired"; [ "${PIPESTATUS[0]}" -eq 2 ] || { echo "FAIL: share on an expired Room"; fail=1; }
[ "$($cli room)" = "$room" ] || { echo "FAIL: share on an expired Room changed the saved Room"; fail=1; }
done
Expand Down
Loading