agentleFS
kmarrrahulkmarrrahul/dataweave-ai-playground/.agents/skills/bruno-collection/SKILL.md

bruno-collection

Skill2 starsChanged 5 months agoMITView on GitHub

Create, update, and manage Bruno API collections — scaffold new collections, add/modify requests, create sub-folders, manage environments, variables, headers, params, body, pre-request scripts, post-response scripts, tests, assertions, authentication, and documentation. Run and validate collections using the Bruno CLI. Use when a user asks to create a Bruno collection, add folders, add requests, modify .bru files, manage Bruno environments, run API tests, or work with the Bruno CLI.

  • Reads credentials
  • Installs packages
  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 0 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create and manage Bruno API collections.

    line 10
  2. Very specific:

    Create root folder + environments/ subfolder

    line 99
  3. Very specific:

    Create bruno.json with collection name

    line 100
  4. Very specific:

    Create at least one environment file (e.g., environments/Local.bru)

    line 102
  5. Very specific:

    Create directory + folder.bru with meta { name: ...

    line 105
  6. Very specific:

    Create .bru file: meta → method block → body → scripts/tests (as needed).

    line 108
  7. Very specific:

    Create .bru file in environments/:

    line 111
  8. Very specific:

    Use {{variables}} — never hardcode URLs/tokens

    line 240
  9. Very specific:

    Use vars:secret for sensitive values.

    line 242
  10. Very specific:

    Add docs {} block to complex requests

    line 245
  11. Very specific:

    Always create at least one environment file (Local.bru)

    line 246
  12. Very specific:

    Use seq in meta blocks to control execution order

    line 247
  13. Very specific:

    After creating/modifying a collection, validate with bru run to catch syntax errors

    line 248

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bruno Collection Manager

Purpose

Create and manage Bruno API collections. Collections are plain folders on disk — every request is a .bru text file, Git-friendly with no proprietary format.


Collection Structure

my-collection/
├── bruno.json              # {"version":"1","name":"...","type":"collection"}
├── collection.bru          # Collection-level auth/headers/scripts (optional)
├── environments/
│   ├── Local.bru           # vars { baseUrl: http://localhost:3000 }
│   ├── Dev.bru
│   └── Prod.bru
├── folder-a/
│   ├── folder.bru          # Folder metadata + inherited auth
│   └── Get Resource.bru
└── folder-b/
    └── sub-folder/
        ├── folder.bru
        └── Create Item.bru

Core Files

bruno.json — {"version":"1","name":"My API","type":"collection","ignore":["node_modules",".git"]}

collection.bru — Shared auth/headers/scripts inherited by all requests:

headers {
  Content-Type: application/json
}

auth {
  mode: bearer
}

auth:bearer {
  token: {{authToken}}
}

folder.bru — Folder metadata + inherited settings:

meta {
  name: Folder Name
}

auth {
  mode: inherit
}

Minimal Request File

meta {
  name: Get Users
  type: http
  seq: 1
}

get {
  url: {{baseUrl}}/api/users
  body: none
  auth: inherit
}

References (read ONLY what the task requires)

NeedReference File
HTTP methods, body types, auth modes, headers, params, settingsreferences/request-format.md
Auth modes (bearer, basic, apikey, OAuth2, collection/folder level)references/authentication.md
Pre/post scripts, script objects, external npm libraries, request chainingreferences/scripting.md
Variables, environments, secrets, dynamic varsreferences/variables-and-environments.md
Assertions, JavaScript tests, Chai expectreferences/tests-and-assertions.md
Bruno CLI: run, validate, CI/CD, output formats, flagsreferences/bruno-cli.md

Operations

Create Collection

  1. Create root folder + environments/ subfolder
  2. Create bruno.json with collection name
  3. Optionally create collection.bru for shared auth/headers
  4. Create at least one environment file (e.g., environments/Local.bru)

Add Sub-Folder

Create directory + folder.bru with meta { name: ... } and auth { mode: inherit }.

Add Request

Create .bru file: meta → method block → body → scripts/tests (as needed).

Add Environment

Create .bru file in environments/:

vars {
  baseUrl: http://localhost:3000
  apiVersion: v1
}

vars:secret [
  token,
  apiKey
]

Naming Conventions

  • Files: Get All Users.bru, Create Order.bru, Produce Event - ID-123.bru
  • seq in meta for ordering (1-based)
  • ~ prefix to disable params/headers without deleting

Validate & Run (Bruno CLI)

Prerequisite: Install the Bruno CLI: npm install -g @usebruno/cli Critical: All bru run commands must be executed from the collection root (the folder containing bruno.json).

Run a Single Request

cd /path/to/my-collection
bru run 'SubFolder/Request Name.bru' --env-file environments/Local.bru

Run a Folder

bru run SubFolder --env-file environments/Local.bru

Run Entire Collection

bru run --env-file environments/Local.bru

Validate Collection

Running any bru run command validates the entire collection first. If any .bru file has syntax errors, the CLI reports them and fails before executing. This is the recommended way to check for .bru format errors:

bru run 'any-request.bru' --env-file environments/Local.bru

Override Variables at Runtime

bru run --env-file environments/Local.bru --env-var "baseUrl=http://localhost:8080"

CI/CD Output

bru run --env-file environments/CI.bru --format junit --output results.xml --bail

For full CLI reference (flags, output formats, CI/CD examples), read references/bruno-cli.md.


Quick Recipes (no reference needed)

Pre-Request Script — Generate Dynamic Value

script:pre-request {
  const timestamp = new Date().toISOString();
  bru.setVar("requestTimestamp", timestamp);
  req.setHeader("X-Request-ID", "req-" + Date.now());
}

Post-Response Script — Store Token for Chaining

script:post-response {
  if (res.status === 200) {
    bru.setVar("authToken", res.body.access_token);
    bru.setVar("userId", res.body.user.id);
  }
}

Assertions (Declarative)

assert {
  res.status: eq 200
  res.body.success: eq true
  res.body.data.length: gt 0
  res.responseTime: lt 2000
}

JavaScript Tests

tests {
  test("status is 200", function() {
    expect(res.status).to.equal(200);
  });

  test("response has data", function() {
    expect(res.body).to.have.property('data');
    expect(res.body.data).to.be.an('array');
  });
}

Authentication Inheritance

Set auth once in collection.bru, then all requests with auth: inherit use it:

# In collection.bru:
auth {
  mode: bearer
}
auth:bearer {
  token: {{authToken}}
}

# In any request .bru file:
get {
  url: {{baseUrl}}/api/resource
  body: none
  auth: inherit
}

Best Practices

  • Use {{variables}} — never hardcode URLs/tokens
  • Inherit auth from collection/folder level to avoid repetition
  • Use vars:secret for sensitive values; {{process.env.NAME}} for system env
  • ~ prefix to disable (not delete) params/headers
  • Git-friendly filenames (hyphens and spaces only)
  • Add docs {} block to complex requests
  • Always create at least one environment file (Local.bru)
  • Use seq in meta blocks to control execution order
  • After creating/modifying a collection, validate with bru run to catch syntax errors

External Reference

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.