Claude-skill-registry bruno-api
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.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/bruno-api" ~/.claude/skills/majiayu000-claude-skill-registry-bruno-api && rm -rf "$T"
skills/data/bruno-api/SKILL.mdBruno API Documentation Generator Skill
Inputs & Modes
This Skill expects one of:
- A path to a single Bruno file (usually
), OR*.bru
to analyze all--scan <dir>
files under a directory..bru
Optional flags:
– produce an analysis plan only (no deep codebase search).--dry-run
– write the generated markdown documentation to a file.--output <path>
If inputs are missing or ambiguous, ask the user to confirm:
- Which
file(s) to analyze..bru - Whether they want
or full documentation.--dry-run - 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
(headers + params/body with types/validation)## Request
(success example + common error cases)## Response
(URL config + view + serializer/schema; always with## Implementation Details
)file.py:line
(step-by-step, include side effects like tasks/external calls)## Business Logic
(TypeScript types + call example + React Query hook example)## Frontend Integration
(Bruno tests + edge cases + required fixtures/data)## Testing
(perf considerations, related endpoints, rollout notes)## Notes
Use severity tags only when something prevents correctness/completeness:
– cannot locate the endpoint implementation or critical auth/permission logic.[BLOCKING]
– documentation gaps due to missing/incomplete source details (e.g., response shape unclear).[SHOULD_FIX]
– optional improvements, related endpoints, refactors, or performance observations.[NOTE]
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
for the view/viewset.dashboardapp/views/v2/
- Check
- If the URL starts with
:/api/v2/pulse/- Check
for Django Ninja routers/endpoints.pulse_iq/api/
- Check
- Otherwise:
- Search app-level
modules for the path prefix.urls.py - If needed,
for a distinctive path segment from the Bruno URL.Grep
- Search app-level
Once the route is found, identify the implementation type:
- DRF
- View / ViewSet class and handler method (
,list
,retrieve
, custom actions).create - Serializer(s) used (including nested serializers) and validation rules.
- Permissions / authentication classes.
- Queryset and filtering (especially company/org scoping).
- View / ViewSet class and handler method (
- 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.
- When you’re unsure, be explicit about assumptions and mark with
.[SHOULD_FIX]
Step 5 — Handle --output
and --scan
--output--scan- If
:--scan <dir>- Find all
files recursively under that directory..bru - Generate one markdown doc per file.
- If no
is provided, return docs in the response (grouped by file).--output
- Find all
- If
is provided:--output <path>- 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.