rb:boundaries

Analyze Rails and Grape codebases for coupling and boundary violations.

7|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/slbug/claude-ruby-grape-rails --skill rb-boundaries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rb:boundaries
Source: https://github.com/slbug/claude-ruby-grape-rails/tree/main/plugins/ruby-grape-rails/skills/rb-boundaries
Command: npx skills add https://github.com/slbug/claude-ruby-grape-rails --skill rb-boundaries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify and explain architectural boundary violations in Rails and Grape applications so teams can extract misplaced logic, reduce coupling, and enforce clear service boundaries before they cause runtime bugs or brittle code.

Core Features & Use Cases

  • Layered boundary analysis: Scans controllers, endpoints, services, models, jobs, and mailers to detect business logic in the wrong layer, external calls in model callbacks, and deep cross-context coupling.
  • Actionable remediation: Provides concrete recommendations such as extracting services, converting callbacks to jobs, passing IDs to background workers, and introducing explicit APIs or events.
  • Monolith / Packwerk guidance: Advises when to adopt Packwerk-style package boundaries for modular monoliths and how to configure enforce_dependencies and enforce_privacy for large codebases.

Quick Start

Ask the agent to analyze the app directory app/ for coupling, list detected boundary violations, and recommend explicit refactors and Packwerk package boundaries.

Frequently Asked Questions about rb:boundaries

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

FAQPage Schema
How do I detect boundary violations in a Rails application?

Detect Rails boundary violations by scanning the app directory for coupling, business logic in controllers, external calls in model callbacks, and services depending on request context. The analysis identifies misplaced logic and recommends explicit refactors.

What is the best way to refactor business logic out of Rails controllers?

Refactoring Rails controllers involves extracting misplaced business logic into dedicated services and converting model callbacks to jobs. This process reduces cross-context coupling and enforces clear service boundaries for better architecture.

How do I configure Packwerk boundaries for a modular monolith?

Configure Packwerk boundaries by adopting enforce_dependencies and enforce_privacy settings for large codebases. This modular monolith approach isolates packages, restricts unauthorized cross-context calls, and prevents deep structural coupling.

Can I analyze Grape endpoints for architectural coupling?

Grape endpoints are fully supported for architectural coupling analysis. The scan detects deep cross-context coupling and improper job arguments within Grape applications, recommending explicit APIs or eventing to fix structural violations.

Why do my Rails background jobs fail with improper arguments?

Improper job arguments often occur when passing complex request context objects instead of IDs to background workers. Detecting this boundary violation recommends passing IDs to jobs, decoupling the worker from the web request lifecycle.

When do I need to introduce explicit APIs or eventing in Rails?

Introduce explicit APIs or eventing in Rails when detecting deep cross-context coupling or external calls within model callbacks. This architectural shift isolates service boundaries, replacing brittle direct calls with structured communication.