plugins/beaver/skills/beaver-pr/SKILL.md
Commit, push, and open a PR with Beaver compliance checks (LOC guard, label completeness, test evidence). Automatically transitions the linked Issue to review-needed. Trigger when the user wants to commit, push, or create a pull request.
npx skillsauth add primatrix/skills beaver-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Commit changes, push, and open a GitHub PR with integrated Beaver compliance checks. Validates LOC limits, label completeness, and test evidence before PR creation. Automatically transitions the linked Issue to status/review-needed.
References beaver-engine for: guardrails G004-G006 (Section 3), label ops (Section 4), config reading (Section 5), transition execution (Section 6).
gh auth status must succeedRun in parallel:
git status
git diff HEAD
git branch --show-current
git log --oneline -10
<type>/<issue-number>-<short-desc>
.env, credentials.*)-u origin <branch> if new branchDetect issue number from:
feat/42-add-login → #42)#NIf detected, confirm with user. If not detected, ask:
"Associate this PR with a Beaver issue?"
- Enter issue number (e.g.,
42or#42) or full URLnew→ create via beaver-issue firstskip→ no association
Parse response. If new: tell user to run /beaver-issue first, then resume.
Run all checks and present results as a table:
git diff --numstat origin/main...HEAD
Filter to core directories (from beaver-config, default: repo root). Exclude:
**/*_test.*, **/test_*.*, **/tests/****/*.md, **/docs/***.pb.go, *_generated.*, *.lockSum added lines. If > 200:
beaver/needs-split label after PR creationIf Issue is associated:
gh api repos/{owner}/{repo}/issues/{number}/labels --jq '.[].name'
Check for at least one type/ and one size/ label. If missing:
Search for test evidence in order:
PASSED, FAILED, ok, FAIL, test count summaries)If evidence found, extract summary for PR body. If not found:
beaver/missing-test label after PR creation## Beaver Compliance Check
| Rule | Status | Details |
|------|--------|---------|
| G005 LOC Guard | PASS/WARN | {N} lines in core dirs (limit: 200) |
| G006 Labels | PASS/FAIL | type/{x}, size/{y} present |
| G004 Test Evidence | PASS/WARN | {source}: {summary} |
{If any FAIL}: "Some checks failed. Fix issues before creating PR."
{If only WARN}: "Warnings found. Continue with PR creation? (y/n)"
{If all PASS}: "All checks passed. Creating PR."
Wait for user confirmation if there are warnings.
gh pr create --title "{title}" --body "$(cat <<'EOF'
## Summary
{bullet points describing changes}
## Test Plan
{test evidence summary from G004, or "TODO: add test evidence"}
{If issue associated: "Relates to {owner}/{repo}#{number}"}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
If an Issue is associated (user did NOT choose skip):
Apply beaver labels for any WARN checks:
# If G005 warned:
gh api repos/{owner}/{repo}/issues/{issue_number}/labels --method POST -f "labels[]=beaver/needs-split"
# If G004 warned:
gh api repos/{owner}/{repo}/issues/{issue_number}/labels --method POST -f "labels[]=beaver/missing-test"
Transition Issue status to status/review-needed:
Execute per engine Section 6 — validate target is legal next state from current status per Section 2.
If no Issue associated (skip): skip label and transition steps.
.env, credentials.*, or files likely containing secretsdevelopment
Use when analyzing TPU pretraining HBM occupancy from a profile directory — locates the static HBM peak (the same number TensorBoard's Memory Viewer shows), enumerates every buffer alive at the peak schedule moment with size / HLO instruction / opcode / op_name, and rolls the alive set up by opcode and op_name. Reads compile-time `*.hlo_proto.pb` (BufferAssignmentProto) as the primary source; runtime `*.xplane.pb` allocator events are a secondary, often-truncated signal.
testing
Use when analyzing TPU pretraining compute efficiency from xplane.pb — produces source-line-aggregated HLO duration tables, layer-scoped breakdowns, non-compute (padding/cast/copy) audits, and v7x roofline shortfall vs theoretical peak. Reads schema documented by profile-anatomy.
tools
--- name: comm-analysis description: Use when analyzing communication on a TPU pretraining profile — extracts every comm primitive (async + sync, TC + SparseCore), attributes axes via HLO replica_groups, computes per-row NCCL bus BW vs per-axis peak ICI BW (peak_link × k_torus_dims × directions_per_dim; TPUv7x: 200 GB/s bidir per link on a 3D torus; util% requires `--mesh-spec` with topology), and reports per-step compute/comm overlap. Builds on profile-anatomy. --- # Communication Analysis **
documentation
Use when reading TPU pretraining profiles (xplane.pb, trace.json.gz) — describes the on-disk layout, the XSpace/XPlane/XLine/XEvent/XStat hierarchy, and provides reference scripts that future tpu-perf skills can read as schema documentation.