SuperAPI AI Directory

mir-update-snippet

General & other

View repository

Updated 10-16 08:33

About this skill

update-snippet

A skill that updates and improves existing snippets based on the quality checklist.

Trigger

Use when the user says "I want to improve a snippet," "I want to update it," or "I want to raise its quality."

Procedure

  1. Check the target snippet
    npx mir info <name>
    
  2. mir sync Update the variable definitions with
    npx mir sync <name>
    
  3. Check the following checklist in order, and fix any issues

Checklist

  • Appropriate schema (type, default, enum), description, and suggests are set for the variable
  • description, tags, and version are appropriately set in snippet.yaml
  • Maintenance comments are written in the snippet definition YAML (referenced file paths, design intent/background, etc.)
  • The generated code works as-is
    • Install it in a temporary directory and verify that it works
      npx mir install <name> --out-dir=/tmp/mir-test-<name>
      
    • Ask the user how to verify operation (build, test, etc.)
  • dependencies are explicitly declared (when depending on other snippets)
  • It is designed so that it does not error even on its own
  • There are no unused variable definitions
  • Template helpers (camelCase, pascalCase, kebabCase, etc.) are appropriately used to expand one variable into multiple naming conventions
  • Template variables are also used in file names, so the output destination can be controlled dynamically
  • The hooks before-install displays prerequisite checks and explanations
  • The hooks after-install guides the next step (e.g., npm install please do)
  • Path traversal (..) is not included in template files
  • snippet.yaml の name The field and file name match
  1. After making corrections, run mir sync again to sync the variables
  2. Run the installation test again and confirm there are no issues

Notes

  • Before making corrections, report the current state to the user and obtain approval before making changes
  • Set hooks only when necessary according to the snippet's purpose (they are not required for all snippets)