npx skills add ...
npx skills add nvidia/skills --skill hsb-app
Discover and run Holoscan Sensor Bridge example applications on a connected devkit. Filters available apps by the user's platform, HSB software version, board type, and sensors. Supports timed execution, failure analysis, code-edit suggestions, and iterative re-runs.
npx skills add nvidia/skills --skill hsb-app
Use this skill when the user wants to discover, select, and run Holoscan Sensor Bridge example applications on a devkit with a connected HSB board.
This skill assumes the devkit is already set up (SSH, demo container built, host configured, board connected). If setup is not complete, instruct the user to run /hsb-setup first.
This workflow runs applications inside the demo container. Only run it when the user explicitly invokes it.
Gate 1 — Read environment variables. Before doing anything else, check these variables and print their resolved values to the user:
SSH_TARGET and REMOTE_ROOT are required. Stop and ask the user for them if either is missing.
Gate 2 — Present the phase plan and get confirmation. Before taking any action:
If the user's request already includes platform, board type, and sensors, also state upfront:
examples/ and filter apps by the user's sensor type and platform--headless automatically — only if the user explicitly requests itdocker run, using python3 for Python-based examplesShow the phase plan:
Then ask explicitly: Shall I proceed with Phase 0? [Y/n] — do not start Phase 0 until the user confirms.
Gate 3 — Fast path check. After the user confirms in Gate 2, run this check before executing any Phase 0 commands:
If the output contains _SESSION_VERIFIED=true, skip Phase 0 and Phase 1 setup discovery — go directly to app selection and inform the user.
examples/ directory to build a list of applications compatible with the user's setup. Present the list and let the user choose an app to run.Reuse the same environment variables from the hsb-setup and hsb-flash skills:
SSH_TARGET for the remote login target (e.g. nvidia@agx-thor-host)REMOTE_ROOT for the remote working directoryREMOTE_SUDO for privileged commandsREMOTE_SSH_OPTS for additional SSH optionsHSB_PLATFORM as an optional platform hintIf these are set, notify the user of these settings and use them without re-asking.
Before Phase 0, print the resolved remote execution settings.
When no valid session state exists, show the full phase plan:
Then execute one phase at a time.
When the session state file (/tmp/.claude_hsb_app_session/state.sh) exists and contains _SESSION_VERIFIED=true, the skill skips Phase 0 and Phase 1 setup discovery because connectivity and hardware were already verified. Instead, inform the user and jump directly to app selection:
Then execute:
Phase 0 must be re-run (ignoring the fast path) when:
No such device errors), clear _SESSION_VERIFIED from the session state and re-run Phase 0 before retrying./hsb-app --full, run Phase 0 from scratch.See ## Phase gate below for the full confirmation protocol.
If something fails, do not just dump raw logs. Summarize:
See references/phase-details.md for full step-by-step phase instructions.
Use the same persistent SSH session model as hsb-setup and hsb-flash. Each phase runs as a single SSH heredoc block:
Replace __REMOTE_ROOT__ with the literal value of $REMOTE_ROOT when composing the heredoc.
Application commands run inside the demo container. Use the detached pattern with a named container.
For apps with --timeout, use the watchdog pattern. For indefinite-run apps, stream logs and wait for the user to request a stop.
After every app run, stop and remove the container. See references/phase-details.md for the cleanup pattern.
After Phase 3 (or on any failure that stops the workflow):
After completing each phase (Phases 0–2), always prompt the user for confirmation before starting the next phase.
Exception: When --y (auto-approve mode) is active, phase gates are skipped. See "Auto-approve mode (--y)" section.
All prompts in this skill require explicit typed responses. Never treat a blank or Enter-only input as a selection — re-prompt the user instead.
--help)If $ARGUMENTS contains --help or -h, print the following and stop:
/hsb-app/hsb-app --verbose/hsb-app --timeout 60/hsb-app --timeout 30 --verbose/hsb-app --y/hsb-app --y --timeout 120/hsb-app --full/hsb-app --full --verbose/hsb-app --help--verbose)The skill supports a --verbose flag:
Check whether $ARGUMENTS (the text after the slash command) contains any of: --help / -h, --verbose, --y, --timeout N, or --full (case-insensitive). Strip all flags (and their values) from arguments before further parsing.
When --full is present, ignore any cached session state and run Phase 0 from scratch.
--verbose)--y)The skill supports a --y flag that skips all phase gates and runs the entire workflow from start to finish without waiting for user confirmation between phases. This is not recommended for normal use.
When --y is detected, display a warning and ask the user to confirm:
--y is active--timeout was specified on the command line (to avoid indefinite hangs).hsb-app-log-YYYY-MM-DD-HHMMSS.md in $REMOTE_ROOT/ or current directory.--y --verbose: Auto-approve with full raw output.--y --timeout N: Auto-approve with a fixed app runtime.--y alone: Auto-approve with concise output and no timeout (app runs for a default 30 seconds in auto-approve mode to avoid indefinite hangs).--timeout)The skill supports a --timeout N flag where N is the number of seconds to run the application.
Match --timeout followed by a whitespace-separated integer in $ARGUMENTS. Example: --timeout 60.
docker stop. The output collected during that window is shown to the user.ssh -o BatchMode=yes $REMOTE_SSH_OPTS $SSH_TARGET \
"grep _SESSION_VERIFIED /tmp/.claude_hsb_app_session/state.sh 2>/dev/null || echo 'no session'"Session already verified — skipping connectivity checks.
SSH target: $SSH_TARGET
Board: HSB Lattice | FPGA: XXXX
Platform: AGX Thor | HSB version: X.X.X
Sensors: Dual IMX274
Proceeding directly to application selection.ssh -o BatchMode=yes $REMOTE_SSH_OPTS $SSH_TARGET bash -s <<'REMOTE'
set -e
# restore state from previous phase
source /tmp/.claude_hsb_app_session/state.sh 2>/dev/null || true
cd "${_CLAUDE_CWD:-__REMOTE_ROOT__}"
# phase commands
echo "=== Phase N: description ==="
command1
command2
# save state for next phase (preserves _SESSION_VERIFIED if already set)
_PREV_VERIFIED="${_SESSION_VERIFIED:-}"
mkdir -p /tmp/.claude_hsb_app_session
{
echo "export _CLAUDE_CWD=\"$(pwd)\""
echo "export PATH=\"$PATH\""
echo "export REPO_DIR=\"$REPO_DIR\""
echo "export VERSION=\"$VERSION\""
echo "export HSB_PLATFORM=\"$HSB_PLATFORM\""
echo "export BOARD_TYPE=\"$BOARD_TYPE\""
echo "export SENSORS=\"$SENSORS\""
echo "export FPGA_VERSION=\"$FPGA_VERSION\""
echo "export SELECTED_APP=\"$SELECTED_APP\""
echo "export APP_OPTIONS=\"$APP_OPTIONS\""
echo "export APP_TIMEOUT=\"$APP_TIMEOUT\""
[ "$_PREV_VERIFIED" = "true" ] && echo "export _SESSION_VERIFIED=true"
} > /tmp/.claude_hsb_app_session/state.sh
REMOTEdocker ps --filter "name=hsb_app_" --format '{{.Names}}' | xargs -r docker stop -t 2 2>/dev/null || true
ssh -o BatchMode=yes $REMOTE_SSH_OPTS $SSH_TARGET "rm -rf /tmp/.claude_hsb_app_session"Proceed to Phase <N+1> (<phase description>)? [Y/n]