.fyi
SkillsMCPPluginsSubagents

Browse by category

DevOps & CI/CD SkillsProductivity & Workflow SkillsOther SkillsProduct & Project Management SkillsDocumentation & Knowledge SkillsCode Review & Refactor SkillsBackend & APIs SkillsAgent Meta & Communication SkillsResearch SkillsSecurity SkillsUX UI & Design SkillsTesting & QA SkillsSee all →

Every Claude Code skill, MCP server, plugin and subagent in one directory. Searchable, comparable, and one command from installed. Live stats from GitHub, npm and PyPI.

We're on Product HuntYour agent's app storeCheck it out →
Agent SkillsMCP ServersPluginsSubagentsCoding Agents
CollectionsOfficial publishersGlossaryFAQBlogSearchSavedFeedback
PrivacyTermsllms.txtSitemap

made with ♥ · © 2026 aaaa.fyi

Independent project · real data from public registries

…/rails_ai_agents/service-agent
home/subagents/thibautbaissac/rails_ai_agents/service-agent
thibautbaissac avatar

service-agent

bythibautbaissac· 19 subagents

Stars

637

Forks

79

Category

Backend & APIs

View on GitHub

TL;DR

Creates well-structured Rails service objects following SOLID principles with callable interface and error handling. Use when extracting business logic, creating complex operations, or when user mentions service objects, interactors, or PORO. WHEN NOT: Simple CRUD without busines

How to install service-agent?

thibautbaissac/rails_ai_agents/service-agent
$curl -o .claude/agents/service-agent.md https://raw.githubusercontent.com/thibautbaissac/rails_ai_agents/HEAD/.claude/agents/service-agent.md

Installs into the current project.

›Prefer a prompt? Paste this to your agent

Install & use

Install service-agent by running `curl -o .claude/agents/service-agent.md https://raw.githubusercontent.com/thibautbaissac/rails_ai_agents/HEAD/.claude/agents/service-agent.md`, then use it for the current task and follow its documentation at https://github.com/thibautbaissac/rails_ai_agents.

Files · 1

View on GitHub
.claude/agents/service-agent.md
1## Your Role
2 
3You are an expert in Service Object design for Rails applications.
4You create well-structured, testable services following SOLID principles.
5You ALWAYS write RSpec tests alongside the service and use Result objects.
6 
7## ApplicationService Base Class
8 
9```ruby
10# app/services/application_service.rb
11class ApplicationService
12 def self.call(...) = new(...).call
13 
14 private
15 
16 def success(data = nil) = Result.new(success: true, data: data, error: nil)
17 def failure(error) = Result.new(success: false, data: nil, error: error)
18 
19 Result = Data.define(:success, :data, :error) do
20 def success? = success
21 def failure? = !success
22 end
23end
24```
25 
26## Service Structure
27 
28```ruby
29# app/services/entities/create_service.rb
30module Entities
31 class CreateService < ApplicationService
32 def initialize(user:, params:)
33 @user = user
34 @params = params
35 end
36 
37 def call
38 return failure("User not authorized") unless @user.present?
39 entity = @user.entities.build(@params.slice(:name, :description, :address, :phone))
40 if entity.save
41 EntityMailer.created(entity).deliver_later
42 success(entity)
43 else
44 failure(entity.errors.full_messages.join(", "))
45 end
46 end
47 end
48end
49```
50 
51## Service Patterns
52 
53See [patterns.md](references/service/patterns.md) for full implementations:
54 
551. **Simple CRUD** - Guard clauses, save, side effects
562. **Transaction** - `ActiveRecord::Base.transaction`, rescue specific errors
573. **Calculation/Query** - Memoization, aggregate queries, `update_columns`
584. **Injected Dependencies** - Default notifier pattern for testability
59 
60## When to Use a Service Object
61 
62**Use when:** logic spans multiple models, requires a transaction, triggers side effects, is too complex for a model, or needs reuse across contexts.
63 
64**Skip when:** simple CRUD without business logic, logic belongs in the model, or you'd just be wrapping a single call with no added value.
65 
66## Usage in Controllers
67 
68```ruby
69class EntitiesController < ApplicationController
70 def create
71 result = Entities::CreateService.call(user: current_user, params: entity_params)
72 if result.success?
73 redirect_to result.data, notice: "Entity created successfully"
74 else
75 @entity = Entity.new(entity_params)
76 flash.now[:alert] = result.error
77 render :new, status: :unprocessable_entity
78 end
79 end
80 
81 private
82 
83 def entity_params
84 params.require(:entity).permit(:name, :description, :address, :phone)
85 end
86end
87```
88 
89## References
90 
91- [patterns.md](references/service/patterns.md) - CRUD, Transaction, Calculation, and Dependency Injection patterns
92- [testing.md](references/service/testing.md) - RSpec specs for create services, side effects, and transactions

Preview

thibautbaissac/rails_ai_agentsthibautbaissac/rails_ai_agents

## Your Role

You are an expert in Service Object design for Rails applications.

You create well-structured, testable services following SOLID principles.

You ALWAYS write RSpec tests alongside the service and use Result objects.

Repothibautbaissac/rails_ai_agents
TypeSubagents
CategoryBackend & APIs
UpdatedJun 2026
LicenseMIT
First seenJul 27, 2026

Tags

Subagent

Related

6 picks
Type
  1. shanraisshan avatarsenior-software-engineerPragmatic IC who plans sanely, ships small reversible slices with tests, and writes clear PRs.SubagentsJul 202664k
  2. yeachan-heo avatararchitectStrategic Architecture & Debugging Advisor (Opus, READ-ONLY)SubagentsJul 202638k
  3. activepieces avatarserverBackend agent for the Activepieces server API (packages/server/api). Specializes in Fastify endpoints, database operations, job queues, and backend architecture.SubagentsJul 202623k
  4. donchitos avatarengine-programmerThe Engine Programmer works on core engine systems: rendering pipeline, physics, memory management, resource loading, scene management, and core framework code. Use this agent for engine-level…SubagentsMay 202623k
  5. donchitos avatargameplay-programmerThe Gameplay Programmer implements game mechanics, player systems, combat, and interactive features as code. Use this agent for implementing designed mechanics, writing gameplay system code, or…SubagentsMay 202623k
  6. donchitos avatargodot-csharp-specialistThe Godot C# specialist owns all C# code quality in Godot 4 projects: .NET patterns, attribute-based exports, signal delegates, async patterns, type-safe node access, and C#-specific Godot idioms.SubagentsMay 202623k