version-api
Use when versioning a Rails REST API (v1/v2, deprecation, Sunset headers).
Skill by igmarin
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/igmarin-version-api
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/version-api
What's inside
- Skill name
version-api- Description
- Use when versioning a Rails REST API (v1/v2, deprecation, Sunset headers). Never break a public version in place. Trigger words: API version, v1, v2, versioning, deprecation.
- License
- MIT
- Metadata
- version: 1.0.0 · user-invocable: true
- Instructions
- 94 lines in SKILL.md · view on GitHub
Files (4)
- EXAMPLES.md
- SKILL.md
- strategies.md · references/
- workflow.md · references/
SKILL.md (first lines)
# Version API
Implement versioning strategies for Rails APIs.
## Quick Reference
| Concern | File |
|---|---|
| Route namespaces | `config/routes.rb` |
| Header versioning | `app/controllers/concerns/api_versioning.rb` |
| Deprecation headers | `app/controllers/concerns/deprecatable.rb` |
| Compatibility specs | `spec/requests/api/backward_compatibility_spec.rb` |
## HARD-GATE
```text
GENERATED CODE SAFETY:
- NEVER generate code that constantizes or evaluates caller-supplied version strings
(e.g. "V#{params[:version]}".constantize is forbidden — use an explicit allowlist).
- NEVER generate code that passes request headers or paths unsanitized into class
instantiation, eval, or dynamic dispatch.
- Allowlist-only version resolution: generated routing/concern code MUST resolve
version identifiers from a fixed set (V1, V2, ...), not from free-form input.
ALWAYS maintain backward compatibility for at least one major version
NEVER remove endpoints without deprecation period
ALWAYS version in URL path (/api/v1/) or Accept header, never in body
```
## Core Process
1. **Choose strategy** — URL path (`/api/v1/`) for public APIs; Accept header for internal/private APIs. See [strategies.md](./references/strategies.md) for header-based versioning details and trade-offs.
2. **Add route namespace** — Wrap new version resources in a `namespace :v2` block in `config/routes.rb`:
```ruby
namespace :v1 do
resources :users
end
namespace :v2 do
resources :users
end
```
3. **Create controllers** — Inherit from the previous version's controller and override only changed actions:
```ruby
module V2
class UsersController < V1::UsersController
def index
render json: User.all, only: [:id, :name, :email, :phone]
end
end
end
```
See [EXAMPLES.md](./EXAMPLES.md) for additional inheritance patterns.
4. **Apply deprecation** — Include `Deprecatable` in old-version controllers to emit `Sunset` and `Deprecation` response headers automatically via a `before_action`:
```ruby
module V1
class UsersController < ApplicationController
include Deprecatable
# Override sunset_date on the class to set the retirement date:
# def self.sunset_date = Date.new(2025, 6, 1)
end
end
```
5. **Run compatibility specs** — Execute `bundle exec rspec spec/requests/api/backward_compatibility_spec.rb` to confirm no regressions before merging.
6. **Update documentation** — Record the sunset date and migration guide for deprecated endpoints. See [workflow.md](./references/workflow.md) for the full deprecation communication workflow.
## Output Style
When asked to implement API versioning, your output MUST include:
1. **Versioning strategy** — Explicitly state whether using URL path (/api/v1/) or Accept header versioning
2. **Inheritance strategy** — Document how new version controllers inherit from previous version
3. **Route definition** — Show the namespace route configuration in config/routes.rb
4. **Deprecation headers** — Include Deprecatable concern with sunset date configuration
5. **Compatibility specs** — Include the command to run backward compatibility specs
6. **Language** — Must be in English unless explicitly requested otherwise
## Extended Resources (Progressive Disclosure)
Load these files only when their specific content is needed:
- **[EXAMPLES.md](EXAMPLES.md)** — Use when you need complete API versioning examples with route definitions and controller inheritance
- **[references/strategies.md](references/strategies.md)** — Use when comparing versioning strategies (URL path vs header vs query param)
- **[references/workflow.md](references/workflow.md)** — Use when implementing the deprecation communication workflow and sunset scheduling
## Integration
| Skill | When to chain |
|-------|---------------|
| **generate-api-collection** | When generating the updated API endpoints |
| **test-engine** | When verifying specs for regressions |From igmarin/rails-agent-skills, MIT.
More from igmarin/rails-agent-skills
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
setup-environment
igmarin
Use when onboarding onto a Rails app: Ruby version, Docker, env, database, test suite.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
seed-database
igmarin
Use when choosing seeds, fixtures, or factories for Rails dev/test data.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.616score
load-context
igmarin
Use before writing code, specs, or a PRD in an existing Rails app.
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
create-engine-installer
igmarin
Use when writing an install generator for a Rails engine (migrations, config).
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
implement-graphql
igmarin
Use when building or reviewing a graphql-ruby schema, resolver, or mutation.
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
apply-code-conventions
igmarin
Use when applying daily Rails conventions by path (DRY, YAGNI, PORO, CoC, KISS).
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
implement-background-job
igmarin
Use when adding or reviewing an Active Job / Sidekiq / Solid Queue worker.
SkillAFreshness: A★ 28Claude Code +9
Signals
- Stars
- 28
- Forks
- 8
- Open issues
- 0
- Contributors
- 7
- Last commit (this folder)
- Sep 28, 2026 (1 month ago)
- Last release
- May 16, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/igmarin/rails-agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from igmarin
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
seed-database
igmarin
Use when choosing seeds, fixtures, or factories for Rails dev/test data.
SkillAFreshness: A★ 28Claude Code +9
Cite this page
version-api skill. Agent Mart. https://agentmart.dev/skills/igmarin-version-api (last updated 2026-10-24)