使用上游示例同步配置

安全地从上游示例刷新参考注释和 URL,而不更改用户正在使用的配置。

j3ffyang
2026年9月20日
0 收藏
58 下载

安装与下载

1 ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install sync-config-with-sample

2 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/
工作区 {'/skills/'}

优先级:工作区 › 全局 › 内置

3 提示词安装

将此提示词复制到 Openclaw 即可自动安装。

请帮我使用 Clawhub 安装 skill-sync-config-with-sample。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

更倾向于下载?

获取包含原生技能文件的ZIP压缩包。

下载技能 (.zip)

基本信息

名称 使用上游示例同步配置
Slug sync-config-with-sample
创建者 j3ffyang
创建时间 2026-09-20 05:31:27
更新时间 2026-09-20 05:31:27
收藏数 0
使用量 58
浏览量 9

安装指南

  1. ClawHub CLI 从源直接安装技能的最快方式。
    npx clawhub@latest install sync-config-with-sample
  2. 手动安装 将技能文件夹复制到以下位置之一
    全局模式
    ~/.openclaw/skills/
    工作区
    /skills/
    优先级:工作区 > 本地 > 内置
  3. 提示词安装 将此提示词复制到 OpenClaw 即可自动安装。
    请帮我使用 Clawhub 安装 sync-config-with-sample。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
    更倾向于下载?
    获取包含原生技能文件的ZIP压缩包。
    下载技能 (.zip)

什么是

这个 Openclaw Skills 工作流会将生产配置文件与最新的上游示例同步,同时保留所有由用户控制的值、绑定、活动块和功能。它将示例视为不可变基线,并通过只复制惰性注释、章节引用和文档 URL,从 diff 中移除参考噪音。
该 skill 使用严格的差异与分类流程,将参考更改与真正的配置差异区分开。在任何编辑之前,都会针对上游提交、文档和已安装软件版本调查有歧义的 hunk,因此它适合安全维护诸如 Hyprland 配置之类的文件。

应用场景

根据新下载的、带日期标记的上游示例刷新设备特定的生产配置。
从配置 diff 中移除过时的 wiki URL 或说明性注释差异。
保留自定义值、按键绑定、活动启动块、环境设置以及新增功能。
判断可疑更改是上游重命名、弃用、拼写错误修复,还是真实的用户配置。
在升级底层应用程序之前,准备干净且可审查的 diff。
将归档的活动配置文件(例如
hyprland.lua.gpd
)与上游示例(例如
hyprland.lua.260917
)一起维护。

工作原理

识别生产文件(通常是带设备后缀的文件,例如 *.gpd)以及最新的带日期上游示例。
声明两个受保护集合:绝不修改示例,也绝不更改生产文件中的实际配置。
运行文件 diff,以暴露生产配置与示例之间的每一处差异。
将每个 diff hunk 分类为 Reference、Config 或 Ambiguous。
将仅涉及参考的注释、标题、措辞和 URL 从示例原样复制到生产文件。
保持配置 hunk 不变,并将其记录为预期保留的差异。
使用示例、上游 GitHub 提交、pull request、issue、文档以及已安装包版本调查有歧义的行。
在更改任何类似配置的有歧义 hunk 之前,请求作出决定。
应用精确、唯一且不与可执行配置代码重叠的编辑。
重新运行 diff,并验证示例未更改、用户配置得以保留,并且只剩合法的配置差异。

配置指南

无需安装软件包。在本地准备这两个文件,并确保标准 diff 工具可用。可选的版本检查需要相关应用程序的 CLI 和包管理器。
将实时或归档的生产配置以及新下载的上游示例放在同一工作目录中。
确认生产文件使用设备后缀,示例使用清晰的基于日期的后缀。
确保上游示例是干净下载;绝不要就地编辑它。
当出现有歧义的重命名或兼容性问题时,查看已安装应用程序的版本。
diff hyprland.lua. hyprland.lua.
hyprctl version
pacman -Q
仅在需要精确替换参考行时,才使用可用的编辑机制。完成之前,保留或提交生产文件的备份,以便可以安全审查最终 diff。

数据架构

该 skill 围绕两个不可变角色组织配置数据:
文件或数据元素 角色 处理方式 *.gpd 或带设备后缀的文件 生产配置 保留值、绑定、活动块、环境设置和自定义功能 带日期的 *.2609xx 文件 上游参考示例 只读;绝不要就地修改
Diff hunk 更改单元 分类为 Reference、Config 或 Ambiguous
参考注释 惰性元数据 从示例复制精确措辞、空白、URL 和章节标题
配置代码 运行数据 保持不动,并报告为保留的 diff
有歧义条目 未解决的兼容性数据 在编辑前调查上游历史记录和已安装版本支持
元数据分类法有意保持保守:Reference 更改会被应用,Config 更改会被保留,而 Ambiguous 更改需要证据和用户批准。生成的产物是更新后的生产文件,以及最终 diff 和记录所有真实配置差异的存活列表。

高级特性

不可变示例保护可防止意外编辑可重新下载的上游基线。
精确的唯一字符串编辑可保留空白并尽量减少意外更改。
三向 hunk 分类将文档噪音与可执行配置分离。
真实依据调查会检查上游 GitHub PR、commit、issue、wiki 页面和已安装版本。
兼容性感知建议会考虑重命名或弃用的设置以及版本特定支持。
用户批准会拦截有歧义的编辑,而不是静默应用可能造成破坏的更改。
最终验证会确认示例完整性、配置存活以及参考或 URL 噪音的移除。
该工作流可扩展到设备特定文件和周期性上游示例刷新,作为 Openclaw Skills 自动化的一部分。


name: sync-config-with-sample description: Sync a production config file (e.g. hyprland.lua.gpd) against the latest upstream sample (e.g. hyprland.lua.260917) by copying only reference info/URL comments while preserving the user's actual configuration. Use when the user drops a freshly downloaded sample alongside a live config, mentions keeping the newest sample as the diff baseline, or wants only real config differences to remain visible in diff.

Sync config with upstream sample

The user keeps a production config (live ~/.config/... file, archived in this repo with a device suffix like .gpd) next to the latest upstream sample (freshly re-downloaded from the project's GitHub repo, named with a date, e.g. .260917). The sample is the baseline: the only acceptable diff is the user's real configuration — never reference noise, never lost config.

Rules (immutable)
Never modify the sample file. It will be re-downloaded as the example. If it must change, copy a fresh one — never edit it in place.
Never change actual configuration in the production file: values, binds, active blocks, added features. Copy only reference information.
Reference info = anything inert: comment lines containing wiki/repo URLs, section headers, -- See https://... links, wording of explanatory comments that upstream rewrote. These are safe to adopt verbatim from the sample.
The end state is verified by diff: the only remaining hunks must be real config differences (user's values vs sample's), with zero reference/URL noise.
Raise hands when a hunk is ambiguous (see Ground truth below) before touching anything ambiguous.

Procedure

  1. Establish files and intent Identify the production file (*.gpd = this device's live config) and the sample (dated *.2609xx).
    State the two "don't touch" sets explicitly up front: the sample, and the user's config.
  2. Diff and classify every hunk diff hyprland.lua. hyprland.lua.

For each hunk, classify into one of three buckets:

Reference → apply (copy the sample's exact wording into the production file).
Config → leave untouched, but list it so the user sees what will remain in the diff.
Ambiguous → pause and investigate (below). 3. Ground truth before acting on ambiguous hunks

A diffed line may look like config but really be an upstream rename, deprecation, or fixed typo. Determine the truth before deciding:

Read the sample itself (does it document this part?).
Check upstream: GitHub PRs/commits/issues for the change (e.g. hyprwm/Hyprland), the wiki page behind the reference URL.
Check what the installed version on this machine understands: hyprctl version, pacman -Q
. If the rename landed after the installed release, keep the old name — it works now and the compat shim usually accepts it after upgrade too.
Present findings + recommendation, get the user's decision, apply. 4. Apply reference edits

Use edit with exact unique oldString matches. Take wording verbatim from the sample (whitespace included). Only touch reference lines — if an edit's oldString overlaps config code, split the edit or re-classify.

  1. Verify with the user, step by step Re-run diff hyprland.lua. hyprland.lua..
    Confirm: (a) sample unmodified, (b) every remaining hunk is real config, (c) no reference URL hunk left, (d) no config line changed.
    Show the user the final diff and the survival list of their config before finishing.
    Example: hyprland.lua (2026-09)

Concrete classification from a real run:

Reference (applied verbatim from sample): wiki URLs restructured from Configuring/Basics/... and Configuring/Advanced-and-Cool/... to lowercase configuring/core/... etc. — 15 comment hunks (monitors, autostart, env-vars, permissions, variables, tearing, animations, workspace-rules, dwindle/master/scrolling layouts, devices, binds, window/workspace-rules).
Config (kept, remain in diff): fileManager = "thunar", menu = "wofi --show drun", the active hl.on("hyprland.start") block (fcitx5, waybar, hypridle, hyprsunset), hl.env("XCURSOR_THEME", "Adwaita"), hyprsunset +500/-500 binds, the SCREENSHOTS block.
Ambiguous → ground truth: dampening vs damping on a spring hl.curve. Found upstream PR hyprwm/Hyprland#15993 — a deliberate rename ("It IS a breaking change") merged Aug 29 2026 with a compat shim accepting the old dampening. Installed version here was hyprland 0.56.2 (Aug 5 2026), old enough that damping was not yet recognized. Decision: keep dampening — works on the installed release and remains accepted after upgrade; stays as a legitimate config diff.
p-video-2-pro
plan-review