Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Ruby Pro

ASecurity

当用 Ruby/Rails 写惯用代码、做元编程 DSL、开发 gem、写测试或做性能优化时使用;产出符合社区惯例的 Ruby 代码、Rails MVC 应用、RSpec/Minitest 测试、gem 规范与 benchmark-ips 基准;不适用于其他语言运行时、仅需基础语法解释、或无法改动 Gemfile 与工具链的场景;触发词:Rails、ActiveRecord、元编程、RSpec、RuboCop、gem 开发

3 stars
0 votes
0 copies
3 views
Added 9/19/2026
ai-agentsrustgojavarubyphprailscode-reviewapibackend

Works with

cursorcliapi

Security Analysis

A100/100

Scanned 9/19/2026

$npx -y skills add findscripter/everything-skills --skill ruby-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ruby Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Ruby Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/findscripter-ruby-pro/badge)](https://www.skillsdirectory.com/skills/findscripter-ruby-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: ruby-pro
title: Ruby 进阶开发
description: 当用 Ruby/Rails 写惯用代码、做元编程 DSL、开发 gem、写测试或做性能优化时使用;产出符合社区惯例的 Ruby 代码、Rails MVC 应用、RSpec/Minitest 测试、gem 规范与 benchmark-ips 基准;不适用于其他语言运行时、仅需基础语法解释、或无法改动 Gemfile 与工具链的场景;触发词:Rails、ActiveRecord、元编程、RSpec、RuboCop、gem 开发
domain: 研发/backend
triggers: [Ruby 惯用代码, Rails 模式, ActiveRecord, 元编程, mixin 模块, DSL 设计, RSpec 测试, Minitest, RuboCop, gem 开发, benchmark-ips 性能, 遗留 Ruby 重构]
tags: [ruby, rails, 元编程, gem, 测试, 性能优化, 研发]
level: 精通
status: stable
agents: [claude-code, codex, cursor, gemini-cli]
tools: [ruby, rails, rspec, minitest, rubocop, benchmark-ips, bundler, ruby-prof]
requires: []
related: [php-pro, golang-pro, java-modern-pro, rust-pro]
combines_with: [rest-api-endpoint-builder, error-handling-patterns, code-reviewer]
license: MIT
source: sickn33/agentic-awesome-skills
source_license: MIT
---
## 何时使用

适用:
- 用 Ruby/Rails 写惯用、可维护的代码,或对既有 Ruby 工程做架构与代码质量评审。
- 设计元编程能力(模块/mixin、DSL),用块与枚举器抽象复杂逻辑。
- 开发 gem 并管理依赖与版本;用 RSpec/Minitest 补测试;做性能剖析与优化。

不该用(负边界):
- 需要其他语言或运行时。
- 只需基础 Ruby 语法解释。
- 无法改动 Gemfile、`.rubocop.yml` 或工具链(代码生成与优化无从落地)。

## 步骤

1. 对齐前提:确认 Ruby/Rails 版本、目标(功能/重构/调优)、约束与必需输入。
2. 选型:依据场景选惯用法——元编程做 DSL、块与枚举器做迭代、组合优先于继承。
3. 实现:遵循 Ruby/Rails 惯例与命名,异常用 `rescue/ensure` 显式处理,配套 RSpec/Minitest。
4. 优化:先测量后优化——用 benchmark-ips / ruby-prof 定位热点再调;可读性优先于性能。
5. 验收:跑 RuboCop 静态检查与测试套件,输出重构建议;相关时附 Gemfile 与 `.rubocop.yml`。

## 指令

- 拥抱 Ruby 表达力:善用块、`Enumerable`、关键字参数;元编程(`define_method`、`method_missing`、`Module#included`)服务于清晰的 DSL,而非炫技。
- 异常处理显式化:`begin/rescue/ensure` 收尾资源,按具体异常类捕获,不裸 `rescue`。
- 可读性优先、性能其次:只在有 benchmark 数据时调优,禁止凭直觉。
- 测试用 RSpec 或 Minitest,配 fixtures/mocks;Rails 走 MVC,胖模型瘦控制器。
- 关键命令:
  - 运行测试:`bundle exec rspec` / `bundle exec rake test`
  - 静态检查与自动修复:`bundle exec rubocop` / `rubocop -a`
  - 性能基准:`require "benchmark/ips"` → `Benchmark.ips { |x| x.report(...) ; x.compare! }`
  - 剖析热点:`ruby-prof` / `stackprof`
  - gem 脚手架与发布:`bundle gem <name>` → 在 `.gemspec` 用语义化版本 → `gem build` / `gem push`

## 示例

用 `Benchmark.ips` 对比两种实现:

```ruby
require "benchmark/ips"

Benchmark.ips do |x|
  x.report("map")     { (1..1000).map { |i| i * 2 } }
  x.report("each_with_object") do
    (1..1000).each_with_object([]) { |i, a| a << i * 2 }
  end
  x.compare!
end
```

典型请求:
- "把这段遗留 Ruby 重构成惯用写法并补 RSpec"
- "为这个配置层设计一个简洁的 DSL"
- "用 benchmark-ips 定位并优化这段循环的瓶颈"
- "搭一个带语义化版本和测试的 gem 骨架"

## 注意事项

- 输出不能替代环境内的实测、测试与专家评审;落地前务必跑通测试套件与 RuboCop。
- 元编程会牺牲可读性与调试性,仅在收益明确时使用;优先简单方案。
- 输入、权限、安全边界或验收标准缺失时,先停下来澄清再动手。
- 仅在任务确实落在上述范围内时使用本技能。

## 互见

- Rails 后端架构、ActiveRecord 查询优化相关技能。
- 通用性能剖析与遗留代码现代化方法论。
- 测试策略与覆盖率(RSpec/Minitest)相关技能。

---
采编自 sickn33/antigravity-awesome-skills(MIT)。

Attribution

findscripterfindscripter
View sourceSee grades on GitHubMore from findscripter →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →