clash-auto-switch

> Clash 代理自动切换 Skill for OpenClaw

3,891 stars

Best use case

clash-auto-switch is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

> Clash 代理自动切换 Skill for OpenClaw

Teams using clash-auto-switch should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/clash-auto-switch/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/adminlove520/clash-auto-switch/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/clash-auto-switch/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How clash-auto-switch Compares

Feature / Agentclash-auto-switchStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

> Clash 代理自动切换 Skill for OpenClaw

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# clash-auto-switch

> Clash 代理自动切换 Skill for OpenClaw

自动检测代理健康状态并在故障时自动切换到最佳节点。

## 配置

首次使用需要配置 Clash API:

```bash
# 设置 API 地址和密钥
/clash config set --api http://127.0.0.1:58871 --secret 你的密钥
```

或通过环境变量:
- `CLASH_API`: Clash API 地址
- `CLASH_SECRET`: API 密钥
- `CLASH_PROXY`: 代理地址 (默认: http://127.0.0.1:7890)

## 功能

### 健康检查

检查当前代理是否正常工作:

```
/clash health
```

返回示例:
```
✓ 代理健康 (3/3)
- Telegram: OK
- Google: OK
- Anthropic: OK
```

### 列出节点

查看所有代理组和可用节点:

```
/clash list
```

### 自动切换

自动检测并切换到最佳节点:

```
/clash auto
```

逻辑:
1. 测试 Telegram / Google / Anthropic 连通性
2. 如果不健康,遍历所有节点
3. 测试延迟,优先选择新加坡/日本/香港/美国节点
4. 切换到最佳节点

### 手动切换

切换到指定节点:

```
/clash switch ChatGPT 新加坡-优化-Gemini-GPT
```

### 区域切换

快速切换到指定区域:

```
/clash sg    # 切换到新加坡
/clash us    # 切换到美国
/clash jp    # 切换到日本
/clash hk    # 切换到香港
```

### 状态查询

查看当前代理状态:

```
/clash status
```

## 在 Cron 中使用

添加到 cron job 实现定时健康检查:

```json
{
  "name": "clash-health-check",
  "schedule": {
    "kind": "every",
    "everyMs": 900000
  },
  "payload": {
    "kind": "agentTurn",
    "message": "/clash auto"
  },
  "sessionTarget": "isolated"
}
```

## 在 Heartbeat 中使用

在 heartbeat 中添加健康检查:

```
# 在 HEARTBEAT.md 中添加
/clash health
```

## 支持的代理组

- ChatGPT
- Copilot
- GLOBAL
- Netflix
- Steam
- Telegram
- TikTok
- Twitter
- WhatsApp
- 境内使用
- 海外使用
- 节点选择
- 谷歌服务
- 微软服务
- 苹果服务

## 示例对话

**用户**: 检查代理状态  
**小溪**: 调用 `/clash health` → 返回健康度

**用户**: 代理好像很慢  
**小溪**: 调用 `/clash auto` → 自动切换到最佳节点

**用户**: 切换到新加坡节点  
**小溪**: 调用 `/clash sg` → 切换完成

## 实现原理

1. 调用 Clash API (`/proxies`) 获取所有代理组
2. 对每个 Selector 类型的代理组执行健康检查
3. 如果不健康,测试所有节点延迟
4. 优先选择优先区域的节点
5. 调用 Clash API (`/proxies/{group}`) 切换节点

Related Skills

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

n8n Workflow Mastery — Complete Automation Engineering System

3891
from openclaw/skills

You are an expert n8n workflow architect. You design, build, debug, optimize, and scale n8n automations following production-grade methodology. Every workflow you create is complete, functional, and follows the patterns in this guide.

Workflow & Productivity

Insurance Operations Automation

3891
from openclaw/skills

Comprehensive insurance operations framework for AI agents. Covers the full insurance lifecycle — underwriting, claims, policy management, renewals, compliance, and broker operations.

Workflow & Productivity

afrexai-business-automation

3891
from openclaw/skills

Turn your AI agent into a business automation architect. Design, document, implement, and monitor automated workflows across sales, ops, finance, HR, and support — no n8n or Zapier required.

Workflow & Productivity

Business Automation Strategy — AfrexAI

3891
from openclaw/skills

> The complete methodology for identifying, designing, building, and scaling business automations. Platform-agnostic — works with n8n, Zapier, Make, Power Automate, custom code, or any combination.

Auto Repair Shop Operations

3891
from openclaw/skills

Complete operational reference for independent auto repair shops. Covers labor rates, parts markup, ASE certification, EPA compliance, diagnostic workflows, flat rate times, KPIs, technician compensation, equipment costs, and growth playbook from solo shop to multi-location.

AI Automation Agency Blueprint

3891
from openclaw/skills

You are an AI Automation Agency strategist. Help the user build, price, sell, and scale an AI agent services business — from solo consultant to 7-figure agency. Every recommendation must be specific, actionable, and backed by real economics.

Business Strategy & Growth

Accounts Payable Automation Framework

3891
from openclaw/skills

You are an AP process optimizer. When the user describes their payable workflows, vendor relationships, or payment processes, generate a complete accounts payable management framework.

Workflow & Productivity

agent-autopilot

3891
from openclaw/skills

Self-driving agent workflow with heartbeat-driven task execution, day/night progress reports, and long-term memory consolidation. Integrates with todo-management for task tracking.

Workflow & Productivity

n8n-workflow-automation

3891
from openclaw/skills

Designs and outputs n8n workflow JSON with robust triggers, idempotency, error handling, logging, retries, and human-in-the-loop review queues. Use when you need an auditable automation that won’t silently fail.

Workflow & Productivity

autoresearch-pro

3891
from openclaw/skills

Automatically improve OpenClaw skills, prompts, or articles through iterative mutation-testing loops. Inspired by Karpathy's autoresearch. Use when user says 'optimize [skill]', 'autoresearch [skill]', 'improve my skill', 'optimize this prompt', 'improve my prompt', 'polish this article', 'improve this article', or explicitly requests quality improvement for any text-based content. Supports three modes: skill (SKILL.md files), prompt (any prompt text), and article (any document).

Workflow & Productivity

auto-respawn

3891
from openclaw/skills

Your agent always comes back. Anchor identity and memory on-chain so any new instance can resurrect from just an address — no local state, no single point of failure. Permanent identity and recovery on the Autonomys Network.

Agent Orchestration & Management