Verified SOP & TutorialAudited Score 98/100

The Complete Production SOP: How to Deploy and Run Bruno Git-Friendly API Collection Spec in Autonomous AI Agents

Step-by-step SOP to install and run the Bruno Git-Friendly API Collection skill in Codex, Claude Code, and Cursor. Automate version-controlled .bru APIs safely.

Target Runtimes:codexclaude-codecursorwindsurf
5 min read • Updated for 2026

Technical Overview & Architectural Context

Autonomous coding agents like Claude Code, Codex, and Cursor frequently fail when tasked with maintaining API collections. When prompted to generate or update API requests, LLMs default to monolithic Postman JSON v2.1 exports. These bloated files cause severe Git merge conflicts, obscure simple delta changes, leak authentication tokens into version control, and rapidly consume context windows. Furthermore, LLM hallucinations routinely introduce malformed JSON syntax inside nested script blocks. The 'Bruno Git-Friendly API Collection Spec' skill enforces strict procedural boundaries by guiding agents to author declarative, plain-text Bruno (.bru) specifications. By restricting requests to modular folder hierarchies with separated meta, HTTP verb, headers, body, and test blocks, the skill guarantees clean Git diffs, zero token leakage through environment variable abstraction, and deterministic CI/CD test execution via the @usebruno/cli runner.

Prerequisites & Environment Requirements

Codex Desktop, Claude Code CLI, Cursor, or Windsurf installed with agent capabilities enabled
Node.js 20+ installed locally with npm or pnpm in the workspace environment
Git 2.40+ initialized in your target project repository
Bruno CLI globally or locally installed (@usebruno/cli)

Verified Search Intents & Long-Tail Queries Solved

SEO Audit Score: 98/100

This operational tutorial is engineered to provide deterministic solutions for these developer search queries:

#install bruno-git-friendly-api-docs in cursor ide#claude code bruno-git-friendly-api-docs rules#codex desktop bruno-git-friendly-api-docs setup tutorial#how to fix bruno bru cli syntax errors in agent runs#version controlled api collection bruno skill#deterministic documents agent SOP bruno#bruno-git-friendly-api-docs sandbox permissions and security score#bruno-git-friendly-api-docs prompt examples and triggers

Step-by-Step Execution Playbook

1

Local Environment Setup & SKILL.md Mounting

Mount the skill manifest into your agent directory to enable trigger-based discovery.

Autonomous agent frameworks (including Claude Code, Codex, and Cursor project rules) look for skill definitions either in global agent directories (~/.agents/skills) or project-scoped configuration trees (.agents/skills or .cursor/rules). Mounting this skill provides the parser with exact YAML frontmatter triggers and execution bounds, preventing agents from falling back to unstructured curl scripts or bloated JSON schemas.

Terminal Command
mkdir -p .agents/skills/bruno-git-friendly-api-docs && curl -fsSL https://askills.dev/api/skills/bruno-git-friendly-api-docs/raw -o .agents/skills/bruno-git-friendly-api-docs/SKILL.md
.agents/skills/bruno-git-friendly-api-docs/SKILL.md
---
name: "bruno-git-friendly-api-docs"
description: "Manage version-controlled, collaborative API request collections with Bruno Bru files."
metadata:
  author: "UseBruno"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create bruno api collection"
  - "write .bru request file"
  - "run bruno collection cli"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---
Production Pro-Tip

Store the skill in the repository root under .agents/skills/ so all team members and CI-based agents share identical deterministic rules without re-downloading.

Sandbox Gotcha

Ensure that the agent runtime respects fs_write: 'workspace'. Never allow an agent to write .bru files outside the repo tree.

2

Environment Secrets & Bruno Workspace Initialization

Initialize the bruno.json collection root and configure environment secrets isolation.

Bruno collections require a root `bruno.json` descriptor to establish collection identity and environments. Instruct the agent to scaffold this manifest and set up an environments directory. Secrets must be parameterized via process environment lookups or untracked .env files rather than hardcoded in .bru files.

Terminal Command
npx @usebruno/cli --version || npm install -D @usebruno/cli
bruno.json
{
  "version": "1",
  "name": "Service API Collection",
  "type": "collection",
  "ignore": [
    "node_modules",
    ".git"
  ]
}
Production Pro-Tip

Direct the agent to reference {{process.env.API_KEY}} within Bruno environment files rather than embedding raw bearer tokens.

Sandbox Gotcha

Add `environments/*.local.bru` to your project's `.gitignore` to prevent developers or agents from committing real credentials.

3

Intent Matching & Trigger Invocation

Trigger the agent to generate human-readable, declarative .bru files matching your routes.

Invoke the skill using precise trigger phrasing. The agent will read route definitions from your controllers/routers and map them into modular Bruno requests containing meta, HTTP method, headers, and test assertion blocks conforming strictly to the Bru syntax parser.

Terminal Command
claude "create bruno api collection for auth endpoints with login and refresh token flows"
auth/login.bru
meta {
  name: User Login
  type: http
  seq: 1
}

post {
  url: {{baseUrl}}/api/v1/auth/login
  body: json
  auth: none
}

headers {
  Content-Type: application/json
}

body:json {
  {
    "email": "[email protected]",
    "password": "{{userPassword}}"
  }
}

tests {
  test("should return 200 OK and token", function() {
    expect(res.getStatus()).to.equal(200);
    expect(res.getBody().token).to.be.a('string');
  });
}
Production Pro-Tip

Require the agent to assign sequential `seq` values in meta blocks so collection CLI test runs execute in logical dependency order.

Sandbox Gotcha

Ensure the agent does not enclose JSON keys or string payloads in unescaped double quotes inside the body:json block.

4

Verification, Linting & Output Quality Gate

Execute automated self-healing validation using the Bruno CLI in CI or local terminal.

Before accepting agent changes, require the agent to validate the syntax of generated .bru files and run local verification against a mock or live testing server. If syntax errors or schema violations occur, the agent must catch exit codes and self-heal.

Terminal Command
npx @usebruno/cli run auth --env Local
scripts/validate-bru.sh
#!/usr/bin/env bash
set -euo pipefail

echo "Validating Bruno files syntax..."
find . -name "*.bru" -type f -exec grep -q "meta" {} \; || {
  echo "Error: Found invalid .bru file missing meta block"
  exit 1
}
echo "Bruno syntax check passed."
Production Pro-Tip

Use `git diff --stat` during the verification gate to confirm that only modular .bru files were created without unrequested modifications to app code.

Sandbox Gotcha

Running `bru run` in CI without mock or network stubs will fail if net_access is disabled in agent sandbox policies; provide an in-memory test runner if necessary.

Real-World Scenario: Scaffold Git-Controlled Payment Gateway API Collection with Automated Assertions

Tested Trigger Prompt (Feed directly into Codex, Claude, or Cursor):

“create bruno api collection for our new Stripe webhook and checkout session endpoints in ./api-docs/payments. Include input schemas, mock headers, and assertions verifying 201 status and session ID returns.”

Deterministic Agent Verification Pipeline:
Detected skill trigger 'create bruno api collection' and loaded bruno-git-friendly-api-docs SOP rules.
Inspected payment router source code to extract endpoint URLs, schemas, and required auth headers.
Created `bruno.json` descriptor in `./api-docs/payments` and organized endpoints into `create-session.bru` and `webhook-handler.bru`.
Formulated valid `.bru` blocks (meta, post, headers, body:json, tests) using Chai assertions inside the `tests` block.
Executed local CLI dry-run via `npx @usebruno/cli run ./api-docs/payments` to ensure syntax validity before concluding.

Runtime Troubleshooting & Failure Modes

Error: Error: Parsing error on line X: Unexpected token in .bru file (e.g. malformed body:json or unclosed block)

Root Cause: The agent attempted to wrap JSON payloads in additional quotation marks or improperly closed the block delimiter (e.g., missing closing curly brace or syntax misalignment between Bru block headers and body content).

Resolution Command / Fix:
Sed or prompt instruction to repair: Ensure body:json starts immediately on the next line and is valid JSON without backticks:
body:json {
  "key": "value"
}
Error: Error: Cannot find module '@usebruno/cli' or 'bru: command not found'

Root Cause: The agent runtime sandbox does not have the Bruno CLI installed globally, or npx execution is restricted by the sandbox policy.

Resolution Command / Fix:
npm install --save-dev @usebruno/cli && npx @usebruno/cli run ./path-to-collection

Frequently Asked Questions (Bruno Git-Friendly API Collection Spec SOP)

Q:Can I use Bruno Git-Friendly API Collection Spec across Codex, Claude Code, and Cursor simultaneously?

Yes. The skill conforms to the universal SKILL.md specification supported across all modern agent runtimes. Simply place the file in `.agents/skills/` or reference it within `.cursorrules` / CLAUDE.md to share procedural rules across your team's development environments.

Q:How does Bruno Git-Friendly API Collection Spec prevent context window overflow during long agent sessions?

Traditional Postman collections consist of multi-megabyte JSON trees that exhaust LLM token limits and induce hallucination. Bruno splits each endpoint into an isolated, human-readable `.bru` plain-text file. The agent only reads and modifies the single targeted `.bru` file needed for the task, keeping token usage under 500 tokens per operation.

Q:Does this skill require escalated root or container permissions?

No. The skill is audited with a security score of 98/100. It requires only standard workspace filesystem write access (`fs_write: workspace`) to generate text files, while network access and shell execution can remain strictly sandboxed or disabled.

Ready to equip your autonomous agent with Bruno Git-Friendly API Collection Spec?

Copy the complete audited SKILL.md specification or download the 1-click zip bundle directly from our verified registry.

Get 1-Click Install Spec