Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问clear审计通过

rspecrspec 命令行

Agent Skill

rspec 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,690

周安装

276

GitHub Stars

87

下载量

2,186
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill rspec

简介

rspec 用于记录任务执行中的错误与改进点,帮助 Ruby on Rails 项目持续优化测试覆盖率。

  • 适用于需要沉淀用户反馈、修正测试用例或追踪能力缺口的协作场景。
  • 通过 npx skills add 命令从 GitHub 安装,需确认项目是否已配置 RSpec 框架。
  • 建议在使用前验证 spec 文件结构和运行命令,避免因环境差异导致失败。
  • 涉及数据库清理策略时应区分测试环境与生产数据,防止污染。

SKILL.md

RSpec Testing Best Practices

You are an expert in Ruby, Rails, and RSpec testing.

Key Principles

Comprehensive Coverage

Tests must cover both typical cases and edge cases, including invalid inputs and error conditions.

Readability and Clarity

  • Employ descriptive names for describe, context, and it blocks
  • Use the expect syntax for improved assertion readability
  • Keep test code concise without unnecessary complexity
  • Include comments explaining complex logic

Test Organization

  • Use describe for classes/modules and context for different scenarios
  • Use the subject helper to prevent repetition when defining objects under test
  • Mirror your source file structure within the spec directory

Test Data Management

  • Leverage let and let! for minimal, necessary setup
  • Prefer FactoryBot factories over fixtures for generating test data
  • Create only the data necessary for each test

Test Isolation

  • Each test must be independent without shared state between tests
  • Mock external services (APIs, databases) and stub methods appropriately
  • Avoid over-mocking: test real behavior when feasible

Reduce Duplication

  • Share common behaviors across contexts using shared_examples
  • Extract repetitive patterns into helpers or custom matchers
  • Use shared_context for common setup across multiple specs

Example Structure

RSpec.describe User, type: :model do
  subject { build(:user) }

  describe 'validations' do
    it { is_expected.to validate_presence_of(:email) }
    it { is_expected.to validate_uniqueness_of(:email) }
  end

  describe '#full_name' do
    context 'when both first and last name are present' do
      let(:user) { build(:user, first_name: 'John', last_name: 'Doe') }

      it 'returns the combined name' do
        expect(user.full_name).to eq('John Doe')
      end
    end

    context 'when last name is missing' do
      let(:user) { build(:user, first_name: 'John', last_name: nil) }

      it 'returns only the first name' do
        expect(user.full_name).to eq('John')
      end
    end
  end
end

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenCode

28.7%
按下载量换算627

Claude Code

21.99%
按下载量换算481

Antigravity

16.42%
按下载量换算359

Codex

12.96%
按下载量换算283

Gemini CLI

8.46%
按下载量换算185

github-copilot

3.1%
按下载量换算68

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills