Mirror Optimizer logo

Mirror Optimizer

Community
huangwb8
mirror-optimizer

当用户明确要求优化镜像源、配置国内镜像、加速部署或切换依赖源时使用。分析项目技术栈并生成适配的镜像配置。⚠️ 不适用:用户只是询问镜像源概念、无需部署加速,或明确要求使用官方源。

Overview

Publisherhuangwb8
Repositoryskills
Skill namemirror-optimizer
Stars
50
Forks
8
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by huangwb8 on GitHub. Read the source before you install it.

Installation

Install the Mirror Optimizer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/huangwb8/skills/tree/main/skills/alpha/awesome-code/agents/mirror-optimizer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huangwb8/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/alpha/awesome-code/agents/mirror-optimizer .claude/skills/mirror-optimizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mirror Optimizer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mirror Optimizer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mirror Optimizer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Mirror Optimizer - 镜像源优化代理

铁律

NO DEPLOYMENT WITHOUT MIRROR CONFIGURATION FIRST

任何涉及依赖下载的部署任务,必须先确认并优化镜像源配置,否则在国内环境下部署将极慢或失败。

核心理念

智能适配,透明可逆。根据项目技术栈自动识别需要配置的镜像源类型,生成标准化的配置文件,同时保持官方源兼容性,支持一键切换。

何时使用

  • 项目包含 Dockerfile、docker-compose.yml 或 .dockerignore
  • 项目包含 requirements.txt、pyproject.toml、Pipfile、setup.py、setup.cfg 或 poetry.lock
  • 项目包含 package.json、yarn.lock、pnpm-lock.yaml 或 package-lock.json
  • 项目包含 go.mod、go.sum、Gopkg.lock 或 Gopkg.toml
  • 项目包含 pom.xml、build.gradle、build.gradle.kts 或 settings.gradle
  • 项目包含 Gemfile、gems.rb 或 Cargo.toml
  • 用户明确要求"配置国内镜像"、"加速部署"、"切换镜像源"
  • 部署过程中出现依赖下载超时或失败

输入

  • 必需:项目根目录路径
  • 可选:目标部署区域(默认:中国大陆)

输出

  • 检测报告:识别出的包管理器类型和当前配置状态
  • 配置文件:为每个包管理器生成的镜像源配置
  • Dockerfile 优化建议(如适用)
  • 使用说明:如何应用配置和验证效果
  • 跳过清单:未生成的包管理器与原因(记录在报告中)

支持的镜像源类型

类型检测文件配置输出国内镜像源
DockerDockerfile, docker-compose.yml, .dockerignoreDockerfile.mirror阿里云、腾讯云
Python/piprequirements.txt, pyproject.tomlpip.conf清华、阿里云、中科大
Node.js/npmpackage.json, package-lock.json.npmrc淘宝、腾讯云
Node.js/yarnyarn.lock.yarnrc.yml淘宝、腾讯云
Go Modulesgo.mod, go.sumgo.env阿里云、腾讯云
Java/Mavenpom.xmlsettings.xml阿里云、腾讯云
Java/Gradlebuild.gradle*, settings.gradle*init.gradle阿里云、腾讯云
Ruby/BundlerGemfile, gems.rbconfig淘宝、腾讯云
Rust/CargoCargo.tomlconfig.toml清华、中科大

工作流

  1. 项目扫描

    • 使用硬编码脚本扫描项目根目录
    • 识别所有包管理器标记文件
    • 检查现有镜像源配置
  2. 智能分析

    • 根据检测文件确定需要配置的镜像源类型
    • 分析现有 Dockerfile 是否包含镜像源优化
    • 评估当前配置的潜在问题
  3. 配置生成

    • 为每个识别的包管理器生成标准化配置
    • 创建 Dockerfile.mirror 优化版本(如适用)
    • 生成 .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/mirror-optimizer/output/ 目录存放所有配置文件
  4. 文档输出

    • 生成 MIRROR_OPTIMIZATION_REPORT.md 报告
    • 包含配置说明、使用方法、验证命令
    • 提供切换回官方源的指南
  5. 验证检查

    • 提供验证命令测试镜像源连通性
    • 确认配置文件格式正确
    • 建议测试下载速度

配置文件结构

输出目录以 config.yaml:mirror_optimization.output_dir 为准,以下以默认 .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/mirror-optimizer/output/ 为例。

.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/mirror-optimizer/output/
├── docker/
│   ├── Dockerfile.mirror        # 优化的 Dockerfile
├── python/
│   └── pip.conf                 # pip 配置
├── nodejs/
│   ├── .npmrc                   # npm 配置
│   └── .yarnrc.yml              # yarn 配置
├── golang/
│   └── go.env                   # Go Modules 配置
├── java/
│   ├── maven/
│   │   └── settings.xml          # Maven 配置
│   └── gradle/
│       └── init.gradle           # Gradle 配置
└── MIRROR_OPTIMIZATION_REPORT.md

质量门槛

  • 完整性:检测到所有相关包管理器
  • 正确性:生成的配置文件格式正确
  • 兼容性:配置与官方源兼容,可一键切换
  • 透明性:配置有清晰注释说明用途
  • 可验证性:提供验证命令测试效果

国内镜像源推荐

类型推荐源URL
Docker阿里云https://registry.cn-hangzhou.aliyuncs.com
Docker腾讯云https://mirror.ccs.tencentyun.com
Python清华https://pypi.tuna.tsinghua.edu.cn/simple
Python阿里云https://mirrors.aliyun.com/pypi/simple/
Node.js淘宝https://registry.npmmirror.com
Go阿里云https://mirrors.aliyun.com/goproxy/
Go腾讯云https://mirrors.tencent.com/go/
Java/Maven阿里云https://maven.aliyun.com/repository/public
Ruby淘宝https://gems.ruby-china.com
Rust清华https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git

安全注意事项

  • 只使用知名云服务商的镜像源
  • 验证镜像源的 HTTPS 证书
  • 定期检查镜像源可用性
  • 生产环境建议配置镜像源备份

相关参考

约束

公共硬约束

本块由 docs/templates/skill-common-constraints.md 统一维护;每个 SKILL.md 的 ## 约束 必须逐字同步本块,不得在副本中改写公共规则。

  • 任务需要落盘时,使用唯一的 ./.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/ 根目录;共享材料放入 shared/,Skill 专属材料放入该 Skill 的 input/、output/、log/。
  • 正式交付物、源代码和正式计划按项目约定保存,不写入任务工作区;未经授权不覆盖、删除、迁移或远程写入。
  • 项目维护变更检查 BAC 可用性并记录需求、AI 产出、工具结果、文件改动和验证摘要;BAC 只做过程审计,不替代署名、责任或合规判断。
  • 不记录 API Key、访问令牌、密码、Cookie、环境/凭据文件、私有 Prompt、身份信息、本地用户名、主机名或不必要的大体积原始数据。
  • 文件路径必须规范化并限制在授权项目范围内;外部 URL、子进程和网络访问遵循最小权限,防止路径遍历、SSRF 和命令注入。
  • Skill 版本唯一记录在自身 config.yaml:skill_info.version;公开 API、协议、目录或配置变更同步文档与 CHANGELOG.md。
  • bensz-collect-bugs 是一个 Agent Skill;仅将 Bensz Agent Skill 或 Bensz 基础设施本身的设计缺陷交给它。先脱敏写入 ~/.bensz-skills/bugs/,当前任务不中断,只有用户明确要求才公开上报,禁止直接修改用户已安装的 Skill 源码。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Mirror Optimizer AI skill do?

当用户明确要求优化镜像源、配置国内镜像、加速部署或切换依赖源时使用。分析项目技术栈并生成适配的镜像配置。⚠️ 不适用:用户只是询问镜像源概念、无需部署加速,或明确要求使用官方源。

Why use Mirror Optimizer on TypingMind?

Because you install it once and use it with any model. Mirror Optimizer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mirror Optimizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huangwb8/skills/tree/main/skills/alpha/awesome-code/agents/mirror-optimizer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Mirror Optimizer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mirror Optimizer?

As many as you like. As long as a model supports skills, you can use Mirror Optimizer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mirror Optimizer AI skill free?

Yes. It is published on GitHub by huangwb8 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇