AGENT SKILL

create-beta-tag

Create and push a signed, annotated NeMo Fabric beta tag from its release branch or from validated main. Use when cutting a beta tag; not for RC or stable release tags.

License 许可
Apache-2.0
所属仓库
leemiracle/work4ai
最近更新
2026-11-12
Stars
★ 4
Forks
0

01 前言 Front Matter

name
create-beta-tag
author
NVIDIA Corporation and Affiliates
license
Apache-2.0
description
Create and push a signed, annotated NeMo Fabric beta tag from its release branch or from validated main. Use when cutting a beta tag; not for RC or stable release tags.

03 SKILL.md 正文

Create a Beta Tag

Require the user to provide the stable release version in either <major>.<minor> or <major>.<minor>.<patch> form. Treat two components as <major>.<minor>.0. Do not infer the version from package metadata or a branch name, and do not edit package metadata while creating the tag.

RELEASE_VERSION_INPUT="<user-provided-major.minor[.patch]>"
if [[ "${RELEASE_VERSION_INPUT}" =~ ^[0-9]+\.[0-9]+$ ]]; then
  RELEASE_BASE_VERSION="${RELEASE_VERSION_INPUT}.0"
elif [[ "${RELEASE_VERSION_INPUT}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
  RELEASE_BASE_VERSION="${RELEASE_VERSION_INPUT}"
else
  echo "Error: release version must be <major>.<minor> or <major>.<minor>.<patch>" >&2
  exit 1
fi
RELEASE_BRANCH="release/$(printf '%s' "${RELEASE_BASE_VERSION}" | cut -d. -f1,2)"

Select the tag source

Prefer the corresponding remote release branch. If it does not exist, use main only when upstream/main:Cargo.toml declares the requested base version. Stop if neither condition holds.

if git ls-remote --exit-code --heads upstream "refs/heads/${RELEASE_BRANCH}" >/dev/null; then
  TAG_SOURCE_BRANCH="${RELEASE_BRANCH}"
else
  TAG_SOURCE_BRANCH='main'
fi

git fetch upstream "${TAG_SOURCE_BRANCH}" --tags

if [[ "${TAG_SOURCE_BRANCH}" == 'main' ]]; then
  UPSTREAM_MAIN_VERSION="$(
    git show 'upstream/main:Cargo.toml' |
      python -c "import sys, tomllib; print(tomllib.loads(sys.stdin.read())['workspace']['package']['version'])"
  )"
  test "${UPSTREAM_MAIN_VERSION}" = "${RELEASE_BASE_VERSION}"
fi

If the user provides a beta number, use it only after checking that it is a positive integer and its remote tag does not already exist. Otherwise, select one greater than the largest numeric beta suffix for this exact base version, starting at 1:

LAST_BETA_NUM="$(
  git tag --list "v${RELEASE_BASE_VERSION}-beta.*" |
    awk -v prefix="v${RELEASE_BASE_VERSION}-beta." '
      index($0, prefix) == 1 {
        suffix = substr($0, length(prefix) + 1)
        if (suffix ~ /^[0-9]+$/ && suffix + 0 > max) max = suffix + 0
      }
      END { if (max) print max }
    '
)"
BETA_NUM="${LAST_BETA_NUM:+$((LAST_BETA_NUM + 1))}"
BETA_NUM="${BETA_NUM:-1}"
RELEASE_VERSION="${RELEASE_BASE_VERSION}-beta.${BETA_NUM}"
RELEASE_TAG="v${RELEASE_VERSION}"

Create and verify the tag

Assume upstream is the NVIDIA repository remote. Preserve user changes: do not stash, discard, or switch away from a dirty worktree. Require the checked out commit to equal the selected upstream branch. This also verifies the local package version when tagging from a release branch, and re-verifies the upstream/main version condition after switching to main.

Run the remaining commands in one noninteractive Bash session. Record the user's original checkout and install this exit trap before switching branches. The trap returns to the original named branch (or detached commit) after a successful tag or any error, but only if this workflow changed the checkout.

set -euo pipefail
ORIGINAL_BRANCH="$(git branch --show-current)"
ORIGINAL_HEAD="$(git rev-parse --verify HEAD)"
CHECKOUT_CHANGED=false

restore_checkout() {
  local outcome=$?
  trap - EXIT
  if [[ "${CHECKOUT_CHANGED}" == true ]]; then
    if [[ -n "${ORIGINAL_BRANCH}" ]]; then
      git switch "${ORIGINAL_BRANCH}" || outcome=1
    else
      git switch --detach "${ORIGINAL_HEAD}" || outcome=1
    fi
  fi
  exit "${outcome}"
}
trap restore_checkout EXIT
if [[ "${ORIGINAL_BRANCH}" != "${TAG_SOURCE_BRANCH}" ]]; then
  git switch "${TAG_SOURCE_BRANCH}"
  CHECKOUT_CHANGED=true
fi
git pull --ff-only upstream "${TAG_SOURCE_BRANCH}"

test -z "$(git status --porcelain)"
RELEASE_SHA="$(git rev-parse HEAD)"
REMOTE_RELEASE_SHA="$(git rev-parse "upstream/${TAG_SOURCE_BRANCH}^{commit}")"
test "${RELEASE_SHA}" = "${REMOTE_RELEASE_SHA}"
test "$(just normalize-release-tag "${RELEASE_TAG}")" = "${RELEASE_VERSION}"
CURRENT_VERSION="$(python -c "import tomllib; print(tomllib.load(open('Cargo.toml', 'rb'))['workspace']['package']['version'])")"
test "${CURRENT_VERSION}" = "${RELEASE_BASE_VERSION}"

if git ls-remote --exit-code --tags upstream "refs/tags/${RELEASE_TAG}" >/dev/null; then
  echo "Error: remote tag ${RELEASE_TAG} already exists" >&2
  exit 1
fi

git tag -s -a \
  -m "NVIDIA NeMo Fabric ${RELEASE_VERSION}" \
  "${RELEASE_TAG}" \
  "${RELEASE_SHA}"

git tag -v "${RELEASE_TAG}"
git show "${RELEASE_TAG}"
test "$(git rev-parse "${RELEASE_TAG}^{commit}")" = "${RELEASE_SHA}"

git push upstream "refs/tags/${RELEASE_TAG}"

Stop on any failed check. Do not force-update, replace, or delete an existing local or remote tag.

04 同仓库更多 Skills

leemiracle
leemiracle/work4ai

agentic-ecology-ui

Guidelines and templates for creating a generic web UI to visualize, rank, filter, and annotate vector databases. The UI has a hierarchical structure covering database selection, label selection/definition, ranking/filtering configuration, and row visualization/annotation. Use when building, serving, or adapting an interactive web UI for Hoplite vector databases.

★ 4
leemiracle
leemiracle/work4ai

agentic-ecology-init

Initializes a local uv-managed project directory for agentic ecology workloads. Sets up Python dependencies using reference pyproject.toml and uv.lock, configures workspace rules, and ensures Agentic Ecology skills are discoverable. Use when initializing a new project workspace or bootstrapping a clean environment.

★ 4
leemiracle
leemiracle/work4ai

agentic-ecology-camera-traps

Provides capabilities to run SpeciesNet detector and classifier on camera trap images, extract crop-level feature embeddings, and populate a Hoplite vector database for downstream search and agile modeling. Use when ingesting camera trap images, classifying wildlife photos, or indexing camera trap data.

★ 4
leemiracle
leemiracle/work4ai

agentic-ecology-bioacoustics

Provides bioacoustic analysis capabilities for ecologists and researchers using the perch-hoplite Python package. A typical use case is to use agile modeling to bootstrap the creation and deployment of a bespoke detector for targeted species on an existing collection of passive acoustic monitoring recordings. Use when processing and annotating audio recordings for bioacoustic applications.

★ 4
leemiracle
leemiracle/work4ai

sample-skill

Sample skill used by agent-env integration tests. Exercises SKILL.md parsing plus supporting scripts and references.

★ 4
leemiracle
leemiracle/work4ai

simready-foundation-validate-foundation-change

Use for auditing SimReady requirement, validator, feature, profile, adapter, test, and skill consistency.

★ 4