Skip to content

liferay/liferay-portal / .claude/skills/pr-check

pr-check

Verified

Check that a PR is ready to be sent for review.

FileKindSize
SKILL.mdskill md36.5 KB
find_modules.shexecutablescript1.4 KB
references/testing.mdmarkdown5.4 KB
select_paths.shexecutablescript2.2 KB
select_validations.shexecutablescript1.1 KB
validations/branch/bean-param-util-getter.mdmarkdown6.6 KB
validations/branch/bnd-content.mdmarkdown15.2 KB
validations/branch/bnd-dsannotations-options.mdmarkdown9.1 KB
validations/branch/cache-field-usage.mdmarkdown13.9 KB
validations/branch/concurrent-mapper-hash-map-usage.mdmarkdown7.5 KB
validations/branch/html-escaping.mdmarkdown2.6 KB
validations/branch/pr-reviewer.mdmarkdown6.6 KB
validations/branch/redundant-assert-message.mdmarkdown13.5 KB
validations/branch/required-configuration-policy.mdmarkdown7.9 KB
validations/branch/service-holder-usage.mdmarkdown8.3 KB
validations/branch/service-registration.mdmarkdown3.7 KB
validations/branch/source-format.mdmarkdown4.1 KB
validations/branch/startup-sync-usage.mdmarkdown10.6 KB
validations/branch/transaction-usage.mdmarkdown4.0 KB
validations/branch/unused-project-dependencies.mdmarkdown18.5 KB
validations/portal/baseline.mdmarkdown14.0 KB
validations/portal/cross-module-compile.mdmarkdown7.9 KB
validations/portal/full-portal-build.mdmarkdown1.4 KB
validations/portal/go-generate.mdmarkdown2.8 KB
validations/portal/go-source-format.mdmarkdown1.9 KB
validations/portal/helm-unit-test-order.mdmarkdown1.4 KB
validations/portal/instance-wrapper-build.mdmarkdown656 B
validations/portal/java-unit-test.mdmarkdown6.7 KB
validations/portal/javascript-unit-test.mdmarkdown7.7 KB
validations/portal/module-registration.mdmarkdown7.8 KB
validations/portal/per-module-compile.mdmarkdown10.4 KB
validations/portal/portlet-title.mdmarkdown1.1 KB
validations/portal/poshi-syntax.mdmarkdown336 B
validations/portal/pql-validation.mdmarkdown516 B
validations/portal/rest-builder.mdmarkdown938 B
validations/portal/service-builder.mdmarkdown1.6 KB
validations/portal/structural-smoke.mdmarkdown3.9 KB
validations/portal/theme-build.mdmarkdown2.0 KB
validations/workspaces/generated-file.mdmarkdown2.5 KB
validations/workspaces/source-format.mdmarkdown2.0 KB
validations/workspaces/workspace-compile.mdmarkdown1.8 KB
validations/workspaces/workspace-java-unit-test.mdmarkdown1.7 KB
validations/workspaces/workspace-javascript-unit-test.mdmarkdown1.9 KB

references/testing.md

View on GitHub
# Testing Changes to PR Check

A change to this skill is prose, so reading it proves nothing. Test it by running the text against changes planted for the purpose on a branch that is never pushed. Judge the result from git and from the logs rather than from the summary a run prints.

## Selection

When a change touches a `## Match` section, the routing, the list in `SKILL.md`, or `select_paths.sh`, resolve the paths of recent commits on the base branch and select from them twice, once with the rules on the base branch and once with the change, and account for every validation and path that differs. Include a path the change must select and one it must not, so that a broken comparison reads as a disagreement rather than as agreement. Running `select_paths.sh` on a single validation is the quickest check of what it selects, and piping a single path into `find_modules.sh` the quickest check of its module.

## Scripts

When a change touches `select_paths.sh`, `select_validations.sh`, or `find_modules.sh`, test it locally in a throwaway Git repository, with commit signing turned off, that plants the marker files each case needs, and compare every printed line with the line you expect. None of the scripts carries committed test cases.

For `find_modules.sh`, cover a path under `src/main`, `src/test`, `src/testIntegration`, and `src/jmh`; a `.groovy` resource; a path with a space; a nested module, which resolves to the outermost; a module deleted on the branch, which resolves through the merge base; `modules/.releng`; `modules/test/playwright`, which is no module; Poshi and `portal-web/test`; a file at the repository root; and, in a workspace, a client extension, a module, and a theme, which is no module there.

For `select_paths.sh`, cover a branch, a portal, and a workspace validation; a `## Match` with an ` &! ` exclude side; a portal validation that must not see workspace paths; the regenerated and owned paths of a workspace other than `liferay-sample-workspace`; and the three errors: a file with no `## Match`, an unknown folder, and a workspace validation without a workspace name.

Break each rule in a copy of the script and confirm that a case fails, so that a case that can never fail does not read as coverage.

## Commands

When a change touches a `## Command` or `## Autocommit` section, extract exactly that section, as the runner hands it to a subagent, and confirm the extract carries the change and nothing from the rest of the file. Set `${SKILL_DIR}`, `${MERGE_BASE}`, and `${VALIDATION_FILE}` the way the runner does, since a **Command** builds its paths, modules, and projects with `select_paths.sh` and has nothing to work on without them. Give the new text and the text on `master` to two subagents that know nothing about the change, with the same planted diff, and ask each for its verdict and the sentence that decided it. A change that works splits the verdicts. Identical verdicts mean the change made no difference where it is read.

When a command reimplements a rule another tool enforces, run both against the same planted cases and require them to agree, including a case that must fail on both sides. A command that crashes prints nothing, which reads as a pass, so check its exit status as well as its output.

Run every shell command in a validation under both zsh and bash. The Bash tool runs zsh on macOS, and zsh does not split an unquoted variable or command substitution into words, so under zsh a command that builds its arguments in a variable passes them to the tool as a single argument.

## Whole Runs

Run `/pr-check` from the root of a worktree that holds the planted changes, for example with `claude -p "/pr-check"`. A headless session cannot answer the question Pass 1 asks when the estimate exceeds 20 minutes, so say in the prompt to proceed without asking. Plant one change for each outcome to prove, each in its own commit, and check the verdicts against git, for example against the `<TICKET> SF` commit a formatter makes.

A branch in this repository always carries the rule change in its own diff, so a test run here also reports on the `.claude` files the change touched. That is expected.

To test the rules as the private repository runs them, copy `pr`, `pr-check`, and `pr-check-publish` from the branch holding the change into a worktree of `liferay-portal-ee` on `master-private`. The copies do not come from local `master`, so name the rules commit in the prompt.

## Measurements

A change that can alter how long a run takes or how many tokens it uses, such as a new precondition, a narrower `## Match`, or a different **Command**, comes with numbers. Run `/pr-check` twice on the same planted branch, once with the rules on the base branch and once with the change, and put both sets of numbers side by side in the pull request description. A number without its base run says nothing about the change.

For each run, record the wall time of the whole run and of each shared precondition, and the tokens the runner and every subagent used together. A headless session writes its transcript to `~/.claude/projects/<project>/<session>.jsonl` and each subagent's to `~/.claude/projects/<project>/<session>/subagents`, and the sum of the `usage` of every message across those files is the total.

Run both on an idle machine and record its load average, since a build under load can take several times as long and reads as a slower change. Start both from the same Gradle build cache, empty or full, and say which, since a full cache hides most of what a build costs.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall