Agent Skillsnubjs/nub › windows-vm-test

windows-vm-test

GitHub

在本地Windows 11 ARM64 QEMU VM中运行Nub测试和调试探针。通过SSH连接,支持原生ARM64及x64模拟环境下的交互式检查,需确保磁盘、密钥及QEMU工具就绪。

.agents/skills/windows-vm-test/SKILL.md nubjs/nub

Trigger Scenarios

需要在本地Windows 11 ARM64 QEMU虚拟机中执行Nub测试或调试 进行win32-arm64原生或win32-x64模拟环境的验证

Install

npx skills add nubjs/nub --skill windows-vm-test -g -y
More Options

Non-standard path

npx skills add https://github.com/nubjs/nub/tree/main/.agents/skills/windows-vm-test -g -y

Use without installing

npx skills use nubjs/nub@windows-vm-test

指定 Agent (Claude Code)

npx skills add nubjs/nub --skill windows-vm-test -a claude-code -g -y

安装 repo 全部 skill

npx skills add nubjs/nub --all -g -y

预览 repo 内 skill

npx skills add nubjs/nub --list

SKILL.md

Frontmatter
{
    "name": "windows-vm-test",
    "metadata": {
        "internal": true
    },
    "description": "Run ad-hoc Nub tests and debugging probes in the maintainer's existing local Windows 11 ARM64 QEMU\/HVF VM when its external disk and runbook are present. Use for interactive win32-arm64 or Windows-on-ARM x64-emulation checks; use ci-adhoc-test for true x64-native behavior or when the local VM is unavailable."
}

Windows VM testing

Operate the existing VM; do not provision one. The known-good guest was Windows 11 ARM64 under QEMU/HVF at /Volumes/Plex/nub-winvm, with host port 2222 forwarded to guest SSH. The VM tests win32-arm64 natively and win32-x64 under emulation. True win32-x64-native behavior requires windows-latest through ci-adhoc-test.

Fail-closed preflight

Run read-only checks first:

VM_ROOT=/Volumes/Plex/nub-winvm
test -d "$VM_ROOT" || {
  echo 'Windows VM disk unavailable; use ci-adhoc-test or restore the external volume.' >&2
  exit 1
}
test -r "$HOME/.ssh/nub-winvm" || {
  echo 'Windows VM SSH key unavailable.' >&2
  exit 1
}
command -v qemu-system-aarch64 qemu-img >/dev/null || {
  echo 'QEMU tooling unavailable.' >&2
  exit 1
}
find "$VM_ROOT" -maxdepth 1 -type f -print
pgrep -alf 'qemu-system-aarch64|install-loop|win11' || true
lsof -nP -iTCP:2222 -sTCP:LISTEN || true

Stop if the disk, its runbook, or its own lifecycle helpers are absent. Do not mount a missing volume, reconstruct QEMU arguments, create a disk, or reprovision Windows as part of this skill.

VM lifecycle

Read the restored runbook and invoke its exact start, stop, and snapshot commands. Before launch, prove that no other QEMU process owns win11.qcow2. Never run competing QEMU or installer loops against one disk.

The historical clean-snapshot command is evidence, not a default action:

cd /Volumes/Plex/nub-winvm
qemu-img snapshot -c clean win11.qcow2

Create or apply a snapshot only while the VM state matches the restored runbook. Never guess a snapshot-restore sequence.

SSH readiness

Gate readiness on a guest command, not an open forwarded port:

SSH_OPTS=(
  -i "$HOME/.ssh/nub-winvm"
  -p 2222
  -o StrictHostKeyChecking=no
  -o UserKnownHostsFile=/dev/null
)
SCP_OPTS=(
  -i "$HOME/.ssh/nub-winvm"
  -P 2222
  -o StrictHostKeyChecking=no
  -o UserKnownHostsFile=/dev/null
)

ssh "${SSH_OPTS[@]}" nub@localhost \
  'powershell -NoProfile -Command "$PSVersionTable.OS; $env:PROCESSOR_ARCHITECTURE"'

Record the reported OS and architecture with every result.

Transfer and run a probe

Copy only the binary, script, and fixtures the probe needs into the remote user's home:

NUB_EXE=/absolute/path/to/nub.exe
test -f "$NUB_EXE"
file "$NUB_EXE"
shasum -a 256 "$NUB_EXE"

scp "${SCP_OPTS[@]}" "$NUB_EXE" nub@localhost:nub.exe
scp "${SCP_OPTS[@]}" ./probe.ps1 nub@localhost:probe.ps1
ssh "${SSH_OPTS[@]}" nub@localhost \
  'powershell -NoProfile -ExecutionPolicy Bypass -File "$HOME\probe.ps1"'

For a Rust failure, preserve the exit code while capturing a backtrace and log:

$ErrorActionPreference = 'Stop'
$env:RUST_BACKTRACE = 'full'
$env:RUST_LOG = 'debug'

& "$HOME\nub.exe" <args> *>&1 | Tee-Object "$HOME\nub-probe.log"
$code = $LASTEXITCODE
Write-Host "EXIT_CODE=$code"
exit $code

Use Get-Command nub -All, where.exe nub, Get-Item, and Get-Acl for resolution or filesystem diagnostics. Kill only processes created by the probe.

Run the Windows survey

After the runbook's clean-snapshot restore, copy and run tests/windows/papercut-survey.ps1:

& "$HOME\papercut-survey.ps1" `
  -NubBin "$HOME\nub.exe" `
  -WorkDir "$HOME\nub-papercut" `
  -OutputJson "$HOME\nub-papercut\results.json"
exit $LASTEXITCODE

Retrieve nub-papercut/results.json and any focused log before stopping or reverting the guest.

Evidence and CI boundary

Record the host commit, guest build/architecture, binary architecture, exact PowerShell invocation, exit status, stdout/stderr, and retrieved artifacts. The local ARM VM does not prove x64-native behavior and is not a clean hosted runner. Invoke ci-adhoc-test for a fresh Windows environment, x64-native behavior, unavailable local storage, or release-platform evidence.

Version History

  • 4fd083f Current 2026-07-19 12:02

Same Skill Collection

.agents/skills/linux-vm-test/SKILL.md
.claude/skills/audit-thread/SKILL.md
.claude/skills/download-stats/SKILL.md
.claude/skills/git-archaeology/SKILL.md
.claude/skills/md-toc/SKILL.md
.claude/skills/plan-thread/SKILL.md
.claude/skills/pm-perf-tracing/SKILL.md
.claude/skills/todo/SKILL.md
skills/nub/SKILL.md
.agents/skills/agent-browser/SKILL.md
.claude/skills/ad-hoc-test/SKILL.md
.claude/skills/address-issue/SKILL.md
.claude/skills/aube-sync/SKILL.md
.claude/skills/ci-adhoc-test/SKILL.md
.claude/skills/ci-watch/SKILL.md
.claude/skills/dev-loop/SKILL.md
.claude/skills/impact-analysis/SKILL.md
.claude/skills/implementation-thread/SKILL.md
.claude/skills/prose-writing/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/rust-build/SKILL.md
.claude/skills/visual-review/SKILL.md
.claude/skills/worktree/SKILL.md

Metadata

Files
0
Version
4fd083f
Hash
2fbc063b
Indexed
2026-07-19 12:02

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-21 21:36
浙ICP备14020137号-1 $お客様$