Skip to content

Add a Claude Code skill for SPHEREx data-release notebook updates - #402

Draft
jkrick wants to merge 6 commits into
Caltech-IPAC:mainfrom
jkrick:spherex-release-skill
Draft

jkrick wants to merge 6 commits into
Caltech-IPAC:mainfrom
jkrick:spherex-release-skill

Conversation

@jkrick

@jkrick jkrick commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds .claude/skills/spherex-data-release/, a Claude Code project skill that captures how the SPHEREx tutorials were updated for DR1 (#392, PR #401), so the next release (DR2, a new Quick Release, a reprocessing) can follow the same steps instead of rediscovering them.

What's in it

  • SKILL.md: the workflow. Keep a plan file, check what's live on the pre-release hosts, ask IRSA/SSDC early for what only they can provide (SIA collection names, DOI, Explanatory Supplement), make the changes, test every notebook end to end, then the release-day steps.
  • references/touchpoints.md: every release-dependent spot in each SPHEREx notebook, checked against main on 2026-12-03 (after DR1). Notebooks merged after that date need to be added.
  • references/decisions.md: rules settled during DR1 (which DOI to cite, which flags count as bad, no test code in the notebooks), gotchas that cost time, and DR1's release-day checklist.
  • scripts/check_release.sh <release>: reports what's live for a release on irsadev, irsatest and production (SIA, TAP, IBE, cloud_access), on S3, and the Explanatory Supplement.
  • scripts/run_release_test.py: executes any SPHEREx notebook against a pre-release host by changing only a copy (TAP, SIA, cutout/HiPS URLs, S3 reads through that host's IBE, Firefly through its viewer), in the notebook's own conda env kernel, and lists any cell errors. The notebooks themselves never carry test code. Running every cell is what found the D4/D5 detector bug fixed in the DR1 PR.

Notes for reviewers

  • This is the first .claude/ directory in the repo. Claude Code picks up skills in .claude/skills/ automatically; nothing else uses them. The docs build (MyST, driven by toc.yml) and the notebook tests (which look only under tutorials/) ignore it.
  • No notebook changes.
  • check_release.sh and the SDT run of the test script were run against DR1 on IRSA's pre-release hosts on 2026-10-30. The generalized run_release_test.py was smoke-tested against production; it still needs one run against irsatest from the IRSA network.
  • Release-day lessons from DR1 are still welcome as additions.

🤖 Generated with Claude Code

jkrick and others added 4 commits October 29, 2026 12:21
Captures the DR1 update as a repeatable workflow: release-dependent spots
in each notebook, settled decisions and gotchas, a release-availability
check script, and a parameterized Source Discovery Tool test harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_sdt_release_test.py gains --sia-host to run the notebook's own SIA
cells against irsadev; decisions.md notes how to test SIA notebooks there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TAP's ivoa.obscore leaves cloud_access blank even where SIA fills it
(production QR3 included), so the script reported a false blank. Ask
SIA, as the notebooks do, at the position of one of the release's own
images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old test ran selected cells and stood in a 2MASS star for secs.
9-11, which hid sec. 6 picking a D5 image instead of D4 on DR1. The
script now executes every cell on a copy against the pre-release host
(SIA, IBE in place of S3, that host's Firefly viewer) and prints a
summary of what to check. Also record the DR1 gotchas: detector
selection by name, the hard-coded selected_ids source, Firefly and
MOST on pre-release hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jkrick jkrick self-assigned this Oct 30, 2026
@jkrick jkrick added infrastructure Infrastructure related issues/PRs. content: spherex Content related issues/PRs for notebooks with SPHEREx relevance labels Oct 30, 2026
@jkrick

jkrick commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@DeekshaMohanty as you are doing the final release, it would be super helpful if you (or your AI) could update this skill with any last minute items that are good to document about this workflow, that would help make this smoother for the next go around.

@DeekshaMohanty

Copy link
Copy Markdown
Contributor

@DeekshaMohanty as you are doing the final release, it would be super helpful if you (or your AI) could update this skill with any last minute items that are good to document about this workflow, that would help make this smoother for the next go around.

Sure thing - I'm finishing up the HATS catalogs now, so I'll start taking a look at the PRs assigned to me for review shortly. Thanks!

@troyraen troyraen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I left a few comments. I looked at the markdown files but not the scripts.

Re markdown formatting, can we have one line per sentence please?

Comment on lines +71 to +72
1. TAP notebooks (`spherex_cutouts.md`, `spherex_psf.md`, SDT sec. 12): point at the pre-release
host through an `IRSA_HOST` variable inside a clearly marked `# TESTING ONLY` block, and add the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be set outside the notebooks (env var?) so we're not adding testing blocks to the notebooks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The notebooks no longer get any test code. scripts/run_release_test.py copies a notebook, points the copy at the pre-release host (TAP, SIA, cutout/HiPS URLs, S3 reads through that host's IBE, Firefly through its viewer) and runs it, so the notebooks are written with production values from the start and there's nothing to revert on release day.

Comment on lines +79 to +80
3. SIA notebooks (`spherex_intro.md`, SDT secs. 6-11): switch to the guessed collection names now
(pattern below), so only a check is left for release day.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not test against irsadev/test like is being done for TAP rather than guessing names and waiting to check until release day?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The guessing was there because the DR1 SIA collections reached the pre-release hosts late (none were there as of Oct 22). The skill now says to get the names from IRSA and confirm them on the pre-release host as soon as they're loaded. The previous release's pattern is only a stopgap until then, and it stays an open item in the plan.

Comment on lines +97 to +98
release's SIA collection on that host and SExtractor's `sex` command (`brew install sextractor`
is enough; the notebook's conda env is not needed). Run it from the repo root:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should use the notebook's conda env to test that everything will work together. If that can't happen for some reason, please at least remove or soften the directive to use brew as I really don't want anything brew-related happening on my machine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. brew is gone everywhere. The skill now says to run each notebook in a kernel built from its own conda env (example given for conda-spherex_sdt.yml, which includes SExtractor), so the test also checks the env.


Run the whole notebook, not selected cells. A DR1 test that ran only some cells and stood in a
2MASS star for secs. 9-11 passed while sec. 6 was silently picking a D5 image instead of D4
(see decisions.md). `scripts/run_sdt_release_test.py` executes every cell on a copy, with the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about what's going on here. Why does the skill treat Source Discovery Tool so differently from the other notebooks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDT got its own script because it was the hardest to point at a pre-release host: it reads from S3 (empty before release), uses Firefly in JupyterLab (production Firefly can't load pre-release images), needs SExtractor, and depends on SIA, which reached the pre-release hosts late. An early partial run also missed the D4/D5 bug, so the script runs every cell. But you're right that the process shouldn't differ, so I've made it one test script, run_release_test.py, that runs any SPHEREx notebook on a copy pointed at the test hosts, so nothing test-related goes into the notebooks. Section 5 of SKILL.md now covers all the notebooks; the SDT keeps only its notebook-specific checks (D2/D4, selected_ids).

Comment on lines +5 to +6
- **Show only the newest release.** Older collections stay searchable, but the tutorials
demonstrate only the newest one. TAP notebooks filter on `a.uri LIKE 'ibe/data/spherex/<rel>/%'`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect right now (we show DR1 + QR3), and I think what we do when new data releases come out should be handled on a case-by-case basis.

Suggested change
- **Show only the newest release.** Older collections stay searchable, but the tutorials
demonstrate only the newest one. TAP notebooks filter on `a.uri LIKE 'ibe/data/spherex/<rel>/%'`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, removed. It now says which releases to show is decided case by case, and notes that after DR1 the notebooks show DR1 + QR3. The touchpoints file was also brought up to date with main (no release filter, DR1 + QR3 collections).

Comment on lines +59 to +60
- Expect overlapping cleanup PRs. Merge them into the release branch before opening the release
PR, or the same changes show up twice.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to me. What is "the release branch"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It meant the branch holding the release work (spherex-dr1 last time): merge other PRs that touched the same notebooks into it so the release PR's diff shows only release changes. That's standard practice and doesn't need to be in the skill, so I removed it.

Comment on lines +75 to +77
6. `techniques-and-tools/MOST_queries.md` belongs to other authors and isn't in the release PR.
For DR1 a separate issue asked them to re-run it once MOST serves the release and check which
release MOST returns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these belong to us. I think the reason this one wasn't in the dr1 PR is that it didn't need changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, in both the checklist and touchpoints: it uses SPHEREx, needed no changes for DR1, and the release-day item is to check which release MOST returns.

Comment on lines +10 to +12
- TAP release filter: `AND a.uri LIKE 'ibe/data/spherex/dr1/%'`. `spherex.plane.datarelease` is a
date, not a release name, so filter on the URI path. Without a filter the query mixes releases
and `results[...][0]` picks the oldest.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably the notebook already uses the correct filter syntax. Why does a wrong method need to be spelled out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from touchpoints; the notebooks don't filter by release anymore anyway. One line stays in the gotchas, because datarelease looks like the obvious column to filter on and isn't.

Comment on lines +20 to +22
- Sec. 5.1 reads the image's own `EPSF` extension (image version >= 7.0). Sec. 5.2 is a fallback
for older images that reads ePSF calibration files from S3 (`<rel>/epsf/cal-epsf-v*-*`). It must
stay guarded so it does not overwrite a new image's own ePSF (a DR1 bug).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a DR1 bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was badly worded. It was a bug in the notebook, found and fixed during the DR1 update: the QR2 fallback in sec. 5.2 overwrote a new image's own ePSF. It's guarded by if not epsf_in_image: now, and the text says so.

Comment on lines +29 to +30
- Collection list and the `Irsa.query_sia(..., collection='spherex_dr1')` call; bullet list of
"two collections" (wide `spherex_dr1`, deep `spherex_dr1_deep`). Show only the newest release.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Collection list and the `Irsa.query_sia(..., collection='spherex_dr1')` call; bullet list of
"two collections" (wide `spherex_dr1`, deep `spherex_dr1_deep`). Show only the newest release.
- Collection list and the `Irsa.query_sia(..., collection='spherex_dr1')` call; bullet list of
"two collections" (wide `spherex_dr1`, deep `spherex_dr1_deep`).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed "Show only the newest release." The bullet now matches main: four collections (DR1 and QR3, wide and deep) and collection=['spherex_dr1', 'spherex_qr3'].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jkrick

jkrick commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Done: all three markdown files are now one sentence per line.

@jkrick

jkrick commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@troyraen Thanks for the comments! I believe I have addressed them all.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content: spherex Content related issues/PRs for notebooks with SPHEREx relevance infrastructure Infrastructure related issues/PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants