Agent skill

Ray So Code Snippet

by intellectronica in intellectronica/agent-skills

Generate beautiful code snippet images using ray.so. An agent skill from intellectronica/agent-skills.

CC0-1.0Auto-check passedProductivity & Automation

Install Ray So Code Snippet

skills CLI
$ npx skills add intellectronica/agent-skills --skill ray-so-code-snippet -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install intellectronica/agent-skills ray-so-code-snippet --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/intellectronica/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ray-so-code-snippet .claude/skills/ray-so-code-snippet && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ray-so-code-snippet
GitHub stars
295
Token cost
~3.1k tokens
SKILL.md length
899 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
CC0-1.0

At a glance

Generate beautiful code snippet images using ray.so. An agent skill from intellectronica/agent-skills.

  • Works in 6 steps: Verify agent-browser Availability → Fetch Available Options → Ask User for ALL Parameters → …
  • Asks to create a code image
  • SKILL.md covers Requirements, Workflow, Complete Example and Image Resolution and Quality, plus 1 more section
  • Calls python3 and curl; reaches ray.so and raw.githubusercontent.com

What it does

Ray So Code Snippet is an agent skill from intellectronica/agent-skills. Generate beautiful code snippet images using ray.so. This skill should be used when the user asks to create a code image, code screenshot, code snippet image, or wants to make their code look pretty for sharing. Saves images locally to the current working directory or a user-specified path.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Productivity & Automation, covering Browser automation. The repository describes itself as: @intellectronica's agent skills. The licence is CC0-1.0.

When your agent uses it

  • Asks to create a code image
  • Code screenshot
  • Code snippet image
  • Wants to make their code look pretty for sharing

Example prompts

  • “/ray-so-code-snippet”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Verify agent-browser Availability
  2. Fetch Available Options
  3. Ask User for ALL Parameters
  4. Build the ray.so URL
  5. Capture High-Quality Image with agent-browser
  6. Confirm Output and STOP

What it can do on your machine

Read from SKILL.md and the folder at commit 9b0e00a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • ray.so
    • raw.githubusercontent.com
    • cdn.jsdelivr.net

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ray So Code Snippet loads about 3.1k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 899 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from intellectronica/agent-skills at commit 9b0e00a, republished under its CC0-1.0 licence (© intellectronica). 899 words, ~3,128 tokens.

Download SKILL.mdSave it as .claude/skills/ray-so-code-snippet/SKILL.md (or your agent's skills folder).
name
ray-so-code-snippet
description
Generate beautiful code snippet images using ray.so. This skill should be used when the user asks to create a code image, code screenshot, code snippet image, or wants to make their code look pretty for sharing. Saves images locally to the current working directory or a user-specified path.

ray.so Code Snippet Image Generator

Generate beautiful code snippet images using ray.so and save them locally.

Requirements

  • The user MUST provide the code snippet, either directly or by pointing to a file/selection in context
  • MUST ask the user for ALL styling parameters before generating, presenting ALL available options
  • MUST use agent-browser for screenshot capture (check availability first)

Workflow

Step 1: Verify agent-browser Availability

Before proceeding, verify that agent-browser is available:

bash
which agent-browser

If agent-browser is not found in the PATH, inform the user that this skill requires agent-browser and cannot proceed without it.

Step 2: Fetch Available Options

Fetch the current themes and languages from ray.so's GitHub repository using curl:

bash
# Fetch and parse available themes
curl -s "https://raw.githubusercontent.com/raycast/ray-so/main/app/(navigation)/(code)/store/themes.ts" | grep -oE 'id:\s*"[^"]+"' | sed 's/id:\s*"//;s/"//' | sort -u

# Fetch and parse available languages
curl -s "https://raw.githubusercontent.com/raycast/ray-so/main/app/(navigation)/(code)/util/languages.ts" | grep -oE '^[[:space:]]*"?[a-zA-Z0-9+#-]+"?\s*:\s*\{' | sed 's/[[:space:]]*"//g;s/".*//;s/:.*//' | sort -u
Step 3: Ask User for ALL Parameters

MUST use AskUserQuestion to ask for EVERY parameter, presenting ALL available options. Ask for parameters in this order:

3.1 Theme Selection

Present ALL available themes. In the question, list every theme fetched from step 2. Example:

Question: "Which theme would you like?"
Description: "Available themes: [list ALL themes from curl output]"
Options (pick 4 popular ones for quick select):
- breeze (default, purple gradient)
- midnight (cyan-blue)
- vercel (minimalist dark)
- sunset (warm orange)
Note: User can select "Other" to type any theme from the full list
3.2 Language Selection

Infer the language when possible. Skip this question if:

  • The user explicitly specified a language
  • The code comes from a file with a clear extension (e.g., .py → python, .js → javascript, .ts → typescript, .rs → rust, .go → go, etc.)
  • The syntax is unmistakably identifiable (e.g., def/import → python, func/package → go, fn/let mut → rust)

Only ask this question if the language cannot be confidently inferred:

Question: "Which language for syntax highlighting?"
Description: "Available languages: [list ALL languages from curl output]"
Options:
- auto (auto-detect)
- javascript
- python
- typescript
Note: User can select "Other" to type any language from the full list
3.3 Dark/Light Mode
Question: "Dark or light mode?"
Options:
- Dark mode (default)
- Light mode
3.4 Background
Question: "Show the gradient background?"
Options:
- Yes, show background (default)
- No, transparent/minimal background
3.5 Padding
Question: "How much padding around the code?"
Options:
- 16 (compact)
- 32 (small)
- 64 (medium, default)
- 128 (large)
3.6 Line Numbers
Question: "Show line numbers?"
Options:
- No (default)
- Yes
3.7 Title
Question: "Add a title above the code? (e.g., filename)"
Options:
- No title (default)
- Yes, add title
If yes, ask for the title text.

Note: Do NOT ask about output path/filename. Save to the current working directory with a sensible filename (e.g., rayso-snippet.png, or based on the title if provided like fibonacci.png). Only use a different path if the user explicitly specifies one in their original request.

Step 4: Build the ray.so URL

CRITICAL: ALL parameters must be in the URL hash (after #), NOT in the query string.

Build the URL using shell commands:

bash
# 1. Base64 encode the code
CODE_BASE64=$(echo -n 'YOUR_CODE_HERE' | base64)

# 2. URL encode the base64 string
CODE_ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$CODE_BASE64'))")

# 3. Build the URL with ALL parameters in the hash
# Format: https://ray.so/#param1=value1&param2=value2&code=ENCODED_CODE
# Do NOT include width parameter - let ray.so auto-size to fit content
URL="https://ray.so/#theme=THEME&padding=PADDING&background=BACKGROUND&darkMode=DARKMODE&language=LANGUAGE&code=${CODE_ENCODED}"

# Add optional parameters if needed:
# If lineNumbers: add "&lineNumbers=true" before &code=
# If title: add "&title=URL_ENCODED_TITLE" before &code=

URL Hash Parameters:

ParameterValuesDefault
themeAny theme from listbreeze
padding16, 32, 64, 12864
backgroundtrue, falsetrue
darkModetrue, falsetrue
languageAny language from list, or "auto"auto
lineNumberstrue, falsefalse
titleURL-encoded string(none)
widthNumber (pixels)auto
codeBase64-encoded, then URL-encoded(required)

Note on width: Do NOT include the width parameter unless you specifically need a fixed width. Without it, ray.so auto-sizes the frame to fit the code content, avoiding unnecessary empty space.

Example URL construction:

bash
# For code: for i in range(23):\n    print(i)
# Theme: midnight, Padding: 64, Dark mode: true, Background: true, Language: python, Title: test.py

CODE='for i in range(23):
    print(i)'
CODE_BASE64=$(echo -n "$CODE" | base64)
CODE_ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$CODE_BASE64'))")
TITLE_ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('test.py'))")
URL="https://ray.so/#theme=midnight&padding=64&background=true&darkMode=true&language=python&title=${TITLE_ENCODED}&code=${CODE_ENCODED}"
echo "$URL"
Step 5: Capture High-Quality Image with agent-browser

MUST use agent-browser (verified in Step 1). This approach uses the html-to-image library (same as ray.so's internal export) with high pixelRatio for crisp, sharp text rendering.

IMPORTANT: Always use a unique session name with --session to avoid stale session issues.

bash
# Generate unique session name
SESSION="rayso-$(date +%s)"

# 1. Set viewport
agent-browser --session $SESSION set viewport 1400 900

# 2. Open the URL
agent-browser --session $SESSION open "$URL"

# 3. Wait for the page to fully render
agent-browser --session $SESSION wait --load networkidle
agent-browser --session $SESSION wait 3000

# 4. Load html-to-image library (same library ray.so uses internally)
agent-browser --session $SESSION eval 'new Promise((r,e)=>{const s=document.createElement("script");s.src="https://cdn.jsdelivr.net/npm/html-to-image@1.11.11/dist/html-to-image.js";s.onload=r;s.onerror=e;document.head.appendChild(s)})'

# 5. Capture at 4x resolution using html-to-image (produces crisp text)
agent-browser --session $SESSION eval 'htmlToImage.toPng(document.querySelector("#frame > div"),{pixelRatio:4,skipAutoScale:true})' > /tmp/rayso-dataurl-$SESSION.txt

# 6. Close the browser
agent-browser --session $SESSION close

# 7. Convert data URL to PNG file
DATAURL=$(cat /tmp/rayso-dataurl-$SESSION.txt | tr -d '"' | tr -d '\n')
echo "$DATAURL" | sed 's/data:image\/png;base64,//' | base64 -d > /path/to/output.png

# 8. Clean up temp file
rm /tmp/rayso-dataurl-$SESSION.txt

Critical notes:

  • Uses html-to-image library which is what ray.so uses for its own export feature
  • pixelRatio: 4 produces high-DPI images with crisp, sharp text (4x native resolution)
  • The data URL is captured directly from the library, not from a screenshot
  • No ImageMagick required - pure browser-based rendering at high resolution
  • Output is correctly sized with no extra whitespace
Step 6: Confirm Output and STOP

Report the saved file location to the user. The task is complete - do not perform any additional checks, explorations, or verifications after the screenshot is saved.

Show full SKILL.md (381 more words)Show less

Complete Example

User: "Create a code snippet image of this Python function"

python
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
  1. Check which agent-browser - confirmed available

  2. Fetch themes and languages:

bash
curl -s "https://raw.githubusercontent.com/raycast/ray-so/main/app/(navigation)/(code)/store/themes.ts" | grep -oE 'id:\s*"[^"]+"' | sed 's/id:\s*"//;s/"//' | sort -u
  1. Ask user for parameters via AskUserQuestion:

    • Theme: user selects "midnight"
    • Language: inferred as python from def syntax - not asked
    • Dark mode: user selects "Dark mode"
    • Background: user selects "Yes"
    • Padding: user selects "64"
    • Line numbers: user selects "No"
    • Title: user selects "No title"
  2. Build URL (all params in hash, no width for auto-sizing):

bash
CODE='def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)'
CODE_BASE64=$(echo -n "$CODE" | base64)
CODE_ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$CODE_BASE64'))")
URL="https://ray.so/#theme=midnight&padding=64&background=true&darkMode=true&language=python&code=${CODE_ENCODED}"
  1. Capture high-quality image:
bash
SESSION="rayso-$(date +%s)"

agent-browser --session $SESSION set viewport 1400 900
agent-browser --session $SESSION open "$URL"
agent-browser --session $SESSION wait --load networkidle
agent-browser --session $SESSION wait 3000

# Load html-to-image library
agent-browser --session $SESSION eval 'new Promise((r,e)=>{const s=document.createElement("script");s.src="https://cdn.jsdelivr.net/npm/html-to-image@1.11.11/dist/html-to-image.js";s.onload=r;s.onerror=e;document.head.appendChild(s)})'

# Capture at 4x resolution
agent-browser --session $SESSION eval 'htmlToImage.toPng(document.querySelector("#frame > div"),{pixelRatio:4,skipAutoScale:true})' > /tmp/rayso-dataurl-$SESSION.txt
agent-browser --session $SESSION close

# Save as PNG
DATAURL=$(cat /tmp/rayso-dataurl-$SESSION.txt | tr -d '"' | tr -d '\n')
echo "$DATAURL" | sed 's/data:image\/png;base64,//' | base64 -d > ./fibonacci.png
rm /tmp/rayso-dataurl-$SESSION.txt
  1. Report: "Saved code snippet image to ./fibonacci.png"

Image Resolution and Quality

This skill uses the html-to-image library with pixelRatio: 4 to produce high-quality images with crisp, sharp text. This is the same rendering approach that ray.so uses for its built-in export feature.

Output quality:

  • Default: 4x native resolution (frame auto-sizes to content, then rendered at 4x)
  • Text is rendered at high DPI, not upscaled from low resolution
  • Gradient backgrounds and all CSS styling are preserved
  • No unnecessary empty space (frame auto-sizes to fit code)

Adjusting resolution:

  • For smaller files: Change pixelRatio:4 to pixelRatio:2 in the eval command
  • For maximum quality: Use pixelRatio:6 (same as ray.so's "6x" export option)

Forcing a specific width:

  • Only add &width=NUMBER to the URL if you need a fixed width (e.g., for consistent sizing across multiple images)

Troubleshooting

  • If agent-browser is not available: Inform the user and do not proceed
  • If curl fails to fetch themes/languages, use these common defaults:
    • Themes: breeze, midnight, candy, crimson, falcon, meadow, raindrop, sunset, vercel, supabase, tailwind
    • Languages: auto, javascript, typescript, python, rust, go, java, ruby, swift, kotlin, css, html, json, yaml, bash
  • If parameters aren't applied: Ensure ALL parameters are in the URL hash (after #), not the query string
  • If title isn't showing: The title parameter must be in the hash: #title=filename.py&code=...
  • If html-to-image fails to load: Check network connectivity; the library loads from jsdelivr CDN
  • If capture returns empty: The frame selector #frame > div may have changed; inspect the page structure
  • For very long code snippets, ray.so may truncate; consider splitting into multiple images
  • If the page doesn't load properly, increase the wait time (try 4000ms or more)
  • If you get a blank page: Use a fresh unique session name with --session flag
  • If data URL is malformed: Ensure quotes and newlines are stripped before base64 decoding

© intellectronica, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/ray-so-code-snippet of intellectronica/agent-skills.

Open the folder on GitHubat commit 9b0e00a

Compare with similar skills

Ray So Code Snippet next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ray So Code Snippet compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ray So Code Snippet this skillintellectronica/agent-skills295—~3.1kAutomated safety check: PassCC0-1.0
Agent Browserquran/quran.com-frontend-next1.9k42 repos~3.3kAutomated safety check: PassNone
Dev-Browser CLI AutomationSawyerHood/dev-browser6.7k1 repos~455Automated safety check: PassMIT
Agent Browsersuperagent-ai/grok-cli3.5k1 repos~633Automated safety check: PassMIT
Browser Automationopenclaw/openclaw392k—~2.9kAutomated safety check: PassMIT
Camoufox CLIBin-Huang/camoufox-cli3501 repos~4.5kAutomated safety check: PassMIT

Similar skills

  • Agent Browser

    quran/quran.com-frontend-next

    Automates browser interactions for web testing, form filling, screenshots, and data extraction.

    1.9k GitHub starsUsed in 42 repos~3.3k tokens
    Productivity & AutomationAuto-check passed
  • Dev-Browser CLI Automation

    SawyerHood/dev-browser

    Browser automation with persistent named pages via the dev-browser CLI. Use when users ask to navigate websites, fill forms, take screenshots, extract web…

    6.7k GitHub starsUsed in 1 repo~455 tokens
    Productivity & AutomationAuto-check passed
  • Agent Browser

    superagent-ai/grok-cli

    Use the host-side agent-browser CLI for local browser smoke tests, screenshots, snapshots, and simple UI validation against forwarded localhost URLs.

    3.5k GitHub starsUsed in 1 repo~633 tokens
    Productivity & AutomationAuto-check passed
  • Browser Automation

    openclaw/openclaw

    A skill your agent uses when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

    392k GitHub stars~2.9k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Camoufox CLI

    Bin-Huang/camoufox-cli

    Anti-detect browser automation CLI & Skills for AI agents. An agent skill from Bin-Huang/camoufox-cli.

    350 GitHub starsUsed in 1 repo~4.5k tokens
    Productivity & AutomationAuto-check passed
  • Browser

    VibiumDev/vibium

    Automate browsers with the Vibium CLI. An agent skill from VibiumDev/vibium.

    2.9k GitHub stars~4.8k tokensUpdated today
    Productivity & AutomationAuto-check passed

More from intellectronica/agent-skills

All 21 skills in this repo
  • Beautiful Mermaid

    intellectronica/agent-skills

    Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library.

    295 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Gpt Image 1 5

    intellectronica/agent-skills

    Generate and edit images using OpenAI's GPT Image 1.5 model.

    295 GitHub stars~1.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana 2

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API.

    295 GitHub stars~972 tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana Pro

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API.

    295 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Notion API

    intellectronica/agent-skills

    This skill provides comprehensive instructions for interacting with the Notion API via REST calls.

    295 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Youtube Transcript

    intellectronica/agent-skills

    Extract transcripts from YouTube videos. An agent skill from intellectronica/agent-skills.

    295 GitHub starsUsed in 3 repos~394 tokens
    Auto-check passed

Questions about Ray So Code Snippet

What does Ray So Code Snippet do?

Generate beautiful code snippet images using ray.so. An agent skill from intellectronica/agent-skills. Ray So Code Snippet is an agent skill from intellectronica/agent-skills.so.

When should I use Ray So Code Snippet?

Ray So Code Snippet fits situations like: asks to create a code image; code screenshot; code snippet image; wants to make their code look pretty for sharing.

How do I install Ray So Code Snippet in Claude Code?

Run `npx skills add intellectronica/agent-skills --skill ray-so-code-snippet -a claude-code`. Or copy the skill folder (skills/ray-so-code-snippet in intellectronica/agent-skills) into .claude/skills/ray-so-code-snippet in your project. Claude Code loads it when a task matches its description.

How do I install Ray So Code Snippet in Codex?

Run `npx skills add intellectronica/agent-skills --skill ray-so-code-snippet -a codex`. Or copy the skill folder (skills/ray-so-code-snippet in intellectronica/agent-skills) into .agents/skills/ray-so-code-snippet in your project. Codex loads it when a task matches its description.

Can I use Ray So Code Snippet in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intellectronica/agent-skills --skill ray-so-code-snippet -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ray-so-code-snippet, .gemini/skills/ray-so-code-snippet, .github/skills/ray-so-code-snippet and .opencode/skills/ray-so-code-snippet in your project.

What does Ray So Code Snippet need to run?

Going by SKILL.md and its folder, Ray So Code Snippet needs the command-line tools its instructions call (python3 and curl). Our summary lists: Python 3.

Does Ray So Code Snippet access the network?

SKILL.md names 3 domains. In commands or code: ray.so, raw.githubusercontent.com and cdn.jsdelivr.net; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Ray So Code Snippet safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ray So Code Snippet use?

Ray So Code Snippet is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ray So Code Snippet use?

About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ray So Code Snippet?

Skills that share tags, products or a category with Ray So Code Snippet: Agent Browser (quran/quran.com-frontend-next, 1.9k stars), Dev-Browser CLI Automation (SawyerHood/dev-browser, 6.7k stars), Agent Browser (superagent-ai/grok-cli, 3.5k stars) and Browser Automation (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ray So Code Snippet?

intellectronica (a GitHub user) maintains it in intellectronica/agent-skills, which has 295 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on April 25, 2026.

Source: intellectronica/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.