folio-rails-code-structure

Guide Ruby/Rails code structure in Folio CMS applications.

10|2|Updated Jul 10, 2017
One-click install
npx skills add https://github.com/sinfin/folio --skill folio-rails-code-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: folio-rails-code-structure
Source: https://github.com/sinfin/folio/tree/main/.skills/folio-rails-code-structure
Command: npx skills add https://github.com/sinfin/folio --skill folio-rails-code-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers maintain clean and efficient code in Folio CMS by promoting best practices for structuring model, controller, and concern methods, and by avoiding helper-method clusters.

Core Features & Use Cases

  • Code Structure Best Practices: Guides on keeping methods thin and extracting complex logic to focused classes.
  • Model, Controller, and Concern Optimization: Ensures that public methods are focused on their integration role.
  • Use Case: When refactoring a Rails application using Folio, this Skill helps in organizing code for better maintainability and performance.

Quick Start

Apply the folio-rails-code-structure skill to refactor a model method, such as def update_status, by extracting complex logic into a focused class under lib/.

Frequently Asked Questions about folio-rails-code-structure

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

FAQPage Schema
How do I refactor Ruby/Rails code structure in Folio CMS to improve maintainability?

To refactor Ruby/Rails code structure in Folio CMS, keep model, controller, and concern methods thin by extracting complex logic into focused classes under `lib/`, ensuring public methods remain dedicated to their integration role.

What is the best way to organize Folio CMS controller methods to avoid helper-method clusters?

The best way to organize Folio CMS controller methods is by keeping entrypoints thin and extracting complex logic into focused classes, which prevents helper-method clusters and ensures public methods maintain a clear integration role.

How does extracting complex logic to focused classes improve Rails code structure in Folio?

Extracting complex logic to focused classes improves Rails code structure in Folio by isolating behavior, which keeps entrypoints thin and allows public methods to focus strictly on integration, enhancing overall maintainability.

Can I use this refactoring methodology for standard Ruby/Rails applications without Folio CMS?

This refactoring methodology is specifically designed for Rails developers working on Folio applications, focusing on Folio CMS code structure guidelines rather than standard Ruby/Rails applications.

Why should I avoid helper-method clusters when structuring Folio CMS models and concerns?

You should avoid helper-method clusters when structuring Folio CMS models and concerns because they bloat code and obscure the integration role of public methods, reducing maintainability and performance.

When should I extract complex logic from a model method into a focused class in Folio CMS?

You should extract complex logic from a Folio CMS model method into a focused class under `lib/` during refactoring when the method becomes too heavy, ensuring the model's public method remains thin and focused.