api-versioning

Create versioned Rails API routes and controllers with v1 and v2 namespaces.

Updated Nov 1, 2025
One-click install
npx skills add https://github.com/nschneble/rails-superstack --skill api-versioning-nschneble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-versioning
Source: https://github.com/nschneble/rails-superstack/tree/main/.agents/skills/api-versioning
Command: npx skills add https://github.com/nschneble/rails-superstack --skill api-versioning-nschneble

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams design and maintain backward-compatible Rails APIs by organizing endpoints into versioned namespaces and providing request specs scaffolding.

Core Features & Use Cases

  • Versioned routing in Rails with API namespaces (v1, v2)
  • Shared base controllers for consistent error handling
  • Request specs scaffolding for API endpoints and deprecation workflows
  • Use Case: Add a new v2 endpoint alongside an existing v1 without breaking existing clients

Quick Start

Create a Rails API with Api::V1 and Api::V2 namespaces, add a sample resource, and verify versioned routes work with a simple request.

Frequently Asked Questions about api-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new v2 endpoint to a Rails API without breaking existing v1 clients?

Using a shared base controller for your Rails API ensures consistent error handling across all versioned endpoints. It centralizes error response logic, providing uniform API behavior for every v1 and v2 consumer.

What is the best way to structure REST API deprecation workflows in Rails?

The best way to structure REST API deprecation workflows involves organizing versioned routing in Rails and providing consumer guidance. This allows you to plan endpoint deprecations while maintaining documentation across multiple API versions.

How do I write request specs for versioned Rails API endpoints?

You write request specs for versioned Rails API endpoints by using scaffolding designed for API namespaces. This verifies that versioned routes work correctly and validates endpoint behavior across different API versions.

Does URL-based API versioning work well for scaling RESTful Rails applications?

URL-based API versioning works well for scaling RESTful Rails applications by separating endpoint logic into distinct namespaces. This ensures stable, backward-compatible APIs that can safely evolve over time.