What problem does it solve?
This Skill solves the challenge of implementing correct, least-privilege authorization with Pundit by providing repeatable policy structure, role-based patterns, scoped access, and test-driven workflows for Rails applications.
Core Features & Use Cases
- Authorization policy patterns: Create consistent
ApplicationPolicy bases, CRUD permission methods, and reusable Scope resolution for collections.
- Role + custom action modeling: Implement policies that support roles (visitor/user/owner/admin) and custom actions like moderate/approve/cancel/flag.
- Temporal and dependency logic: Encode booking windows, cancellation deadlines, and “no destructive changes when dependencies exist” rules.
- TDD-first approach: Guide you to write policy tests first (RED/GREEN), then wire controllers with
authorize and policy_scope.
Quick Start
Ask your AI to help you implement a new Pundit policy for a Rails resource with role-based permissions, scoped index visibility, and TDD policy tests first.