diff --git a/.claude/skills/picard-bump/SKILL.md b/.claude/skills/picard-bump/SKILL.md new file mode 100644 index 0000000..424cb0e --- /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 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 + +```sh +python tools/run_tests.py --coverage +mise run lint +mise run typecheck +``` + +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 + +`.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`. 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. + +## 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`.