Cache and reuse code from prior AI agent executions via Raysurfer. Search before coding, upload after success.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install raysurfer或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install raysurfer⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/raysurfer/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: raysurfer description: "Cache and reuse code from prior AI agent executions via Raysurfer. Search before coding, upload after success." argument-hint: "[search query or \"upload\"]" allowed-tools: - Bash - Read - Write - Edit - Grep - Glob ---
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.
https://api.raysurfer.comRAYSURFER_API_KEY environment variableContent-Type: application/jsonFollow this sequence for every coding task:
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:
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.When a good cache hit is found:
source field from the best matching code_block.When no suitable cache hit exists:
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.
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.
/raysurfer parse CSV and generate chart), run Step 1 with that query as the task.upload (e.g., /raysurfer upload), run Step 4 for the most recently generated code in the conversation.When $ARGUMENTS is provided, use it as: $ARGUMENTS
Ready-to-run scripts are in this skill's directory. Requires RAYSURFER_API_KEY to be set.
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"
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
RAYSURFER_API_KEY is set before making API calls. If unset, inform the user and skip cache operations.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").| Action | Endpoint | Method | |--------|----------|--------| | Search cache | /api/retrieve/search | POST | | Upload code | /api/store/execution-result | POST | | Vote on code | /api/store/cache-usage | POST |
See references/api-reference.md for full request and response schemas.
安装 Raysurfer Code Caching 后,可以对 AI 说这些话来触发它
Help me get started with Raysurfer Code Caching
Explains what Raysurfer Code Caching does, walks through the setup, and runs a quick demo based on your current project
Use Raysurfer Code Caching to cache and reuse code from prior AI agent executions via Raysurfer
Invokes Raysurfer Code Caching with the right parameters and returns the result directly in the conversation
What can I do with Raysurfer Code Caching in my developer & devops workflow?
Lists the top use cases for Raysurfer Code Caching, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/raysurfer/ 目录(个人级,所有项目可用),或 .claude/skills/raysurfer/(项目级)。重启 AI 客户端后,用 /raysurfer 主动调用,或让 AI 根据上下文自动发现并使用。
Raysurfer Code Caching 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Raysurfer Code Caching 可免费安装使用。请查阅仓库了解许可证信息。
Cache and reuse code from prior AI agent executions via Raysurfer. Search before coding, upload after success.
Raysurfer Code Caching 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Raysurfer Code Caching
Identifies repetitive steps in your workflow and sets up Raysurfer Code Caching to handle them automatically