/xwiki:xwiki-backport-testneededfrom xwiki
Backports automated tests for JIRA issues labeled 'testneeded' to stable branches, adjusts @since tags, and opens PRs. Use when asked to backport a test or catch a stable branch up with a recently-added test.
Ships in xwiki. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Backport the test added for one testneeded-labelled JIRA issue onto the currently-supported
stable branches, keep its @since tags consistent across every branch, and open one PR per branch.
This skill is the testneeded layer on top of xwiki-backport. Do the generic backport work —
establishing the target branches/versions, finding all the issue's commits, worktree +
cherry-pick -x oldest-first, the adapt-to-branch checks (pom versions §3.A, Java level §3.B,
conflict rules §3.C, @since §3.D), reset-and-re-cherry-pick when a base moves, verification, and push/PR — by
following xwiki-backport. This file adds only what is specific to backporting testneeded tests:
finding the issues, the @since policy for test-support classes, the testneeded label, and the
consolidated master PR.
Related skills: xwiki-backport (mechanics), xwiki-build (Maven), xwiki-pull-request
(PR/commit conventions), xwiki-knowledge (the @since / versioning convention in the KB).
Run per one issue. Doing several at once is opt-in: only when the user asks, apply the steps per
issue (a worktree + subagent per issue parallelises well) and consolidate the master @since edits
of all issues into a single master PR (see below) instead of one per issue.
To find candidate issues, sweep JIRA with this JQL:
project = XWIKI AND labels = testneeded AND resolution = Fixed AND resolutiondate >= <cutoff>
Run the JQL and the per-issue lookups via the xwiki-jira skill (it owns JIRA access — jira-cli
or REST — and auth). For each candidate, read fixVersions + summary
(.../issue/<KEY>?fields=fixVersions,summary) and the version release dates / branch-cut points
(.../project/XWIKI/versions) to drive the branch decision (xwiki-backport §1: a branch needs the
test only if the fix landed after that branch was cut and is not already released on its line).
(Network calls redirected under context-mode: run them via ctx_execute/ctx_fetch_and_index.)
Follow xwiki-backport end to end. Two testneeded-specific touches on top:
--label testneeded to the gh pr create command (create the label once if missing:
gh label create testneeded ...).*-test-docker / *-test-pageobjects module hits the pom-version trap (xwiki-backport
§3.A) even on a clean cherry-pick, and page-object code copied from the source branch can hit the
Java-level trap (§3.B). Do not skip them because "it's just a test".@since on every branch (and master) — the test-specific layerThe generic @since adjustment — add the target branch's line, keep the block identical on every
branch (master/source included), decide the lines empirically, the durable format — is
xwiki-backport §3.D. Apply it. This section adds only what is specific to testneeded tests:
What carries @since in a test backport — the test tools, not the tests — is
kb/conventions/versioning.md ("@since goes on reusable code", "Tests themselves carry no
@since"). If the issue only adds tests and touches no test tool, there is no @since work at
all.
Concretely, deciding the lines for a new class or member (the §3.D empirical check, made explicit
here): keep the element's existing original @since from master; if it is absent on
origin/stable-17.10.x → add @since 17.10.10; if absent on origin/stable-18.4.x (and the
issue was backported there) → add @since 18.4.3; if it already exists on a branch, do not re-add
that branch's line.
Apply the identical edit on each backport branch (an extra commit on the existing PR branch — it
updates that PR) and on master (the "source branch also carries it" half of §3.D). The master
change is a single commit whose subject = the original commit title (body noting the @since was
adjusted), on a backport/master/XWIKI-nnnnn branch, opened as its own master PR. For several issues
at once, fold all their master @since edits into one consolidated master PR.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
backport, test-backport, jira-testneeded, since-tag, stable-branch
npx claudepluginhub xwiki/xwiki-dev-llm --plugin xwiki38 skills in this plugin
/xwiki-backportBackport any change (bug fix, feature, refactor, or test) to an older branch of an XWiki repo (xwiki-platform / xwiki-commons / xwiki-rendering / xwiki-contrib). Cherry-pick `-x` the source commit(s) into a worktree, ADAPT the result to the older branch (module pom versions, Java level, `@since` tags, data migration versions and skip ranges, style/API divergence), verify it compiles against that branch, and push / open a PR. Use whenever a commit that exists on one branch needs to be applied to an older/maintenance branch. For the `testneeded`-labelled test sweep use xwiki-backport-testneeded (which builds on this skill); for Maven commands use xwiki-build; for PR/commit conventions use xwiki-pull-request; for the versioning/`@since` conventions (the format and what carries `@since`) use xwiki-knowledge./xwiki-buildBuild and test XWiki Maven modules. Use when building XWiki, running its tests, or when the user mentions mvn, a build, a failing test, or a specific XWiki module./xwiki-capture-ui-changeCapture the "before" screenshot of a fix to existing XWiki UI when the branch can no longer produce it (the fix is already in the working tree) - on the released version's Docker image, or by building and deploying the pre-fix code on a local instance - and shoot the same fixture in both states. Costs minutes to tens of minutes, so propose it and run it only with the user's explicit approval. Not for a new feature or a redesign (there is no "before"), nor when the bug can still be shot on a running instance before applying the fix. For deploying an extension without a comparison use xwiki-deploy-extension; for Maven commands use xwiki-build; for the PR/JIRA screenshot conventions use xwiki-pull-request; for manually testing every fix of a release use xwiki-manual-test.