policy-patterns

Official

Ship secure Pundit policies with TDD.

AuthorLaunchPadLab
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: policy-patterns
Download link: https://github.com/LaunchPadLab/ai-bank/archive/main.zip#policy-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.