ruby_rspec_tdd_skill

This skill drafts executable RSpec test suites and skeletons for Ruby projects using TDD best practices, enhancing test quality and maintainability.
  • Ruby

5

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill viamin/aidp --skill ruby_rspec_tdd

  • SKILL.md10.8 KB

Overview

This skill generates Test-Driven Development specifications and runnable RSpec skeletons for Ruby projects. It produces organized spec files, fixtures, and FactoryBot factories that follow RSpec conventions and TDD best practices. The output is ready to run with common RSpec commands and integrates doubles, hooks, and matchers for reliable tests.

How this skill works

The skill inspects feature descriptions, public interfaces, and the source file layout to produce a test specification document and matching spec files under spec/. It scaffolds unit, integration, and acceptance specs with Given-When-Then structure, appropriate describe/context/it nesting, let/subject helpers, and sample fixtures or factories. It also adds mocks/stubs for external dependencies and a sample spec_helper.rb configured for common workflows.

When to use it

  • Starting new features using TDD to drive implementation
  • Adding tests for existing public interfaces before refactoring
  • Creating integration scenarios that require controlled external dependencies
  • Standardizing test layout and conventions across a Ruby codebase
  • Bootstrapping test suites for new services or gems

Best practices

  • Test one behavior per it block and use descriptive example names
  • Prefer testing public behavior, not internal implementation details
  • Use Given-When-Then comments to make intent clear and repeatable
  • Mock external services with instance_double and stub network calls
  • Keep fixtures in spec/fixtures and use FactoryBot for repeatable factories
  • Run specs frequently with bundle exec rspec and enable --fail-fast for focused feedback

Example use cases

  • Generate spec/unit/*_spec.rb skeletons for a new library class before implementation
  • Create integration specs that stub external APIs and assert rollback or retry behavior
  • Produce acceptance specs that map to user stories and verify end-to-end flows
  • Scaffold FactoryBot factories and fixtures for a domain model to accelerate test writing
  • Provide a docs/tdd_specifications.md file listing test cases for team review

FAQ

Yes. Files are scaffolded to be runnable with a standard spec_helper.rb, sample fixtures, and FactoryBot support. You may need to adjust require_relative paths to match your project layout.

How do external dependencies get handled?

External services are replaced with instance_double/class doubles and allow(...).to receive(...) stubs in the generated specs so tests do not make real network calls. You can swap in real integrations in dedicated integration specs.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational