Skip to main content
在 Manus 中运行任何 Skill
一键导入

create-service-object

星标2
分支0
更新时间2026年5月30日 04:10

Use when creating or refactoring Ruby service classes following the `def self.call(...)` → `new(...).call` entry point pattern with a strict `{ success: true/false, response: { ... } }` response contract. Handles error shape (`{ success: false, response: { error: { message: string } } }`), `StandardError` rescue with `logger.error` logging, `UPPER_SNAKE_CASE` error constants, and mandatory module READMEs. Enforces test-first workflow: spec written and confirmed failing before implementation. Covers 4 core patterns (Standard, Batch, Static/Class-only, Orchestrator), `.call` ≤ 20 lines, and YARD documentation on `self.call` and `#call`. File layout: spec at `spec/services/[module]/[name]_spec.rb`, impl at `services/[module]/[name].rb`. Trigger words: service object, .call pattern, services, service module, response hash, success/response shape, YARD on self.call, service skeleton, module README, orchestrator.

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

文件资源管理器
5 个文件
SKILL.md
readonly