Skip to content

Add Rubydex skill library with CLI command - #982

Open
dersam wants to merge 4 commits into
mainfrom
dersam/skill-provider
Open

Add Rubydex skill library with CLI command#982
dersam wants to merge 4 commits into
mainfrom
dersam/skill-provider

Conversation

@dersam

@dersam dersam commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a skill system that lets the rdx CLI load and display skill files — Markdown documents with YAML frontmatter that encode remediation guidance for linter rules.

This is the first part of a system that will allow Rubydex tools to provide references to detailed skills for fixing issues, without having to load every skill. The linter finding is the trigger point for skill loading, rather than relying on the agent pulling from context.

Screenshot 2026-08-05 at 3 58 27 PM

Skill files live at skills/<id>/SKILL.md and use YAML frontmatter to declare a name and description. This is the standard agent skill format.

  • rdx skill — lists available skills with id and description, aligned in columns
  • rdx skill <id> — loads and prints the skill body
  • rdx skill <unknown id> — reports unknown skill: <id> on stderr, exits non-zero

The skills directory is resolved relative to the source file (__dir__), so it works both in development and when installed as a gem. Skills are also added to the gemspec file list.

The diagram below illustrates the intended use of skill ids in a Rubydex tooling loop.

Screenshot 2026-08-05 at 3 58 52 PM

dersam added 4 commits August 5, 2026 15:53
Every failure to produce a `Skill` now raises `SkillError`: `load` wraps the
errors `File.read` raises, and the frontmatter parse wraps Psych's, so the CLI
reports a bad skill file instead of a backtrace.

`SkillRegistry#fetch` raises `SkillError` naming the available ids rather than
`KeyError`, which removes the `key?` guard at the call site, and it rejects a
skill whose frontmatter `name` disagrees with its directory so the id has one
spelling.

`rdx skill` rejects a trailing argument like `rdx mcp` does, reports an empty
library, and wraps long descriptions under the first line through
`CLI.describe`, which is now public for that.

The skill files are required by the CLI command instead of `lib/rubydex.rb`, so
a gem consumer no longer loads psych for a command it may never run.

The `send-private-method` skill claimed a bare `private` makes `def self.bar`
private and that moving the definition promotes it; both are false, and an
agent following them would flag a public method and then "fix" it with a no-op.
The examples now run, and the trigger no longer implies a detector Rubydex does
not have.

Documents the library in README.md and AGENTS.md.
`SkillRegistry#fetch` raised a message that spelled out the available ids, which
made the registry answer a question only an interface can answer. It now raises
`UnknownSkillError` naming just the id, and `rdx skill` builds the "Available
skills" line from `SkillRegistry#ids` when it renders the failure — the same
line it prints for an empty library. A second interface picks its own wording
from the same data.
@dersam
dersam marked this pull request as ready for review August 5, 2026 20:37
@dersam
dersam requested a review from a team as a code owner August 5, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant