rails-initializers

Configure Rails boot-time initializers for extensions, filtering, CORS, and settings.

4|2|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/rubakas/agent-notes --skill rails-initializers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-initializers
Source: https://github.com/rubakas/agent-notes/tree/main/rails-initializers
Command: npx skills add https://github.com/rubakas/agent-notes --skill rails-initializers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails apps often suffer from scattered boot-time configuration and inconsistent initializer patterns. This Skill centralizes common Rails initializers to ensure consistent behavior across environments, improving maintainability and reducing startup errors.

Core Features & Use Cases

  • Load custom library extensions from lib/rails_ext and auto-require them at startup.
  • Secure parameter filtering with Rails.config.filter_parameters to hide secrets in logs.
  • Configure CORS using Rack::Cors and environment-specific origins and resources.
  • Centralized custom configuration via Rails.configuration.x for app-specific settings.

Quick Start

Add this skill to your CLAUDE.md and reference @agent-notes/rails-initializers/index.md to apply standard boot-time configurations across environments.

Frequently Asked Questions about rails-initializers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Rails initializers consistently across development, staging, and production?

Configure Rails initializers deterministically by applying environment-specific guardrails and load order patterns for extension loading, CORS, and custom settings. This ensures consistent boot behavior and reduces startup errors across environments.

What is the best way to load custom library extensions at Rails boot time?

The best way to load custom library extensions at Rails boot time is to auto-require them from a dedicated directory like lib/rails_ext during the initializer phase. This centralizes extension loading for reliable startup availability.

How does parameter filtering work for securing sensitive data in Rails logs?

Parameter filtering works by configuring Rails.config.filter_parameters to intercept and mask sensitive request parameters before they reach logs. This prevents secrets from being exposed in application logs across all environments.

Can I configure Rack::Cors with environment-specific origins in Rails?

Yes, you can configure Rack::Cors with environment-specific origins and resources in Rails initializers. By applying environment guardrails, you can restrict allowed origins for production while permitting broader access in development and staging.

How do I set up centralized custom configuration via Rails.configuration.x?

You set up centralized custom configuration by assigning app-specific settings to Rails.configuration.x within an initializer. This provides a single, consistent namespace for custom app settings accessible throughout the application lifecycle.

Why does my Rails application fail to boot due to initializer load order issues?

Rails boot failures from initializer load order issues occur when dependencies are loaded before their prerequisites. Using deterministic initializer patterns ensures extensions and configurations load in the correct sequence, preventing startup errors.