Token导航 LogoToken导航

Agent Skill · 待分类

scenes(scenes 命令行)

scenes 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

scenes 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 3,523。

总安装 979周安装 40GitHub Stars 39,516下载 314核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/phaserjs/phaser --skill scenes

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

用于处理 Phaser 游戏引擎中的场景管理和切换逻辑。适合在游戏开发中组织关卡、菜单或动画序列。可生成场景加载顺序和资源配置建议。scenes 属于待分类类 Skill,可作为该场景下的辅助能力补充。安装方式基于 GitHub,需确保 JavaScript 环境就绪。建议先在模拟器中测试场景切换稳定性。

来源仓库内路径:skills/scenes

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/phaserjs/phaser --skill scenes;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

scenes 怎么安装?

在终端执行 npx skills add https://github.com/phaserjs/phaser --skill scenes。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

scenes 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

scenes 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

scenes 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

scenes 用的人多吗?

公开数据是累计安装 979 次,近一周安装 40 次,下载 314 次,GitHub 39,516 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

scenes 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 39,516 星,维护活跃度相对可查。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
scenes

scenes 命令行 · 本页

97939,516只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Scenes

Scenes are the organizational backbone of a Phaser game. Each Scene has its own lifecycle (init, preload, create, update), its own set of injected systems (this.add, this.input, this.cameras, etc.), and can be started, stopped, paused, slept, or run in parallel with other Scenes. The ScenePlugin (this.scene) controls all multi-scene orchestration.

Key source paths: src/scene/Scene.js, src/scene/Systems.js, src/scene/SceneManager.js, src/scene/ScenePlugin.js, src/scene/Settings.js, src/scene/const.js, src/scene/events/, src/scene/InjectionMap.js Related skills:../game-setup-and-config/SKILL.md,../loading-assets/SKILL.md,../events-system/SKILL.md

Quick Start

// Minimal scene with all lifecycle methods
class GameScene extends Phaser.Scene {
    constructor() {
        super('GameScene');
    }

    init(data) {
        // Called first. Receives data passed from other scenes.
        // 'data' is whatever was passed via scene.start('GameScene', { level: 1 })
        this.level = data.level || 1;
    }

    preload() {
        // Called after init. Load assets here.
        this.load.image('logo', 'assets/logo.png');
    }

    create(data) {
        // Called after preload completes. Set up game objects.
        // 'data' is the same object passed to init.
        this.add.image(400, 300, 'logo');
    }

    update(time, delta) {
        // Called every frame while scene is RUNNING.
        // time: current time (ms), delta: ms since last frame (smoothed)
    }
}

const config = {
    width: 800,
    height: 600,
    scene: [GameScene]
};

const game = new Phaser.Game(config);

Core Concepts

Scene Lifecycle

The lifecycle is driven by SceneManager.bootScene() and SceneManager.create():

  1. PENDING (0) - Scene is registered but not yet started.
  2. INIT (1) - scene.init(data) is called if defined. Data comes from settings.data.
  3. START (2) - Systems.start() fires. Events start and ready are emitted.
  4. LOADING (3) - scene.preload() is called if defined. Loader runs. On completion, proceeds to create.
  5. CREATING (4) - scene.create(data) is called if defined. Same data as init.
  6. RUNNING (5) - scene.update(time, delta) called every frame. Scene renders.
  7. PAUSED (6) - No update, but still renders.
  8. SLEEPING (7) - No update, no render. State preserved in memory.
  9. SHUTDOWN (8) - Scene is shut down, systems emit shutdown. Can be restarted.
  10. DESTROYED (9) - Scene is fully destroyed. Cannot be restarted.

State constants are on Phaser.Scenes: Phaser.Scenes.PENDING, Phaser.Scenes.RUNNING, etc.

Flow when no preload exists: init() -> create() -> update() loop (preload is skipped entirely).

Flow with preload: init() -> preload() -> loader runs -> create() -> update() loop.

Scene-Injected Properties

These properties are injected into every Scene instance via the InjectionMap (src/scene/InjectionMap.js). The left side is the Systems key, the right is the Scene property name.

Global Managers (shared across all scenes)
Scene PropertyTypeDescription
this.gamePhaser.GameThe Game instance
this.renderer`CanvasRenderer \WebGLRenderer`The active renderer
this.animsPhaser.Animations.AnimationManagerGlobal animation manager
this.cachePhaser.Cache.CacheManagerGlobal cache for non-image assets
this.pluginsPhaser.Plugins.PluginManagerGlobal plugin manager
this.registryPhaser.Data.DataManagerGlobal data manager (shared between scenes)
this.scalePhaser.Scale.ScaleManagerGlobal scale manager
this.sound`NoAudio \HTML5Audio \WebAudioSoundManager`Sound manager
this.texturesPhaser.Textures.TextureManagerGlobal texture manager
Scene-Specific Systems (unique per scene)
Scene PropertyTypeDescription
this.sysPhaser.Scenes.SystemsScene systems (never overwrite)
this.eventsPhaser.Events.EventEmitterScene-specific event emitter
this.camerasPhaser.Cameras.Scene2D.CameraManagerScene camera manager
this.addPhaser.GameObjects.GameObjectFactoryFactory: creates and adds to display list
this.makePhaser.GameObjects.GameObjectCreatorCreator: creates but does NOT add to display list
this.scenePhaser.Scenes.ScenePluginScene manager plugin (start/stop/launch)
this.childrenPhaser.GameObjects.DisplayListThe scene display list
this.lightsPhaser.GameObjects.LightsManagerScene lights (plugin)
this.dataPhaser.Data.DataManagerScene-specific data manager
this.inputPhaser.Input.InputPluginScene input manager (plugin)
this.loadPhaser.Loader.LoaderPluginScene loader (plugin)
this.timePhaser.Time.ClockScene time/clock (plugin)
this.tweensPhaser.Tweens.TweenManagerScene tween manager (plugin)
this.physicsPhaser.Physics.Arcade.ArcadePhysicsArcade physics (if configured)
this.matterPhaser.Physics.Matter.MatterPhysicsMatter physics (if configured)
Customizing the Injection Map
// Rename injected properties via scene config
const config = {
    key: 'MyScene',
    map: {
        add: 'makeStuff',   // this.makeStuff instead of this.add
        load: 'loader'      // this.loader instead of this.load
    }
};

Scene Manager

The SceneManager (src/scene/SceneManager.js) is a game-level system. Do not call its methods directly -- use this.scene (the ScenePlugin) instead. The SceneManager:

  • Maintains an ordered array of scenes (determines render/update order)
  • Processes a queue of operations (start, stop, sleep, etc.) at the start of each game step
  • All ScenePlugin methods are queued, not immediate (they execute next frame)

Common Patterns

Switching Between Scenes

// start() -- shuts down current scene, starts target scene
// Current scene gets SHUTDOWN event; target gets full lifecycle
this.scene.start('LevelTwo', { score: 100 });

// restart() -- shuts down and restarts the same scene
this.scene.restart({ score: 0 });

// switch() -- sleeps current scene, starts/wakes target scene
// Current scene state is preserved in memory
this.scene.switch('PauseMenu', { fromScene: 'GameScene' });

// transition() -- animated transition with duration
this.scene.transition({
    target: 'LevelTwo',
    duration: 1000,
    moveAbove: true,        // render target above this scene
    sleep: false,           // false = stop this scene (default), true = sleep it
    remove: false,          // true = remove this scene from manager after transition
    allowInput: false,      // allow input on this scene during transition
    data: { score: 100 },
    onUpdate: function (progress) {
        // progress: 0 to 1 over duration
    }
});

Running Scenes in Parallel

// launch() -- starts another scene in parallel (does NOT stop current scene)
this.scene.launch('UIScene', { lives: 3 });

// run() -- smart launcher: starts if not running, resumes if paused, wakes if sleeping
this.scene.run('UIScene', { lives: 3 });

// Control render order of parallel scenes
this.scene.bringToTop('UIScene');      // render last (on top)
this.scene.sendToBack('Background');   // render first (behind)
this.scene.moveAbove('GameScene', 'UIScene');  // UIScene renders above GameScene
this.scene.moveBelow('GameScene', 'Background');
this.scene.moveUp('UIScene');          // move one position up
this.scene.moveDown('UIScene');        // move one position down
this.scene.swapPosition('SceneA', 'SceneB');

Passing Data Between Scenes

// Method 1: Pass data via start/launch/restart/switch/wake/run
this.scene.start('LevelScene', { level: 5, score: 1200 });
// In LevelScene:
// init(data) { data.level === 5 }
// create(data) { data.score === 1200 }

// Method 2: Access data later via sys.getData()
// In receiving scene, at any time:
const data = this.sys.getData(); // returns settings.data

// Method 3: Global registry (shared across ALL scenes)
// In Scene A:
this.registry.set('playerHP', 100);
// In Scene B:
const hp = this.registry.get('playerHP'); // 100

// Method 4: Scene-specific data manager
this.data.set('localValue', 42);
this.data.get('localValue'); // 42

// Method 5: Direct scene reference
const otherScene = this.scene.get('OtherScene');
otherScene.somePublicProperty;

// Method 6: Events on the global registry
// In Scene A:
this.registry.events.on('changedata-playerHP', (parent, value, previousValue) => {
    // react to change
});
// In Scene B:
this.registry.set('playerHP', 50); // triggers the event in Scene A

Pausing and Resuming

// Pause: stops update loop, still renders
this.scene.pause();               // pause this scene
this.scene.pause('OtherScene');   // pause another scene

// Resume: restart update loop
this.scene.resume();
this.scene.resume('OtherScene', { message: 'welcome back' });

// Sleep: no update AND no render, but state preserved
this.scene.sleep();
this.scene.sleep('OtherScene');

// Wake: restore from sleep
this.scene.wake();
this.scene.wake('OtherScene', { data: 'here' });

// Stop: full shutdown, clears display list and timers
this.scene.stop();
this.scene.stop('OtherScene');

// Check state
this.scene.isActive('OtherScene');    // boolean
this.scene.isPaused('OtherScene');    // boolean
this.scene.isSleeping('OtherScene');  // boolean
this.scene.isVisible('OtherScene');   // boolean

// Control visibility/activity independently
this.scene.setActive(false);          // pause
this.scene.setActive(true);           // resume
this.scene.setVisible(false);         // hide but still update
this.scene.setVisible(true);          // show

Adding and Removing Scenes at Runtime

// Add a new scene dynamically
this.scene.add('BonusLevel', BonusLevelScene, false, { someData: true });
// args: key, sceneConfig, autoStart, data

// Remove a scene entirely (destroyed, cannot be restarted)
this.scene.remove('BonusLevel');

// Spawn multiple instances from one class
for (let i = 0; i < 5; i++) {
    this.scene.add('Level' + i, new LevelScene('Level' + i), false);
}

Cross-Scene Event Communication

One scene emits custom events; another listens. The emitting scene is decoupled.

// GameScene emits events
class GameScene extends Phaser.Scene {
    collectCoin(coin) {
        coin.destroy();
        this.events.emit('addScore', 10);
    }
}

// UIScene listens (launched in parallel with { active: true })
class UIScene extends Phaser.Scene {
    constructor() {
        super({ key: 'UIScene', active: true });
    }

    create() {
        this.score = 0;
        this.scoreText = this.add.text(10, 10, 'Score: 0');

        // Listen for events from GameScene
        const gameScene = this.scene.get('GameScene');
        gameScene.events.on('addScore', (points) => {
            this.score += points;
            this.scoreText.setText('Score: ' + this.score);
        });
    }
}

Configuring Plugins Per Scene

Disable all default plugins (only core plugins remain):

super({ key: 'MinimalScene', plugins: [] });
// No this.load, this.tweens, this.time, this.input, this.data, this.lights

Include only specific plugins:

super({ key: 'PreloadScene', plugins: ['Loader'] });
// Only this.load is available; this.tweens, this.time, etc. are undefined

Scene Config in Constructor

Pass config to super() for per-scene physics, loader, or preloaded files:

class Level1 extends Phaser.Scene {
    constructor() {
        super({
            key: 'Level1',
            physics: { arcade: { debug: true, gravity: { y: 200 } } },
            loader: { path: 'assets/levels/1/' },
            // 'pack' loads files before preload() runs -- good for progress bar assets
            pack: {
                files: [
                    { type: 'image', key: 'bar', url: 'loaderBar.png' }
                ]
            }
        });
    }
}

Safely Restarting Scenes

Reset state in init(), not the constructor. The constructor runs once; init() runs every start.

class GameScene extends Phaser.Scene {
    constructor() {
        super('GameScene');
        // BAD: this.gameOver = false; -- only set once, not on restart
    }

    init() {
        // GOOD: reset state every time the scene starts
        this.gameOver = false;
        this.score = 0;
    }

    create() {
        // Clean up on shutdown to avoid stale references
        this.events.once('shutdown', () => {
            // Clear any arrays holding game object references
            this.enemies = [];
        });
    }
}

Events

All events are emitted on this.events (the scene-specific EventEmitter) and have string values. Listen via this.events.on('eventname', callback).

Lifecycle Events

Event StringConstantCallback SignatureWhen
'boot'Phaser.Scenes.Events.BOOT(sys)Once, when scene is first instantiated (for plugins)
'start'Phaser.Scenes.Events.START(sys)Scene systems start (for plugins)
'ready'Phaser.Scenes.Events.READY(sys, data)After start, for user code
'create'Phaser.Scenes.Events.CREATE(scene)After create() method runs, scene is now RUNNING
'preupdate'Phaser.Scenes.Events.PRE_UPDATE(time, delta)Before update each frame
'update'Phaser.Scenes.Events.UPDATE(time, delta)During update each frame
'postupdate'Phaser.Scenes.Events.POST_UPDATE(time, delta)After update each frame
'prerender'Phaser.Scenes.Events.PRE_RENDER(renderer)Before scene renders
'render'Phaser.Scenes.Events.RENDER(renderer)After scene renders

State-Change Events

Event StringConstantCallback SignatureWhen
'pause'Phaser.Scenes.Events.PAUSE(sys, data)Scene is paused
'resume'Phaser.Scenes.Events.RESUME(sys, data)Scene is resumed
'sleep'Phaser.Scenes.Events.SLEEP(sys, data)Scene is sent to sleep
'wake'Phaser.Scenes.Events.WAKE(sys, data)Scene is woken up
'shutdown'Phaser.Scenes.Events.SHUTDOWN(sys, data)Scene is shutting down
'destroy'Phaser.Scenes.Events.DESTROY(sys)Scene is being destroyed

Transition Events

Event StringConstantCallback SignatureEmitted On
'transitionout'TRANSITION_OUT(targetScene, duration)Source scene
'transitioninit'TRANSITION_INIT(fromScene, duration)Target scene (during init)
'transitionstart'TRANSITION_START(fromScene, duration)Target scene (after create)
'transitionwake'TRANSITION_WAKE(fromScene, duration)Target scene (if woken from sleep)
'transitioncomplete'TRANSITION_COMPLETE(scene)Target scene (when done)

Game Object Events

Event StringConstantCallback Signature
'addedtoscene'ADDED_TO_SCENE(gameObject, scene)
'removedfromscene'REMOVED_FROM_SCENE(gameObject, scene)

For detailed API reference tables and source file maps, see the reference guide.

Gotchas and Common Mistakes

  1. Operations are queued, not immediate. Calling this.scene.start('X') does not start X synchronously. It happens at the next SceneManager update. Do not rely on the target scene's state within the same frame.
  2. start() shuts down the calling scene. this.scene.start('X') stops the current scene and starts X. If you want both running, use launch() or run().
  3. switch() sleeps, start() shuts down. switch() preserves the current scene in memory (sleep), while start() triggers a full shutdown. Sleeping scenes still have their events and references live.
  4. Paused scenes still render. pause() only stops the update loop. The scene is still drawn. Use sleep() to stop both update and render.
  5. Do not overwrite this.sys. The Scene class JSDoc explicitly warns: overwriting this.sys will break everything.
  6. this.scene.start() with no key restarts the current scene. This is equivalent to this.scene.restart().
  7. Data passed to start()/launch() is available in both init(data) and create(data). It is stored in settings.data and accessible later via this.sys.getData().
  8. Sleeping scenes can still receive events from other scenes. If Scene A is sleeping but Scene B emits on the global registry, Scene A's listeners still fire. Be careful with active listeners on sleeping scenes.
  9. Scene render order = array order. Scenes later in the array render on top. Use bringToTop(), sendToBack(), moveAbove(), moveBelow() to control layering.
  10. shutdown vs destroy. Shutdown puts a scene into hibernation (can restart). Destroy permanently removes it. Listen to 'shutdown' to free resources that should be recreated on restart. Listen to 'destroy' for final cleanup.
  11. Plugin properties like this.physics and this.matter are only available if the physics system is configured. They will be undefined otherwise.
  12. The create event fires AFTER the create() method returns, and after the status changes to RUNNING. If you need to do post-create setup, listen for this event.
  13. Reset state in init(), not the constructor. The constructor only runs once when the scene is first instantiated. init() runs every time the scene starts/restarts. Place state resets there.
  14. Clean up on shutdown to avoid stale references. Listen for this.events.once('shutdown',...) to clear arrays holding game objects, remove external event listeners, etc. Stale references to destroyed game objects cause errors on restart.
  15. switch() restarts a paused scene, never resumes it. If you need resume behavior, use run() instead.
  16. Scenes update in reverse order, render in forward order. The top scene updates first (gets input priority), but renders last (appears on top). Establish render order in the game config scene array.

平台分布

Codex

34.37%
按下载量换算108

Claude

28.59%
按下载量换算90

Cursor

19.93%
按下载量换算63

Gemini CLI

10.33%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills