agentleFS
vibesurf-aivibesurf-ai/claude-surf/skills/file/SKILL.md

file

Skill24 starsChanged 11 months agoMITView on GitHub

Use when user asks to upload files, download files, list uploaded files, or manage file storage in VibeSurf. Handles file operations including upload, download, and file listing. Does NOT include delete operations.

  • Sends data out

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Tip: Use absolute path when you know the exact file location, as it's more reliable.

    line 179
  2. Distinctive:

    All file paths are validated for security (must be within workspace)

    line 183

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

File - File Upload and Management

Overview

Manage file uploads and downloads in VibeSurf. Upload files to workspace directories, download files by ID or path, and list uploaded files.

When to Use

  • User wants to upload files to VibeSurf
  • User wants to download files from VibeSurf
  • User wants to list uploaded files
  • User wants to browse session files
  • User needs to manage file storage

API Endpoints

Base path: $VIBESURF_ENDPOINT/api/files

ActionMethodEndpointDescription
Upload FilesPOST/api/files/uploadUpload files to workspace
Download FileGET/api/files/download?file_id={id}Download file by ID or path
List FilesGET/api/filesList all uploaded files
List Session FilesGET/api/files/session/{session_id}List files in a session directory

Request Examples

Upload Files

curl -X POST "$VIBESURF_ENDPOINT/api/files/upload" \
  -F "files=@/path/to/file1.pdf" \
  -F "files=@/path/to/file2.jpg" \
  -F "session_id=optional-session-id"

Response:

{
  "message": "Successfully uploaded 2 files",
  "files": [
    {
      "file_id": "uuid-string",
      "original_filename": "file1.pdf",
      "stored_filename": "file1.pdf",
      "session_id": null,
      "file_size": 12345,
      "mime_type": "application/pdf",
      "upload_time": "2026-02-08T12:00:00",
      "file_path": "/path/to/file"
    }
  ],
  "upload_directory": "/workspace/sessions/upload_files"
}

Download File by ID

curl -X GET "$VIBESURF_ENDPOINT/api/files/download?file_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -o downloaded_file.pdf

Download File by Path (Absolute or Relative)

Using absolute path (preferred for direct file access):

curl -X GET "$VIBESURF_ENDPOINT/api/files/download?file_path=/workspace/sessions/upload_files/myfile.pdf" \
  -o downloaded_file.pdf

Using relative path from workspace:

curl -X GET "$VIBESURF_ENDPOINT/api/files/download?file_path=sessions/upload_files/myfile.pdf" \
  -o downloaded_file.pdf

List Uploaded Files

# List all files
curl -X GET "$VIBESURF_ENDPOINT/api/files"

# List with pagination
curl -X GET "$VIBESURF_ENDPOINT/api/files?limit=10&offset=0"

# List files for specific session
curl -X GET "$VIBESURF_ENDPOINT/api/files?session_id=optional-session-id"

Response:

{
  "files": [
    {
      "file_id": "uuid-string",
      "original_filename": "document.pdf",
      "stored_filename": "document.pdf",
      "session_id": null,
      "file_size": 12345,
      "mime_type": "application/pdf",
      "upload_time": "2026-02-08T12:00:00",
      "file_path": "/workspace/sessions/upload_files/document.pdf"
    }
  ],
  "total_count": 1,
  "limit": 100,
  "offset": 0,
  "has_more": false,
  "session_id": null
}

List Session Files

# List all files in a session directory
curl -X GET "$VIBESURF_ENDPOINT/api/files/session/{session_id}"

# Include directories
curl -X GET "$VIBESURF_ENDPOINT/api/files/session/{session_id}?include_directories=true"

Response:

{
  "session_id": "session-uuid",
  "files": [
    {
      "name": "document.pdf",
      "path": "document.pdf",
      "size": 12345,
      "mime_type": "application/pdf",
      "modified_time": "2026-02-08T12:00:00",
      "type": "file"
    }
  ],
  "directories": [],
  "total_files": 1,
  "total_directories": 0
}

File Upload Behavior

  • Files are stored in workspace upload_files directory
  • Duplicate filenames are automatically renamed (e.g., file_1.pdf, file_2.pdf)
  • File metadata is stored in the database
  • Session-specific files are stored in sessions/{session_id}/upload_files

Query Parameters

List Files Query

ParameterTypeDefaultDescription
session_idstringnullFilter by session ID
limitinteger100Number of results (-1 for all)
offsetinteger0Pagination offset

Session Files Query

ParameterTypeDefaultDescription
include_directoriesbooleanfalseInclude directories in response

Download Options

Either file_id or file_path must be provided:

  • file_id: UUID of the uploaded file (uses database lookup)
  • file_path: Absolute path (e.g., /workspace/sessions/upload_files/file.pdf) or relative path (e.g., sessions/upload_files/file.pdf)

Tip: Use absolute path when you know the exact file location, as it's more reliable.

Important Notes

  • All file paths are validated for security (must be within workspace)
  • Large file uploads may take time depending on network
  • File download returns the file with original filename and correct MIME type
  • Session files endpoint walks the entire session directory recursively

Error Handling

ErrorCauseSolution
400 Bad RequestMissing file_id or file_path in downloadProvide either parameter
403 ForbiddenFile path outside workspaceUse valid file path
404 Not FoundFile not foundCheck file_id or file_path
500 Internal ErrorFile system or database errorRetry or check logs

Workflow

  1. Upload files → POST /api/files/upload
  2. Get file_id from upload response
  3. List files to verify (optional) → GET /api/files
  4. Download file → GET /api/files/download?file_id={id}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.