mcpbeat

Template Gallery

microsoft/template-gallery

Use when working in the Awesome Rayfin template gallery repo — creating, validating, or updating templates under templates/, regenerating gallery manifests, or updating the templates table in README. Triggers: awesome-rayfin, template gallery, templates/, new-template.sh, generate-manifest.mjs, rayfin-template.yml, manifest.json, template metadata, templateId, template.name, template.displayName, template.description, rayfin init -t, scaffold template, gallery README, leaf manifest, root manifest

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
82
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/awesome-rayfin --skill template-gallery

The instruction itself

12 sections, as written by the author

Use this skill when working in the Awesome Rayfin template gallery repo. This is an operational checklist for creating, validating, and maintaining gallery templates.

Goal

Make changes that keep individual templates, generated manifests, and gallery documentation consistent.

Before you change anything

  • Read docs/template-guidelines.md for the expected template structure.
  • Read the root AGENTS.md for gallery-specific workflow guidance.
  • Use the rayfin MCP server from .mcp.json when you need Rayfin SDK or CLI docs.
  • Review a nearby template in templates/ if you need a working example.
  • Use .scratchpad/ for any temporary or working files — it is git-ignored.

Create a new template

  • Run:
   ./scripts/new-template.sh <name> "<Display Name>" "<description>"
  • Open the new templates/<name>/ directory.
  • Customize the generated files, especially:
  • src/ for the application UI and client logic
  • rayfin/data/ for entities and schema definitions
  • rayfin/rayfin.yml for service configuration
  • Update any placeholder content in README.md, manifest.json, and package.json.
  • Confirm package.json includes:
  • template.name
  • template.displayName
  • template.description
  • If the template adds new routes or features, make sure the README explains what the template demonstrates.

Validate a template

  • Verify generated manifests are in sync:
   node scripts/generate-manifest.mjs --check
  • Smoke-test scaffolding in a fresh scratch directory:
   rayfin init -t . --template-name "<name>"

If the CLI supports it in your environment, point the output to a new empty directory so you can inspect the scaffolded result safely.

  • Check the scaffolded output contains the expected project files, especially package.json.
  • Re-open the source template's package.json and confirm template.name, template.displayName, and template.description are present and correct.
  • If the repo workflow or your change touches manifest generation, compare the regenerated files before finishing.

After changing template metadata or adding/removing templates, run:

node scripts/generate-manifest.mjs

This regenerates:

  • root rayfin-template.yml
  • per-template rayfin-template.yml
  • the templates table in README.md

Do not hand-edit generated manifest content if the script owns it.

Required template structure

Each template should include these files:

  • package.json with template metadata
  • manifest.json
  • rayfin-template.yml
  • rayfin/rayfin.yml
  • rayfin/data/schema.ts
  • README.md
  • index.html
  • src/main.tsx
  • tsconfig.json
  • vite.config.ts

If any required file is missing, add it before considering the template complete.

Common patterns

Add a data entity

  • Create a new file in rayfin/data/.
  • Define the entity with decorators from @microsoft/rayfin-core.
  • Export the entity from rayfin/data/schema.ts so the schema includes it.
  • Update any app code that reads or writes the new entity.
  • Document the new data model in the template README if it changes what the template demonstrates.

Add a page

  • Create the page component in src/pages/.
  • Add the route in src/App.tsx.
  • Link to the page from navigation or the relevant entry point.
  • Verify the page works with the template's auth and data model.

Cross-platform compatibility (Windows + macOS/Linux)

Templates are used on Windows, macOS, and Linux. Check for platform issues when adding or modifying scripts:

  • Prefer .mjs over .sh for any script that end users run. Shell scripts are fine for contributor tooling only (e.g., scripts/new-template.sh).
  • No Unix-only assumptions in runtime scripts: avoid hardcoded Unix socket paths (/var/run/docker.sock), symlinks, or POSIX-only APIs without a Windows fallback.
  • Use process.platform guards when behavior diverges (e.g., Docker daemon detection uses sockets on Unix but named pipes/CLI on Windows).
  • Use cross-env for environment variables in npm scripts — never rely on VAR=value cmd syntax.
  • Avoid path separators in JS: use path.join()/path.resolve() instead of string concatenation with /.
  • && chaining in npm scripts is safe (works in cmd, PowerShell 7+, and bash).

When reviewing or validating a template, scan scripts for:

  • Hardcoded Unix paths (/var/run/, /tmp/, ~/.docker/run/)
  • Socket or pipe assumptions without platform checks
  • Shell-specific syntax in npm scripts (backticks, $(...), export)
  • File permission operations (chmod, chown) without guards

Final checklist

  • Template structure matches docs/template-guidelines.md
  • Template metadata in package.json is complete
  • node scripts/generate-manifest.mjs --check passes
  • rayfin init -t . --template-name "<name>" works for the changed template
  • Generated gallery files were refreshed with node scripts/generate-manifest.mjs when needed
  • README and manifest content reflect the actual template behavior

How to use it

Copy the folder

Take microsoft/template-gallery from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.