skill-rails-api

skill-rails-api is a command for Claude Code from dewtech-technologies/dare-method. It costs 0 tokens per session (1,635 once invoked), scanned A, original, MIT.

A set of conventions for building REST APIs with Ruby on Rails 8. It covers the API structure, database models, background jobs, authentication, authorization, request limits, documentation, and tests.

In plain words
What is it for?
Use it to audit a Rails API, generate user-related API layers, or move business logic out of controllers into services.
Why use it?
It gives Rails API work a consistent structure and helps keep controllers, services, validation, security, and tests organized.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to audit a Rails API, generate user-related API layers, or move business logic out of controllers into services.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/dewtech-technologies/dare-method/skill-rails-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dewtech-technologies/dare-method

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for skill-rails-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/dewtech-technologies/dare-method/skill-rails-api/github.svg)](https://agentmods.dev/commands/dewtech-technologies/dare-method/skill-rails-api)
Your own site
<a href="https://agentmods.dev/commands/dewtech-technologies/dare-method/skill-rails-api"><img src="https://agentmods.dev/badge/commands/dewtech-technologies/dare-method/skill-rails-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for skill-rails-api

Your own site · 80×15
<a href="https://agentmods.dev/commands/dewtech-technologies/dare-method/skill-rails-api"><img src="https://agentmods.dev/badge/commands/dewtech-technologies/dare-method/skill-rails-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,635 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01635
Opus 5.5 $0.00000 $0.00654
Sonnet 5.5 $0.00000 $0.00327
Haiku 4.5 $0.00000 $0.00163

Measured 1mo ago against content hash 54fa887e8103, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

skill-rails-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

implementations/claude/.claude/commands/skill-rails-api.md · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/skill-rails-api

Padrões DARE para APIs em Ruby on Rails 8 — API mode, ActiveRecord, Solid Queue, Solid Cable, Action Cable, strong params, Services, serializers (Blueprinter/Alba), Devise/JWT, rack-attack, rswag.

Como usar

/skill-rails-api                          # audita projeto Rails
/skill-rails-api scaffold users           # gera controller + service + blueprint + tests
/skill-rails-api migrate-controllers      # extrai lógica de controllers para services

Stack canônica

  • Ruby 3.3+
  • Rails 8.x (rails new --api)
  • PostgreSQL 16
  • Solid Queue (jobs) + Solid Cable (websockets) — built-in Rails 8
  • Devise + devise-jwt (ou JWT puro)
  • Pundit ou CanCanCan (autorização)
  • Blueprinter ou Alba (serializers)
  • rack-attack (rate limit)
  • rswag (OpenAPI)
  • RSpec + FactoryBot + Faker
  • Rubocop rails-omakase
  • bundler-audit (CVEs)

Layered Design

Camada Pasta Rails
Handler app/controllers/api/v1/
Service app/services/
Repository app/repositories/ (opcional)
Model app/models/
Presenter app/blueprints/ ou app/serializers/

Controllers

module Api::V1
  class UsersController < ApplicationController
    before_action :authenticate_user!

    def create
      result = RegisterUser.new(user_params).call
      if result.success?
        render json: UserBlueprint.render(result.user), status: :created
      else
        render json: { error: result.error_code }, status: :conflict
      end
    end

    private

    def user_params
      params.require(:user).permit(:email, :name, :password)
    end
  end
end

Service Object

class RegisterUser
  Result = Struct.new(:success?, :user, :error_code)

  def initialize(params)
    @params = params
  end

  def call
    return Result.new(false, nil, 'USER_EXISTS') if User.exists?(email: @params[:email])
    user = User.create!(@params)
    Result.new(true, user, nil)
  end
end

Model

class User < ApplicationRecord
  has_secure_password
  validates :email, presence: true, uniqueness: true, format: URI::MailTo::EMAIL_REGEXP
  validates :name, presence: true
  validates :password, length: { minimum: 12 }, if: :password_required?
end

Read the full file on GitHub · 237 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 237 lines · 0 tokens per session scan A 54fa887e8103

Subscribe to this mod's changes

skill-rails-api is a command published in the GitHub repository dewtech-technologies/dare-method (5 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,635 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.