截屏2026-09-16 19.59.44.jpg

即刻开用

Profiles4limbo 基础配置

#  ------------------------------------------------------------------
#  Mihomo / Clash Meta 进阶定制配置文件 (Profiles4limbo)
#  ------------------------------------------------------------------
#  【核心架构与功能】
#  1. 基础网络:开启 TUN 模式(System 栈)、严格路由、以太网自动路由与 DNS 劫持,默认绑定 7890 混合端口。
#  2. 智能 DNS:采用 ARC 缓存算法与 Fake-IP 增强模式,整合本地规则直连过滤与多上游并发加密解析。
#  3. 节点分流:基于正则自动识别地区(美/日/港/台),提供 Fallback 顺位故障切换与动态延迟检测。
#  4. 规则路由:精确区分 AI 平台(OpenAI / Claude / Gemini 独立分流)、主流流媒体、谷歌/苹果/微软服务、Adobe 破解与广告拦截。
#  ------------------------------------------------------------------

📱支持的 Mihomo / Clash 客户端核心矩阵:

平台 兼容客户端名称
桌面端 (Win / Mac / Linux) Clash Verge Rev、Clash Nyanpasu、FlClash
移动端 (Android) Clash Meta for Android (CMFA)、FlClash
iOS / iPadOS 端 Clash Mi、Stash

📬联系我们 🌐毒奶博客 🔍毒奶搜索

Profiles4limbo.yaml 内容大致如下:使用到了 https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash 下的分流规则,像配置 iOS 各类代理软件一样,非常巴适!简单好上手。大家可以自己改配置模板,改成自己喜欢的样子!

查看 Profiles4limbo.yaml 大致代码

#  ------------------------------------------------------------------
#  Mihomo / Clash Meta 进阶定制配置文件 (Profiles4limbo)
#  ------------------------------------------------------------------
#  【核心架构与功能】
#  1. 基础网络:开启 TUN 模式(System 栈)、严格路由、以太网自动路由与 DNS 劫持,默认绑定 7890 混合端口。
#  2. 智能 DNS:采用 ARC 缓存算法与 Fake-IP 增强模式,整合本地规则直连过滤与多上游并发加密解析。
#  3. 节点分流:基于正则自动识别地区(美/日/港/台),提供 Fallback 顺位故障切换与动态延迟检测。
#  4. 规则路由:精确区分 AI 平台(OpenAI / Claude / Gemini 独立分流)、主流流媒体、谷歌/苹果/微软服务、Adobe 破解与广告拦截。
#  ------------------------------------------------------------------

# --- 节点定义(请在此处添加或替换为你的节点/订阅) ---
proxies:
  - name: 🇨🇳 直连 
    type: direct

# --- 全局基础设置 ---
mixed-port: 7890
allow-lan: true
ipv6: true
mode: rule
log-level: info
bind-address: "*"
unified-delay: true
tcp-concurrent: true
keep-alive-interval: 60
find-process-mode: strict
external-controller: 127.0.0.1:9090
external-ui: ui
external-ui-url: https://github.com/Zephyruso/zashboard/releases/latest/download/dist.zip

profile:
  store-selected: true
  store-fake-ip: true

# --- DNS 配置 ---
dns:
  enable: true
  ipv6: true
  use-hosts: true
  cache-algorithm: arc
  use-system-hosts: true
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/15
  fake-ip-range6: 2001:2::1/48
  fake-ip-filter:
    - rule-set:local_rules
  proxy-server-nameserver:
    - https://223.5.5.5/dns-query#DIRECT
    - https://1.12.12.12/dns-query#DIRECT
    - https://114.114.114.114/dns-query#DIRECT
  default-nameserver:
    - https://223.5.5.5/dns-query#DIRECT
    - https://1.12.12.12/dns-query#DIRECT
    - https://114.114.114.114/dns-query#DIRECT
  nameserver:
    - https://cloudflare-dns.com/dns-query#✈️ 机场专线
    - https://dns.google/dns-query#✈️ 机场专线
  nameserver-policy:
    geosite:cn:
      - system
      - 223.5.5.5#DIRECT
      - 119.29.29.29#DIRECT
  direct-nameserver:
    - system
    - 223.5.5.5#DIRECT
    - 119.29.29.29#DIRECT

hosts:
  cloudflare-dns.com:
    - 1.1.1.1
    - 1.0.0.1
  dns.google:
    - 8.8.8.8
    - 8.8.4.4
  services.googleapis.cn: services.googleapis.com
  +.mcdn.bilivideo.com:
    - 0.0.0.0
  +.mcdn.bilivideo.cn:
    - 0.0.0.0
  +.edge.mountaintoys.cn:
    - 0.0.0.0
  +.h2.smtcdns.net:
    - 0.0.0.0

ntp:
  enable: true
  write-to-system: false
  server: ntp.aliyun.com
  port: 123
  interval: 60

tun:
  enable: true
  stack: system
  auto-route: true
  strict-route: true
  auto-redirect: true
  auto-detect-interface: true
  dns-hijack:
    - any:53
    - tcp://any:53

# --- 规则集定义 ---
rule-providers:
  adobecc:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Profiles4limbo/main/adobecc.list
    path: ./ruleset/adobecc.list
  adblock4limbo_surge:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Adblock4limbo/refs/heads/main/rule/Surge/Adblock4limbo_surge.list
    path: ./ruleset/adblock4limbo_surge.list
  advertising_lite:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/AdvertisingLite/AdvertisingLite.list
    path: ./ruleset/advertising_lite.list
  easylistchina_surge:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Adblock4limbo/refs/heads/main/rule/Surge/easylistchina_surge.list
    path: ./ruleset/easylistchina_surge.list
  easylist_surge:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Adblock4limbo/refs/heads/main/rule/Surge/easylist_surge.list
    path: ./ruleset/easylist_surge.list
  airports:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Profiles4limbo/main/airports.list
    path: ./ruleset/airports.list
  dmm:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/DMM/DMM.list
    path: ./ruleset/dmm.list
  netflix:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Netflix/Netflix.list
    path: ./ruleset/netflix.list
  youtube:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/YouTube/YouTube.list
    path: ./ruleset/youtube.list
  youtubemusic:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/YouTubeMusic/YouTubeMusic.list
    path: ./ruleset/youtubemusic.list
  disney:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Disney/Disney.list
    path: ./ruleset/disney.list
  hbo:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/HBO/HBO.list
    path: ./ruleset/hbo.list
  primevideo:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PrimeVideo/PrimeVideo.list
    path: ./ruleset/primevideo.list
  appletv:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/AppleTV/AppleTV.list
    path: ./ruleset/appletv.list
  hulu:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Hulu/Hulu.list
    path: ./ruleset/hulu.list
  tiktok:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/TikTok/TikTok.list
    path: ./ruleset/tiktok.list
  spotify:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Spotify/Spotify.list
    path: ./ruleset/spotify.list
  bilibiliintl:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/BiliBiliIntl/BiliBiliIntl.list
    path: ./ruleset/bilibiliintl.list
  bahamut:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Bahamut/Bahamut.list
    path: ./ruleset/bahamut.list
  google_service:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Google/Google.list
    path: ./ruleset/google_service.list
  apple_all:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Surge/Apple/Apple_All.list
    path: ./ruleset/apple_all.list
  apple_service:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Apple/Apple.list
    path: ./ruleset/apple_service.list
  microsoft_service:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Microsoft/Microsoft.list
    path: ./ruleset/microsoft_service.list
  openai:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/OpenAI/OpenAI.list
    path: ./ruleset/openai.list
  claude:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Claude/Claude.list
    path: ./ruleset/claude.list
  gemini:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Gemini/Gemini.list
    path: ./ruleset/gemini.list
  local_rules:
    type: http
    behavior: classical
    interval: 86400
    format: text
    url: https://raw.githubusercontent.com/limbopro/Profiles/master/limbopro/Local.list
    path: ./ruleset/local_rules.list

# --- 策略组定义 ---
proxy-groups:
  - name: 🛑 广告拦截
    type: select
    proxies:
      - REJECT
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Advertising.png

  - name: ☠️ AdobeCrack
    type: select
    proxies:
      - REJECT
      - DIRECT
      - ♻️ 故障切换
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Reject.png

  - name: ♻️ 故障切换
    type: fallback
    url: http://www.gstatic.com/generate_204
    interval: 60
    timeout: 3000
    include-all: true
    exclude-type: DIRECT
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Auto.png

  - name: ✈️ 机场专线
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Airport.png

  - name: 🍎 苹果服务
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Apple.png

  - name: Ⓜ️ 微软服务
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Microsoft.png

  - name: 🐞 谷歌服务
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Google_Search.png


  # --- 独立拆分的 AI 平台策略组 ---

  - name: 🤖 Gemini
    type: select
    proxies:
      - 🐞 谷歌服务
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://raw.githubusercontent.com/lige47/lige_icon/refs/heads/main/icon/04ProxySoft/gemini.png

  - name: 🤖 OpenAI
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/ChatGPT.png

  - name: 🤖 Claude
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|UnitedStates|US"
    icon: https://raw.githubusercontent.com/lige47/lige_icon/refs/heads/main/icon/04ProxySoft/claude.png

  # -----------------------------

  - name: 🇯🇵 DMM
    type: select
    proxies:
      - 🇯🇵 日本节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)日本|Japan|JP"

  - name: 🇦 Apple tv
    type: select
    proxies:
      - 🍎 苹果服务
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    filter: "(?i)美国|USA|新加坡|SG|Singapore|香港|HongKong|台湾|Taiwan"

  - name: 🇩 Disney+
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Disney.png

  - name: 🇭 HBO
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/HBO.png

  - name: 🇭 Hulu
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true

  - name: 🇳 Netflix
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Netflix.png

  - name: 🇵 PrimeVideo
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true

  - name: 🇾 YouTube
    type: select
    proxies:
      - 🐞 谷歌服务
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/YouTube.png

  - name: 🇹 TikTok
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true

  - name: 🇸 Spotify
    type: select
    proxies:
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Spotify.png

  - name: 🐱 哔哩哔哩台湾
    type: select
    proxies:
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    filter: "(?i)台|Taiwan|TW"     # 通过正则精准过滤出所有的台湾单节点并自动展开
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Bahamut.png


  - name: 🐽 巴哈姆特
    type: select
    proxies:
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
    filter: "(?i)台|Taiwan|TW"     # 通过正则精准过滤出所有的台湾单节点并自动展开
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Bahamut.png

  - name: 🇺🇸 美国节点
    type: select
    filter: (?i)(美国|USA|US|🇺🇸)
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/United_States.png

  - name: 🇯🇵 日本节点
    type: select
    filter: (?i)(日本|JP|Japan|JPAN|🇯🇵)
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Japan.png

  - name: 🇭🇰 香港节点
    type: select
    filter: (?i)(香港|HK|HongKong|Hong|🇭🇰)
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Hong_Kong.png

  - name: 🇨🇳 台湾节点
    type: select
    filter: (?i)(台湾|TW|Taiwan|TAIWAN|TaiWan|🇨🇳)
    include-all: true
    icon: https://fastly.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Taiwan.png

  - name: 🐟 final
    type: select
    proxies:
      - ✈️ 机场专线
      - 🇺🇸 美国节点
      - 🇯🇵 日本节点
      - 🇭🇰 香港节点
      - 🇨🇳 台湾节点
      - ♻️ 故障切换
      - DIRECT
      - REJECT

# --- 路由规则 ---
rules:
  - RULE-SET,adobecc,☠️ AdobeCrack
  - RULE-SET,adblock4limbo_surge,🛑 广告拦截
  - RULE-SET,advertising_lite,🛑 广告拦截
  - RULE-SET,easylistchina_surge,🛑 广告拦截
  - RULE-SET,easylist_surge,🛑 广告拦截
  - RULE-SET,airports,✈️ 机场专线
  - RULE-SET,dmm,🇯🇵 DMM
  - RULE-SET,netflix,🇳 Netflix
  - RULE-SET,youtube,🇾 YouTube
  - RULE-SET,youtubemusic,🇾 YouTube
  - RULE-SET,disney,🇩 Disney+
  - RULE-SET,hbo,🇭 HBO
  - RULE-SET,primevideo,🇵 PrimeVideo
  - RULE-SET,appletv,🇦 Apple tv
  - RULE-SET,hulu,🇭 Hulu
  - RULE-SET,tiktok,🇹 TikTok
  - RULE-SET,spotify,🇸 Spotify
  - RULE-SET,bilibiliintl,🐱 哔哩哔哩台湾
  - RULE-SET,bahamut,🐽 巴哈姆特
  - RULE-SET,google_service,🐞 谷歌服务
  - RULE-SET,apple_all,🍎 苹果服务
  - RULE-SET,apple_service,🍎 苹果服务
  - RULE-SET,microsoft_service,Ⓜ️ 微软服务
  # --- 独立的 AI 平台分流规则(保留 Gemini,移除 Bard) ---
  - RULE-SET,openai,🤖 OpenAI
  - RULE-SET,claude,🤖 Claude
  - RULE-SET,gemini,🤖 Gemini
  # -----------------------------
  - RULE-SET,local_rules,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,🐟 final

新手就是爱记录📝

IMG_1809.PNG

源自今早收到的一条网友消息,代码✍️基本上是Gemini完成的。

以下是 Gemini 的记录,

01. 问题的起点:从一个具体痛点出发

在日常代理节点的管理中,如何将第三方订阅源中的节点高效合并到自己精心调教的配置中,一直是高频需求。然而,市面上的工具往往采用“固定模板”或“强耦合”的设计,导致用户无法自主控制个性化的策略组与规则。

为了彻底解决这一痛点,我决定利用 AI 作为架构师首席程序员,从第一性原理出发,从零打造一款基础配置文件与节点订阅完全解耦、兼具极致交互体验的纯前端 Mihomo / Clash 节点合并追加工具


02. 第一性原理拆解与 AI 协作机制

与传统的“提示词直接要代码”不同,高效利用 AI 搞定复杂项目的关键在于将 AI 视为思维伙伴(Thought Partner),遵循以下递进式协作步骤:

1. 结构化 Prompt 约束

为避免 AI 产生幻觉或写出不可用的代码片段,在交互前设定了严格的系统约束:

  • 核心原则:第一性原理拆解、客观严谨、拒绝对问题进行无意义的赞美或谄媚。
  • 技术规范:优先使用现代化、无依赖的轻量库(如单文件原生 JS + Tailwind CSS + js-yaml),实现零后端、纯前端离线解析,确保完全解耦与数据隐私安全。

2. 问题的本质分解

在撰写与优化代码前,我要求 AI 对整个项目的核心链路进行深度推演:

  • 解耦架构层:如何让“基础配置文件”与“节点订阅”两端完全独立?用户既可以自主通过本地上传或 URL 拉取自定义基础配置(包含专属策略组与规则),又可以独立加载待追加的节点订阅,互不干涉。
  • 异步解析与去重层:如何利用 Web Worker 在后台安全解析 YAML,并以节点名称(name)作为唯一标识自动去重,避免阻塞 UI 主线程?

03. 演进与攻防:从解耦架构到极致交互的迭代

整个工具的打磨经历了从“核心架构解耦”到“前端交互边界攻防”的 3 个关键阶段:

阶段 1:确立“基础配置与节点解耦”的核心架构

在架构初期,抛弃了传统的固定模板思路,确立了双模块 UI:

  • 左侧(Base Config):用户自主导入或上传自己的基础配置文件,工具绝不强行覆写或破坏用户自定义的 proxy-groupsrules
  • 右侧(Provider Config):纯粹作为“节点仓库”,工具仅提取其中的 proxies 数组,在合并时精准追加到基础配置文件的末尾。

阶段 2:Web Worker 异步优化与跨域攻防

引入了 Web Worker 技术,将复杂的 YAML 解析与同名节点去重逻辑移出主线程;同时增加了可选的跨域代理开关(CORS Proxy)与标准的 User-Agent 伪装,完美解决远程拉取时的浏览器阻断问题。


04. 项目收益与人机协作心得

通过这套“AI 架构推演 + 编写代码,人负责边界判断与工程裁决”的模式,项目获得了以下成果:

  • 真正的配置自由:彻底实现了基础配置与节点订阅的完全解耦,用户可以随时更换、定制属于自己的个性化主模板。
  • 极致的安全与鲁棒性:纯前端离线运行,无任何数据保留风险;多线程异步解析。

AI 赋能开发的核心法则

  1. 先做第一性原理拆解,再写代码:不要盲目索取大段代码,先让 AI 梳理逻辑链路与解耦边界。
  2. 及时迭代与重构:从早期的单一思路逐步演进为当前的“完全解耦 + 极致交互”,人类开发者的核心价值在于精准定义演进方向,驱动 AI 持续完成架构与细节的完美闭环。

以上。

最后修改:2026 年 09 月 17 日 12 : 48 AM