mir-update-published-snippet

Original🇨🇳 Chinese
Translated

Update and upgrade published mir snippets. Use this when you want to update a published snippet, fix a published snippet, or upgrade the version of a snippet.

2installs
Added on

NPX Install

npx skill4agent add tbsten/mir mir-update-published-snippet

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

update-published-snippet

A skill for updating published snippets.

Trigger

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. 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

  • 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