一键导入
viverse-template-generation
Build, certify, and evolve file-backed VIVERSE templates with high-risk/editable contracts and runtime-safe generation rules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build, certify, and evolve file-backed VIVERSE templates with high-risk/editable contracts and runtime-safe generation rules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Three.js Polygon Streaming .xrg integration and debugging playbook for @polygon-streaming/web-player-threejs, including correct wrapper events, asset publishing, model fitting, and fallback replacement policy
Bundle entry for the exported VIVERSE PlayCanvas Toolkit workflow pack. Use when you want bundled VIVERSE PlayCanvas Toolkit skills, prompts, catalogs, and helper assets in one standalone package.
Collision detection patterns for Three.js games without physics engines
Protect third-party API keys by moving secret-bearing calls into VIVERSE Play Lambda scripts and keeping only non-secret user data in VIVERSE Storage.
Build or fix CPU racing drivers for Three.js or VIVERSE racing games. Use for waypoint loops, tile-to-route reconstruction, lap completion, recovery logic, and low-overhead debug workflows.
VIVERSE Login SDK integration for user authentication and SSO
| name | viverse-template-generation |
| description | Build, certify, and evolve file-backed VIVERSE templates with high-risk/editable contracts and runtime-safe generation rules. |
| prerequisites | ["template-registry","contract-schema","orchestrator-enforcement"] |
| tags | ["templates","architecture","orchestration","compliance","battletanks"] |
Use this skill when implementing or evolving the internal template system (registry, contracts, enforcement, certification) and when onboarding a new game template.
template.json, and TEMPLATE.md before generation.Every template directory MUST have rulesets/default.json or TemplateCertificationService
blocks all runs with 'no ruleset files found'. Minimum content:
{"id":"default","name":"Default","description":"...","authRequired":true,"mobileFirst":true,"iframeEmbeddable":true}
See templates/REQUIRED_STRUCTURE.md for the full required directory layout.
Do not replace game bootstrap with an auth-only shell. Startup must still launch the world/game loop.
Gameplay/UI changes must not rewrite protected bootstrap/runtime files unless a verified blocker proves it is necessary.
Template shells must remain playable on short viewports; avoid fixed full-screen layouts that hide gameplay/UI below the fold.
Auth/profile recovery must continue past generic placeholders.
Once an App ID is created and written to .env, treat it as locked for the workspace.
Separate first-publish logic from republish logic.
Overlay panels must not permanently cover active gameplay.
Preview-shell success is not runtime certification; require browser/probe evidence.
template.json MUST declare buildConfig or agents default to the blank-webapp Vite pattern
(creating vite.config.js, running npm run build) — which breaks static PlayCanvas/game templates.
Minimum for static templates: "buildConfig": {"type":"static","command":"<cp command>","outputDir":"dist","entryHtml":"index.html"}
Minimum for Vite templates: "buildConfig": {"command":"npm run build","outputDir":"dist","entryHtml":"index.html"}
Static PlayCanvas templates MUST set enforcement.defaultMode: "enforce" (not "audit").
With "audit", contract violations (writing vite.config.js, src.js) are silently allowed,
causing the Coder to build a Vite app instead of the PlayCanvas game — blank runtime at publish time.
Never read playcanvas-stable.min.js, *.min.js, or binary/media files — they blow the LLM
context window and cause auth/logic tasks to timeout. The file service now blocks these reads
automatically, returning [FILE BLOCKED]. Use grep or targeted file inspection instead.
For App ID injection in non-Vite templates, use a sed-style replacement on the placeholder
YOUR_APP_ID — pre-inject this placeholder in the template source's config file.
Fast-path template modification (visual/asset-only changes) must NOT re-scaffold. When the user
requests only cosmetic changes to a seeded template workspace (e.g. "change ring to bird", "stylize
the aircraft"), the workspace is already copied from the template source. Do NOT run npm install,
do NOT re-seed, do NOT re-create the folder structure. Apply ONLY the specific string/value changes
to editable files, then build if build.required is true. Leave YOUR_APP_ID in place for the
publish step.
CONTRACT.json is auto-generated for fast-path runs — it does NOT need to be created by an
Architect task. The system derives it from template.json buildConfig at seeding time. Do NOT
search for it in nested paths or run find commands to locate it; it is always at the workspace
root. If a cat CONTRACT.json returns an error, run pwd && ls -la to confirm you are in the
correct workspace root (not a double-nested path like workspaces/.../workspaces/...).
Scope for [TEMPLATE_MODIFICATION_ONLY] tasks is gameplay + ui + platform-core.bootstrap.
The template contract enforces subsystem scopes. index.html is classified as
platform-core.bootstrap — if the scope only includes gameplay + ui, writing cosmetic title/theme
changes to index.html will be blocked. The fast-path modify task has platform-core.bootstrap
in its allowed subsystems specifically to permit this. Do NOT escalate scope beyond these three.
[FAST_PATH] publish tasks do not emit a formal SKILL_COMPLIANCE_REPORT block. They are
3-step CLI tasks (login → app create → publish). Absence of the structured compliance report is
expected and tolerated; the task is not aborted for non-PASS skill compliance. The App ID obtained
from viverse-cli app create is automatically synced to CONTRACT.json by the orchestrator —
there is no need to manually patch it with sed unless the build output still contains the
YOUR_APP_ID placeholder.
Art Modularization Assessment is REQUIRED during template extraction. Before freezing a game into a template, scan the source to determine its "theme-swap readiness" level. If the source scores below Level 2, perform minimal modularization surgery before packaging.
When extracting a new template, run this assessment on the source code to determine how easy it will be for agents to swap themes/assets at generation time.
ThemeConfig, Constants, THEME,
palette, or a top-level config object that collects colors/paths in one place.0x[0-9a-f]{6}, #[0-9a-f]{3,6}, hsl(, rgb( in
scene/rendering files. Count how many unique locations define visual constants.| Level | Name | Criteria | Agent theme-swap cost |
|---|---|---|---|
| 3 | Fully modularized | Centralized ThemeConfig.js or equivalent; all colors, model paths, and atmosphere values reference it. One-file change = full retheme. | 1 file edit |
| 2 | Partially modularized | Procedural textures as standalone functions; shared colormap; colors hardcoded but grouped in few files (≤3). | 3-5 edits, same file regions |
| 1 | Scattered | Colors/paths spread across 5+ files, inline in logic, no config object. | 10+ edits across many files, error-prone |
| 0 | Entangled | Visual constants mixed into gameplay math; changing a color could break collision/physics. | Refactor required before theming |
If the source scores Level 1 or 0, apply these minimal modularization steps before packaging:
Move any canvas/texture generation into named top-level functions with color parameters at the top:
// BEFORE (entangled):
class Scene { build() { ctx.fillStyle = '#1a2e1a'; ... } }
// AFTER (modularized):
function makeGroundTexture(baseColor = '#1a2e1a', noiseHue = 115) { ... }
// Asset registry — swap these paths for a full model retheme
const MODEL_PATHS = {
castle: '/assets/castle/',
enemies: '/assets/enemies/',
weapons: '/assets/weapons/',
};
// ── Theme atmosphere (edit these for mood changes) ──
const ATMOSPHERE = {
background: 0x0a0e1a,
fog: { color: 0x0a0e1a, density: 0.014 },
ambient: { color: 0x8899bb, intensity: 2.8 },
sun: { color: 0xfff5dd, intensity: 1.2 },
};
Add a comment at the template level noting which colormap file recolors which model set.
After assessment, record the level and swap instructions in the template's TEMPLATE.md under
a ## Art Architecture section. This tells the fast-path modification agent exactly where to
make edits for theme swaps. Include:
dashrunner-v1 → Level 3: js/game/ThemeManager.js has 7 named presets controlling all visuals.
One function call setTheme('volcanic') rethemes everything.
starter-kit-racing-v1 → Level 3: js/ThemeConfig.js + shared colormap atlas. Change palette
PNG or config object = full retheme.
bastion-archer-v1 → Level 2: Procedural textures are standalone functions with grouped color params. Shared colormaps per model category. But no single ThemeConfig — colors are in SceneBuilder.js functions + atmosphere in constructor. 3-5 edit locations for full retheme.
flight-simulator-v1 → Level 3: All visual constants in src/core/Constants.js.
immutablePaths (advisory high-risk), editablePaths, injectionHooks, requiredGatesscenario.schema.json exists and matches template/rulesetsrulesets/ exists; if schema references default, rulesets/default.json existstemplate.json includes buildConfig with correct type (static or vite)enforcement.defaultMode is "enforce" not "audit"YOUR_APP_ID is pre-injected in the config file
that appIdPropagation.approvedConfigFiles points toCONTRACT.json at workspace root (not a nested path) to get editablePaths and build.requiredbuild.required is true, run build.command once — do NOT run it again in the publish taskYOUR_APP_ID in source files; the publish step replaces it after app creategameplay, ui, platform-core.bootstrap — do NOT touch auth/matchmaking filesWhen using this skill, output: