pre-pr-review
Skill432 starsChanged 13 days agoApache-2.0View on GitHub
Use before opening a valkey-operator PR, to validate the current branch on a fresh kind cluster and review its diff (e.g. "/pre-pr-review", "check my branch before I raise a PR", "kind-validate my change").
9 other projects use a version of this.
Adopted by
Most recently taken up by
- stv-io/claude-skillstheir own version, first seen Nov 29, 2026
- magnusrodseth/dotfilestheir own version, first seen Nov 29, 2026
- redis/redis-vl-pythontheir own version, first seen Nov 2, 2026
- kenchris/review-looptheir own version, first seen Nov 1, 2026
- osac-project/osac-ai-skillstheir own version, first seen Oct 13, 2026
- wisnuwiry/padutheir own version, first seen Oct 8, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- redis/redis-vl-python★ 435same name
- wisnuwiry/padu★ 27same name
- kenchris/review-loop★ 4same name
- magnusrodseth/dotfiles★ 3same name
- SirGuanZz/claude-skills★ 2same name
- osac-project/osac-ai-skills★ 1same name
- racoonamatatas/claude-skills★ 0same name
- stv-io/claude-skills★ 0same name
- tchughesiv/osac-ai-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Create the cluster: Always a fresh one, with its own kubeconfig.
- Very specific: line 56
When a fix forces a rebuild mid-run, tag each new image review-<slug>-r2, -r3 and so on.
- Very specific: line 59
When the diff changes what the operator renders into pods or their ConfigMaps (pod template, volumes, scripts, ConfigMap keys), include an …
- Very specific: line 93
Report: Run git check-ignore -q .review/<slug>.md.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pre-PR review
Validate the contributor's branch on a fresh kind cluster, review its diff, and write a report plus a Testing block for the PR description. Report findings; the contributor decides what to change.
Workflow
Resolve the target. The current branch, as it is on disk. Run
git fetch https://github.com/valkey-io/valkey-operator.git mainand takegit merge-base HEAD FETCH_HEADas<base>. Fetching by URL gets upstreammainwhatever the contributor's remotes are called, and avoids diffing against a stale forkmain. Stop and tell the contributor if HEAD is onmain, or ifgit rev-list --count <base>..HEADprints 0 andgit status --porcelainprints nothing.Save
git status --porcelainto/tmp/review-<slug>-status.beforeandgit diff | sha256sumto/tmp/review-<slug>-diff.before. If the status prints anything, carry on and mark the run dirty: the image builds from the working tree, so uncommitted changes are part of the review.Derive
<slug>from the branch name: lowercase it, replace each run of characters outsidea-z0-9with-, trim to 40 characters, strip leading and trailing-.feat/Zone-Pinningbecomesfeat-zone-pinning. The cluster isreview-<slug>.- Understand the change. Read
git diff <base>(commits plus uncommitted changes) andgit log <base>..HEAD.git diffleaves out untracked files, which the image still builds from, so also read each filegit ls-files --others --exclude-standardlists that belongs to the change, and include them in step 4's review. For each issue referenced in the commit messages (Fixes #n,Closes #n), read it withgh issue view <n> --repo valkey-io/valkey-operator --commentswhenghis installed; otherwise ask the contributor for the issue and its repro steps. Done when you can list (a) every behaviour the diff changes, each with a scenario that exercises it, including one that reproduces the issue's original failure, and (b) the cluster shape those scenarios need: node count, zone labels, cert-manager. Fast checks. Run
make lintandmake testas separate commands, so a lint failure doesn't skip the tests. Then runhack/check-copyright.sh <base>, CI's check that new Go files carry the current year in their header. The script reads committed files only, so on a dirty run also check the header of each new uncommitted Go file. Record pass or fail, and the failing output, for the report. Continue to step 4 on failure.make testrunsmanifests generate fmt, so it rewrites files the contributor forgot to regenerate or format. Comparegit status --porcelainwith/tmp/review-<slug>-status.beforeandgit diff | sha256sumwith/tmp/review-<slug>-diff.before; the hash catches a rewrite of a file that was already modified, whose status line readsMboth times. Rungit diffon anything that changed. Report these files that make changed as a "fix first" finding: CI's generated-code check fails on them. Repeat this check after step 6.- Start the static review in the background. On Claude Code, invoke the
code-reviewskill on the diff atmediumeffort. On other agents, use the agent's own review command, or dispatch a subagent to reviewgit diff <base>for correctness bugs. Give every reviewer the untracked files from step 2 as well as the diff. When the diff or the untracked files from step 2 touchapi/, a*_types.go, orconfig/crd/, also apply every item of the API checklist to those files. The findings feed steps 7 and 9. Create the cluster. Always a fresh one, with its own kubeconfig. The contributor's ambient kubectl context may point at a real cluster, and
make install/deploy/undeployact on whatever context is current, so the review cluster never touches~/.kube/config:kind delete cluster --name review-<slug> # clears a leftover from an earlier run echo '{"kind": "Cluster", "apiVersion": "kind.x-k8s.io/v1alpha4", "nodes": [{"role": "control-plane"}, {"role": "worker"}, {"role": "worker"}]}' \ | kind create cluster --name review-<slug> --kubeconfig /tmp/kind-review-<slug>.kubeconfig --config -Extend the node list when step 2's cluster shape needs more (zone labels, extra workers). When it needs cert-manager, install the version pinned as
certmanagerVersionintest/utils/utils.go:export KUBECONFIG=/tmp/kind-review-<slug>.kubeconfig kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/<version>/cert-manager.yaml kubectl -n cert-manager rollout status deploy --timeout=180sThe cluster outlives the review.
From here on, every cluster-touching command,
makeandkubectlalike, runs withKUBECONFIG=/tmp/kind-review-<slug>.kubeconfig. Shell state may not carry between commands, so set it at the top of each block.Build and deploy.
make deployrewritesconfig/manager/kustomization.yaml; the backup and theEXITtrap put back the contributor's version, uncommitted edits included, even when the block fails or is killed.set -estops the block at the first failure, so a failed build never deploys an image left over from an earlier run.set -e export KUBECONFIG=/tmp/kind-review-<slug>.kubeconfig [ "$(kubectl config current-context)" = kind-review-<slug> ] || exit 1 cp config/manager/kustomization.yaml /tmp/review-<slug>-kustomization.yaml.bak trap 'cp /tmp/review-<slug>-kustomization.yaml.bak config/manager/kustomization.yaml' EXIT make docker-build IMG=valkey-operator:review-<slug> kind load docker-image valkey-operator:review-<slug> --name review-<slug> make install make deploy IMG=valkey-operator:review-<slug> kubectl -n valkey-operator-system rollout status deploy --timeout=180sWhen a fix forces a rebuild mid-run, tag each new image
review-<slug>-r2,-r3and so on. Reloading the same tag into kind can leave running pods on the old image.Validate. Exercise each behaviour from step 2 directly: apply CRs, mutate specs, watch conditions and operator logs. At least one scenario must fail without the change. When the static findings arrive, add a scenario for each one the cluster can confirm or refute. Capture every command and its observed output verbatim as you go; the report quotes them. Done when every behaviour from step 2 and every cluster-checkable finding has a scenario with a recorded pass or fail. Delete the CRs you created; keep the cluster.
When the diff changes what the operator renders into pods or their ConfigMaps (pod template, volumes, scripts, ConfigMap keys), include an upgrade scenario. Build and deploy
<base>under its own tag:set -e export KUBECONFIG=/tmp/kind-review-<slug>.kubeconfig [ "$(kubectl config current-context)" = kind-review-<slug> ] || exit 1 git worktree remove --force /tmp/review-<slug>-base 2>/dev/null || true # clears a leftover from an aborted run git worktree add /tmp/review-<slug>-base <base> cd /tmp/review-<slug>-base make docker-build IMG=valkey-operator:review-<slug>-base kind load docker-image valkey-operator:review-<slug>-base --name review-<slug> make install make deploy IMG=valkey-operator:review-<slug>-base kubectl -n valkey-operator-system rollout status deploy --timeout=180sCreate a cluster with some data. Then run step 6's block again from the branch, with the newest branch tag. The image reference changes from
-base, so the operator rolls onto branch code; check that the Valkey pods roll one at a time with the data kept. Remove the worktree afterwards withgit worktree remove --force /tmp/review-<slug>-base;--forceis needed becausemake deploymodified it. This is the only scenario that checks the order of operations on upgrade, such as the ConfigMap updating before the first pod rolls.Before marking a static finding refuted, grep
test/e2e/andinternal/controller/*_test.gofor its scenario and reuse their setup (Secrets, ConfigMaps, cluster shape). Refute only when a working repro shows the behaviour is fine, or the code path is unreachable. A repro that fails for an unrelated reason refutes nothing.Run the related e2e specs. Grep
test/e2e/for the functions, fields, files and resource names the diff touches, and list theLabel(...)values on the matchingDescribe/Context/Itblocks. Pick the narrowest label that covers each match (external-cm, notvalkeynode). Each label takes about two minutes. AfterSuite removes the review deployment and the CRDs, so this is the last cluster step:set -e export KUBECONFIG=/tmp/kind-review-<slug>.kubeconfig [ "$(kubectl config current-context)" = kind-review-<slug> ] || exit 1 cp config/manager/kustomization.yaml /tmp/review-<slug>-kustomization.yaml.bak trap 'cp /tmp/review-<slug>-kustomization.yaml.bak config/manager/kustomization.yaml' EXIT make undeploy KIND_CLUSTER=review-<slug> CERT_MANAGER_INSTALL_SKIP=true \ E2E_MANAGER_IMAGE=valkey-operator:review-<slug> E2E_SKIP_IMAGE_BUILD=true \ go test -tags=e2e ./test/e2e/ -v -timeout 40m -ginkgo.label-filter "<label> || <label>"E2E_MANAGER_IMAGEreuses the image from step 6 instead of building another; pass the newest tag when step 7 rebuilt (-r2, ...). The 40-minute timeout matchesmake test-e2e-run; at Go's 10-minute default the process can die before AfterSuite cleans up. BeforeSuite runsmake deploy, which rewriteskustomization.yaml; the trap restores it as in step 6. Several labels run for longer than a default tool timeout, so run this block in the background or with a long timeout. DropCERT_MANAGER_INSTALL_SKIP=truewhen a selected label needs TLS. Record pass or fail per label.Report. Run
git check-ignore -q .review/<slug>.md; checking the file path works before.review/exists. If it succeeds, write.review/<slug>.md. Otherwise the branch predates the ignore rule, so write/tmp/review-<slug>.mdand say so in the output. Sections, in order:- Verdict: "ready to open" or "fix first", with the reasons
- Change summary
- Environment: cluster name and config, every image tag built (
-base,-r2, ...),<base>and HEAD SHAs, dirty or clean - Fast checks
- Validation scenarios: per scenario, purpose, commands, observed output, pass or fail
- Related e2e specs: per label, pass or fail
- Code review findings
- API checklist results, when the diff touches API types. State whether the shape is right for the change, not only whether it works.
- Follow-ups
Then print to the contributor, in this order:
A Testing block in a fenced
markdowncode block, ready to paste under the PR template's### Testing:Validated on kind (`review-<slug>`, image `valkey-operator:review-<slug>`, HEAD `<short-sha>`): - `make lint`: <pass or fail> - `make test`: <pass or fail> - <scenario purpose>: <pass or fail> - e2e `<label>`: <pass or fail>- The report path.
- The teardown command:
kind delete cluster --name review-<slug>.
API checklist
Apply each item to the changed API types and CRDs. The Kubernetes API conventions are the reference.
- New fields are optional with a documented default, or required with a stated reason.
- A bool that could grow a third state is an enum.
- Structured config uses typed fields or a list of named entries, not
map[string]string. - Enums use
+kubebuilder:validation:Enumwith CamelCase values. - Fields sharing a prefix sit in a nested struct.
- Status reports state through conditions per
docs/status-conditions.md, not ad-hoc bools or message strings. - Cross-namespace references carry a stated reason.
- Spec changes stay compatible with existing CRs; renames and type changes carry a migration note.
- The change belongs in the API at all, rather than as an operator default.
make manifests generatewas run, and the CRD diff matches the type diff.
Gotchas
make test-e2echainscleanup-test-e2e, which deletes the kind cluster mid-review; step 8 runsgo testdirectly. The suite brings its own operator: BeforeSuite builds an image (unlessE2E_SKIP_IMAGE_BUILD=true), loads it into kind, createsvalkey-operator-system(failing if it exists), and runsmake deploy; AfterSuite runsmake undeployandmake uninstall, removing the review deployment, the CRDs and every CR.- Tag images with something other than
latest::latestimpliesimagePullPolicy: Always, which breaks kind-loaded images. - TLS-related changes need cert-manager in the cluster; step 5 installs it. The e2e suite skips its own install when cert-manager is already there.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

