shunk031-manage-public-private-dotfiles
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManage Public and Private Dotfiles
管理公开与私有Dotfiles
Treat the public and private chezmoi sources as related but separate management domains. Establish their current ownership boundary before proposing or making changes.
Skill content is not one of those domains any more. It lives in and , and the dotfiles repositories hold only the subscription allowlist that installs it. Use the skill for anything that adds, edits, or removes a skill, and use this one for the configuration around it.
shunk031/skillsshunk031/skills-privateshunk031-manage-public-private-skills将公开和私有chezmoi源视为相关但独立的管理域。在提议或进行更改之前,先明确它们当前的所有权边界。
Skill内容不再属于这些域之一。它存储在和中,而dotfiles仓库仅包含用于安装它的订阅白名单。添加、编辑或移除Skill时,请使用技能,而本技能用于处理其相关配置。
shunk031/skillsshunk031/skills-privateshunk031-manage-public-private-skillsWorkflow
工作流程
-
Read the applicable instructions before investigating.
- Read , then read
~/.agents/AGENTS.mdwhen it is readable.~/.agents/AGENTS-private.md - Treat as the stable user-level path. Its canonical content is
~/.agents/AGENTS-private.md, while its symlink wiring is managed by the public dotfiles source.~/.local/share/chezmoi-private/.agents/AGENTS-private.md - Edit the private repository for content changes and the public repository only for symlink wiring changes. Do not duplicate or move the private content into either tree.
home/ - Read the root in both dotfiles repositories. Follow each repository's rules for changes made there.
AGENTS.md
- Read
-
Inspect both repositories before choosing an edit target.
- Public source: , using
~/.local/share/chezmoi.~/.config/chezmoi/chezmoi.yaml - Private source: , using
~/.local/share/chezmoi-private.~/.config/chezmoi-private/chezmoi.yaml - Check in both repositories and preserve all existing changes.
git status --short --branch - Search both sources for the relevant applied path, command, setting, identifier, and documentation. Use with the corresponding source and config when the source mapping is unclear.
chezmoi source-path - Inspect relevant history in both repositories when ownership, intent, or a previous migration cannot be determined from the current files alone.
- Public source:
-
Determine the current source of truth from evidence.
- Prefer the public repository for portable, shareable configuration and shared agent guidance.
- Prefer the private repository for credentials, internal infrastructure, private profiles, authentication helpers, internal endpoints, and private launchers.
- Treat these as defaults, not a substitute for reading the current repository instructions and implementation.
- Do not copy a setting into both repositories merely to make it available in both contexts. Preserve adapters and symlinks that expose one canonical source.
-
Make only the required source changes.
- Edit chezmoi source state rather than applied files under the home directory.
- Change only the authoritative repository when the task belongs to one management domain.
- When both repositories require coordinated changes, keep their worktrees, commits, and pull requests separate and explain the dependency between them.
- Create a clean task worktree for each affected repository when required by its instructions. Never mix unrelated local changes into the task.
-
Validate and report each affected domain independently.
- Run the checks required by each affected repository and report which repository owns each change.
- Keep credentials and secret values out of command output, diffs quoted in chat, and summaries.
- Do not run , change runtime state, push, open or update pull requests, or merge unless the user's request explicitly authorizes that operation.
chezmoi apply
-
在调查前阅读适用说明。
- 阅读,当
~/.agents/AGENTS.md可读时再阅读该文件。~/.agents/AGENTS-private.md - 将视为稳定的用户级路径。其标准内容位于
~/.agents/AGENTS-private.md,而其符号链接由公开dotfiles源管理。~/.local/share/chezmoi-private/.agents/AGENTS-private.md - 内容更改编辑私有仓库,仅符号链接配置更改编辑公开仓库。不要将私有内容复制或移动到任一目录树中。
home/ - 阅读两个dotfiles仓库根目录下的。遵循每个仓库中关于更改的规则。
AGENTS.md
- 阅读
-
在选择编辑目标前检查两个仓库。
- 公开源:,使用
~/.local/share/chezmoi。~/.config/chezmoi/chezmoi.yaml - 私有源:,使用
~/.local/share/chezmoi-private。~/.config/chezmoi-private/chezmoi.yaml - 在两个仓库中执行并保留所有现有更改。
git status --short --branch - 在两个源中搜索相关的应用路径、命令、设置、标识符和文档。当源映射不明确时,结合对应的源和配置使用。
chezmoi source-path - 当仅从当前文件无法确定所有权、意图或之前的迁移情况时,检查两个仓库中的相关历史记录。
- 公开源:
-
根据证据确定当前的权威源。
- 对于可移植、可共享的配置和共享Agent指引,优先选择公开仓库。
- 对于凭据、内部基础设施、私有配置文件、认证助手、内部端点和私有启动程序,优先选择私有仓库。
- 将这些视为默认规则,而非替代阅读当前仓库说明和实现的依据。
- 不要仅仅为了在两种环境中都可用而将设置复制到两个仓库中。保留用于公开一个标准源的适配器和符号链接。
-
仅进行必要的源更改。
- 编辑chezmoi源状态,而非主目录下的已应用文件。
- 当任务属于一个管理域时,仅更改权威仓库。
- 当两个仓库需要协调更改时,保持它们的工作树、提交和拉取请求分离,并说明它们之间的依赖关系。
- 根据仓库说明要求,为每个受影响的仓库创建干净的任务工作树。切勿将无关的本地更改混入任务中。
-
独立验证并报告每个受影响的域。
- 运行每个受影响仓库所需的检查,并报告每个更改所属的仓库。
- 确保凭据和机密值不出现在命令输出、聊天中引用的差异和摘要中。
- 除非用户请求明确授权,否则不要运行、更改运行时状态、推送、打开或更新拉取请求,或合并。
chezmoi apply
Expected Outcome
预期结果
Report the evidence used to select each source of truth, the files changed in each repository, the validation performed, and any ordering required between public and private changes. If investigation shows that only one repository needs modification, say that explicitly.
报告用于选择每个权威源的证据、每个仓库中更改的文件、执行的验证以及公开和私有更改之间所需的任何顺序。如果调查显示仅需修改一个仓库,请明确说明。