‹ 首页

pensieve-sync-to-main

@kingkongshot · 收录于 1 周前 · 上游提交 2 个月前

Sync Pensieve's Chinese development/release branch into the English main branch. Use in the Pensieve repository when the user asks to sync zh or experimental to main, publish the English branch, translate Pensieve README/tool specs/templates/SKILL.md, or run the zh-to-main release flow. Do not use for ordinary project localization or generic i18n.

适合你,如果需要在Pensieve仓库中同步中英文分支并翻译项目文档。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add kingkongshot/pensieve/pensieve-sync-to-main
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- kingkongshot/pensieve/pensieve-sync-to-main
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify kingkongshot/pensieve/pensieve-sync-to-main
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
2522GitHub stars
~964最小装载
~964含声明引用
~1K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 8731f61 · 表述以原文为准
它做什么

安装后,Claude 会在 Pensieve 仓库中,将中文开发或发布分支(zh 或 experimental)的变更同步到英文主分支(main),并自动翻译 README、SKILL.md 等文档中的中文内容为英文,同时保留贡献者历史。

什么时候触发

当你在 Pensieve 仓库中要求同步 zh 或 experimental 到 main、发布英文分支、翻译相关文档或执行 zh-to-main 发布流程时触发。

装好后可以这样说
Claude 会执行同步和翻译流程。
Claude 会合并并保留历史。
技能原文 SKILL.md作者撰写 · MIT · 8731f61

Pensieve Sync to Main

Use only inside the Pensieve repository itself.

This skill syncs changes from experimental or zh into main, preserves contributor history, and ensures main remains the English release branch. This is a maintainer release flow, not a default pipeline that should be seeded into every Pensieve user project.

Hard Rules
  • main must remain English-only and release-grade.
  • Preserve source-branch commit history; do not squash contributor history unless the user explicitly asks.
  • Code logic must stay identical across language branches; only text content may differ.
  • Do not translate code identifiers, paths, protocol names, command names, frontmatter keys, or Markdown link targets unless the branch rules below explicitly require it.
  • When the worktree has unrelated local changes, do not run destructive git cleanup commands.
Branch Strategy
  • experimental: development branch
  • zh: Chinese release branch
  • main: English release branch

Default source branch is zh unless the user explicitly specifies experimental. Default remote is kingkongshot.

Translation Scope

Chinese content in these files must be translated into English:

  • README.md
  • SKILL.md
  • .src/references/*.md
  • .src/tools/*.md
  • .src/templates/**/*.md

These files are synced directly by default; translate only if user-visible Chinese appears on the English branch:

  • Scripts and code
  • JSON/YAML configuration
  • Deleted files
  • Binary assets
Workflow
1. Confirm scope
  1. Check current state: ```bash git branch --show-current git status --short git remote -v ```
  2. Confirm source branch: ```bash git fetch kingkongshot git diff --stat main..kingkongshot/<source-branch> ```
  3. Classify changed files as: needs translation, direct sync, deletion, binary/config.
  4. If the worktree has unrelated local changes, report them before switching branches.
2. Create sync branch
  1. Start from latest main: ```bash git checkout main git pull kingkongshot main git checkout -b sync/zh-to-main-<date>[-topic] ```
  2. Merge the source branch to preserve history: ```bash git merge kingkongshot/<source-branch> -X theirs --no-edit ```
  3. If the user explicitly asks to sync only a few files, use targeted checkout: ```bash git checkout kingkongshot/<source-branch> -- <file> ```
  4. Resolve conflicts before translating.
3. Translate

Rules:

  • Translate all Chinese prose into English.
  • Preserve Markdown structure, frontmatter, code blocks, command syntax, and HTML tags.
  • Preserve intentionally bilingual matching regexes, such as the Exploration Reduction compatibility check.
  • Installation commands in English-branch docs must use git clone -b main, not git clone -b zh.
  • English-branch language-switch links should point back to the Chinese README.
  • Translate Chinese strings in scripts only when they are user-visible on the English branch.

Validation:

rg -n --pcre2 '\p{Han}' README.md SKILL.md .src docs

After translation, results may only include intentionally retained Chinese, such as language-switch links or bilingual regexes.

4. Validate, commit, and open PR
  1. Run checks that exist in the current repository: ```bash git diff --check ```
  2. Commit: ```bash git add -A git commit -m "translate: sync <source-branch> to main" ```
  3. Push and create a PR: ```bash git push kingkongshot sync/zh-to-main-<date>[-topic] gh pr create --repo kingkongshot/Pensieve --base main --head sync/zh-to-main-<date>[-topic] ```
  4. Unless the user explicitly delegated the full release flow, ask for confirmation before merging the PR.
Failure Fallback
  • Merge conflicts remain: stop, list conflict files, and resolve them directly. Prefer source-branch content, then translate.
  • Chinese remains after translation: inspect each item, translate it, or explain why it is intentionally retained.
  • Push rejected: fetch, rebase the sync branch onto latest kingkongshot/main, then retry.
  • GitHub CLI authentication fails: report the exact authentication error; do not switch to an unknown remote.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。