plugins/beaver/skills/beaver-issue/SKILL.md
Create or claim a Beaver-tracked GitHub Issue with automatic status transitions and guardrail checks. Trigger when the user wants to create a GitHub issue, claim/start a task, or pick up work.
npx skillsauth add primatrix/skills beaver-issueInstall 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.
Create a new Beaver-tracked Issue or claim an existing one. Handles Project V2 field setup, label assignment, parent linking, and automatic status transitions with guardrail enforcement.
References beaver-engine for: state machine (Section 2), guardrails G001 (Section 3), label ops (Section 4), config reading (Section 5), transition execution (Section 6), QA loop & HARD-GATE (Section 7), Discovery Triad (Section 8), doc quality constraints (Section 9).
gh auth status must succeedgh auth refresh -s project if missingbeaver-config YAML blockAsk the user once: "What kind of issue is this? (feat / bug / refactor / docs / chore)"
bug: enter Bug submode (see "Bug Submode" section near the bottom of this file).Check auto memory for beaver-issue-defaults.md. If found, present defaults for confirmation. Parse project config per engine Section 5.
Execute engine Section 8 (Discovery Triad) using the user's draft title + objective as the keyword source. Print the Discovery Brief in the §8.3 format. The user does not need to "approve" the Brief — it is informational input for Step 2.
HARD-GATE: Do NOT proceed to Step 2 until the Brief has been printed.
Enter engine Section 7 Q&A loop. The first question MUST be size, because it routes the rest of the loop:
Then route:
size/S route — minimal Q&A (3 questions):
size/L route — full Q&A (4 sections, each with §7.5 approval and §9.3 checklist):
In both routes, Type and Priority labels are collected at the END (after the section-by-section loop), as separate single questions. Type defaults to feat; Priority is required and asked explicitly.
HARD-GATE per §7.2: until the user approves the section per §7.5, do NOT call any gh api POST/PATCH or gh project write command.
Show complete issue details in a structured preview, then present the §9.4 issue-body checklist (Objective is one user-facing sentence / ≥ 2 verifiable acceptance items / no invented file paths). All three rows must be ☑ before continuing. Then ask Approved? (y/revise) per §7.5.
Write the issue body (from template in "Issue Body Template" section) to a temp file, then pass it via -F body=@:
BODY_FILE=$(mktemp)
cat > "$BODY_FILE" << 'BEAVEREOF'
{rendered_body}
BEAVEREOF
gh api repos/{org}/{issueRepo}/issues --method POST \
-H "X-GitHub-Api-Version: 2026-03-10" \
-f title="{title}" -F body=@"$BODY_FILE" \
-f type="{level}" \
-f "labels[]=Control-By-Beaver" \
-f "labels[]=type/{type}" \
-f "labels[]=size/{size}" \
-f "labels[]={priority}" \
-f "labels[]=status/triage"
Add -f milestone={number} if selected. If issue type API fails, retry without -f type.
After the API call, clean up: rm "$BODY_FILE"
NOTE: Only
-F/--fieldsupports@filesyntax for reading file contents.-f/--raw-fieldpasses values as literal strings (sobody=@pathwould send the literal text@path).
gh project item-add {projectNumber} --owner {org} --url {issue_url} --format json
Set Level, Status (Not Started), Progress (0) fields via gh project item-edit.
CHILD_ID=$(gh api repos/{org}/{issueRepo}/issues/{number} --jq '.id')
gh api repos/{org}/{issueRepo}/issues/{parent_number}/sub_issues \
--method POST -H "X-GitHub-Api-Version: 2026-03-10" \
-F sub_issue_id=$CHILD_ID
NOTE: The sub-issues API requires
sub_issue_idto be an integer. Use-F(uppercase,--field) which infers numeric types automatically.-f(lowercase,--raw-field) always sends strings, causing a 422 error.
Per engine state machine:
size/S: transition status/triage → status/in-progresssize/L: transition status/triage → status/design-pendingExecute transition per engine Section 6 (validates G001).
Print summary: issue URL, level, labels, milestone, status, parent. Silently save defaults to beaver-issue-defaults.md.
Entered when Step 0 detects type/bug. Differs from Feature submode: forced size/S, mandatory priority, and p0/blocker direct-to-in-progress flow with CODEOWNERS @-mention.
Same as Feature Step 1 + Step 1.5. For D2 keywords, prefer error messages, stack-trace tokens, API names from the user's reproduction steps. If those are not yet known, ask: "Paste the error message or stack trace so I can search the codebase." THEN run §8.
Set size/S automatically. If the user objects ("this is actually a big bug, mark it size/L"), refuse with: "Bug issues are restricted to size/S per the project-management framework. If the underlying work is multi-component, please file a type/refactor or type/feat Issue instead." Do NOT proceed.
Run engine §7 with these four required sections, each individually approved per §7.5:
Ask: "Priority? (p0/blocker / p1/urgent / p2/high / p3/normal)". This is a required field; do NOT default.
If the answer is p0/blocker:
status/in-progress (skip status/triage) in Bug Step 7.Run:
gh api repos/{owner}/{repo}/contents/.github/CODEOWNERS --jq '.content' | base64 -d
If the file does not exist or returns 404, skip CODEOWNERS resolution and continue.
Otherwise: parse CODEOWNERS, match against file paths surfaced in the Discovery Brief D2 hits (best-effort glob match: * matches segments, ** matches subtrees). Collect the union of matched owner handles.
Append to the Issue body:
cc {@owner1 @owner2 ...}
If no D2 hits matched any CODEOWNERS rule, leave a comment instead of failing: cc (CODEOWNERS lookup found no match — please assign manually).
Show the Bug Issue preview + §9.5-adjusted checklist. All rows must be ☑. Then ask Approved? (y/revise).
Use the Bug body template (in "Issue Body Template" section). Same gh api create call as Feature Step 4. Then:
-f "labels[]=type/bug" -f "labels[]=size/S" -f "labels[]={priority}".p0/blocker: skip the standard "transition from triage" step. Directly atomic-swap status/triage → status/in-progress per engine §4. Validate G001 (size label present — guaranteed since size/S was forced).Same as Feature Step 8. Additionally, when p0/blocker: print "@-mentioned owners: {@owner1 @owner2}".
gh api repos/{owner}/{repo}/issues/{number} --jq '{title, state, labels: [.labels[].name], assignees: [.assignees[].login]}'
Parse labels per engine Section 4. Check status is status/triage or status/ready-to-develop. If not, inform the developer the issue cannot be claimed in its current state.
CURRENT_USER=$(gh api user --jq '.login')
gh api repos/{owner}/{repo}/issues/{number}/assignees --method POST -f "assignees[]=$CURRENT_USER"
Execute transition per engine Section 6:
status/triage: validate G001 (size label required)status/ready-to-develop: direct transitionstatus/in-progressPrint: issue URL, title, assigned user, new status.
## 目标
{objective_in_chinese}
## 验收标准
{acceptance_criteria_in_chinese}
## 目标
{objective_in_chinese}
## 验收标准
{acceptance_criteria_in_chinese}
<!-- beaver-tracking
repos:
- {repo1}
paths:
- {path1}
keywords:
- {keyword1}
-->
## 复现步骤
{steps_in_chinese}
## 期望行为
{expected}
## 实际行为
{actual}
(错误日志 / 截图:原文粘贴)
## 影响范围
{scope}
## 环境
- OS: {os}
- Version/commit: {version}
size/L (refuse with the message in Bug Step 2)p0/blocker skips status/triage but does NOT skip §8 Discovery or §7 Q&Agh api POST / gh project writedevelopment
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.