mir-update-published-snippet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

update-published-snippet

update-published-snippet

公開済の snippet を更新する skill。
A skill for updating published snippets.

トリガー

Trigger

ユーザが「公開済の snippet を更新したい」「publish した snippet を修正したい」「snippet のバージョンを上げたい」と言った場合に使用する。
Use this when the user says "I want to update a published snippet", "I want to fix a published snippet", or "I want to upgrade the version of a snippet."

手順

Steps

  1. 対象の snippet の現在の状態を確認する
    bash
    npx mir info <name>
  2. リモート registry に公開済みの場合、ログイン済みか確認する
    bash
    # ログインしていない場合は先にログインが必要
    npx mir login
  3. 更新先の registry を必ずユーザに確認する。 以下の選択肢を提示すること:
    • ローカル registry (
      ~/.mir/registry/
      ): 自分の PC 内にのみ保存される
    • ⚠️🌍 official-registry ⚠️🌍: 全世界の誰でも閲覧・インストール可能になります! 更新して問題ないか十分に確認してください
  4. snippet のテンプレートや変数定義を修正する(ユーザの要件に応じて)
  5. mir sync
    で変数定義を最新化する
    bash
    npx mir sync <name>
  6. snippet の品質をレビューする(
    review-snippet
    skill の観点でチェック)
  7. snippet.yaml の
    version
    フィールドを更新する
    • 破壊的変更: メジャーバージョンを上げる
    • 機能追加: マイナーバージョンを上げる
    • バグ修正: パッチバージョンを上げる
  8. --force
    を付けて上書き公開する
    • ローカルの場合:
      bash
      npx mir publish <name> --force
    • official-registry の場合:
      bash
      npx mir publish <name> --force --registry=official
  9. 更新後の動作確認を行う
    bash
    npx mir install <name> --out-dir=/tmp/mir-update-test-<name>
  10. テスト用ディレクトリを削除する
  1. Check the current status of the target snippet
    bash
    npx mir info <name>
  2. If it is published to a remote registry, check if you are logged in
    bash
    # You need to log in first if you are not logged in
    npx mir login
  3. Be sure to confirm the target registry with the user. Present the following options:
    • Local registry (
      ~/.mir/registry/
      ): Saved only on your own PC
    • ⚠️🌍 official-registry ⚠️🌍: Anyone in the world can view and install it! Please fully confirm that it is safe to update
  4. Modify the snippet template and variable definitions according to the user's requirements
  5. Update variable definitions to the latest with
    mir sync
    bash
    npx mir sync <name>
  6. Review the quality of the snippet (check from the perspective of the
    review-snippet
    skill)
  7. Update the
    version
    field in snippet.yaml
    • Breaking changes: Increase the major version
    • Feature additions: Increase the minor version
    • Bug fixes: Increase the patch version
  8. Overwrite and publish with
    --force
    • For local registry:
      bash
      npx mir publish <name> --force
    • For official-registry:
      bash
      npx mir publish <name> --force --registry=official
  9. Verify the functionality after update
    bash
    npx mir install <name> --out-dir=/tmp/mir-update-test-<name>
  10. Delete the test directory

注意事項

Notes

  • --force
    なしでは同名 snippet の上書きはできない
  • version の更新を忘れないようにする
  • 破壊的変更がある場合はユーザに明確に伝える
  • リモート registry への更新は snippet の owner のみ可能(最初に publish したユーザー)
  • リモート registry への publish には事前に
    mir login
    が必要
  • You cannot overwrite a snippet with the same name without
    --force
  • Do not forget to update the version
  • Clearly inform the user if there are breaking changes
  • Only the snippet owner (the user who first published it) can update to the remote registry
  • You need to log in with
    mir login
    in advance to publish to the remote registry