avo-coder
Use when building Avo admin interfaces. Creates resources, actions, filters, and dashboards following Avo conventions. Fetches latest docs dynamically.
What this skill does
# Avo Coder
You build admin interfaces using Avo for Rails. Always fetch the latest documentation before creating resources.
## First: Fetch Latest Docs
Before creating any Avo components, fetch the current documentation:
```
WebFetch: https://docs.avohq.io/3.0/llms-full.txt
```
This ensures you use the latest Avo 3.x patterns and APIs.
## Resource Generation
```bash
bin/rails generate avo:resource User
```
## Basic Resource Structure
```ruby
# app/avo/resources/user_resource.rb
class Avo::Resources::User < Avo::BaseResource
self.title = :email
self.includes = [:posts, :profile]
self.search = {
query: -> { query.ransack(email_cont: params[:q]).result }
}
def fields
field :id, as: :id
field :email, as: :text, required: true
field :name, as: :text
field :avatar, as: :file, is_image: true
field :created_at, as: :date_time, readonly: true
# Associations
field :posts, as: :has_many
field :profile, as: :has_one
end
end
```
## Field Types
```ruby
def fields
# Basic fields
field :title, as: :text
field :body, as: :trix # Rich text
field :bio, as: :textarea
field :count, as: :number
field :price, as: :currency
field :published, as: :boolean
field :status, as: :select, options: { draft: "Draft", published: "Published" }
field :tags, as: :tags
# Date/Time
field :published_at, as: :date_time
field :birth_date, as: :date
# Files
field :document, as: :file
field :avatar, as: :file, is_image: true
field :photos, as: :files
# Associations
field :author, as: :belongs_to
field :comments, as: :has_many
field :tags, as: :has_and_belongs_to_many
# Computed
field :full_name, as: :text do
"#{record.first_name} #{record.last_name}"
end
end
```
## Field Visibility
```ruby
field :email, as: :text,
show_on: :index, # Show on index
hide_on: :forms, # Hide on new/edit
readonly: true # Can't edit
# Conditional visibility
field :admin_notes, as: :textarea,
visible: -> { current_user.admin? }
```
## Actions
```bash
bin/rails generate avo:action ArchiveUser
```
```ruby
# app/avo/actions/archive_user.rb
class Avo::Actions::ArchiveUser < Avo::BaseAction
self.name = "Archive User"
self.message = "Are you sure you want to archive this user?"
self.confirm_button_label = "Archive"
self.cancel_button_label = "Cancel"
def fields
field :reason, as: :textarea, required: true
end
def handle(query:, fields:, current_user:, resource:, **args)
query.each do |record|
record.update!(archived: true, archive_reason: fields[:reason])
end
succeed "Archived #{query.count} users"
end
end
```
Register in resource:
```ruby
def actions
action Avo::Actions::ArchiveUser
end
```
## Filters
```bash
bin/rails generate avo:filter ActiveUsers
```
```ruby
# app/avo/filters/active_users.rb
class Avo::Filters::ActiveUsers < Avo::Filters::BooleanFilter
self.name = "Active Status"
def options
{
active: "Active",
inactive: "Inactive"
}
end
def apply(request, query, values)
return query if values.blank?
if values["active"]
query = query.where(active: true)
end
if values["inactive"]
query = query.where(active: false)
end
query
end
end
```
Register in resource:
```ruby
def filters
filter Avo::Filters::ActiveUsers
end
```
## Scopes
```ruby
# In resource
def scopes
scope Avo::Scopes::Active
scope Avo::Scopes::Archived
end
# app/avo/scopes/active.rb
class Avo::Scopes::Active < Avo::Advanced::Scopes::BaseScope
self.name = "Active"
self.description = "Active users only"
self.scope = -> { query.where(active: true) }
end
```
## Cards (Dashboard)
```ruby
# app/avo/cards/users_count.rb
class Avo::Cards::UsersCount < Avo::Cards::MetricCard
self.id = "users_count"
self.label = "Total Users"
def query
result User.count
end
end
```
## Authorization
Avo integrates with Pundit:
```ruby
# app/policies/user_policy.rb
class UserPolicy < ApplicationPolicy
def index?
user.admin?
end
def show?
user.admin? || record == user
end
def create?
user.admin?
end
def update?
user.admin?
end
def destroy?
user.admin? && record != user
end
end
```
## Common Patterns
**Sidebar customization:**
```ruby
# config/initializers/avo.rb
Avo.configure do |config|
config.main_menu = -> {
section "Dashboard", icon: "heroicons/outline/home" do
link_to "Analytics", avo.analytics_path
end
section "Content", icon: "heroicons/outline/document-text" do
resource :post
resource :category
end
section "Users", icon: "heroicons/outline/users" do
resource :user
resource :role
end
}
end
```
## Output Format
After building Avo components:
1. **Files Created** - Resources, actions, filters
2. **Registration** - Where components are registered
3. **Permissions** - Required policy methods
4. **Usage** - How to access in admin UI
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.