Use when creating or modifying REST API endpoints (Rails controllers, engine routes, API actions). Requires generating or updating an API Collection file (e.g., Postman Collection v2.1) so the new or changed endpoints can be tested. Trigger words: endpoint, API route, controller action, API collection, request collection.
86
82%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Use this skill when you add or change a REST API endpoint so that a compatible collection file is generated or updated for testing in a modern API client.
Core principle: Every API surface (Rails app or engine) has a single API collection file that stays in sync with its endpoints. All names, descriptions, and variable labels in the collection must be in English.
| Aspect | Rule |
|---|---|
| When | Create or update collection when creating or modifying any REST API endpoint (route + controller action) |
| Format | Postman Collection JSON v2.1 (schema or info.schema references v2.1) is a good default standard. |
| Location | One file per app or engine, e.g. docs/api-collections/<app-or-engine-name>.json or spec/fixtures/api-collections/ |
| Language | All request names, descriptions, and variable names in the collection in English |
| Per request | method, URL (with variables for base URL), headers (Content-Type, Authorization if needed), body example when applicable |
When you create or modify a REST API endpoint (new or changed route and controller action),
you MUST also create or update the corresponding API collection file so the
flow can be tested. Do not leave the collection missing or outdated.
EXCEPTION: GraphQL endpoints do NOT use REST collections.
For GraphQL, use a dedicated GraphQL client — see note below.Do not use this skill for GraphQL endpoints. REST collections do not map cleanly to GraphQL queries and mutations. For GraphQL:
docs/insomnia/ if the team needs a shared configSee rails-graphql-best-practices for the full GraphQL conventions.
All generated content in the collection must be in English: request names, folder names, descriptions, and variable display names. Do not use another language unless the user explicitly requests it.
info (name, description, schema https://schema.getpostman.com/json/collection/v2.1.0/collection.json), item array.name (English), optional request with method, url (string or object with raw/host/path/variable), header array, body when applicable (e.g. raw JSON for POST/PUT).{{base_url}}) so the collection works across environments.docs/api-collections/<name>.json or spec/fixtures/api-collections/<name>.json.{
"info": {
"name": "My Engine API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Create resource",
"request": {
"method": "POST",
"header": [{ "key": "Content-Type", "value": "application/json" }],
"url": "{{base_url}}/resources",
"body": { "mode": "raw", "raw": "{\"name\": \"Example\"}" }
}
}
],
"variable": [{ "key": "base_url", "value": "http://localhost:3000" }]
}| Mistake | Reality |
|---|---|
| Adding an endpoint but not touching the collection | Collection must be updated so the new flow is testable in an API client |
| Using a language other than English for names/descriptions | Standard is English unless the user requests otherwise |
| Hardcoding full URLs instead of variables | Use {{base_url}} (or similar) so the collection works in dev/staging/prod |
| Missing Content-Type or body for POST/PUT | Include headers and example body so the request works out of the box |
| Skill | When to chain |
|---|---|
| rails-engine-author | When the engine exposes HTTP endpoints |
| rails-engine-docs | When documenting engine API or how to test endpoints |
| rails-code-review | When reviewing API changes (ensure collection was updated) |
| rails-engine-testing | When adding request/routing specs (collection can mirror those flows) |
ae8ea63
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.