Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

use-template使用模板

Agent Skill

use-template 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,240

周安装

260

GitHub Stars

109

下载量

2,080
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:use-template(使用模板)
来源仓库:https://github.com/opusgamelabs/game-creator
仓库路径:skills/use-template
安装命令:
npx skills add https://github.com/opusgamelabs/game-creator --skill use-template
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/opusgamelabs/game-creator --skill use-template

简介

use-template 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词或任务场景快速定位候选结果时使用。

  • 适用于信息调研、内容筛选和线索整理等研究检索类任务。
  • 通过关键词输入和来源仓库路径进行匹配与结果返回。
  • 安装命令为 npx skills add https://github.com/opusgamelabs/game-creator --skill use-template。
  • 使用前请确认权限范围、维护状态及是否涉及联网或文件操作。

SKILL.md

Use Template

Clone a game template from the gallery into a new project. This is a fast copy — working code in seconds, not an AI pipeline.

Behavior

  1. Parse arguments: <template-id> [project-name]

- If no arguments provided, read site/manifest.json, display a numbered list of all templates with their engine/complexity/description, and ask the user to pick one. - template-id is required. project-name defaults to template-id.

  1. Look up template in site/manifest.json by id. If not found, show available IDs and abort.
  2. Determine target directory:

- If current working directory is inside the game-creator repository → examples/<project-name>/ - Otherwise → ./<project-name>/ - If target already exists, abort with error.

  1. Copy the template source directory to the target, excluding:

- node_modules/ - dist/ - output/ - .herenow/ - progress.md - test-results/ - playwright-report/

  1. Update project metadata:

- In package.json: set "name" to the project name - In index.html (if exists): update <title> to a formatted version of the project name

  1. Install dependencies: Run npm install in the target directory.
  2. Print next steps: Template cloned successfully! cd <project-name> npm run dev

Implementation

const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');

// Find game-creator root (contains site/manifest.json)
function findRoot(dir) {
  let d = dir;
  while (d !== path.dirname(d)) {
    if (fs.existsSync(path.join(d, 'gallery', 'manifest.json'))) return d;
    d = path.dirname(d);
  }
  return null;
}

const root = findRoot(process.cwd());
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'gallery', 'manifest.json'), 'utf-8'));

// Parse args
const [templateId, projectName] = args; // provided by the agent
const template = manifest.find(t => t.id === templateId);
const name = projectName || templateId;

// Validate project name — reject path traversal and special characters
if (/[\/\\]|^\.\.?$|\.\./.test(name)) {
  throw new Error(`Invalid project name: "${name}". Must not contain path separators or ".." sequences.`);
}
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)) {
  throw new Error(`Invalid project name: "${name}". Use only alphanumeric characters, hyphens, underscores, and dots.`);
}

// Determine target
const inGameCreator = process.cwd().startsWith(root);
const target = inGameCreator
  ? path.join(root, 'examples', name)
  : path.join(process.cwd(), name);

// Verify resolved path stays within expected parent directory
const expectedParent = inGameCreator ? path.join(root, 'examples') : process.cwd();
if (!path.resolve(target).startsWith(path.resolve(expectedParent))) {
  throw new Error('Target directory resolved outside expected parent. Aborting.');
}

// Copy with exclusions
const EXCLUDE = ['node_modules', 'dist', 'output', '.herenow', 'progress.md', 'test-results', 'playwright-report'];

function copyDir(src, dst) {
  fs.mkdirSync(dst, { recursive: true });
  for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
    if (EXCLUDE.includes(entry.name)) continue;
    const s = path.join(src, entry.name);
    const d = path.join(dst, entry.name);
    if (entry.isDirectory()) copyDir(s, d);
    else fs.copyFileSync(s, d);
  }
}

copyDir(path.join(root, template.source), target);

// Update package.json
const pkgPath = path.join(target, 'package.json');
if (fs.existsSync(pkgPath)) {
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
  pkg.name = name;
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
}

// Update index.html title
const indexPath = path.join(target, 'index.html');
if (fs.existsSync(indexPath)) {
  let html = fs.readFileSync(indexPath, 'utf-8');
  const prettyName = name.replace(/[-_]/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
  html = html.replace(/<title>[^<]*<\/title>/, `<title>${prettyName}</title>`);
  fs.writeFileSync(indexPath, html);
}

// Install
execSync('npm install', { cwd: target, stdio: 'inherit' });

// Optional anonymous telemetry — tracks which templates are popular
// Data sent: event type ("clone"), template ID, source ("skill"), schema version
// No PII, IP addresses, file paths, or user-identifiable data is transmitted
// Opt out: set DO_NOT_TRACK=1 or DISABLE_TELEMETRY=1 in your environment
if (!process.env.DO_NOT_TRACK && !process.env.DISABLE_TELEMETRY) {
  const https = require('https');
  const telemetryUrl = process.env.TELEMETRY_URL || 'https://gallery-telemetry.up.railway.app';
  https.get(`${telemetryUrl}/t?event=clone&template=${encodeURIComponent(templateId)}&source=skill&v=1`)
    .on('error', () => {});
}

Example Usage

/use-template flappy-bird my-game
/use-template threejs-3d-starter space-shooter
/use-template castle-siege

Security Notes

  • Path validation: Project names are validated to reject path traversal (..), path separators, and special characters. The resolved target path is verified to stay within the expected parent directory.
  • npm install: Runs npm install from the copied template's package.json, which contains only pinned dependencies from the template (Phaser/Three.js, Vite). No arbitrary packages are installed.
  • Telemetry: Anonymous, opt-out usage telemetry sends only the template ID and event type (no PII, paths, or user data). Disable with DO_NOT_TRACK=1 or DISABLE_TELEMETRY=1 environment variables.
  • Template source: Templates are copied from the local site/manifest.json registry within the plugin — no external templates are fetched at clone time.

Key Difference from /make-game

/use-template is a 10-second copy. You get working, runnable code instantly and customize it manually. /make-game is a 10-minute AI pipeline that scaffolds, designs, adds audio, tests, deploys, and monetizes from a text prompt.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.84%
按下载量换算704

Claude

33.67%
按下载量换算700

Cursor

18.41%
按下载量换算383

Gemini CLI

9.58%
按下载量换算199

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills