Bruno API Documentation Generator Skill
Inputs & Modes
This Skill expects one of:
- A path to a single Bruno file (usually
*.bru), OR
--scan <dir> to analyze all .bru files under a directory.
Optional flags:
--dry-run – produce an analysis plan only (no deep codebase search).
--output <path> – write the generated markdown documentation to a file.
If inputs are missing or ambiguous, ask the user to confirm:
- Which
.bru file(s) to analyze.
- Whether they want
--dry-run or full documentation.
- Whether an output file should be written.
Output Shape & Severity Tags
Dry-run output
Return a short plan containing:
- Endpoint summary: method, URL, auth, and any detected params/body.
- Where you will look in the Django codebase (specific file paths/directories).
- Which documentation sections will be generated.
- Complexity notes (e.g., “DRF ViewSet + serializer” vs “Ninja router + schema”).
Full documentation output
Generate a single markdown document for each endpoint using this structure:
# <Endpoint Name>
<METHOD> <URL Pattern>
- Authentication, Permissions, Multi-tenant
## Overview
## Request (headers + params/body with types/validation)
## Response (success example + common error cases)
## Implementation Details (URL config + view + serializer/schema; always with file.py:line)
## Business Logic (step-by-step, include side effects like tasks/external calls)
## Frontend Integration (TypeScript types + call example + React Query hook example)
## Testing (Bruno tests + edge cases + required fixtures/data)
## Notes (perf considerations, related endpoints, rollout notes)
Use severity tags only when something prevents correctness/completeness:
[BLOCKING] – cannot locate the endpoint implementation or critical auth/permission logic.
[SHOULD_FIX] – documentation gaps due to missing/incomplete source details (e.g., response shape unclear).
[NOTE] – optional improvements, related endpoints, refactors, or performance observations.
Workflow
Step 1 — Parse the Bruno file(s)
For each .bru file:
- Extract:
- HTTP method
- URL / path pattern
- Headers
- Query parameters
- Path parameters (from the URL pattern)
- Request body (and infer a schema where possible)
- Detect authentication intent:
- JWT / token headers
- Session/cookie usage
- Explicit “no auth” signals
- Capture any Bruno test/assert blocks as testing hints.
Step 2 — Locate the Django route & implementation
Treat these repo conventions as first-class when present:
- If the URL starts with
/api/v2/:
- Check
dashboardapp/v2_urls.py.
- Check
dashboardapp/views/v2/ for the view/viewset.
- If the URL starts with
/api/v2/pulse/:
- Check
pulse_iq/api/ for Django Ninja routers/endpoints.
- Otherwise:
- Search app-level
urls.py modules for the path prefix.
- If needed,
Grep for a distinctive path segment from the Bruno URL.
Once the route is found, identify the implementation type:
- DRF
- View / ViewSet class and handler method (
list, retrieve, create, custom actions).
- Serializer(s) used (including nested serializers) and validation rules.
- Permissions / authentication classes.
- Queryset and filtering (especially company/org scoping).
- Ninja
- Router and endpoint function.
- Pydantic schema(s) and validation.
- Auth configuration/decorators.
- Multi-tenant scoping and access control.
Always record code references with line numbers (path/to/file.py:123).
Step 3 — Extract behavior and contracts
For the located endpoint:
- Summarize the business purpose and any key invariants.
- Document validation and error behavior:
- Common 400 reasons (schema/serializer validation).
- Auth failures (401) and permission failures (403).
- Not-found cases (404) and domain-specific error cases.
- Identify multi-tenant constraints:
- How company/org is inferred (JWT claims, request context, URL param).
- Which queryset filters enforce scoping.
- Note side effects:
- Background tasks (Celery), emails, webhooks, external service calls.
- Writes to critical models and any transactional boundaries.
Step 4 — Generate documentation
Write the markdown doc per “Full documentation output”.
Rules:
- Prefer precise types over “string/number” when you can infer them.
- Include at least one realistic example request and success response.
- If response shape is dynamic or large, document the stable contract and
include a representative sample, not the entire universe of fields.
- If you recommend follow-up code changes, mention the repo's active type gate
(
ty first when configured, else pyright, else mypy) and avoid
recommending blanket suppressions.
- When you’re unsure, be explicit about assumptions and mark with
[SHOULD_FIX].
Step 5 — Handle --output and --scan
- If
--scan <dir>:
- Find all
.bru files recursively under that directory.
- Generate one markdown doc per file.
- If no
--output is provided, return docs in the response (grouped by file).
- If
--output <path> is provided:
- Write output to that path.
- If scanning multiple files, either:
- Write a single combined doc (with a clear table of contents), OR
- Write multiple files under an output directory (ask the user which they want).
Compatibility Notes
This Skill is designed to work with both Claude Code and OpenAI Codex.
- Claude Code: install the corresponding plugin and use its slash commands (see
plugins/bruno-api/commands/).
- Codex: install the Skill directory and invoke
name: bruno-api.
For installation, see this repo's README.md.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: bruno-api3description: Generate comprehensive API docs from Bruno (.bru) files by mapping requests to a Django implementation (DRF/Django Ninja), including auth, multi-tenant filtering, schemas, and code references. Use when this capability is needed.4---56# Bruno API Documentation Generator Skill78## Inputs & Modes910This Skill expects one of:1112- A path to a single Bruno file (usually `*.bru`), OR13- `--scan <dir>` to analyze all `.bru` files under a directory.1415Optional flags:1617- `--dry-run` – produce an analysis plan only (no deep codebase search).18- `--output <path>` – write the generated markdown documentation to a file.1920If inputs are missing or ambiguous, ask the user to confirm:2122- Which `.bru` file(s) to analyze.23- Whether they want `--dry-run` or full documentation.24- Whether an output file should be written.2526## Output Shape & Severity Tags2728### Dry-run output2930Return a short plan containing:3132- Endpoint summary: method, URL, auth, and any detected params/body.33- Where you will look in the Django codebase (specific file paths/directories).34- Which documentation sections will be generated.35- Complexity notes (e.g., “DRF ViewSet + serializer” vs “Ninja router + schema”).3637### Full documentation output3839Generate a single markdown document for each endpoint using this structure:4041- `# <Endpoint Name>`42- ``<METHOD> <URL Pattern>``43- **Authentication**, **Permissions**, **Multi-tenant**44- `## Overview`45- `## Request` (headers + params/body with types/validation)46- `## Response` (success example + common error cases)47- `## Implementation Details` (URL config + view + serializer/schema; always with `file.py:line`)48- `## Business Logic` (step-by-step, include side effects like tasks/external calls)49- `## Frontend Integration` (TypeScript types + call example + React Query hook example)50- `## Testing` (Bruno tests + edge cases + required fixtures/data)51- `## Notes` (perf considerations, related endpoints, rollout notes)5253Use severity tags only when something prevents correctness/completeness:5455- `[BLOCKING]` – cannot locate the endpoint implementation or critical auth/permission logic.56- `[SHOULD_FIX]` – documentation gaps due to missing/incomplete source details (e.g., response shape unclear).57- `[NOTE]` – optional improvements, related endpoints, refactors, or performance observations.5859## Workflow6061### Step 1 — Parse the Bruno file(s)6263For each `.bru` file:6465- Extract:66 - HTTP method67 - URL / path pattern68 - Headers69 - Query parameters70 - Path parameters (from the URL pattern)71 - Request body (and infer a schema where possible)72- Detect authentication intent:73 - JWT / token headers74 - Session/cookie usage75 - Explicit “no auth” signals76- Capture any Bruno test/assert blocks as testing hints.7778### Step 2 — Locate the Django route & implementation7980Treat these repo conventions as first-class when present:8182- If the URL starts with `/api/v2/`:83 - Check `dashboardapp/v2_urls.py`.84 - Check `dashboardapp/views/v2/` for the view/viewset.85- If the URL starts with `/api/v2/pulse/`:86 - Check `pulse_iq/api/` for Django Ninja routers/endpoints.87- Otherwise:88 - Search app-level `urls.py` modules for the path prefix.89 - If needed, `Grep` for a distinctive path segment from the Bruno URL.9091Once the route is found, identify the implementation type:9293- **DRF**94 - View / ViewSet class and handler method (`list`, `retrieve`, `create`, custom actions).95 - Serializer(s) used (including nested serializers) and validation rules.96 - Permissions / authentication classes.97 - Queryset and filtering (especially company/org scoping).98- **Ninja**99 - Router and endpoint function.100 - Pydantic schema(s) and validation.101 - Auth configuration/decorators.102 - Multi-tenant scoping and access control.103104Always record code references with line numbers (`path/to/file.py:123`).105106### Step 3 — Extract behavior and contracts107108For the located endpoint:109110- Summarize the business purpose and any key invariants.111- Document validation and error behavior:112 - Common 400 reasons (schema/serializer validation).113 - Auth failures (401) and permission failures (403).114 - Not-found cases (404) and domain-specific error cases.115- Identify multi-tenant constraints:116 - How company/org is inferred (JWT claims, request context, URL param).117 - Which queryset filters enforce scoping.118- Note side effects:119 - Background tasks (Celery), emails, webhooks, external service calls.120 - Writes to critical models and any transactional boundaries.121122### Step 4 — Generate documentation123124Write the markdown doc per “Full documentation output”.125126Rules:127128- Prefer precise types over “string/number” when you can infer them.129- Include at least one realistic example request and success response.130- If response shape is dynamic or large, document the stable contract and131 include a representative sample, not the entire universe of fields.132- If you recommend follow-up code changes, mention the repo's active type gate133 (`ty` first when configured, else `pyright`, else `mypy`) and avoid134 recommending blanket suppressions.135- When you’re unsure, be explicit about assumptions and mark with `[SHOULD_FIX]`.136137### Step 5 — Handle `--output` and `--scan`138139- If `--scan <dir>`:140 - Find all `.bru` files recursively under that directory.141 - Generate one markdown doc per file.142 - If no `--output` is provided, return docs in the response (grouped by file).143- If `--output <path>` is provided:144 - Write output to that path.145 - If scanning multiple files, either:146 - Write a single combined doc (with a clear table of contents), OR147 - Write multiple files under an output directory (ask the user which they want).148149## Compatibility Notes150151This Skill is designed to work with both Claude Code and OpenAI Codex.152153- Claude Code: install the corresponding plugin and use its slash commands (see `plugins/bruno-api/commands/`).154- Codex: install the Skill directory and invoke `name: bruno-api`.155156For installation, see this repo's `README.md`.157158---159> Converted and distributed by [TomeVault](https://tomevault.io/claim/diversioteam) — claim your Tome and manage your conversions.160<!-- tomevault:4.0:skill_md:2026-04-13 -->