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.
npx skills add Shoebtamboli/rails_claude_skills --skill rails-authorization-cancancangit clone --depth 1 https://github.com/Shoebtamboli/rails_claude_skillsWrote 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.
[](https://agentmods.dev/skills/shoebtamboli/rails_claude_skills/rails-authorization-cancancan)<a href="https://agentmods.dev/skills/shoebtamboli/rails_claude_skills/rails-authorization-cancancan"><img src="https://agentmods.dev/badge/skills/shoebtamboli/rails_claude_skills/rails-authorization-cancancan/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.
<a href="https://agentmods.dev/skills/shoebtamboli/rails_claude_skills/rails-authorization-cancancan"><img src="https://agentmods.dev/badge/skills/shoebtamboli/rails_claude_skills/rails-authorization-cancancan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00109 | $0.03656 |
| Opus 5.5 | $0.00044 | $0.01462 |
| Sonnet 5.5 | $0.00022 | $0.00731 |
| Haiku 4.5 | $0.00011 | $0.00366 |
Grade A, and why
rails-authorization-cancancan 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 604 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rails Authorization with CanCanCan
CanCanCan is a popular authorization library for Rails that restricts what resources a given user is allowed to access. It centralizes all permission logic in a single Ability class, keeping authorization rules DRY and maintainable.
Quick Setup
# Add to Gemfile
bundle add cancancan
# Generate Ability class
rails generate cancan:ability
This creates app/models/ability.rb where all authorization rules are defined.
Core Concepts
Defining Abilities
The Ability class centralizes all permission logic:
# app/models/ability.rb
class Ability
include CanCan::Ability
def initialize(user)
# Guest users (not signed in)
can :read, Post, published: true
can :read, Comment
# Signed-in users
return unless user.present?
can :read, Post
can :create, Post
can :update, Post, user_id: user.id
can :destroy, Post, user_id: user.id
can :create, Comment
can :update, Comment, user_id: user.id
can :destroy, Comment, user_id: user.id
# Admin users
return unless user.admin?
can :manage, :all # Can do anything
end
end
Best Practice: Structure rules hierarchically (guest → user → admin) for clarity.
Actions and Resources
Standard CRUD Actions
:read # :index and :show
:create # :new and :create
:update # :edit and :update
:destroy # :destroy
:manage # All actions (use carefully!)
Custom Actions
can :publish, Post
can :archive, Post
can :approve, Comment
Multiple Resources
can :read, [Post, Comment, Category]
can :manage, [User, Post], user_id: user.id
Ability Conditions
Hash Conditions
# Simple equality
can :update, Post, user_id: user.id
# Multiple conditions (AND logic)
can :read, Post, published: true, category_id: user.accessible_category_ids
# SQL fragment (use sparingly)
can :read, Post, ["published_at <= ?", Time.zone.now]
Block Conditions
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 604 lines · 109 tokens per session scan A 1141f2b4c756
rails-authorization-cancancan is a skill published in the GitHub repository Shoebtamboli/rails_claude_skills (16 stars, last pushed 5mo ago), licensed MIT. It adds 109 tokens to every session and 3,656 once invoked, about $0.0004 per session on Opus 5.5. 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-08-30.
rails-authorization-cancancan compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rails-authorization-cancancanShoebtamboli/rails_claude_skills | Skill | 16 | 5mo ago | MIT | A | 109 | Claude Code, Codex |
| offensive-api-abuseSnailSploit/Claude-Red | Skill | 12k | 15d ago | MIT | B | 184 | Claude Code, Codex |
| offensive-graphqlSnailSploit/Claude-Red | Skill | 12k | 15d ago | MIT | B | 219 | Claude Code, Codex |
| mcp-server-specmohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 101 | Claude Code |
| agent-readiness-auditmohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 117 | Claude Code |
| api-docs-writermohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | B | 80 | Claude Code, Codex |
| agent-ready-auth-mdfabricioctelles/skills | Skill | 151 | 6d ago | Apache-2.0 | A | 37 | Claude Code, Codex |