SY

Synchronizes local Chinese translation files with the official upstream Rust nomicon repository.

Install

mkdir -p .claude/skills/sync-upstream && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7476" && unzip -o skill.zip -d .claude/skills/sync-upstream && rm skill.zip

Installs to .claude/skills/sync-upstream

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Sync Chinese translation repository with upstream rust-lang/nomicon. Use when user wants to check for upstream changes, sync translations, update from upstream, or asks about differences between local translation and upstream English version. Triggers on requests like "sync upstream", "check upstream changes", "update from nomicon", or "sync translation".
357 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Extract current translation commit hash
  • Fetch latest upstream commit from GitHub
  • Identify changed files between commits
  • Apply translation updates to local files
  • Update intro.md metadata

How it works

It compares the local translation commit hash against the upstream repository, identifies changed files, and facilitates the translation of new content.

Inputs & outputs

You give it
Local nomicon-zh-Hans repository
You get back
Updated translation files and sync summary

When to use sync-upstream

  • Check for upstream nomicon changes
  • Update translation repository
  • Compare local translation with upstream

About this skill

Sync Upstream

Synchronize nomicon-zh-Hans (Chinese translation) with upstream rust-lang/nomicon repository.

Workflow

Step 1: Extract Current Translation Base

Extract the commit hash from src/intro.md:

目前翻译基于 commit:<commit_hash>,基于时间:<date>。

Use regex pattern: 目前翻译基于 commit:([a-f0-9]+),基于时间:(\d{4}/\d{2}/\d{2})。

Step 2: Fetch Upstream Latest Commit

Get the latest commit from upstream:

gh api repos/rust-lang/nomicon/commits/main --jq '.sha'

Compare with the extracted commit hash. If identical, report "Already up to date" and exit.

Step 3: Get Changed Files

List files changed between the two commits:

gh api "repos/rust-lang/nomicon/compare/<base_commit>...<latest_commit>" --jq '.files[] | select(.filename | startswith("src/")) | {filename, status, patch}'

Step 4: Process Each Changed File

For each changed file in src/:

  1. Fetch the new English content from upstream
  2. Read the corresponding Chinese file from local repository
  3. Translate the changes maintaining:
    • Existing translation style and terminology
    • Markdown formatting
    • Code blocks unchanged (only translate comments if any)
    • Links and references preserved
  4. Apply the translation to local file

Translation guidelines:

  • Keep technical terms consistent with existing translations
  • Preserve all code examples exactly
  • Only translate prose content, not code
  • Maintain the same file structure

Step 5: Update intro.md Metadata

Update the commit and date line in src/intro.md:

目前翻译基于 commit:<new_commit>,基于时间:<current_date>。

Date format: YYYY/MM/DD

Step 6: Output Summary

Provide a summary including:

  • Previous commit vs new commit
  • List of files updated with change type (added/modified/deleted)
  • Brief description of significant changes
  • Reminder to review changes before committing

Example Output

## Sync Summary

**Upstream sync completed**

- Previous: 5b3a9d084cbc64e54da87e3eec7c7faae0e48ba9 (2026/01/02)
- Current: abc123def456... (2026/01/29)

### Changed Files (3)

| File | Status | Description |
|------|--------|-------------|
| src/intro.md | modified | Updated warning text |
| src/new-chapter.md | added | New chapter on XYZ |
| src/old-file.md | deleted | Removed deprecated content |

### Next Steps
1. Review the translated changes
2. Run `mdbook build` to verify
3. Commit with message: "sync: update to upstream commit abc123"

When not to use it

  • Updating non-nomicon repositories
  • Manual translation without upstream reference

Prerequisites

nomicon-zh-Hans repository

Limitations

  • Limited to rust-lang/nomicon repository
  • Requires manual review of translated changes

How it compares

It automates the comparison and tracking process that would otherwise require manual git diffing and metadata management.

Compared to similar skills

sync-upstream side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
sync-upstream (this skill)16moReviewIntermediate
code-review06moNo flagsIntermediate
icn-shipping06moNo flagsIntermediate
deepwiki-rs259moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

code-review

jonatron55

Instructions for reviewing changes and ensuring quality before completion. Use when asking for a review or before committing changes.

00

icn-shipping

InterCooperative-Network

Prepare ICN branches for merge with required checks, doc/spec sync, clean git hygiene, and high-quality PR metadata.

00

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

rust-learner

actionbook

Use when asking about Rust versions or crate info. Keywords: latest version, what's new, changelog, Rust 1.x, Rust release, stable, nightly, crate info, crates.io, lib.rs, docs.rs, API documentation, crate features, dependencies, which crate, what version, Rust edition, edition 2021, edition 2024, cargo add, cargo update, 最新版本, 版本号, 稳定版, 最新, 哪个版本, crate 信息, 文档, 依赖, Rust 版本, 新特性, 有什么特性

83

release-skills

JimLiu

Universal release workflow. Auto-detects version files and changelogs. Supports Node.js, Python, Rust, Claude Plugin, and generic projects. Use when user says "release", "发布", "new version", "bump version", "push", "推送".

27

exploring-rust-crates

hashintel

Generate Rust documentation to understand crate APIs, structure, and usage. Use when exploring Rust code, understanding crate organization, finding functions/types/traits, or needing context about a Rust package in the HASH workspace.

33

Search skills

Search the agent skills registry