基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ROCm/rocprofiler-systems-skills --skill therock-first-build-with-commit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Given a TheRock nightly build (URL or run-id), return the rocm-systems pin_sha used in that build
Check whether a given rocm-systems commit is included in a specific TheRock nightly build
Reviews Pull Requests or local diffs with an 8-agent fan-out covering static analysis, dead code, code smells + quality (naming, complexity, single-responsibility, magic numbers), language rules (C++/Python/CMake), architecture, simplification, performance (hot-path classification, allocations, locks, I/O), and undefined behaviour (signed overflow, lifetime, strict aliasing, data races, sanitizer coverage; C/C++/unsafe-Rust only). Use when the user asks to "review this PR", "review the diff", "audit this branch", "/pr-review", or when staging changes before push.
| name | therock-first-build-with-commit |
| description | Find the first TheRock nightly build that includes a given rocm-systems commit |
Walks scheduled runs of the Multi-Arch Release workflow on ROCm/rockrel (workflow id 265449761 — the workflow that currently publishes nightly manifests to S3) in chronological order, starting at (or just before) the commit's date, and reports the first build whose rocm-systems pin_sha is a descendant of (or equal to) the user's commit — i.e. the commit is an ancestor of the build's pin_sha.
Legacy: Before mid-June 2026, nightlies used Release portable Linux packages on ROCm/TheRock (workflow id 161312296, now deleted). For commits first shipped in that era, pass --legacy (equivalent to --workflow-repo ROCm/TheRock --workflow 161312296). The default rockrel walk may report a later run as "first" if the commit actually shipped in an earlier TheRock nightly.
Backed by an executable helper script: find_first_build.py.
Use this skill when:
<sha>?"Unless the user says otherwise, this skill targets the rocm-systems submodule on ROCm/rocm-systems.
| Flag | Required | Default | Notes |
|---|---|---|---|
--commit SHA | yes | - | Full 40-char SHA preferred (>= 7 chars); must be visible on --repo |
--repo OWNER/REPO | no | ROCm/rocm-systems | The repo that hosts the commit |
--submodule NAME | no | rocm-systems | Submodule name in therock_manifest.json |
--gpu-family FAMILY | no | gfx94X-dcgpu | Legacy only — fallback path for older builds with per-GPU-family manifests |
--legacy | no | off | Walk ROCm/TheRock workflow 161312296 instead of current ROCm/rockrel / 265449761 |
--workflow-repo OWNER/REPO | no | ROCm/rockrel | Override repo hosting the nightly workflow (ROCm/TheRock with --legacy) |
--workflow ID | no | 265449761 | Override workflow id (161312296 with --legacy) |
--since YYYY-MM-DD | no | commit date minus 1 day | Lower bound for the run listing |
--max-runs N | no | 90 | Caps the linear walk (Actions retention is ~90 days) |
--json | no | off | Emit final result as JSON on stdout (per-iteration progress still goes to stderr) |
gh CLI installed and authenticated against github.com (see skills/git-gh-client/SKILL.md for setup).python3 >= 3.8 (standard library only; no pip install needed).github.com and therock-nightly-artifacts.s3.amazonaws.com.Quick sanity check:
gh auth status
python3 --version
The skill is a thin wrapper around the bundled script. The agent's job is to:
Confirm prerequisites.
Determine the SKILL directory (the folder containing this SKILL.md); call it SKILL_DIR. Typically ~/.claude/skills/therock-first-build-with-commit/.
Invoke the script with the user's commit:
python3 "$SKILL_DIR/find_first_build.py" --commit <SHA>
Stream the per-iteration progress (stderr) to the user as it runs. When done, present the final result (stdout) verbatim — it is already a bullet list; do not reformat it into a table or prose.
If the user wants to pipe the result into other tooling, add --json:
python3 "$SKILL_DIR/find_first_build.py" --commit <SHA> --json
If the user provides a PR URL/number instead of a SHA, resolve it first:
gh api repos/ROCm/rocm-systems/pulls/<PR_NUMBER> \
--jq '{merged, merge_commit_sha, head_sha, base_ref: .base.ref}'
Use merge_commit_sha (the commit that landed on the base branch) - not head_sha (the tip of the PR branch before merge). Then pass merge_commit_sha to --commit.
SKILL_DIR=~/.claude/skills/therock-first-build-with-commit
python3 "$SKILL_DIR/find_first_build.py" \
--commit d22352b782e728115786965046088fc4a71341fb
Sample stderr (progress):
Resolving commit d22352b782e728115786965046088fc4a71341fb on ROCm/rocm-systems...
committed: 2026-06-19T17:02:00+00:00
Listing scheduled runs of ROCm/rockrel workflow 265449761 since 2026-06-18 (max 90)...
Inspecting 9 runs in chronological order.
[ 1/9] run=27728528519 created=2026-06-18T00:25:59Z pin=7ced1a66 status=behind ahead_by=0 behind_by=205
[ 2/9] run=27797822902 created=2026-06-19T00:29:01Z pin=7ced1a66 status=behind ahead_by=0 behind_by=205
[ 3/9] run=27854481844 created=2026-06-20T00:21:36Z pin=a0952b2b status=behind ahead_by=0 behind_by=30
[ 6/9] run=27993312669 created=2026-06-23T00:22:14Z pin=971dc690 status=ahead ahead_by=34 behind_by=0 FOUND
Sample stdout (final result):
Commit d22352b7 first shipped in the 2026-06-23 nightly.
First nightly build to include d22352b782e728115786965046088fc4a71341fb:
- run_id: 27993312669 (created 2026-06-23T00:22:14Z)
- pin_sha: 971dc6904568e810f00473760000939deaf30e84 (34 commits ahead)
- the_rock_commit: 86af3706e7bf2e43f673dbf2f9038e226ede3af7
- Repo snapshot: https://github.com/ROCm/rocm-systems/tree/971dc6904568e810f00473760000939deaf30e84
- GitHub Actions: https://github.com/ROCm/rockrel/actions/runs/27993312669
- Compare: https://github.com/ROCm/rocm-systems/compare/d22352b782e728115786965046088fc4a71341fb...971dc6904568e810f00473760000939deaf30e84
- Manifest: https://therock-nightly-artifacts.s3.amazonaws.com/27993312669-linux/manifests/therock_manifest.json
- Packages (deb): https://rocm.nightlies.amd.com/packages-multi-arch/deb/20260623-27993312669/index.html
- Tarball: https://rocm.nightlies.amd.com/tarball-multi-arch/therock-dist-linux-multiarch-7.14.0a20260623.tar.gz
--legacyFor commits first shipped before the rockrel migration (~2026-06-12), walk the deleted TheRock workflow:
python3 "$SKILL_DIR/find_first_build.py" \
--commit 570dcd3205005305b32b50996be1d7154d399c4a \
--legacy
Legacy run URLs use https://github.com/ROCm/TheRock/actions/runs/<RUN_ID> and per-GPU-family manifest paths.
python3 "$SKILL_DIR/find_first_build.py" --commit <fresh_sha>
Final stdout:
No nightly build in the inspected window contains <fresh_sha>.
Inspected runs: 1 (since 2026-06-03)
The commit may still ship in a later nightly; rerun later or widen --max-runs / --since.
Exit code is 5 (no match). Suggest the user rerun in a day, or widen the window if their commit is older.
python3 "$SKILL_DIR/find_first_build.py" \
--commit <old_sha> \
--since 2026-03-01 \
--max-runs 90
python3 "$SKILL_DIR/find_first_build.py" --commit <sha> --json \
| jq '.first_build.run_id // empty'
gh)PR=6445
COMMIT=$(gh api repos/ROCm/rocm-systems/pulls/$PR --jq .merge_commit_sha)
python3 "$SKILL_DIR/find_first_build.py" --commit "$COMMIT"
This skill produces:
--json).0 found, 3 invalid input, 4 upstream/network failure, 5 exhausted window without finding. (5 rather than 2 so callers can distinguish "no match" from Python's argparse default of 2.)No files are written.
| Mistake | Fix |
|---|---|
| Passing a PR number instead of a SHA | Resolve via gh api repos/.../pulls/<N> --jq .merge_commit_sha first |
Passing the PR's head_sha instead of merge_commit_sha | The head SHA may not exist on the base branch (especially after squash); always use merge_commit_sha |
Setting --since after the commit's committer date | The walk would skip the very window where the fix could appear; if unsure, omit --since and let the default handle it |
Assuming pin_sha varies by architecture | It does not — multi-arch nightlies publish one manifest; pin_sha is the same everywhere |
Treating exit code 5 as a script failure | Exit code 5 means "no nightly in the window contains the commit yet" - rerun later or widen --max-runs / --since. (Note: argparse uses exit 2 for CLI errors like missing --commit, so 5 lets callers distinguish "no match" from "bad invocation".) |
| Reading from stdout while the script is still running | Per-iteration progress goes to stderr; redirect appropriately (2>progress.log or just observe both) |
manifest=missing (skipped) linesCause: not every workflow run publishes artifacts. Failed, cancelled, or in-progress runs typically have no manifest. The script skips them and continues.
If all runs are skipped, verify manifest availability against one known-good build using therock-build-to-commit:
curl -fsSL https://therock-nightly-artifacts.s3.amazonaws.com/<RUN_ID>-linux/manifests/therock_manifest.json | head -c 200
For legacy builds, fall back to .../manifests/gfx94X-dcgpu/therock_manifest.json.
gh rate-limit errorsCause: anonymous rate limit hit, or token scope too narrow.
Steps:
gh auth status.GH_TOKEN=<your_pat> before invoking the script.--max-runs to limit API calls.error: could not resolve commit <sha> on ROCm/rocm-systemsCause: the SHA is on a private fork or not pushed to upstream.
Steps:
gh api repos/ROCm/rocm-systems/commits/<sha> --jq .sha.status=nullCause: GitHub returns extra states for very large diffs.
The script logs ahead_by/behind_by either way. Use that as the source of truth: behind_by == 0 -> commit is an ancestor (included).
| Relationship | Skill | Why |
|---|---|---|
| Calls | git-gh-client | For gh availability and authentication setup |
| Sibling | therock-build-to-commit | Reverse direction: given a build, what's the pinned commit? |
| Sibling | therock-commit-in-build | Single-build spot check (you already know which build to look at) |
Decision matrix:
| User asks... | Use |
|---|---|
| "What commit is in build X?" | therock-build-to-commit |
| "Is commit Y in build X?" | therock-commit-in-build |
| "What's the first build containing commit Y?" | this skill |
--commit, --repo, --submodule, --legacy, --workflow, --workflow-repo, --since, --max-runs, --json), needs structured per-iteration progress, and is most useful when reusable from a shell prompt or CI - not just from inside an agent session.pip install required.