RubyLLM::Skills
Agent Skills for RubyLLM. Teach your AI how to do things your way.
Installation
gem "ruby_llm-skills"Quick Start
chat = RubyLLM.chat
chat.with_skills
chat.ask "Create a PDF report from this data"The LLM discovers skills, calls the skill tool, and gets instructions.
Usage
chat.with_skills # app/skills (default)
chat.with_skills("lib/skills") # custom path
chat.with_skills("app/skills", "app/commands") # multiple paths
chat.with_skills("app/skills", user.skills) # with database recordsCreating Skills
app/skills/
└── pdf-report/
├── SKILL.md
├── scripts/
└── references/
SKILL.md requires frontmatter:
---
name: pdf-report
description: Generate PDF reports. Use when asked to create reports or export to PDF.
---
# PDF Report Generator
Instructions here...Slash Commands
Single-file skills work as commands:
app/commands/
├── write-poem.md
└── review-code.md
chat.with_skills("app/skills", "app/commands")
chat.ask "/write-poem about robots"Database Skills
Store skills or commands in your database:
create_table :skills do |t|
t.string :name, null: false
t.text :description, null: false
t.text :content, null: false # SKILL.md body
t.references :user
t.timestamps
end
chat.with_skills(user.skills)
chat.ask "/my-command args" # works as command tooRecords must respond to #name, #description, and #content. For skills with scripts/references, use filesystem skills.
Rails
Default path auto-configured to Rails.root/app/skills.
rails generate skill pdf-report --description "Generate PDF reports"Development
Setup
bin/setupRunning Tests
bundle exec rake test # Unit tests (151 tests)
bundle exec rake test_rails # Rails integration tests (25+ tests)
bundle exec rake test_all # Both
bundle exec rake # Tests + lintingDummy Rails App
A minimal Rails 8 app at test/dummy/ tests Rails integration:
-
Filesystem skills:
app/skills/greeting/tests directory-based loading -
Database skills:
Skillmodel tests ActiveRecord-based loading -
Generator tests: Tests for
rails generate skill - Composite loading: Tests combining filesystem + database sources
cd test/dummy
bundle exec rails test # Run Rails tests directlyResources
License
MIT