# Send Raysurfer Code Caching to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "raysurfer",
    "name": "Raysurfer Code Caching",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/ryx2/raysurfer",
    "canonicalUrl": "https://clawhub.ai/ryx2/raysurfer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/raysurfer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=raysurfer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "references/api-reference.md",
      "search.py",
      "search.sh",
      "search.ts"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "raysurfer",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T21:35:05.723Z",
      "expiresAt": "2026-05-14T21:35:05.723Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=raysurfer",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=raysurfer",
        "contentDisposition": "attachment; filename=\"raysurfer-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "raysurfer"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/raysurfer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/raysurfer",
    "downloadUrl": "https://openagent3.xyz/downloads/raysurfer",
    "agentUrl": "https://openagent3.xyz/skills/raysurfer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/raysurfer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/raysurfer/agent.md"
  }
}
```
## Documentation

### Raysurfer Code Caching Skill

You have access to Raysurfer, a code caching system that stores and retrieves code from prior AI agent executions. Always check the cache before writing new code and upload successful results afterward.

### Environment

API Base URL: https://api.raysurfer.com
Auth: Bearer token via the RAYSURFER_API_KEY environment variable
All API calls use Content-Type: application/json

### Workflow

Follow this sequence for every coding task:

### Step 1: Search the Cache

Before writing any code, search for existing cached solutions.

To also include community public snippets (crawled from GitHub), add the X-Raysurfer-Public-Snips: true header.

curl -s -X POST https://api.raysurfer.com/api/retrieve/search \\
  -H "Authorization: Bearer $RAYSURFER_API_KEY" \\
  -H "Content-Type: application/json" \\
  -H "X-Raysurfer-Public-Snips: true" \\
  -d '{"task": "<describe the task here>", "top_k": 5, "min_verdict_score": 0.3}'

The response contains:

{
  "matches": [
    {
      "code_block": {
        "id": "uuid",
        "name": "descriptive name",
        "description": "what this code does",
        "source": "the actual code content",
        "language": "python"
      },
      "combined_score": 0.85,
      "filename": "suggested_filename.py",
      "thumbs_up": 12,
      "thumbs_down": 1
    }
  ],
  "total_found": 3,
  "cache_hit": true
}

Decision logic:

If total_found > 0 and the top match has combined_score >= 0.7 and a favorable vote ratio (thumbs_up > thumbs_down), use the cached code.
If matches exist but scores are low, use them as a starting point and adapt.
If no matches, generate the code from scratch.

### Step 2a: Use Cached Code (Cache Hit)

When a good cache hit is found:

Extract the source field from the best matching code_block.
Write it to the appropriate file(s).
Adapt paths, variable names, or configuration to the current project if needed.
Run the code to verify it works.
Proceed to Step 3 (Vote).

### Step 2b: Generate Code (Cache Miss)

When no suitable cache hit exists:

Write the code as you normally would.
Run the code to verify it works.
Proceed to Step 4 (Upload).

### Step 3: Vote on Cached Code

After using cached code, report whether it worked:

curl -s -X POST https://api.raysurfer.com/api/store/cache-usage \\
  -H "Authorization: Bearer $RAYSURFER_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{"code_block_id": "<id from the match>", "code_block_name": "<name from the match>", "code_block_description": "<description from the match>", "succeeded": true, "task": "<the task description>"}'

Set succeeded to true if the code ran correctly, false if it failed or needed significant changes.

### Step 4: Upload New Code

After successfully generating and running new code (cache miss), upload it for future reuse:

curl -s -X POST https://api.raysurfer.com/api/store/execution-result \\
  -H "Authorization: Bearer $RAYSURFER_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "task": "<describe what this code does>",
    "file_written": {"path": "relative/path/to/file.py", "content": "<full file content>"},
    "succeeded": true
  }'

Only upload code that executed successfully. AI voting is enabled by default.

### Handling Arguments

If invoked with a search query (e.g., /raysurfer parse CSV and generate chart), run Step 1 with that query as the task.
If invoked with upload (e.g., /raysurfer upload), run Step 4 for the most recently generated code in the conversation.
If invoked with no arguments, display a summary of the workflow and ask what the user wants to do.

When $ARGUMENTS is provided, use it as: $ARGUMENTS

### Runnable Scripts

Ready-to-run scripts are in this skill's directory. Requires RAYSURFER_API_KEY to be set.

### Search

python search.py "Parse a CSV and plot a chart"
bun search.ts "Parse a CSV and plot a chart"
bash search.sh "Parse a CSV and plot a chart"

### Upload

python upload.py "Generate a bar chart" chart.py
bun upload.ts "Generate a bar chart" chart.py
bash upload.sh "Generate a bar chart" chart.py

### Guidelines

Always verify RAYSURFER_API_KEY is set before making API calls. If unset, inform the user and skip cache operations.
Write descriptive task strings that capture what the code does, not how it does it (e.g., "Parse CSV file and generate a bar chart with matplotlib" rather than "run pandas read_csv and plt.bar").
Never hardcode API keys in any command or file.
If the API is unreachable, proceed with normal code generation without blocking the user.
Keep uploaded code self-contained when possible so it is maximally reusable.

### Quick Reference

ActionEndpointMethodSearch cache/api/retrieve/searchPOSTUpload code/api/store/execution-resultPOSTVote on code/api/store/cache-usagePOST

See references/api-reference.md for full request and response schemas.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: ryx2
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T21:35:05.723Z
- Expires at: 2026-05-14T21:35:05.723Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/raysurfer)
- [Send to Agent page](https://openagent3.xyz/skills/raysurfer/agent)
- [JSON manifest](https://openagent3.xyz/skills/raysurfer/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/raysurfer/agent.md)
- [Download page](https://openagent3.xyz/downloads/raysurfer)