From e901b7a3d579103f3482ab53500328d12dbfb96f Mon Sep 17 00:00:00 2001 From: Robert Richardson Date: Sun, 29 Nov 2026 15:43:26 +1300 Subject: [PATCH 1/4] feat(skills): add /picard-bump for reviewing a PICARD_REF bump Renovate opens these PRs, and a bump moves what every Picard claim in the repo is measured against. The skill runs the suite at the new release, fetches the old tag into the depth-1 .picard/src clone to diff the Picard files the plugin and scripts rely on, dispatches the drift and behaviour-docs reviewers, and reports a verdict without acting on the PR. CLAUDE.md points to it, and says .picard/src overrides context7 and the online docs for Picard. --- .claude/skills/picard-bump/SKILL.md | 71 +++++++++++++++++++++++++++++ CLAUDE.md | 3 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 .claude/skills/picard-bump/SKILL.md diff --git a/.claude/skills/picard-bump/SKILL.md b/.claude/skills/picard-bump/SKILL.md new file mode 100644 index 0000000..fec3adb --- /dev/null +++ b/.claude/skills/picard-bump/SKILL.md @@ -0,0 +1,71 @@ +--- +name: picard-bump +description: Review a pull request that changes PICARD_REF, the Picard release the tests run against (Renovate opens these). Runs the suite at the new release, diffs the parts of Picard the plugin and scripts rely on between the two releases, and has the instruction and behaviour docs re-checked. Invoke as /picard-bump . +disable-model-invocation: true +--- + +# Review a Picard release bump + +A bump changes what every claim about Picard in this repo is measured against: the skills, the hooks and the plugin all cite `.picard/src` at `PICARD_REF`. Passing tests show the plugin still loads and the scripts still parse. They don't show that the instructions still describe the new release. + +## 1. Check out the pull request + +`$ARGUMENTS` is the PR number. With none, list the open candidates and ask which one: + +```sh +gh pr list -R robrich82/picards-scripts-plugins --search "metabrainz/picard in:title" +gh pr view -R robrich82/picards-scripts-plugins --json headRefName,baseRefName,files,title +``` + +Name the repo with `-R` in every gh call: `.picard/src` is a metabrainz/picard clone (CLAUDE.md). Check out the head branch in a worktree as the global instructions describe: from the main checkout, `git fetch origin`, then `git worktree add ~/code/worktrees/picards-scripts-plugins/ `, then `uv sync --frozen`. Work there from now on. + +`OLD` is `PICARD_REF` on the base (`git show origin/:tools/run_tests.py`), `NEW` is `PICARD_REF` in the worktree's `tools/run_tests.py`. If the PR changes more than `tools/run_tests.py` and the README lines Renovate rewrites (`renovate.json`'s `customManagers`), review those changes too. + +## 2. Run the suite at the new release + +```sh +python tools/run_tests.py --coverage +mise run lint +mise run typecheck +``` + +`run_tests.py` re-clones `.picard/src` at `NEW` because `.picard/REF` no longer matches. Keep any failure's output for the report. Don't fix anything in this pass. + +## 3. Diff what the repo relies on + +`.picard/src` is a depth-1 clone of `NEW`, so fetch `OLD` before diffing: + +```sh +git -C .picard/src fetch --quiet --depth 1 origin tag OLD +git -C .picard/src diff --stat OLD NEW -- docs/PLUGINSV3 picard/plugin3 picard/script picard/__init__.py pyproject.toml +``` + +Then read the diff of each file the stat lists. Look for: + +| Upstream change | Where it matters here | +| --- | --- | +| `register_*` hooks, `api` methods or their signatures (`docs/PLUGINSV3/API.md`, `picard/plugin3/`) | every call in `plugins/*/__init__.py` | +| `MANIFEST.md` fields or limits, or the validator in `picard/plugin3/` | `plugins/*/MANIFEST.toml`, `test_manifest_valid_for_this_picard` | +| `api_versions` in `picard/__init__.py` | the plugin's `api` list: add a new version only once the tests pass on it (the `picard-plugin` skill) | +| `requires-python` in `pyproject.toml` | `plugins/**` = `py310` in `per-file-target-version`, and the `picard-plugin` skill's "Python version" | +| script functions (`picard/script/functions.py`) or escapes (`parse_escape_sequence` in `picard/script/parser.py`) | `tagger-scripts/*.ptsp` and the `picard-script` skill's escaping table | + +## 4. Re-check the instructions and docs + +Dispatch, in parallel, with the PR's base branch as the base ref: + +- `instruction-drift-reviewer`: say it is a `PICARD_REF` bump from `OLD` to `NEW`. Its steps already cover checking every Picard claim against `.picard/src`. +- `behaviour-docs-reviewer`, only when step 2 failed or step 3 found a change in behaviour the plugin or a script uses. + +Settle each finding against `.picard/src` yourself before reporting it. + +## 5. Report + +Give, in this order: + +1. The tests, lint and typecheck results. +2. Each upstream change from step 3 that touches the repo, with its `.picard/src` file and line, and what in the repo it affects. +3. The instruction or doc claims that are now false or stale, with the reviewers' evidence. +4. A verdict: **merge as is**, **merge after these changes** (list them), or **don't merge** (say why). + +Don't approve, merge or comment on the PR, and don't push fixes to Renovate's branch. Offer them, and do only what the user picks. diff --git a/CLAUDE.md b/CLAUDE.md index 41c1882..6e67c65 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,6 +19,7 @@ uv run python tools/check_min_python.py [file...] # flags stdlib APIs newer tha - Edit `.ptsp` and `.py` files with Edit/Write, not a shell command. The PostToolUse hooks in `.claude/settings.json` only see those tools: they check `.ptsp` edits with Picard's parser (this needs the venv from one `run_tests.py` run) and run `ruff format` and `tools/check_min_python.py` on `.py` edits. - Don't run the `mise run install-*` tasks / `tools/install.py` unless asked: they write the user's real Picard config and plugin folder. - Behaviour is documented in the README tables and, for the plugin, `MANIFEST.toml` `long_description`. Update them in the same change. In self-review of such a change, dispatch the `behaviour-docs-reviewer` agent with the base ref. -- In self-review of a change to `CLAUDE.md` or `.claude/`, or to what they describe (a `PICARD_REF` bump, `pyproject.toml`, `tools/`), dispatch the `instruction-drift-reviewer` agent with the base ref. +- In self-review of a change to `CLAUDE.md` or `.claude/`, or to what they describe (a `PICARD_REF` bump, `pyproject.toml`, `tools/`), dispatch the `instruction-drift-reviewer` agent with the base ref. Review a pull request that bumps `PICARD_REF` with `/picard-bump `. +- For Picard's API, script functions and plugin rules, `.picard/src` at `PICARD_REF` overrides context7 and the online docs, which may describe another release. - Never create a tag Picard reads as a version (`v1.2.3`, `2.0`, `release-1.2`…) or a GitHub release by hand; see README's "Releasing the plugin". - Tagger scripts run in filename order (04 before 05 matters). A script that writes a new tag needs it added to `WRITTEN` in `tests/test_tagger_scripts.py`. From 2cd47f5ab344a83be6aaeaaff31b298f13b94c2e Mon Sep 17 00:00:00 2001 From: Robert Richardson Date: Mon, 30 Nov 2026 23:22:38 +1300 Subject: [PATCH 2/4] fix(skills): picard-bump: a fresh worktree clones Picard, grep for OLD, expect pinned text to go stale --- .claude/skills/picard-bump/SKILL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude/skills/picard-bump/SKILL.md b/.claude/skills/picard-bump/SKILL.md index fec3adb..b5d8a2b 100644 --- a/.claude/skills/picard-bump/SKILL.md +++ b/.claude/skills/picard-bump/SKILL.md @@ -19,7 +19,7 @@ gh pr view -R robrich82/picards-scripts-plugins --json headRefName,baseRefNa Name the repo with `-R` in every gh call: `.picard/src` is a metabrainz/picard clone (CLAUDE.md). Check out the head branch in a worktree as the global instructions describe: from the main checkout, `git fetch origin`, then `git worktree add ~/code/worktrees/picards-scripts-plugins/ `, then `uv sync --frozen`. Work there from now on. -`OLD` is `PICARD_REF` on the base (`git show origin/:tools/run_tests.py`), `NEW` is `PICARD_REF` in the worktree's `tools/run_tests.py`. If the PR changes more than `tools/run_tests.py` and the README lines Renovate rewrites (`renovate.json`'s `customManagers`), review those changes too. +`OLD` is `PICARD_REF` on the base (`git show origin/:tools/run_tests.py | grep PICARD_REF`), `NEW` is `PICARD_REF` in the worktree's `tools/run_tests.py`. If the PR changes more than `tools/run_tests.py` and the README lines Renovate rewrites (`renovate.json`'s `customManagers`), review those changes too. ## 2. Run the suite at the new release @@ -29,7 +29,7 @@ mise run lint mise run typecheck ``` -`run_tests.py` re-clones `.picard/src` at `NEW` because `.picard/REF` no longer matches. Keep any failure's output for the report. Don't fix anything in this pass. +The new worktree has no `.picard/`, so `run_tests.py` clones `.picard/src` at `NEW` and builds its venv, which takes a few minutes and needs the network. Keep any failure's output for the report. Don't fix anything in this pass. ## 3. Diff what the repo relies on @@ -54,7 +54,7 @@ Then read the diff of each file the stat lists. Look for: Dispatch, in parallel, with the PR's base branch as the base ref: -- `instruction-drift-reviewer`: say it is a `PICARD_REF` bump from `OLD` to `NEW`. Its steps already cover checking every Picard claim against `.picard/src`. +- `instruction-drift-reviewer`: say it is a `PICARD_REF` bump from `OLD` to `NEW`. Its steps already cover checking every Picard claim against `.picard/src`. Expect it to flag text that names `OLD`, such as the `picard-plugin` skill's "(3.10 at `release-…`)": Renovate rewrites only the lines in `renovate.json`'s `customManagers`. - `behaviour-docs-reviewer`, only when step 2 failed or step 3 found a change in behaviour the plugin or a script uses. Settle each finding against `.picard/src` yourself before reporting it. From b571f1880ab4d150ca9d49e51a937dbc2a0563a6 Mon Sep 17 00:00:00 2001 From: Robert Richardson Date: Fri, 4 Dec 2026 16:57:27 +1300 Subject: [PATCH 3/4] fix(skills): picard-bump: grep only the PICARD_REF assignment for OLD --- .claude/skills/picard-bump/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/skills/picard-bump/SKILL.md b/.claude/skills/picard-bump/SKILL.md index b5d8a2b..54acecc 100644 --- a/.claude/skills/picard-bump/SKILL.md +++ b/.claude/skills/picard-bump/SKILL.md @@ -19,7 +19,7 @@ gh pr view -R robrich82/picards-scripts-plugins --json headRefName,baseRefNa Name the repo with `-R` in every gh call: `.picard/src` is a metabrainz/picard clone (CLAUDE.md). Check out the head branch in a worktree as the global instructions describe: from the main checkout, `git fetch origin`, then `git worktree add ~/code/worktrees/picards-scripts-plugins/ `, then `uv sync --frozen`. Work there from now on. -`OLD` is `PICARD_REF` on the base (`git show origin/:tools/run_tests.py | grep PICARD_REF`), `NEW` is `PICARD_REF` in the worktree's `tools/run_tests.py`. If the PR changes more than `tools/run_tests.py` and the README lines Renovate rewrites (`renovate.json`'s `customManagers`), review those changes too. +`OLD` is the `release-…` value of `PICARD_REF` on the base (`git show origin/:tools/run_tests.py | grep '^PICARD_REF ='`), `NEW` the same line in the worktree's `tools/run_tests.py`. If the PR changes more than `tools/run_tests.py` and the README lines Renovate rewrites (`renovate.json`'s `customManagers`), review those changes too. ## 2. Run the suite at the new release From 46fe68cf25a9f8ebc31769f30a0b9aa45f30a640 Mon Sep 17 00:00:00 2001 From: Robert Richardson Date: Fri, 4 Dec 2026 18:16:42 +1300 Subject: [PATCH 4/4] docs(skills): picard-bump: drop the picard-plugin example, which no longer names a release --- .claude/skills/picard-bump/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/skills/picard-bump/SKILL.md b/.claude/skills/picard-bump/SKILL.md index 54acecc..424cb0e 100644 --- a/.claude/skills/picard-bump/SKILL.md +++ b/.claude/skills/picard-bump/SKILL.md @@ -54,7 +54,7 @@ Then read the diff of each file the stat lists. Look for: Dispatch, in parallel, with the PR's base branch as the base ref: -- `instruction-drift-reviewer`: say it is a `PICARD_REF` bump from `OLD` to `NEW`. Its steps already cover checking every Picard claim against `.picard/src`. Expect it to flag text that names `OLD`, such as the `picard-plugin` skill's "(3.10 at `release-…`)": Renovate rewrites only the lines in `renovate.json`'s `customManagers`. +- `instruction-drift-reviewer`: say it is a `PICARD_REF` bump from `OLD` to `NEW`. Its steps already cover checking every Picard claim against `.picard/src`. Expect it to flag any text that names `OLD`: Renovate rewrites only the lines in `renovate.json`'s `customManagers`. - `behaviour-docs-reviewer`, only when step 2 failed or step 3 found a change in behaviour the plugin or a script uses. Settle each finding against `.picard/src` yourself before reporting it.