postman-collection-generator
Postman Collection Generator
Produce a valid, importable Postman Collection v2.1 JSON (and optionally a Postman Environment JSON) that mirrors the API defined in the codebase. The goal is a collection a developer can import and run immediately: organized folders, parameterized URLs, request bodies, auth wired through variables, and at least one saved example per endpoint.
This skill is agnostic to language, framework, and routing style. Discover the routing conventions by reading the code; never assume a specific stack.
Core workflow
Work through these phases in order. Track them with the task tools if the API is large.
1. Scan routes
Find every place the codebase declares HTTP endpoints. Do not guess the framework — detect it from the files actually present.
- Locate route registrations, controller/handler annotations, router config, or API schema files (e.g. an existing OpenAPI/Swagger spec — if one exists, prefer it as the source of truth and skip manual extraction).
- Search broadly for HTTP-verb registrations and path-mounting calls; routers commonly nest a base prefix or version segment plus per-resource sub-routes. Reconstruct the full path by concatenating every mount prefix down to the leaf route.
- Note any middleware attached to a route or route group (auth, rate limiting, CORS, content-type guards) — these drive headers and the auth scheme.
Deliver a flat inventory: METHOD full/path -> handler [middleware...] before generating anything. Confirm the inventory looks complete; missing routes are the most common failure.