Skip to content

generate-bruno-files

Point this skill at a source file, and it produces Bruno .bru request files for every HTTP call it finds — properly named, sequenced, with shared variables pulled up into the collection.

Install with your preferred package manager.

Terminal window
gh skill install oharu121/skills generate-bruno-files

Any project that uses Bruno as its API client accumulates a .bruno/ directory of request files. Bootstrapping those files by hand is tedious: you copy the URL from source, reformat headers, name the file something sensible, pick a sequence number, and repeat for every endpoint. This skill reads the source file for you.

It extracts method, URL, headers, query params, and request body from your code. For each unique endpoint it writes a .bru file with a kebab-case name based on the action (list-users.bru, not get-api-v1-users.bru), picks the next sequence number, and uses {{variable}} placeholders for any secrets, tokens, or dynamic IDs rather than hardcoding them.

When a request needs a new variable that’s not already in .bruno/collection.example.bru, the skill proposes it and reminds you to fill the value locally in collection.bru (gitignored).

  • You just added an API client to a project and want Bruno files to test it without handwriting each one
  • You’re onboarding a teammate and want a ready-made .bruno/ collection they can open and hit “Send”
  • You refactored a client module and want Bruno files to stay in sync with the new endpoints
  1. Identify API calls. The skill reads the source file you specify, extracting method, URL, headers, query params, and request body for each HTTP request.

  2. Check for duplicates. Existing .bru files in .bruno/ are listed first. Endpoints already covered are skipped; you’re told which.

  3. Review variables. The skill reads .bruno/collection.example.bru to see which variables are already defined, and notes any new ones needed.

  4. Create .bru files. Each unique endpoint becomes a kebab-case-named file (verb-resource.bru) with meta, HTTP verb block, optional auth:bearer, headers, and body:json — following Bruno’s file format conventions.

  5. Update collection variables. New variables are added to collection.example.bru with empty values. You’re reminded to fill them locally in collection.bru.

  6. Summary. A table of created files with method, endpoint, and source location.

Your codebase has an API client at src/api/orders.ts:

/generate-bruno-files src/api/orders.ts

The skill produces:

FileMethodEndpointSource
list-orders.bruGET/api/v1/ordersorders.ts:12
get-order.bruGET/api/v1/orders/{{order_id}}orders.ts:24
create-order.bruPOST/api/v1/ordersorders.ts:36

Plus a note: “Added order_id to collection.example.bru. Fill the value in your local collection.bru.”

  • Names — kebab-case action-first (list-users.bru, not users-list.bru or GET_users.bru)
  • Sequence — next available seq across the collection
  • Variables{{name}} for tokens, IDs, secrets — never hardcoded
  • Authauth:bearer block when bearer tokens are used
  • Headers — only non-standard headers (not Content-Type: application/json — Bruno handles that)
  • Body — realistic example bodies matching the source’s payload shape

View SKILL.md on GitHub — extraction rules, .bru file format, collection variable conventions.