Setting Up an Agent Skill
Overview
A coding agent can manage AI Workbench projects through the CLI binary.
The agent calls ~/.nvwb/bin/nvwb-cli with -c, -p, and -o json the same way a script does.
See Using the CLI Binary for Scripts and Agents for the calling convention, JSON response shapes, and state machine.
The agent needs a skill definition that encodes what it should know about the CLI.
A skill is a structured prompt or tool definition that tells the agent how to call the binary, what flags to pass, and how to interpret responses.
The skill replaces documentation the agent would otherwise have to discover on its own.
The agent should run inside a sandbox.
AI Workbench provides sandboxing for agents that run inside a project container. See Sandboxing Agents with AI Workbench for how to configure the sandbox and what it restricts.
Key Concepts
Skill definition
A file or prompt that gives the agent the calling convention, flag rules, JSON shapes, and state machine in a format it can act on directly.
State-aware execution
The agent must check project state before issuing commands that have preconditions.
For example, start fails if the project has not been built, and environment variable
changes fail if the container is running.
Build assistant
AI Workbench includes a build assistant that can analyze and fix failed container builds.
An agent can start, stop, and check the status of the build assistant through
nvwb internal build-assistant commands.
See Build Assistant for the full command set.
What the Skill Should Include
The binary path and calling convention.
The agent needs to know it calls ~/.nvwb/bin/nvwb-cli, not the nvwb wrapper.
It also needs to know which flags each command requires.
Commands that operate on a project need -c and -p.
Commands that operate on a location need -c only.
Commands that operate on AI Workbench itself need neither.
The JSON response shapes.
The agent needs to know the four response shapes (list, status, create/clone, error) so it can parse output and detect failures.
The state machine and preconditions.
The agent needs to check status before running commands like build, start, or
create environment-variable, and understand which states allow which operations.
The project path rule.
The agent should always use the absolute project path with -p, not the registered project name.
The name comes from spec.yaml and may not match the directory name.
Example: End-to-End Agent Workflow
This example shows the sequence an agent follows to clone, build, configure, and start a project.
After each step, the agent should check for errors.
Every error returns {"error": "...", "detail": "..."}.
The agent can parse this shape consistently across all commands.
Example: Using the Build Assistant
If a build fails, the agent can use the build assistant to diagnose and fix the issue.
Related Topics
- Using the CLI Binary for Scripts and Agents - Calling convention, JSON shapes, state machine, and patterns
- AI Workbench Command Line Interface (CLI) Reference - CLI command reference
- Build Assistant - Build assistant commands
- Sandboxing Agents with AI Workbench - Sandboxing for coding agents
- Interactive CLI Use - Interactive CLI use