/superpowers-rails:rails-policy-conventionsfrom superpowers-rails
Creates and modifies Pundit authorization policies with role-based permissions, ensuring policies check user permissions not resource state.
Ships in superpowers-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Policies answer one question: "Is this user allowed to attempt this action?" They check WHO, not WHAT or WHEN.
mentor_or_above?, content_creator_or_above? from ApplicationPolicyspec/policies/, NOT request specs. Request specs use authorized users (happy path) and never mock policies# WRONG - checking state
def publish?
user.admin? && !record.published? # State check doesn't belong here
end
# RIGHT - permission only
def publish?
content_creator_or_above?
end
mentor_or_above? # mentor? || content_creator? || company_admin?
content_creator_or_above? # content_creator? || company_admin?
| Do | Don't |
|---|---|
| Check user permissions | Check resource state |
| Use role helper methods | Complex inline role checks |
authorize @resource in every action | Skip authorization |
| Return boolean only | Raise errors in policies |
| Keep policies thin | Business logic in policies |
mentor_or_above? not inline checksRemember: Policies are gatekeepers, not validators. They check WHO, not WHAT or WHEN.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pundit, authorization, role-based-permissions, rails-policies
npx claudepluginhub fryga-io/superpowers-rails --plugin superpowers-rails23 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./diagnosing-superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/executing-plansUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available/finishing-a-development-branchUse when implementation is complete, all tests pass, and you need to decide how to integrate the work/rails-controller-conventionsUse when creating or modifying Rails controllers, adding actions, setting up authorization, configuring routes, modeling state changes as resources, or handling Turbo responsesOther plugins' skills for the same job