SuperAPI AI Directory

mir-review-snippet

General & other

View repository

Updated 10-16 08:46

About this skill

review-snippet

A skill that reviews the quality of a snippet and suggests improvements.

Triggers

Use when the user says "review the snippet," "check the quality," or "check before publishing."

Procedure

  1. Read the definition file and templates of the target snippet
    • .mir/snippets/<name>.yaml
    • .mir/snippets/<name>/ All files in
  2. Review from the following perspectives and report the results

Review perspectives

Variable design

  • Do variable names clearly express their purpose?
  • Are the schema type / default / enum appropriate?
  • For values derived from other variables, is a template expression used in default? (e.g., default: "{{ replace packageDir '/' '.' }}")
  • Is description easy to understand in the prompt at install time?
  • Are choices presented via suggests (when applicable)?

Template quality

  • Are template helpers (lowercase, uppercase, capitalize, uncapitalize, camelCase, pascalCase, snakeCase, kebabCase, dotCase, pathCase, replace, concat, slice, trim, contains, startsWith, endsWith, length) used appropriately?
  • Are multiple naming conventions correctly expanded from a single variable?
  • Is the generated code sufficiently readable?
  • Is there any unnecessary hardcoding?
  • Are Handlebars conditionals and loops used appropriately?

hooks の UX

  • Is it explained what happens in before-install?
  • In after-install, are next actions (installing dependencies, changing settings, etc.) explained?
  • Are exit conditions set appropriately?

Comments (maintainability)

  • Are maintenance comments written in the snippet definition YAML?
  • Is the original file path recorded for each template file (e.g., # <name>/hoge.ts ... from src/hoge.ts)
  • Are the snippet's intent and the background of design decisions left as comments?
  • Can a future updater understand how to make modifications?

Metadata

  • Does description accurately convey the purpose of the snippet?
  • Is it easy to search with tags?
  • Is version set?

Safety

  • Does a template filename contain path traversal (..)?
  • Is there a risk of unintended file overwriting?
  • snippet.yaml の name field and the filename match?
  1. Present the issues and improvement proposals as a list
  2. Make corrections only after obtaining the user's approval
  3. After correction,mir sync , synchronize the variables and verify operation
    npx mir sync <name>
    npx mir install <name> --out-dir=/tmp/mir-test-<name>
    

Notes

  • Report review results with the severity of the issue (high/medium/low)
  • It is not necessary to satisfy all items (judge according to the purpose of the snippet)
  • hooks are not mandatory, but if they are configured, check the UX