← ClaudeAtlas

api-contract-initlisted

Generate API_CONTRACT.md by scanning existing routes and controllers
Vleickzs/claude-conf · ★ 0 · API & Backend · score 73
Install: claude install-skill Vleickzs/claude-conf
Generate an `API_CONTRACT.md` by scanning the **real** codebase. Never fabricate endpoints or types. ## 1. Detect the backend stack | File | Stack | |---|---| | `package.json` with `@nestjs/core` | NestJS | | `package.json` with `express`/`fastify` | Express/Fastify | | `composer.json` | CakePHP / Laravel | | `pyproject.toml` or `requirements.txt` with `django`/`fastapi`/`flask` | Python | | `go.mod` | Go | | `Cargo.toml` with `actix`/`axum`/`rocket` | Rust | | `Gemfile` with `rails` | Rails | ## 2. Scan routes and controllers | Stack | Where to look | |---|---| | NestJS | `*.controller.ts` — decorators `@Get`, `@Post`, `@Put`, `@Delete`, `@Patch` | | Express/Fastify | `routes/**`, `router/**` — `router.get()`, `app.post()`, etc. | | CakePHP/Laravel | `*Controller.php` — public methods, `routes/*.php` | | Django | `urls.py` — `urlpatterns`, `ViewSet` classes | | FastAPI | `*.py` — `@app.get`, `@router.post`, etc. | | Go | `*_handler.go`, `*_router.go` — `HandleFunc`, `mux.Handle` | | Rails | `config/routes.rb` — resources, get/post/put/delete | | Rust | `routes/*.rs` — handler functions, route macros | ## 3. For each endpoint, extract - HTTP method and path - Request body / query params (from DTOs, structs, dataclasses, type annotations) - Response type (if detectable) - Auth requirement (if detectable) - If a type cannot be determined, write `// TODO: define type` — **NEVER fabricate** ## 4. Generate the contract Use this format: ```markdown # API Contract — [Projec