.agents/skills/update-api-reference/SKILL.md
Regenerate the OpenAPI reference documentation after adding, modifying, or removing API endpoints in sandbox-api. Run this whenever handler signatures, route paths, or swag annotations change.
npx skillsauth add blaxel-ai/sandbox update-api-referenceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The OpenAPI spec is generated from swaggo annotations in the Go handler code. After changing any endpoint, regenerate the docs.
make reference
This single command:
swag init to parse Go annotations → generates sandbox-api/docs/swagger.yaml and docs.gofilesystem.Directory with Directory)swagger2openapifixopenapi.sh for additional patchesThe output file is sandbox-api/docs/openapi.yml.
Annotations are Go comments above handler functions. Example:
// HandleGetFile retrieves a file from the sandbox filesystem.
//
// @Summary Get file or directory
// @Description Returns file content or directory listing
// @Tags filesystem
// @Produce application/octet-stream
// @Param path path string true "File path"
// @Success 200 {string} string "File content"
// @Failure 404 {object} ErrorResponse
// @Router /filesystem/{path} [get]
func (h *FileSystemHandler) HandleGetFile(c *gin.Context) {
Key annotation fields:
@Summary — short description (shown in API reference)@Description — longer explanation@Tags — group endpoints in the UI (filesystem, process, network, codegen)@Param — parameter: name location type required "description"
path, query, body, header@Success / @Failure — response codes with type and description@Router — path and HTTP method [get|post|put|delete]@Accept / @Produce — request/response content types| File | Purpose |
|------|---------|
| sandbox-api/docs/openapi.yml | Final OpenAPI 3.0 spec (commit this) |
| sandbox-api/docs/docs.go | Auto-generated Go embed of the spec |
| sandbox-api/docs/fixopenapi.sh | Post-processing patches |
sandbox-api/src/api/router.gomake referencesandbox-api/docs/openapi.yml to confirm your endpoint appears correctlyopenapi.yml and docs.goOpen the Swagger UI at http://localhost:8080/swagger/index.html while the dev server is running. It reads docs.go which is embedded at build time.
swag: command not found: Run make dependencies first@Router annotation and the function is exported@Descriptionswagger2openapi not found: Run npm install -g swagger2openapi or npx swagger2openapi (the Makefile uses npx)development
Run the sandbox-api integration tests against a live API instance. Use after making changes to sandbox-api to verify all endpoints still work correctly.
development
Run the full end-to-end test suite against a custom sandbox image deployed locally or on Blaxel. Use before merging significant changes to validate the complete sandbox-api binary, not just unit/integration tests.
testing
Deploy a Playwright sandbox (chromium or firefox) on Blaxel and run e2e tests against it. Use to validate that playwright hub images work end-to-end (browser connection, page navigation, DOM interaction) after changes.
development
Start the local sandbox-api development environment with hot-reload. Use when developing or testing changes to the sandbox-api Go code locally.