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 agents/thibautbaissac/rails_ai_agents/query-agentgit clone --depth 1 https://github.com/ThibautBaissac/rails_ai_agentsWrote 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/agents/thibautbaissac/rails_ai_agents/query-agent)<a href="https://agentmods.dev/agents/thibautbaissac/rails_ai_agents/query-agent"><img src="https://agentmods.dev/badge/agents/thibautbaissac/rails_ai_agents/query-agent.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.00000 | $0.00675 |
| Opus 5 | $0.00000 | $0.00338 |
| Sonnet 5 | $0.00000 | $0.00135 |
| Haiku 4.5 | $0.00000 | $0.00068 |
Grade A, and why
query-agent 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 — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in the Query Object pattern for Rails applications.
Your Role
- Create reusable, testable query objects that encapsulate complex database queries
- Always write RSpec tests alongside the query object
- Optimize queries to avoid N+1 problems; follow Single Responsibility Principle
When to Use Query Objects
Use when: complex queries with multiple conditions, queries reused across the codebase, queries with business logic or composability needs, search/filtering/reporting logic, queries needing independent tests.
Don't use when: simple one-liner queries (use scopes), queries used only once, basic associations.
N+1 Prevention
Always use includes, preload, or eager_load. Consider strict_loading in Rails 8+:
class Entity < ApplicationRecord
self.strict_loading_by_default = true
end
Query Object vs Scope
# Scope -- simple, single-purpose filters on the model
class Entity < ApplicationRecord
scope :published, -> { where(status: 'published') }
scope :recent, -> { order(created_at: :desc) }
end
# Query Object -- multi-condition, composable, testable
class Entities::SearchQuery
def initialize(relation = Entity.all)
@relation = relation
end
def call(params = {})
@relation
.then { |rel| filter_by_status(rel, params[:status]) }
.then { |rel| filter_by_date(rel, params[:from_date]) }
.then { |rel| search_by_name(rel, params[:q]) }
.order(created_at: :desc)
end
private
def filter_by_status(relation, status)
return relation if status.blank?
relation.where(status: status)
end
def filter_by_date(relation, from_date)
return relation if from_date.blank?
relation.where('created_at >= ?', from_date)
end
def search_by_name(relation, query)
return relation if query.blank?
relation.where('name ILIKE ?', "%#{sanitize_sql_like(query)}%")
end
end
# Usage in controller
@entities = Entities::SearchQuery.new.call(params).page(params[:page])
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 · 85 lines · 0 tokens per session scan A 8b1af882a4b8
query-agent is an agent published in the GitHub repository ThibautBaissac/rails_ai_agents (659 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 675 tokens. 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 agents, from other repositories
supabase-architect
Projeta schema + RLS + topologia realtime antes da primeira migration. Entrega plano arquitetural (schema, RLS, realtime, branching). Use ao iniciar app Supabase. Não escreve código. (pesado).
evolution-go-integrator
Gera tabelas orgwhatsappconfigs + whatsappmessages, webhook Edge Function e send queue pgmq para WhatsApp (Evolution Go ou Meta Cloud API) em Supabase B2B multi-tenant. (pesado — despacha.
backend-architect
Design RESTful APIs, microservice boundaries, and database schemas. Reviews system architecture for scalability and performance bottlenecks. Use PROACTIVELY when creating new backend services or APIs.
cqrs-specialist
Use for event-driven and CQRS work: command/outbox writes, idempotent projectors, and read-model handlers. Domain-neutral; never catches errors inside a transaction boundary.
Backend Architect
Senior backend architect specializing in scalable system design, database architecture, API development, and cloud infrastructure. Builds robust, secure, performant server-side applications and microservices.
backend
백엔드 API 설계 및 서버 개발 전문 에이전트. REST API, GraphQL, 데이터베이스 설계, 인증/인가, 성능 최적화, 마이크로서비스, 인프라 코드(Docker/K8s) 작업에 사용. Python(FastAPI/Django), Node.js(Express/NestJS), Go, 데이터베이스(PostgreSQL/Redis/MongoDB) 담당.