Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Helps with tasks related to Gerrit and Buildbucket.
.claude/skills/pigweed-project-gerrit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 234% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 106% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -9% | 0% |
This document summarizes the tricks and methods discovered for interacting with Gerrit and Buildbucket programmatically and via CLI in the Pigweed environment.
Pigweed uses LUCI Buildbucket for checks. You can query the status of builds for a specific CL and patchset without using the Gerrit UI.
To query the status of all Buildbucket checks for a patchset (including handling pagination and deduplicating retries to keep only the latest run for each builder), use the provided Python helper script:
bashpython3 .agents/skills/gerrit/scripts/search_builds.py <CHANGE_ID> <PATCHSET_ID>
Or with a Gerrit URL:
bashpython3 .agents/skills/gerrit/scripts/search_builds.py <GERRIT_URL>
fetched from Buildbucket (e.g., ~72) will often be less than the total checks count displayed in the Gerrit UI (e.g., ~132). This is expected behavior. The Gerrit UI "Checks" tab aggregates top-level Buildbucket tryjobs plus individual sub-steps (like distinct tests run inside a pw_presubmit invocation reporting separately) and other robot/linter plugins (e.g., AyeAye linter comments, SLSA policy checks). The Buildbucket query focuses specifically on top-level infrastructure builders that can be individually triggered or retried via bb add.
To get specific logs for a build:
https://cr-buildbucket.appspot.com/prpc/buildbucket.v2.Builds/GetBuild
POSTjson { "id": "<BUILD_ID>", "fields": "steps" } Note: Requesting the `steps` field returns `viewUrl` links to logs in LogDog for each step.
bb CLI)The bb CLI tool is used to interact with Buildbucket builders directly. Note that bb is made ambiently available on $PATH by bootstrapping or activating the Pigweed environment:
bash source bootstrap.sh # or: source activate.sh
bb is still not installed and cipd is available, download it usingcipd export: bash # e.g., platform can be mac-arm64, mac-amd64, linux-amd64 echo 'infra/tools/bb/${platform} latest' | \ cipd export -root /path/to/install -ensure-file -
bb auth-login in their owninteractive terminal first. Use bb auth-info to verify the active login state.
When addressing failed checks on a CL, follow this resource-efficient workflow:
bb add): Initially, trigger only thespecific checks that failed using the bb CLI to quickly verify the fix without wasting CI resources on the whole suite.
checks have passed successfully, proceed to trigger a full dry run (all checks) via Gerrit API or push options. This ensures the complete suite is validated on the final code state as required by Gerrit for submission.
bb CLI (Specific Builders)To trigger a specific check manually after it has been scheduled or failed:
bashbb add -cl \ https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/<CHANGE_ID>/<PATCHSET_ID> \ pigweed/pigweed.try/<BUILDER_NAME>
Example:
bashbb add -cl \ https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/404076/4 \ pigweed/pigweed.try/pigweed-mac-arm-vscode
You can trigger all CQ checks (Dry Run) on the current patchset by setting the Commit-Queue label to 1 via the Gerrit REST API using the user's local git cookies:
bashcurl -sb ~/.gitcookies -X POST \ -H "Content-Type: application/json" \ -d '{"labels": {"Commit-Queue": 1}}' \ "https://pigweed-review.googlesource.com/a/changes/<CHANGE_ID>/revisions/current/review"
You can trigger a dry run when pushing to Gerrit by setting the Commit-Queue label:
bashgit push origin HEAD:refs/for/main%l=Commit-Queue+1
Or using the -o option:
bashgit push origin HEAD:refs/for/main -o l=Commit-Queue+1
.../changes/<ID>/jwts requires alogged-in session.
Attempting to use the Gerrit JWT directly resulted in a signature check error: unknown signing key.
bb CLI Authbb tool requires authentication via bb auth-login.bb auth-info to verify if the active accountdetails and OAuth scopes are valid.
bb auth-login cannot be run by the AI agentdirectly because it requires an interactive terminal (TTY) to proceed with the login flow.
bb auth-login in their own interactiveterminal first. Once authenticated, the agent can use the bb CLI tool successfully.
To get open comments on a change:
https://pigweed-review.googlesource.com/changes/<CHANGE_ID>/comments
GET"unresolved": true and for thelatest patch_set.
comments-<CHANGE_ID>.md) with checkboxesfor each unresolved comment.
changes.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,085 | 11,899 | +68% | 1 | 1 | 0% | 921 | 1,922 | +109% | 0 | 0 | — |
case-02 | fail→pass | 17,104 | 33,996 | +99% | 1 | 1 | 0% | 1,796 | 5,997 | +234% | 0 | 0 | — |
case-03 | fail→fail | 21,946 | 10,058 | -54% | 1 | 1 | 0% | 2,712 | 2,200 | -19% | 0 | 0 | — |
case-04 | pass→pass | 17,442 | 13,505 | -23% | 1 | 1 | 0% | 2,827 | 2,716 | -4% | 0 | 0 | — |
case-05 | pass→pass | 11,020 | 4,961 | -55% | 1 | 1 | 0% | 2,023 | 2,445 | +21% | 0 | 0 | — |
case-06 | fail→pass | 11,569 | 14,807 | +28% | 1 | 1 | 0% | 1,695 | 2,907 | +72% | 0 | 0 | — |
case-07 | fail→pass | 9,697 | 4,140 | -57% | 1 | 1 | 0% | 1,438 | 2,301 | +60% | 0 | 0 | — |
case-08 | pass→pass | 10,624 | 25,890 | +144% | 1 | 1 | 0% | 1,600 | 2,253 | +41% | 0 | 0 | — |
case-09 | pass→pass | 6,495 | 3,825 | -41% | 1 | 1 | 0% | 871 | 1,937 | +122% | 0 | 0 | — |
case-10 | pass→pass | 21,982 | 5,258 | -76% | 1 | 1 | 0% | 1,863 | 2,367 | +27% | 0 | 0 | — |
case-11 | pass→pass | 18,885 | 3,841 | -80% | 1 | 1 | 0% | 1,296 | 2,140 | +65% | 0 | 0 | — |
case-12 | fail→pass | 19,451 | 3,571 | -82% | 1 | 1 | 0% | 1,085 | 2,239 | +106% | 0 | 0 | — |
case-13 | fail→pass | 15,128 | 5,171 | -66% | 1 | 1 | 0% | 2,472 | 2,241 | -9% | 0 | 0 | — |
case-14 | fail→pass | 28,046 | 11,755 | -58% | 1 | 1 | 0% | 2,316 | 2,440 | +5% | 0 | 0 | — |
case-15 | pass→pass | 17,360 | 3,371 | -81% | 1 | 1 | 0% | 2,171 | 1,969 | -9% | 0 | 0 | — |
case-16 | pass→pass | 7,077 | 12,119 | +71% | 1 | 1 | 0% | 1,079 | 2,162 | +100% | 0 | 0 | — |
case-17 | pass→pass | 10,604 | 2,562 | -76% | 1 | 1 | 0% | 1,671 | 1,987 | +19% | 0 | 0 | — |
case-18 | pass→pass | 7,401 | 9,366 | +27% | 1 | 1 | 0% | 1,143 | 3,026 | +165% | 0 | 0 | — |
case-19 | pass→pass | 19,506 | 24,128 | +24% | 1 | 1 | 0% | 1,400 | 2,745 | +96% | 0 | 0 | — |
case-20 | pass→pass | 8,069 | 5,025 | -38% | 1 | 1 | 0% | 1,357 | 2,509 | +85% | 0 | 0 | — |
case-21 | pass→pass | 12,172 | 8,395 | -31% | 1 | 1 | 0% | 1,885 | 2,805 | +49% | 0 | 0 | — |
case-22 | pass→pass | 9,103 | 3,322 | -64% | 1 | 1 | 0% | 1,439 | 2,087 | +45% | 0 | 0 | — |
case-23 | fail→pass | 9,028 | 8,675 | -4% | 1 | 1 | 0% | 1,197 | 2,143 | +79% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 20 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +30 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.