agent-fresh-operate
Operates the lifecycle of agent VMs, including setup, destruction, and verification.
Install
mkdir -p .claude/skills/agent-fresh-operate && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17057" && unzip -o skill.zip -d .claude/skills/agent-fresh-operate && rm skill.zipInstalls to .claude/skills/agent-fresh-operate
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when deploying, tearing down, or reproducing a fresh NPA agent VM from scratch — npa-driven destroy/fresh-setup, profile selection, tiered verify gates, and teardown failure recovery.Key capabilities
- →Deploy a fresh NPA agent VM
- →Teardown existing agent infrastructure
- →Reproduce agent environments from scratch
- →Verify `/api/models` and `/api/chat` after deployment
- →Debug destroy/fresh-setup failures
- →Run smoke, grounded, and live verification gates
How it works
This skill manages the lifecycle of NPA agent VMs by providing commands for fresh setup, teardown, and verification loops. It uses `npa` commands and scripts to deploy, bootstrap, and test agent functionality on a development machine.
Inputs & outputs
When to use agent-fresh-operate
- →Deploy a fresh agent VM
- →Destroy agent infrastructure
- →Reproduce agent environment
- →Verify deployment health
About this skill
Agent Fresh Operate
When To Use
Use this skill to operate a clean agent VM lifecycle on the operator/dev VM:
- First-time
fresh-setupon a project alias - Teardown → redeploy loops (“reproduce from scratch”)
- Validate
/api/modelsand/api/chatafter deploy - Debug destroy/fresh-setup failures (IAM, orphan VMs, ingress rules)
For chat UX, API shapes, and Rerun iframe behavior, use npa-agent. For
npa configure / object-storage provisioning, use nebius-infra.
Entry Points
npa/.venv/bin/npa agent fresh-setup— initialize project env + deploy + bootstrapnpa/.venv/bin/npa agent destroy— npa-driven teardown (ingress cleanup, TF destroy, orphan VM delete)- If the project stanza is already gone, resume only from the opaque receipt ID
printed before removal (
agent destroy --receipt <id> --name <name> --yes) or from exact--project-id/--instance-idprovider identity. Conflicting receipt, operation-journal, record, or exact identities stop before deletion; NPA never performs a display-name/prefix VM sweep. npa/scripts/agent_fresh_setup_loop.sh— destroy → fresh-setup → smoke chat (loop until success)- Exact-name retries after client transport loss adopt a healthy exact VM or
resume its first incomplete phase. Do not use
--replacesolely because the final Terraform/SSH response was lost; mismatched or unavailable evidence is indeterminate and resumable. npa/scripts/agent_mature_verify_loop.sh— bootstrap-first mature loop (existing agents; not fresh deploy)
All npa agent … and nebius commands run on the operator/dev VM with
~/.npa/config.yaml and ~/.npa/credentials.yaml. Cloud agents sync the
target branch to the dev VM before live tests.
Procedure
-
Preconditions (dev VM).
cd ~/nebius-physical-ai git checkout <branch> && npa/.venv/bin/pip install -e npa -q nebius profile activate "${NPA_NEBIUS_PROFILE:-npa-mk8s}" export NPA_NEBIUS_PROFILE="${NPA_NEBIUS_PROFILE:-npa-mk8s}" export NPA_SSH_KEY="${NPA_SSH_KEY:-$HOME/.ssh/id_ed25519}"NPA_SSH_KEYis the SSH private-key path used after provisioning. It is not cloud-init key content and must never be passed as--ssh-public-key-path. That option defaults to the matching~/.ssh/id_ed25519.puband accepts exactly one OpenSSH public-key record. For a non-default private key, pass its existing matching.pubfile. If it is absent, derive only the public record withssh-keygen -y -f "$NPA_SSH_KEY"into an owner-controlled.pubfile, verify the two fingerprints match, and pass that.pubpath; never log either key's contents. -
Teardown (npa-driven — no manual
nebius vpcedits).npa/.venv/bin/npa agent destroy --project <alias> --name agent -
Fresh deploy.
npa/.venv/bin/npa agent fresh-setup \ --project <alias> --name agent \ --project-id <project-id> \ --tenant-id <tenant-id> \ --region us-central1Expect compute PermissionDenied with VM SA attachment on some cross-project profiles; npa retries apply without attached
service_account_idand now emits a loud WARNING when it does — a VM without an attached SA cannot self-mint IAM tokens and needs an alternative token source (grant the deploying identitycompute.admin/equivalent, or inject a token on the VM).Agent VM IAM auth = attached service account (not a copied operator token). The VM authenticates to Nebius IAM using its attached
npa-agentservice account:get_iam_token()self-mints fresh tokens from the metadata/token-file sources the SA populates. npa no longer copies the operator's short-lived IAM token onto the VM (noNEBIUS_IAM_TOKEN/TF_VAR_iam_tokenin/opt/npa-agent/nebius.env, no/root/.npa/nebius-token, noagent-bootstrapprofile) — that token went stale and forced re-bootstrap. S3 access keys and the service API keys (Token Factory / HF / NGC) are still staged: object storage is HMAC-based and cannot use an IAM bearer token, and the product keys are independent of the SA. They are staged only after VM creation through the verified SSH channel; they never enter Terraform/cloud-init/user-data. On-VM Terraform (npa cluster …) mints a fresh token at run time vianebius iam get-access-token. -
Smoke gate (default “done” for fresh deploy).
source ~/.npa/agents/<alias>/agent/auth.env BASE="$(npa/.venv/bin/npa agent status --project <alias> --name agent --json \ | npa/.venv/bin/python -c 'import json,sys; print(json.load(sys.stdin).get("public_url","").rstrip("/"))')" curl -sk -u "${AGENT_USER}:${AGENT_PASSWORD}" "${BASE}/api/models" curl -sk -u "${AGENT_USER}:${AGENT_PASSWORD}" -H 'Content-Type: application/json' \ -d '{"messages":[{"role":"user","content":"Say hello in one short sentence."}]}' \ "${BASE}/api/chat" -
Optional full gates.
- Grounded chat: ask “what is the current sim2real status” →
"grounded": true - Live regression:
NPA_AGENT_CHAT_LIVE=1 npa/.venv/bin/npa agent verify-live --project <alias> --name agent - Mature loop:
bash npa/scripts/agent_mature_verify_loop.sh(bootstrap-first)
- Grounded chat: ask “what is the current sim2real status” →
-
One-command loop.
export NPA_AGENT_PROJECT=<alias> NPA_AGENT_NAME=agent export NPA_AGENT_PROJECT_ID=<project-id> NPA_AGENT_TENANT_ID=<tenant-id> export NPA_AGENT_REGION=us-central1 NPA_NEBIUS_PROFILE=npa-mk8s bash npa/scripts/agent_fresh_setup_loop.sh
Verify Tiers
| Tier | Checks | Use when |
|---|---|---|
| Smoke | status --json, /api/models, hello /api/chat | Fresh deploy validated |
| Grounded | sim2real status chat → grounded: true | Chat router wired |
| Live | verify-live | Pre-merge regression |
| Mature | agent_mature_verify_loop.sh + Franka | Chat/router code changes |
Do not block a smoke deploy on verify-live UI wiring markers alone.
Gotchas
- Profile vs project. Cross-project deploy needs a profile with compute IAM on
the target project (commonly
npa-mk8s).cursor-samay lack VPC/compute on foreign projects. Never usetlein scripts (interactive auth hang). - Compute PermissionDenied + SA. First TF apply may fail attaching
npa-agentSA to the VM; npa retries without SA attachment. Bare compute denial → stop and report IAM gap to operator. - Destroy: disk/SG in use. Orphan cloud VM may exist outside TF state after a
failed apply/rollback.
npa agent destroydeletes matching instances by name before TF destroy; retry destroy if preconditions fail once. - CPU destroy output. Canonical Terraform outputs are
platform/presetpluscpu_platform/cpu_preset. Deprecatedgpu_platform/gpu_presetremain GPU-only machine compatibility fields (null for CPU agents) and are suppressed from human destroy progress, socpu-d3is never presented as a GPU fact. fresh-setup --replace. Destroy must run before updating project env (otherwise TF backend keys drift mid-destroy).- 502 / SyntaxError on chat. Re-bootstrap; check embedded
\nescaping in bootstrapbackend.pytemplate. - Ingress rules and default SGs. Stale
allow-npa-*rules can block a non-default security-group delete, so destroy removes NPA-managed ingress first. Nebius default security groups cannot be deleted directly; if the provider surfaces that specific refusal, destroy deletes the parent only when this agent's Terraform state proves the whole network is NPA-owned. A reused/shared/unproven network is preserved with an ownership explanation. - Cloud agent → dev VM. Sync branch (
git pullor tar/scp), confirmnpa agent --helplistsfresh-setup, then run live loop on dev VM.
Symptom → Action
| Symptom | Action |
|---|---|
PermissionDenied: service compute then success after retry message | Expected SA-attachment retry; no action |
PermissionDenied: service compute on retry without SA | Operator IAM on target project |
Agent config not found after destroy | Run fresh-setup |
Destroy fails, instance name agent-<alias>-agent still listed | Re-run npa agent destroy (orphan cleanup) |
| Chat 502, health false | npa agent bootstrap --project <alias> --name agent |
verify-live UI version mismatch but chat OK | Smoke tier passed; fix UI marker separately |
Verify (repo)
npa/.venv/bin/python -m pytest npa/tests/guardrails/test_skills_index.py -q
bash -n npa/scripts/agent_fresh_setup_loop.sh
# Smoke-only against an existing agent (no destroy/deploy):
NPA_FRESH_SETUP_SKIP_DESTROY=1 NPA_FRESH_SETUP_SKIP_DEPLOY=1 \
NPA_AGENT_PROJECT=<alias> bash npa/scripts/agent_fresh_setup_loop.sh
When not to use it
- →For chat UX, API shapes, and Rerun iframe behavior
- →For `npa configure` / object-storage provisioning
Prerequisites
Limitations
- →Cross-project deploy may require specific IAM permissions.
- →Destroy operations might encounter 'disk/SG in use' if orphan VMs exist.
- →The skill does not cover `npa configure` or object-storage provisioning.
How it compares
This workflow offers a complete, automated lifecycle management for NPA agent VMs, including specific verification tiers and failure recovery mechanisms, providing a more reliable and reproducible environment setup than manual VM provisioning
Compared to similar skills
agent-fresh-operate side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| agent-fresh-operate (this skill) | 0 | 1mo | Caution | Advanced |
| azure-role-selector | 0 | 6mo | No flags | Intermediate |
| setup-role-ops | 0 | 5mo | No flags | Intermediate |
| ops | 0 | 1mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
azure-role-selector
Tyler-R-Kendrick
|
setup-role-ops
tachiiri-org
Reconcile an ops repository to the expected shared-guidance baseline.
ops
denniszielke
>
env-stabilize
FlexNetOS
How to keep the environment reproducible and drift-free — the detect/drift, doctor-diagnostic, and content-hashed lock discipline envctl uses, plus how the built-in agent-env engine (envctl agent) provisions and locks the agent config. Use when checking environment health, diagnosing drift, regenera
cloudflare-manager
qdhenry
Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing worker containers, configuring KV/R2 storage, or setting up DNS/routing. Requires CLOUDFLARE_API_KEY in .env and Bun runtime with dependencies installed.
storage-networking
pluginagentmarketplace
Master Kubernetes storage management and networking architecture. Learn persistent storage, network policies, service discovery, and ingress routing.