dragonruby-yard

Set up YARD documentation and Solargraph LSP autocomplete for DragonRuby GTK projects. Use when the user asks about IDE autocomplete, type support, Solargraph, or editor integration for DragonRuby.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "dragonruby-yard" with this command: npx skills add nitemaeric/dragonruby-skills/nitemaeric-dragonruby-skills-dragonruby-yard

This skill sets up rich API autocomplete and type support for DragonRuby using the dragonruby-yard-doc stubs and Solargraph.

How It Works

DragonRuby ships its own Ruby runtime — not CRuby — so standard LSP tooling doesn't know about args, GTK, Geometry, etc. The dragonruby-yard-doc repo provides YARD-annotated stub files that teach Solargraph the full DragonRuby API, giving you autocomplete and type hints without modifying the engine.

Setup

1. Clone the stubs alongside your games

# Wherever you keep your DragonRuby projects, clone the stubs as a sibling:
cd ~/games
git clone https://github.com/owenbutler/dragonruby-yard-doc.git

2. Install CRuby and Solargraph

Solargraph runs on CRuby (not DragonRuby's bundled runtime).

# macOS (rbenv or mise recommended):
brew install rbenv && rbenv install 3.3.0 && rbenv global 3.3.0

# Then install Solargraph:
gem install solargraph

3. Configure your game project

Inside your game directory (the one containing mygame/):

cd ~/games/my-dragonruby-game
solargraph config

Edit the generated .solargraph.yml to include your app files and the stubs:

include:
  - "mygame/app/**/*.rb"
  - "../dragonruby-yard-doc/*.rb"
exclude:
  - vendor/**/*
require_paths: []
reporters:
  - rubocop
formatter:
  rubocop:
    cops: safe
    except: []
    only: []
    extra_args: []
require: []
domains: []
max_files: 5000

Adjust the relative path to dragonruby-yard-doc if your directory layout differs.

Editor Integration

VS Code

Install the Solargraph extension.

Add to .vscode/settings.json:

{
  "solargraph.useBundler": false,
  "solargraph.formatting": true,
  "solargraph.diagnostics": true
}

Neovim (Mason / nvim-lspconfig)

:MasonInstall solargraph

Or with nvim-lspconfig:

require('lspconfig').solargraph.setup({
  settings = {
    solargraph = {
      diagnostics = true,
      formatting  = true
    }
  }
})

Zed

Add to your Zed settings.json:

{
  "lsp": {
    "solargraph": {
      "initialization_options": {
        "diagnostics": true,
        "formatting": true
      }
    }
  }
}

Emacs (lsp-mode)

(use-package lsp-mode
  :hook (ruby-mode . lsp)
  :commands lsp)

Sublime Text

Install the LSP and LSP-solargraph packages, then add to your Ruby syntax settings:

{
  "lsp_format_on_save": true
}

What's Documented

The stubs cover the full DragonRuby API surface:

FileCovers
args.rbargs object — state, inputs, outputs, audio, gtk, grid
outputs.rbargs.outputs — sprites, solids, labels, lines, borders, primitives, sounds
outputs_array.rbArray-form primitive shortcuts
inputs.rbargs.inputs — unified directional, last_active, touch
keyboard.rbargs.inputs.keyboard — key_down/held/up, all keys
controller.rbargs.inputs.controller_one through controller_four
geometry.rbGeometry.* — intersect, distance, angle, vector, transform methods
easing.rbEasing.* — ease, smooth_start/stop, spline
layout.rbLayout.* — rect, point, rect_group, portrait?/landscape?
numeric.rbNumeric extensions — lerp, clamp, remap, frame_index, elapsed?, vector_x/y
gtk.rbargs.gtk — file I/O, HTTP, window, cursor, platform?, serialize_state
globals.rbGlobal helpers — Kernel.tick_count, GTK.reset, etc.
constants.rbEngine constants
phantom_types.rbType definitions used internally by the stubs
toplevel.rbTop-level tick, boot, shutdown signatures

Tips

  • Re-run solargraph config if you add new require paths or restructure your project.
  • If autocomplete stops working after a DragonRuby update, git pull the stubs repo — the community keeps them updated.
  • The stubs are for editor tooling only; they are never loaded by DragonRuby at runtime.
  • Add .solargraph.yml to .gitignore if team members use different editor setups, or commit it if everyone uses Solargraph. See the .gitignore section in /dragonruby for a complete template.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

dragonruby-rendering

No summary provided by upstream source.

Repository SourceNeeds Review
General

dragonruby-audio

No summary provided by upstream source.

Repository SourceNeeds Review
General

dragonruby-ui

No summary provided by upstream source.

Repository SourceNeeds Review