sync-github-repo-metadata

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sync GitHub Repo Metadata

同步GitHub仓库元数据

Use the repository and its configuration as the source of truth. Treat the current README, docs, and existing GitHub metadata as weak hints unless they still match the codebase.
以仓库及其配置为真实数据源。当前的README、文档和现有GitHub元数据仅作为次要参考,除非它们与代码库仍保持一致。

Workflow

工作流程

  1. Gather repo facts.
  2. Read the current remote metadata with:
    • gh repo view --json nameWithOwner,description,repositoryTopics,homepageUrl,url
  3. Infer:
    • one concise repository description
    • a focused topic set based on actual language, framework, domain, and tooling
  4. Preview the current values, proposed values, and the exact
    gh repo edit
    command.
  5. Apply changes only after explicit confirmation.
  1. 收集仓库相关信息。
  2. 使用以下命令读取当前远程元数据:
    • gh repo view --json nameWithOwner,description,repositoryTopics,homepageUrl,url
  3. 推断:
    • 一段简洁的仓库描述
    • 基于实际使用的语言、框架、领域和工具生成一组针对性的主题
  4. 预览当前值、提议值以及精确的
    gh repo edit
    命令。
  5. 仅在获得明确确认后才应用更改。

Guidelines

指导原则

  • Do not change homepage or other repo settings unless the user explicitly asks.
  • Focus on GitHub description and topics only.
  • Prefer a single-sentence description that matches the repo's real purpose.
  • Prefer accurate, specific, stable topics over broad buzzwords.
  • Prefixing description with an emoji is encouraged.
  • Remove stale topics instead of only appending new ones.
  • Use lowercase kebab-case topics.
  • 除非用户明确要求,否则不要修改主页或其他仓库设置。
  • 仅关注GitHub描述和主题。
  • 优先选择符合仓库实际用途的单句描述。
  • 优先选择准确、具体、稳定的主题,而非宽泛的流行词汇。
  • 鼓励在描述前添加表情符号作为前缀。
  • 移除过时的主题,而不仅仅是添加新主题。
  • 主题使用小写短横线分隔格式(kebab-case)。

Preview Format

预览格式

  • Current description
  • Proposed description
  • Current topics
  • Proposed topics
  • Exact
    gh repo edit
    command with
    --description
    ,
    --add-topic
    , and
    --remove-topic
    arguments as needed
  • 当前描述
  • 提议描述
  • 当前主题
  • 提议主题
  • 按需包含
    --description
    --add-topic
    --remove-topic
    参数的精确
    gh repo edit
    命令

Apply Step

应用步骤

  • Never apply blindly.
  • After confirmation, run the exact previewed command.
  • If authentication or permissions fail, report the command and the failure instead of guessing an alternative.
  • 切勿盲目应用更改。
  • 确认后,运行预览的精确命令。
  • 如果认证或权限验证失败,报告命令和失败原因,而非尝试猜测替代方案。