Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Cache Reuse Prior Agent Code

ASecurity

Cache and reuse code from prior AI agent executions via Raysurfer. Search before coding, upload after success.

19 stars
0 votes
0 copies
1 views
Added 9/19/2026
ai-agentspythongobashgitapi

Works with

api

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add rondoflow/rondoflow --skill cache-reuse-prior-agent-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cache Reuse Prior Agent Code?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Cache Reuse Prior Agent Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rondoflow-cache-reuse-prior-agent-code/badge)](https://www.skillsdirectory.com/skills/rondoflow-cache-reuse-prior-agent-code)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: cache-reuse-prior-agent-code
description: "Cache and reuse code from prior AI agent executions via Raysurfer. Search before coding, upload after success."
category: "AI & Agents"
author: community
version: "1.0.0"
icon: bot
---

# 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.

```bash
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:
```json
{
  "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:
1. Extract the `source` field from the best matching `code_block`.
2. Write it to the appropriate file(s).
3. Adapt paths, variable names, or configuration to the current project if needed.
4. Run the code to verify it works.
5. Proceed to Step 3 (Vote).

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

When no suitable cache hit exists:
1. Write the code as you normally would.
2. Run the code to verify it works.
3. Proceed to Step 4 (Upload).

### Step 3: Vote on Cached Code

After using cached code, report whether it worked:

```bash
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:

```bash
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

| 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.

Attribution

rondoflowrondoflow
View sourceMore from rondoflow →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

693161 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →