agentleFS
vibesurf-aivibesurf-ai/claude-surf/CLAUDE.md

claude-surf

CLAUDE.md24 starsChanged 11 months agoMITView on GitHub

Claude-Surf is a Claude Code plugin that integrates with VibeSurf, exposing browser automation, AI skills, workflows, and external app integrations through a pure markdown skill system. Key Dependency: VibeSurf server must be running on http://127.0.0.1:9335 for this plugin to function. This plugin follows the superpowers architecture pattern: surf - Main entry point, automatically injected via SessionStart hook - Provides navigation to all other skills - Contains VibeSurf API documentation - No manual invocation needed All other 13 skills are loaded…

  • Commits and pushes

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

22 rules. About 0 are common, 17 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No manual invocation needed

    line 59
  2. Distinctive:

    All other 13 skills are loaded via the Skill tool when needed:

    line 63
  3. Distinctive:

    Start with "Use when..."

    line 90
  4. Very specific:

    If running: Injects surf skill content to context

    line 172
  5. Distinctive:

    If not running: Displays warning with installation instructions

    line 173
  6. Very specific:

    Fallback pattern: If browser-use fails → use get_browser_state → browser.{action} → repeat loop

    line 202
  7. Distinctive:

    Use for: Complex tasks, form filling, multi-site research, data extraction

    line 221
  8. Very specific:

    Fallback when it fails: Use browser skill with get_browser_state → browser.{action} → repeat loop

    line 225
  9. Distinctive:

    CRITICAL: Read the status from SessionStart hook FIRST (shown at top of surf skill)

    line 253
  10. Distinctive:

    Test: Ask Claude to search web, navigate browser, etc.

    line 276
  11. Very specific:

    Update relevant skills/*/SKILL.md - affects Claude's behavior

    line 294
  12. Distinctive:

    Update README.md - user-facing documentation

    line 295
  13. Distinctive:

    Keep skill descriptions consistent with actual VibeSurf API

    line 296
  14. Distinctive:

    Test with Claude Code to verify skill loading

    line 297
  15. Distinctive:

    When making changes that should be released:

    line 303
  16. Distinctive:

    ⚠️ IMPORTANT: Never commit without updating the version if the changes affect functionality or documentation that users rely on.

    line 324
  17. Distinctive:

    Before executing unknown actions:

    line 345
  18. Very specific:

    Search for action: GET /api/tool/search?keyword=...

    line 346
  19. Distinctive:

    When user makes a browser/automation request:

    line 352
  20. Distinctive:

    Use Skill tool to load that skill

    line 355
  21. Distinctive:

    Follow skill's guidance to call VibeSurf API

    line 356
  22. Distinctive:

    Complementary relationship: - not mutually exclusive:

    line 360

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md 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
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Claude-Surf is a Claude Code plugin that integrates with VibeSurf, exposing browser automation, AI skills, workflows, and external app integrations through a pure markdown skill system.

Key Dependency: VibeSurf server must be running on http://127.0.0.1:9335 for this plugin to function.

Architecture

Superpowers-Inspired Design

This plugin follows the superpowers architecture pattern:

  • No build system - Pure markdown skills, no compilation
  • Hook-based injection - SessionStart injects skill content
  • Frontmatter-driven - description field defines triggers
  • Direct API access - Claude calls VibeSurf HTTP API directly

Project Structure

claude-surf/
├── .claude-plugin/
│   ├── plugin.json          # Plugin metadata
│   └── marketplace.json     # Marketplace configuration
├── hooks/
│   ├── hooks.json           # Hook configuration
│   ├── session-start.sh     # Health check + skill injection
│   └── run-hook.cmd         # Cross-platform wrapper
├── skills/
│   ├── surf/                # Main entry skill (auto-injected)
│   ├── search/              # AI web search
│   ├── fetch/               # Fetch URL content as markdown
│   ├── js_code/             # Structured data extraction
│   ├── crawl/               # Page content extraction
│   ├── summary/             # Page summarization
│   ├── finance/             # Stock data
│   ├── trend/               # Trending news
│   ├── screenshot/          # Screenshots
│   ├── browser/             # Direct browser control (21 actions)
│   ├── browser-use/         # AI multi-step automation
│   ├── website-api/         # Platform APIs (XiaoHongShu/etc)
│   ├── workflows/           # Pre-built workflows
│   └── integrations/        # External apps (Gmail/GitHub/etc)
├── README.md
└── CLAUDE.md

Skill System

Auto-Injected Skill

surf - Main entry point, automatically injected via SessionStart hook

  • Provides navigation to all other skills
  • Contains VibeSurf API documentation
  • No manual invocation needed

On-Demand Skills

All other 13 skills are loaded via the Skill tool when needed:

  • search - AI web search
  • fetch - Fetch URL content as structured markdown
  • js_code - Extract structured data with auto-generated JS
  • crawl - Extract page content
  • summary - Summarize webpages
  • finance - Stock data from Yahoo Finance
  • trend - Trending news
  • screenshot - Page screenshots
  • browser - Direct browser control
  • browser-use - AI multi-step automation
  • website-api - Social platform APIs
  • workflows - Pre-built automations
  • integrations - Gmail/GitHub/Slack/etc

Skill Frontmatter

Each SKILL.md file has YAML frontmatter:

---
name: skill-name
description: Use when [triggering conditions and symptoms]
---

Critical: The description field determines when Claude loads the skill. It should:

  • Start with "Use when..."
  • Describe triggering conditions, NOT workflow
  • Include specific symptoms and examples

VibeSurf API

VibeSurf exposes three core HTTP endpoints at http://127.0.0.1:9335:

1. List Available Actions

GET /api/tool/search?keyword={optional_keyword}

Returns all available VibeSurf actions.

2. Get Action Parameters

GET /api/tool/{action_name}/params

Returns JSON schema for the action's parameters.

3. Execute Action

POST /api/tool/execute
Content-Type: application/json

{
  "action_name": "action_name_here",
  "parameters": {
    // action-specific parameters
  }
}

Standard Workflow

  1. Discover actions → GET /api/tool/search
  2. Get parameters → GET /api/tool/{action_name}/params
  3. Execute → POST /api/tool/execute

Plugin Configuration

Claude Code Plugin Structure

.claude-plugin/plugin.json - Plugin metadata

{
  "name": "surf",
  "description": "VibeSurf integration - Control browsers, automate workflows...",
  "version": "1.0.0"
}

.claude-plugin/marketplace.json - Marketplace configuration

{
  "name": "claude-surf",
  "plugins": [{
    "name": "surf",
    "source": "./"
  }]
}

hooks/hooks.json - SessionStart hook configuration

{
  "hooks": {
    "SessionStart": [{
      "matcher": "startup|resume|clear|compact",
      "hooks": [{
        "type": "command",
        "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh"
      }]
    }]
  }
}

Health Check Hook

hooks/session-start.sh - Runs on session start:

  1. Checks if VibeSurf is running (curl http://127.0.0.1:9335/health)
  2. If running: Injects surf skill content to context
  3. If not running: Displays warning with installation instructions

Non-blocking: Hook timeout is 3 seconds, won't prevent session start.

Skill Reference

AI Skills (8)

SkillActionPurpose
searchskill_searchAI-powered web search (Gemini)
fetchskill_fetchFetch URL content as structured markdown
js_codeskill_codeAuto-generate JS to extract lists/tables
crawlskill_crawlExtract page content with LLM
summaryskill_summarySummarize webpage
financeskill_financeStock data from Yahoo Finance
trendskill_trendTrending news from NewsNow
screenshotskill_screenshotTake screenshots

Browser Skills (2)

SkillActionsPurpose
browser21 actions (browser.*)Precise step-by-step control (navigate, click, input, etc.)
browser-useexecute_browser_use_agentTask-oriented sub-agent automation

Note: These two skills are complementary, not mutually exclusive. Both can accomplish the same tasks:

  • browser-use: High-level, describe goal + desired output, agent figures out steps
  • browser: Low-level, explicit control over each action
  • Fallback pattern: If browser-use fails → use get_browser_state → browser.{action} → repeat loop

Integration Skills (3)

SkillActionsPurpose
website-api2 actionsXiaoHongShu, Weibo, Zhihu, Douyin, YouTube
workflows2 actionsPre-built automation sequences
integrations4 actionsGmail, GitHub, Slack, 100+ apps

Important VibeSurf Actions

Browser-Use Agent (Task-Oriented Sub-Agent)

Action: execute_browser_use_agent

Launches autonomous AI agents for task-oriented automation:

  • Supports parallel execution (unique tab_id per agent)
  • Task-oriented: describe goal + desired output, agent figures out steps
  • Use for: Complex tasks, form filling, multi-site research, data extraction

When to use: Complex tasks where describing the goal is easier than specifying steps

Fallback when it fails: Use browser skill with get_browser_state → browser.{action} → repeat loop

Browser Actions (Precise Control)

All browser.* actions for step-by-step manual control:

  • browser.navigate - Go to URL
  • browser.click - Click element
  • browser.input - Type text
  • browser.switch - Switch tabs
  • browser.extract - LLM data extraction
  • browser.screenshot - Take screenshot
  • get_browser_state - Inspect current page state
  • And 15 more...

Use for: Any browser task where you want explicit control, or as fallback when browser-use fails

Extra Tools (Composio/MCP)

  • get_all_toolkit_types - List available apps
  • search_tool - Find tools in toolkit
  • get_tool_info - Get tool schema
  • execute_extra_tool - Run app action

Important: VibeSurf Execution Policy

CRITICAL: Claude Code must NEVER run the vibesurf command or attempt to install/start VibeSurf.

Policy

  • CRITICAL: Read the status from SessionStart hook FIRST (shown at top of surf skill)
    • Format: <SURF_SKILLS>**VibeSurf Integration** - Status: running/not_running
    • DO NOT IGNORE THIS STATUS - it's already been checked
  • NEVER execute: vibesurf, uv tool install vibesurf, or similar commands
  • IF Status: not_running: Inform user to start VibeSurf manually, DO NOT run commands
  • Manual re-check (only if needed): curl http://127.0.0.1:9335/health

Why?

  • VibeSurf is a long-running service that users manage
  • It may require specific configurations or environments
  • Auto-starting could interfere with user's workflow

Testing the Plugin

Local Testing Workflow

  1. User starts VibeSurf: vibesurf (user does this, not Claude)
  2. Install plugin:
    /plugin marketplace add ./
    /plugin install surf
  3. Restart Claude Code
  4. Test: Ask Claude to search web, navigate browser, etc.

Verifying VibeSurf Connection

# Check if VibeSurf is running
curl http://127.0.0.1:9335/health

# List all available actions
curl http://127.0.0.1:9335/api/tool/search

# Get parameters for specific action
curl http://127.0.0.1:9335/api/tool/skill_search/params

Documentation Sync

When modifying functionality:

  1. Update relevant skills/*/SKILL.md - affects Claude's behavior
  2. Update README.md - user-facing documentation
  3. Keep skill descriptions consistent with actual VibeSurf API
  4. Test with Claude Code to verify skill loading

Release Process

CRITICAL: Always update version before committing and pushing

When making changes that should be released:

  1. Update version in .claude-plugin/plugin.json:
    {
      "version": "X.Y.Z"
    }
  2. Version numbering:
    • Major (X): Breaking changes, major new features
    • Minor (Y): New features, backward compatible
    • Patch (Z): Bug fixes, documentation updates
  3. Then commit and push:
    git add .
    git commit -m "..."
    git push

⚠️ IMPORTANT: Never commit without updating the version if the changes affect functionality or documentation that users rely on.

Key Design Patterns

Error Handling

VibeSurf returns structured responses:

{
  "success": boolean,
  "result": any,
  "extracted_content": string,
  "long_term_memory": string,
  "attachments": string[]
}

Handle errors by checking success field and result for error messages.

Action Discovery Pattern

Before executing unknown actions:

  1. Search for action: GET /api/tool/search?keyword=...
  2. Get parameters: GET /api/tool/{action}/params
  3. Build request: POST /api/tool/execute

Skill Decision Making

When user makes a browser/automation request:

  1. Consult surf skill (already in context)
  2. surf skill points to appropriate specialized skill
  3. Use Skill tool to load that skill
  4. Follow skill's guidance to call VibeSurf API

Browser vs Browser-Use Pattern

Complementary relationship - not mutually exclusive:

ApproachCharacteristicsBest For
browser-useHigh-level, task-oriented sub-agentComplex tasks, describe goal + output
browserLow-level, step-by-step controlPrecise control, fallback mechanism
HybridBest reliabilityTry browser-use first, fallback to browser if needed

Fallback workflow when browser-use fails:

1. get_browser_state    → Inspect page state and available elements
2. browser.{action}     → Perform specific action
3. get_browser_state    → Verify result and plan next step
4. Repeat until complete

Selection principle: Choose based on task complexity and control needs, NOT step count. Both can handle multi-step workflows and form filling.

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.