CtrlK
BlogDocsLog inGet started
Tessl Logo

igmarin/rails-agent-skills

Curated library of 41 public AI agent skills for Ruby on Rails development. Organized by category: planning, testing, code-quality, ddd, engines, infrastructure, api, patterns, context, and orchestration. Covers code review, architecture, security, testing (RSpec), engines, service objects, DDD patterns, and TDD automation. Repository workflows remain documented in GitHub but are intentionally excluded from the Tessl tile.

95

1.77x
Quality

93%

Does it follow best practices?

Impact

96%

1.77x

Average score across 41 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

SKILL.mdskills/infrastructure/seed-database/

name:
seed-database
license:
MIT
description:
Manage development and test data in Rails. Covers fixtures vs seeds, seeding strategies for different environments, test data factories, and production-like data generation. Use when the user asks about setting up seed data, creating test fixtures, or generating development data in a Rails application. Trigger words: seeds, fixtures, seeding, database seed, test data, development data, db:seed.
metadata:
{"version":"1.0.0","user-invocable":"true"}

Seed Database

Manage development and test data effectively.

Quick Reference

UseSolution
Static reference datadb/seeds.rb with find_or_create_by!
Test scenariosFactoryBot in spec/factories/
Complex relationshipsBoth combined

HARD-GATE

NEVER commit production data to seeds
ALWAYS use factories for test-specific scenarios
ALWAYS make seeds idempotent (can run multiple times safely)
NEVER hardcode credentials (passwords, API keys, secrets) in seeds, factories, or examples
  - Use ENV variables (e.g., ENV.fetch('DEFAULT_SEED_PASSWORD')) or SecureRandom.hex(16) for non-production data
  - Use `rails credentials:edit` to manage production secrets, never commit them in code

Core Process

  1. Write idempotent seeds — use find_or_create_by! so re-runs are safe.
  2. Scope by environment — guard non-production data with Rails.env checks.
  3. Run seeds — execute rails db:seed (or rails db:setup for a fresh database).
  4. Validate idempotency — run rails db:seed a second time and confirm no duplicates or errors.
  5. Verify data — open rails console and spot-check expected records exist with correct attributes.

Extended Resources

Environment-Specific Seeds Use find_or_create_by! to keep seeds idempotent — safe to run multiple times.

# db/seeds.rb
if Rails.env.development?
  require Rails.root.join('db/seeds/development')
elsif Rails.env.test?
  require Rails.root.join('db/seeds/test')
end

# db/seeds/development.rb
10.times do |i|
  email = "dev_user_#{i + 1}@example.com"

  User.find_or_create_by!(email: email) do |u|
    u.password = ENV.fetch('DEFAULT_SEED_PASSWORD', SecureRandom.hex(16))
  end
end

FactoryBot Factory Example

# spec/factories/users.rb
FactoryBot.define do
  factory :user do
    email { Faker::Internet.unique.email }
    password { ENV.fetch('DEFAULT_SEED_PASSWORD', SecureRandom.hex(16)) }

    trait :admin do
      admin { true }
    end
  end
end
  • SKILL.md
  • EXAMPLES.md
  • references/workflow.md
  • FactoryBot documentation
  • Faker gem
  • Rails Seeding Guide

Output Style

  1. Use idiomatic Rails seeding patterns.
  2. Structure factories clearly.
  3. Ensure no credentials are leaked.
  4. Include a production-secret note: use rails credentials:edit for production secrets and never commit them in seeds, factories, examples, logs, or docs.
  5. Include verification commands: rails db:seed, a second idempotency run, and a rails console spot-check.
  6. Language — Must be in English unless explicitly requested otherwise.

Integration

SkillWhen to chain
write-testsWhen setting up test scenarios
review-migrationWhen ensuring DB schema is aligned

skills

infrastructure

seed-database

README.md

server.json

tile.json