DE

debugging-output-and-previewing-html-using-ray

Sends data logs and UI visualizations to the Ray desktop application for easier debugging and inspection.

Install

mkdir -p .claude/skills/debugging-output-and-previewing-html-using-ray && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2807" && unzip -o skill.zip -d .claude/skills/debugging-output-and-previewing-html-using-ray && rm skill.zip

Installs to .claude/skills/debugging-output-and-previewing-html-using-ray

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when user says "send to Ray," "show in Ray," "debug in Ray," "log to Ray," "display in Ray," or wants to visualize data, debug output, or show diagrams in the Ray desktop application.
187 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Pushes structured logs to Ray app
  • Displays data visualizations
  • Previews HTML/UI components
  • Sends state snapshots to desktop
  • Links local code to visual feedback

How it works

It sends POST requests to the local Ray server at port 23517 with structured JSON payloads representing logs or UI content.

Inputs & outputs

You give it
Debug data or UI content
You get back
Visualized content in Ray window

When to use debugging-output-and-previewing-html-using-ray

  • Send debug logs to Ray
  • Visualize array data in Ray
  • Preview UI component HTML in Ray
  • Debug production data in local desktop app

About this skill

Ray Skill

Overview

Ray is Spatie's desktop debugging application for developers. Send data directly to Ray by making HTTP requests to its local server.

This can be useful for debugging applications, or to preview design, logos, or other visual content.

This is what the ray() PHP function does under the hood.

Connection Details

SettingDefaultEnvironment Variable
HostlocalhostRAY_HOST
Port23517RAY_PORT
URLhttp://localhost:23517/-

Request Format

Method: POST Content-Type: application/json User-Agent: Ray 1.0

Basic Request Structure

{
  "uuid": "unique-identifier-for-this-ray-instance",
  "payloads": [
    {
      "type": "log",
      "content": { },
      "origin": {
        "file": "/path/to/file.php",
        "line_number": 42,
        "hostname": "my-machine"
      }
    }
  ],
  "meta": {
    "ray_package_version": "1.0.0"
  }
}

Fields

FieldTypeDescription
uuidstringUnique identifier for this Ray instance. Reuse the same UUID to update an existing entry.
payloadsarrayArray of payload objects to send
metaobjectOptional metadata (ray_package_version, project_name, php_version)

Origin Object

Every payload includes origin information:

{
  "file": "/Users/dev/project/app/Controller.php",
  "line_number": 42,
  "hostname": "dev-machine"
}

Payload Types

Log (Send Values)

{
  "type": "log",
  "content": {
    "values": ["Hello World", 42, {"key": "value"}]
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Custom (HTML/Text Content)

{
  "type": "custom",
  "content": {
    "content": "<h1>HTML Content</h1><p>With formatting</p>",
    "label": "My Label"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Table

{
  "type": "table",
  "content": {
    "values": {"name": "John", "email": "[email protected]", "age": 30},
    "label": "User Data"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Color

Set the color of the preceding log entry:

{
  "type": "color",
  "content": {
    "color": "green"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Available colors: green, orange, red, purple, blue, gray

Screen Color

Set the background color of the screen:

{
  "type": "screen_color",
  "content": {
    "color": "green"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Label

Add a label to the entry:

{
  "type": "label",
  "content": {
    "label": "Important"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Size

Set the size of the entry:

{
  "type": "size",
  "content": {
    "size": "lg"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Available sizes: sm, lg

Notify (Desktop Notification)

{
  "type": "notify",
  "content": {
    "value": "Task completed!"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

New Screen

{
  "type": "new_screen",
  "content": {
    "name": "Debug Session"
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

Measure (Timing)

{
  "type": "measure",
  "content": {
    "name": "my-timer",
    "is_new_timer": true,
    "total_time": 0,
    "time_since_last_call": 0,
    "max_memory_usage_during_total_time": 0,
    "max_memory_usage_since_last_call": 0
  },
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}

For subsequent measurements, set is_new_timer: false and provide actual timing values.

Simple Payloads (No Content)

These payloads only need a type and empty content:

{
  "type": "separator",
  "content": {},
  "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
}
TypePurpose
separatorAdd visual divider
clear_allClear all entries
hideHide this entry
removeRemove this entry
confettiShow confetti animation
show_appBring Ray to foreground
hide_appHide Ray window

Combining Multiple Payloads

Send multiple payloads in one request. Use the same uuid to apply modifiers (color, label, size) to a log entry:

{
  "uuid": "abc-123",
  "payloads": [
    {
      "type": "log",
      "content": { "values": ["Important message"] },
      "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
    },
    {
      "type": "color",
      "content": { "color": "red" },
      "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
    },
    {
      "type": "label",
      "content": { "label": "ERROR" },
      "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
    },
    {
      "type": "size",
      "content": { "size": "lg" },
      "origin": { "file": "test.php", "line_number": 1, "hostname": "localhost" }
    }
  ],
  "meta": {}
}

Example: Complete Request

Send a green, labeled log message:

curl -X POST http://localhost:23517/ \
  -H "Content-Type: application/json" \
  -H "User-Agent: Ray 1.0" \
  -d '{
    "uuid": "my-unique-id-123",
    "payloads": [
      {
        "type": "log",
        "content": {
          "values": ["User logged in", {"user_id": 42, "name": "John"}]
        },
        "origin": {
          "file": "/app/AuthController.php",
          "line_number": 55,
          "hostname": "dev-server"
        }
      },
      {
        "type": "color",
        "content": { "color": "green" },
        "origin": { "file": "/app/AuthController.php", "line_number": 55, "hostname": "dev-server" }
      },
      {
        "type": "label",
        "content": { "label": "Auth" },
        "origin": { "file": "/app/AuthController.php", "line_number": 55, "hostname": "dev-server" }
      }
    ],
    "meta": {
      "project_name": "my-app"
    }
  }'

Availability Check

Before sending data, you can check if Ray is running:

GET http://localhost:23517/_availability_check

Ray responds with HTTP 404 when available (the endpoint doesn't exist, but the server is running).

Getting Ray Information

Get Windows

Retrieve information about all open Ray windows:

GET http://localhost:23517/windows

Returns an array of window objects with their IDs and names:

[
  {"id": 1, "name": "Window 1"},
  {"id": 2, "name": "Debug Session"}
]

Get Theme Colors

Retrieve the current theme colors being used by Ray:

GET http://localhost:23517/theme

Returns the theme information including color palette:

{
  "name": "Dark",
  "colors": {
    "primary": "#000000",
    "secondary": "#1a1a1a",
    "accent": "#3b82f6"
  }
}

Use Case: When sending custom HTML content to Ray, use these theme colors to ensure your content matches Ray's current theme and looks visually integrated.

Example: Send HTML with matching colors:


# First, get the theme

THEME=$(curl -s http://localhost:23517/theme)
PRIMARY_COLOR=$(echo $THEME | jq -r '.colors.primary')

# Then send HTML using those colors

curl -X POST http://localhost:23517/ \
  -H "Content-Type: application/json" \
  -d '{
    "uuid": "theme-matched-html",
    "payloads": [{
      "type": "custom",
      "content": {
        "content": "<div style=\"background: '"$PRIMARY_COLOR"'; padding: 20px;\"><h1>Themed Content</h1></div>",
        "label": "Themed HTML"
      },
      "origin": {"file": "script.sh", "line_number": 1, "hostname": "localhost"}
    }]
  }'

Payload Type Reference

TypeContent FieldsPurpose
logvalues (array)Send values to Ray
customcontent, labelHTML or text content
tablevalues, labelDisplay as table
colorcolorSet entry color
screen_colorcolorSet screen background
labellabelAdd label to entry
sizesizeSet entry size (sm/lg)
notifyvalueDesktop notification
new_screennameCreate new screen
measurename, is_new_timer, timing fieldsPerformance timing
separator(empty)Visual divider
clear_all(empty)Clear all entries
hide(empty)Hide entry
remove(empty)Remove entry
confetti(empty)Confetti animation
show_app(empty)Show Ray window
hide_app(empty)Hide Ray window

When not to use it

  • Non-desktop environments
  • Projects restricted from making local network calls

Prerequisites

Ray desktop application

Limitations

  • Requires local network access to localhost
  • Only works if Ray is actively running

How it compares

It offloads visual debugging to a dedicated desktop app instead of using chat or standard console output.

Compared to similar skills

debugging-output-and-previewing-html-using-ray side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
debugging-output-and-previewing-html-using-ray (this skill)26moReviewBeginner
ray-skill16moReviewBeginner
tensorboard17moReviewBeginner
token-data-sources05moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

ray-skill

freekmurze

Use when user says "send to Ray," "show in Ray," "debug in Ray," "log to Ray," "display in Ray," or wants to visualize data, debug output, or show diagrams in the Ray desktop application.

11

tensorboard

davila7

Visualize training metrics, debug models with histograms, compare experiments, visualize model graphs, and profile performance with TensorBoard - Google's ML visualization toolkit

10

token-data-sources

justinchuby

When debugging why the analysis page shows missing or zero token data, or when adding new cost/usage visualizations.

00

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,0441,947

streamlit

sverzijl

When working with Streamlit web apps, data dashboards, ML/AI app UIs, interactive Python visualizations, or building data science applications with Python

86239

python-testing-patterns

wshobson

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

77204

Search skills

Search the agent skills registry