Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/hoblin/claude-ruby-marketplace/activerecordnpx skills add hoblin/claude-ruby-marketplace --skill activerecordgit clone --depth 1 https://github.com/hoblin/claude-ruby-marketplaceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/activerecord)<a href="https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/activerecord"><img src="https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/activerecord.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00180 | $0.02009 |
| Opus 5 | $0.00090 | $0.01005 |
| Sonnet 5 | $0.00036 | $0.00402 |
| Haiku 4.5 | $0.00018 | $0.00201 |
Grade A, and why
activerecord scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 268 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ActiveRecord
This skill provides comprehensive guidance for working with ActiveRecord in Rails applications. Use for writing migrations, defining associations, optimizing queries, preventing N+1 issues, implementing validations, and following database best practices.
Quick Reference
CRUD Operations
# Create
user = User.create(name: "Alice", email: "[email protected]")
user = User.create!(...) # Raises on failure
# Read
User.find(1) # Raises RecordNotFound
User.find_by(email: "x") # Returns nil if not found
User.where(active: true) # Returns Relation
# Update
user.update(name: "Bob")
user.update!(...) # Raises on failure
# Delete (callbacks run)
user.destroy
# Delete (no callbacks)
user.delete
Key Concepts
| Concept | Purpose |
|---|---|
belongs_to |
Child side of association (has foreign key) |
has_many / has_one |
Parent side of association |
has_many :through |
Many-to-many via join model |
includes / preload |
Eager loading (prevent N+1) |
scope |
Named query builder |
validates |
Model-level data validation |
before_save / after_commit |
Lifecycle callbacks |
Eager Loading Decision Tree
Need to access associated data?
├── NO → Use `joins` (filtering only)
└── YES → Need to filter/sort by association?
├── NO → Use `preload` (separate queries)
└── YES → Large dataset with many associations?
├── YES → Use `includes` with `references`
└── NO → Use `eager_load` (single JOIN)
Quick Comparison
| Method | Strategy | Best For |
|---|---|---|
includes |
Auto-choose | Default choice |
preload |
Separate queries | Large datasets, no filtering |
eager_load |
LEFT OUTER JOIN | Filtering by association |
joins |
INNER JOIN | Filtering only, not accessing data |
# N+1 problem
Post.all.each { |p| p.author.name } # 1 + N queries
# Solution
Post.includes(:author).each { |p| p.author.name } # 2 queries
What ships with it
34 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/associations/association_extensions.rb 6.7 KB runs code
- examples/associations/basic_associations.rb 3.2 KB runs code
- examples/associations/counter_caches.rb 6.0 KB runs code
- examples/associations/polymorphic_associations.rb 6.2 KB runs code
- examples/associations/self_referential.rb 7.6 KB runs code
- examples/associations/through_associations.rb 5.5 KB runs code
- examples/basics/crud_operations.rb 5.5 KB runs code
- examples/basics/dirty_tracking.rb 6.5 KB runs code
- examples/basics/inheritance.rb 9.0 KB runs code
- examples/basics/type_casting.rb 8.0 KB runs code
- examples/callbacks/alternatives_to_callbacks.rb 11 KB runs code
- examples/callbacks/conditional_callbacks.rb 8.6 KB runs code
- examples/callbacks/lifecycle_callbacks.rb 7.0 KB runs code
- examples/callbacks/transaction_callbacks.rb 9.4 KB runs code
- examples/migrations/indexes_and_constraints.rb 11 KB runs code
- examples/migrations/reversible_patterns.rb 11 KB runs code
- examples/migrations/safe_patterns.rb 12 KB runs code
- examples/migrations/schema_changes.rb 7.9 KB runs code
- examples/querying/batch_processing.rb 6.1 KB runs code
- examples/querying/eager_loading.rb 7.8 KB runs code
- examples/querying/finder_methods.rb 5.0 KB runs code
- examples/querying/optimization.rb 7.5 KB runs code
- examples/querying/scopes.rb 7.3 KB runs code
- examples/validations/built_in_validators.rb 8.4 KB runs code
- examples/validations/conditional_validations.rb 7.5 KB runs code
- examples/validations/custom_validators.rb 11 KB runs code
- examples/validations/database_constraints.rb 14 KB runs code
- examples/validations/validation_contexts.rb 11 KB runs code
- references/associations.md 18 KB
- references/basics.md 14 KB
- references/callbacks.md 16 KB
- references/migrations.md 16 KB
- references/querying.md 15 KB
- references/validations.md 15 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 268 lines · 180 tokens per session scan A 7d6a011fc493
activerecord is a skill published in the GitHub repository hoblin/claude-ruby-marketplace (37 stars, last pushed yesterday), licensed MIT. It adds 180 tokens to every session and 2,009 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
rb:sequel-patterns
Applying Sequel ORM patterns: datasets, migrations, associations, plugins, transactions, Sequel-vs-AR boundary decisions.
active-record-patterns
Active Record patterns: models, queries, associations, transactions, locking, migrations. Triggers: "AR scope", "hasmany through", "polymorphic". Do NOT use for: Sequel, N+1.
rails-models
ActiveRecord patterns, migrations, validations, callbacks, associations.
laravel-database-optimization
Laravel database optimization patterns. Use when writing Eloquent queries, creating migrations, configuring caching, debugging slow queries, or optimizing database performance. Triggers on tasks involving N+1 queries, indexing, Redis caching, pagination, or database transactions.
python-database-ops
SQLAlchemy and database patterns for Python. Triggers on: sqlalchemy, database, orm, migration, alembic, async database, connection pool, repository pattern, unit of work.
drizzle-knowledge-patch
Use this skill when work touches Drizzle SQL identifiers or aliases, Drizzle Kit module loading, or Zod schemas generated from Drizzle tables.