plugin-replicator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlugin Replicator
Plugin Replicator 插件复制工具
Overview
概述
Primarily a developer machine tool. Use this when you have multiple local projects and want to keep plugin source code in sync between them without manual copying.
It is bidirectional — source and destination are just paths, so it works as both a push (distribute updates outward) and pull (pull latest into a consumer project):
PUSH (run from agent-plugins-skills):
plugins/X -> /other-project/plugins/X
PULL (run from the consumer project):
/agent-plugins-skills/plugins/X -> plugins/XAfter replicating, run Sync in the target project to activate plugins in , , etc.
plugin-maintenance.agent/.claude/.gemini/这是一款主要面向开发者的本地工具。 当你有多个本地项目,希望无需手动复制即可在项目间同步插件源代码时可以使用该工具。
它是双向的——源端和目标端仅为路径,因此既支持推送(向外分发更新)也支持拉取(将最新版本拉取到使用项目中):
PUSH (在agent-plugins-skills目录下运行):
plugins/X -> /other-project/plugins/X
PULL (在使用插件的项目目录下运行):
/agent-plugins-skills/plugins/X -> plugins/X复制完成后,在目标项目中运行 Sync命令,以在、、等目录下激活插件。
plugin-maintenance.agent/.claude/.gemini/References
参考资料
- Overview:
plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_overview.md - Flow diagram:
plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_diagram.mmd
- 概述:
plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_overview.md - 流程图:
plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_diagram.mmd
Modes
运行模式
| Mode | Flag | Behavior |
|---|---|---|
| Additive | (default) | Copies new/updated files only. Nothing deleted from dest. |
| Clean Sync | | Copies new/updated AND removes dest files missing from source. |
| Symlink | | Creates a live symlink — always reflects source. Best for dev. |
| Preview | | Prints what would happen without making changes. |
| 模式 | 参数 | 行为 |
|---|---|---|
| 增量更新 | (默认) | 仅复制新增/更新的文件,不会删除目标路径下的任何内容。 |
| 完全同步 | | 复制新增/更新文件,同时删除源路径中不存在的目标路径文件。 |
| 符号链接 | | 创建实时符号链接——内容始终与源端保持一致,最适合开发场景使用。 |
| 预览 | | 打印预计执行的操作,但不会实际修改任何内容。 |
Execution Protocol
执行流程
CRITICAL: Do not immediately generate bash commands. Operate as an interactive assistant.
重要提示: 不要直接生成bash命令,需作为交互式助手运行。
Phase 1: Guided Discovery
阶段1:引导确认
Ask the user:
- Source: Which plugin(s)? Single plugin or bulk sync of all?
- Destination: What is the absolute path to the target project's folder?
plugins/ - Mode: Additive update (safe default), Clean sync (also removes deleted files), or Symlink (dev)?
- Preview first?: Recommend for the first run.
--dry-run
询问用户以下信息:
- 源端:需要同步哪些插件?单个插件还是批量同步所有插件?
- 目标端:目标项目文件夹的绝对路径是什么?
plugins/ - 运行模式:增量更新(安全默认选项)、完全同步(同时移除已删除文件)还是符号链接(开发场景)?
- 是否先预览?:首次运行推荐使用参数。
--dry-run
Phase 2: Recap-Before-Execute
阶段2:执行前确认
markdown
undefinedmarkdown
undefinedProposed Replication Task
拟执行的复制任务
- Plugin(s): [name or ALL]
- Source: (this repo)
plugins/<name>/ - Destination:
[absolute path] - Mode: [Additive / Clean / Symlink] [DRY RUN?]
Confirm to proceed.
undefined- 插件: [名称或ALL]
- 源路径: (当前仓库)
plugins/<name>/ - 目标路径:
[绝对路径] - 模式: [增量更新 / 完全同步 / 符号链接] [是否试运行?]
请确认后继续执行。
undefinedPhase 3: Command Generation
阶段3:生成命令
Pull: From agent-plugins-skills
into a consumer project (run FROM consumer project)
agent-plugins-skills拉取:从agent-plugins-skills
拉取到使用项目(在使用项目目录下运行)
agent-plugins-skillsbash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
--source /Users/richardfremmerlid/Projects/agent-plugins-skills/plugins/<plugin-name> \
--dest plugins/<plugin-name> \
--cleanbash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
--source /Users/richardfremmerlid/Projects/agent-plugins-skills/plugins/<plugin-name> \
--dest plugins/<plugin-name> \
--cleanPush: From this repo to another project (run FROM this repo)
推送:从当前仓库推送到其他项目(在当前仓库目录下运行)
bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
--source plugins/<plugin-name> \
--dest /path/to/other-project/plugins/<plugin-name>bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
--source plugins/<plugin-name> \
--dest /path/to/other-project/plugins/<plugin-name>Bulk Push: All plugins
批量推送:所有插件
bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
--source plugins/ \
--dest /path/to/other-project/plugins/bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
--source plugins/ \
--dest /path/to/other-project/plugins/Filtered Bulk (e.g., only obsidian-* plugins)
过滤批量推送(例如仅同步obsidian-*开头的插件)
bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
--source plugins/ \
--dest /path/to/other-project/plugins/ \
--filter "obsidian-*" --cleanbash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
--source plugins/ \
--dest /path/to/other-project/plugins/ \
--filter "obsidian-*" --cleanWhen to Use
适用场景
- New project setup: Bulk-replicate all plugins to get started fast.
- Plugin update: Additive sync to push latest changes to a consumer project.
- Removing a skill/file: Run with to propagate deletions.
--clean - Active development: Use to work from source and test in target instantly.
--link
- 新项目初始化:批量复制所有插件,快速启动开发。
- 插件更新:通过增量同步将最新变更推送到使用项目。
- 移除技能/文件:使用参数运行,同步删除操作。
--clean - 活跃开发阶段:使用参数,基于源端开发即可在目标项目即时测试。
--link
Next Actions
后续操作
After replicating, run Sync in the target project to activate the plugins in , , etc.
plugin-maintenance.agent/.claude/.gemini/复制完成后,在目标项目中运行 Sync命令,以在、、等目录下激活插件。
plugin-maintenance.agent/.claude/.gemini/