Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计通过

moai-lang-rubymoai lang Ruby 搜索

Agent Skill

moai-lang-ruby 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

188

周安装

8

GitHub Stars

61

下载量

66
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-lang-ruby(moai lang Ruby 搜索)
来源仓库:https://github.com/modu-ai/cc-plugins
仓库路径:skills/moai-lang-ruby
安装命令:
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-ruby
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-ruby

简介

用于查找、检索和筛选相关信息,支持关键词和任务场景定位。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中快速获取候选结果。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发联网或命令执行。
  • moai-lang-ruby 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Quick Reference (30 seconds)

Ruby 3.3+ Development Specialist - Rails 7.2, ActiveRecord, Hotwire/Turbo, RSpec, and modern Ruby patterns.

Auto-Triggers: Files with.rb extension, Gemfile, Rakefile, config.ru, Rails or Ruby discussions

Core Capabilities:

  • Ruby 3.3 Features: YJIT production-ready, pattern matching, Data class, endless methods
  • Web Framework: Rails 7.2 with Turbo, Stimulus, and ActiveRecord
  • Frontend: Hotwire including Turbo and Stimulus for SPA-like experiences
  • Testing: RSpec with factories, request specs, and system specs
  • Background Jobs: Sidekiq with ActiveJob
  • Package Management: Bundler with Gemfile
  • Code Quality: RuboCop with Rails cops
  • Database: ActiveRecord with migrations, associations, and scopes

Quick Patterns

Rails Controller Pattern:

Create UsersController inheriting from ApplicationController. Add before_action for set_user calling only on show, edit, update, and destroy actions. Define index method assigning User.all to instance variable. Define create method creating new User with user_params. Use respond_to block with format.html redirecting on success or rendering new with unprocessable_entity status, and format.turbo_stream for Turbo responses. Add private set_user method finding by params id. Add user_params method requiring user and permitting name and email.

ActiveRecord Model Pattern:

Create User model inheriting from ApplicationRecord. Define has_many for posts with dependent destroy and has_one for profile with dependent destroy. Add validates for email with presence, uniqueness, and format using URI::MailTo::EMAIL_REGEXP. Add validates for name with presence and length minimum 2 maximum 100. Define active scope filtering where active is true. Define recent scope ordering by created_at descending. Create full_name method returning first_name and last_name joined with space and stripped.

RSpec Test Pattern:

Create RSpec.describe for User model type. In describe validations block, add expectations for validate_presence_of and validate_uniqueness_of for email. In describe full_name block, use let to build user with first_name John and last_name Doe. Add it block expecting user.full_name to eq John Doe.


Implementation Guide (5 minutes)

Ruby 3.3 New Features

YJIT Production-Ready:

YJIT is enabled by default in Ruby 3.3 providing 15 to 20 percent performance improvement for Rails applications. Enable by running ruby with yjit flag or setting RUBY_YJIT_ENABLE environment variable to 1. Check status by calling RubyVM::YJIT.enabled? method.

Pattern Matching with case/in:

Create process_response method taking response parameter. Use case with response and in for pattern matching. Match status ok with data extracting data variable and puts success message. Match status error with message extracting msg variable. Match status with guard condition checking pending or processing. Use else for unknown response.

Data Class for Immutable Structs:

Create User using Data.define with name and email symbols. Add block defining greeting method returning hello message with name. Create user instance with keyword arguments. Access name property and call greeting method.

Endless Method Definition:

Create Calculator class with add, multiply, and positive? methods using equals sign syntax for single expression methods.

Rails 7.2 Patterns

Application Setup in Gemfile:

Set source to rubygems.org. Add rails version constraint for 7.2, pg for 1.5, puma for 6.0 or later, turbo-rails, stimulus-rails, and sidekiq for 7.0. In development and test group add rspec-rails for 7.0, factory_bot_rails, faker, and rubocop-rails with require false. In test group add capybara and shoulda-matchers.

Model with Concerns:

Create Sluggable module extending ActiveSupport::Concern. In included block add before_validation for generate_slug on create and validates for slug with presence and uniqueness. Define to_param returning slug. Add private generate_slug method setting slug from parameterized title if title present and slug blank. Create Post model including Sluggable with belongs_to user, has_many comments with dependent destroy, has_many_attached images. Add validations and published scope.

Service Objects Pattern:

Create UserRegistrationService with initialize accepting user_params. Define call method creating User, using ActiveRecord::Base.transaction to save user, create profile, and send welcome email. Return Result with success true and user. Rescue RecordInvalid returning Result with success false and errors. Add private methods for create_profile and send_welcome_email. Define Result as Data.define with success, user, and errors, adding success? and failure? predicate methods.

Hotwire Turbo and Stimulus

Turbo Frames Pattern:

In index view, use turbo_frame_tag with posts id and iterate posts rendering each. In post partial, use turbo_frame_tag with dom_id for post, containing article with h2 link and truncated content paragraph.

Turbo Streams Pattern:

In controller create action, build post from current_user.posts. Use respond_to with format.turbo_stream and format.html for redirect or render based on save success. In create.turbo_stream.erb view, use turbo_stream.prepend for posts with post, and turbo_stream.update for new_post form partial.

Stimulus Controller Pattern:

In JavaScript controller file, import Controller from hotwired/stimulus. Export default class extending Controller with static targets array for input and submit. Define connect method calling validate. Define validate method checking all input targets have values and setting submit target disabled accordingly.

RSpec Testing Basics

Factory Bot Patterns:

In factories file, define factory for user with sequence for email, Faker::Name.name for name, and password123 for password. Add admin trait setting role to admin symbol. Add with_posts trait with transient posts_count defaulting to 3, using after create callback to create_list posts for user.


Advanced Implementation (10+ minutes)

For comprehensive coverage including:

  • Production deployment patterns for Docker and Kubernetes
  • Advanced ActiveRecord patterns including polymorphic, STI, and query objects
  • Action Cable real-time features
  • Performance optimization techniques
  • Security best practices
  • CI/CD integration patterns
  • Complete RSpec testing patterns

See:

  • modules/advanced-patterns.md for production patterns and advanced features
  • modules/testing-patterns.md for complete RSpec testing guide

Context7 Library Mappings

  • rails/rails for Ruby on Rails web framework
  • rspec/rspec for RSpec testing framework
  • hotwired/turbo-rails for Turbo for Rails
  • hotwired/stimulus-rails for Stimulus for Rails
  • sidekiq/sidekiq for background job processing
  • rubocop/rubocop for Ruby style guide enforcement
  • thoughtbot/factory_bot for test data factories

Works Well With

  • moai-domain-backend for REST API and web application architecture
  • moai-domain-database for SQL patterns and ActiveRecord optimization
  • moai-workflow-testing for DDD and testing strategies
  • moai-essentials-debug for AI-powered debugging
  • moai-foundation-quality for TRUST 5 quality principles

Troubleshooting

Common Issues:

Ruby Version Check:

Run ruby with version flag for 3.3 or later. Check YJIT status by running ruby -e with puts RubyVM::YJIT.enabled? command.

Rails Version Check:

Run rails with version flag for 7.2 or later. Run bundle exec rails about for full environment information.

Database Connection Issues:

  • Check config/database.yml configuration
  • Ensure PostgreSQL or MySQL service is running
  • Run rails db:create if database does not exist

Asset Pipeline Issues:

Run rails assets:precompile to compile assets. Run rails assets:clobber to clear compiled assets.

RSpec Setup Issues:

Run rails generate rspec:install for initial setup. Run bundle exec rspec with specific file path for single spec. Run bundle exec rspec with format documentation for verbose output.

Turbo and Stimulus Issues:

Run rails javascript:install:esbuild for JavaScript setup. Run rails turbo:install for Turbo installation.


Last Updated: 2026-01-11 Status: Active (v1.1.0)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.6%
按下载量换算19

windsurf

24.11%
按下载量换算16

OpenCode

17.73%
按下载量换算12

Codex

12.16%
按下载量换算8

Antigravity

7.74%
按下载量换算5

Gemini CLI

3.38%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills