seed-database
Use when choosing seeds, fixtures, or factories for Rails dev/test data.
Skill by igmarin
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/igmarin-seed-database
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/seed-database
What's inside
- Skill name
seed-database- Description
- Use when choosing seeds, fixtures, or factories for Rails dev/test data. Seeds must be idempotent. Trigger words: seeds, fixtures, test data, development data.
- License
- MIT
- Metadata
- version: 1.0.0 · user-invocable: true
- Instructions
- 82 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (3)
- EXAMPLES.md
- SKILL.md
- workflow.md · references/
SKILL.md (first lines)
# Seed Database
Manage development and test data effectively.
## Quick Reference
| Use | Solution |
|-----|----------|
| Static reference data | `db/seeds.rb` with `find_or_create_by!` |
| Test scenarios | FactoryBot in `spec/factories/` |
| Complex relationships | Both combined |
## HARD-GATE
```text
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.
## Minimal Inline Example
A copy-paste ready `db/seeds.rb` covering idempotency, environment scoping, and safe credentials:
```ruby
# db/seeds.rb
# Static reference data — safe to run repeatedly
Role.find_or_create_by!(name: 'admin') do |r|
r.description = 'Full system access'
end
Role.find_or_create_by!(name: 'member') do |r|
r.description = 'Standard user access'
end
# Development-only seed data — never runs in production
if Rails.env.development?
User.find_or_create_by!(email: 'admin@example.com') do |u|
u.role = Role.find_by!(name: 'admin')
u.password = ENV.fetch('DEFAULT_SEED_PASSWORD', SecureRandom.hex(16))
end
end
```
For FactoryBot factory definitions and more complex relationship patterns, see **[EXAMPLES.md](EXAMPLES.md)**.
## Extended Resources (Progressive Disclosure)
Load these files only when their specific content is needed:
- **[EXAMPLES.md](EXAMPLES.md)** — Use when you need complete seeding examples with environment-specific patterns and FactoryBot factory definitions
- **[references/workflow.md](references/workflow.md)** — Use when implementing complex seeding workflows or migration-dependent seed data
## Output Style
1. Use idiomatic Rails seeding patterns.
2. Structure factories clearly.
3. Follow the credential and idempotency rules in HARD-GATE without exception.
4. Include verification commands: `rails db:seed`, a second idempotency run, and a `rails console` spot-check.
5. Language — Must be in English unless explicitly requested otherwise.
## Integration
| Skill | When to chain |
|-------|---------------|
| **write-tests** | When setting up test scenarios |
| **review-migration** | When ensuring DB schema is aligned |From igmarin/rails-agent-skills, MIT.
More from igmarin/rails-agent-skills
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
version-api
igmarin
Use when versioning a Rails REST API (v1/v2, deprecation, Sunset headers).
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
setup-environment
igmarin
Use when onboarding onto a Rails app: Ruby version, Docker, env, database, test suite.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.616score
load-context
igmarin
Use before writing code, specs, or a PRD in an existing Rails app.
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
create-engine-installer
igmarin
Use when writing an install generator for a Rails engine (migrations, config).
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
implement-graphql
igmarin
Use when building or reviewing a graphql-ruby schema, resolver, or mutation.
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
apply-code-conventions
igmarin
Use when applying daily Rails conventions by path (DRY, YAGNI, PORO, CoC, KISS).
SkillAFreshness: A★ 28Claude Code +9 - 0.614score
implement-background-job
igmarin
Use when adding or reviewing an Active Job / Sidekiq / Solid Queue worker.
SkillAFreshness: A★ 28Claude Code +9
Signals
- Stars
- 28
- Forks
- 8
- Open issues
- 0
- Contributors
- 7
- Last commit (this folder)
- Sep 28, 2026 (1 month ago)
- Last release
- May 16, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/igmarin/rails-agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from igmarin
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
setup-environment
igmarin
Use when onboarding onto a Rails app: Ruby version, Docker, env, database, test suite.
SkillAFreshness: A★ 28Claude Code +9
Cite this page
seed-database skill. Agent Mart. https://agentmart.dev/skills/igmarin-seed-database (last updated 2026-10-24)