Token导航 LogoToken导航

Agent Skill · 研究检索

actions-and-utilities(动作和实用程序)

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

actions-and-utilities 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 43,194。

总安装 1,004周安装 41GitHub Stars 39,517下载 321核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/phaserjs/phaser --skill actions-and-utilities

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Actions & Utilities 提供 Phaser 4 游戏引擎中批量操作 Game Object 的工具函数集合。适用于需要快速排列精灵、调整属性分布或管理对象数组的 2D 游戏开发场景。包含网格对齐、数值扩散、偏移迭代等常用批处理方法,简化复杂布局逻辑。

需从 GitHub 仓库安装,使用前请确认项目使用 Phaser 4 且已导入相关命名空间。注意该技能仅提供函数调用指导,不涉及图形渲染或物理模拟,需配合游戏循环使用。

来源仓库内路径:skills/actions-and-utilities

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

actions-and-utilities 怎么安装?

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

actions-and-utilities 支持哪些 AI 工具?

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

actions-and-utilities 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

actions-and-utilities 是免费的吗?

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

actions-and-utilities 用的人多吗?

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

actions-and-utilities 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 39,517 星,维护活跃度相对可查。

先想清楚的地方

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

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
actions-and-utilities

动作和实用程序 · 本页

1,00439,517需要联网未明确通过

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

SKILL.md 原文

Phaser 4 -- Actions & Utility Functions

Phaser.Actions namespace for batch operations on Game Object arrays, plus Phaser.Utils.Array, Phaser.Utils.Objects, and Phaser.Utils.String helper functions.

Related skills:../groups-and-containers/SKILL.md,../sprites-and-images/SKILL.md


Quick Start

// Create 20 sprites and batch-position them in a grid
const sprites = [];
for (let i = 0; i < 20; i++) {
    sprites.push(this.add.sprite(0, 0, 'gem'));
}

// Arrange into a 5x4 grid
Phaser.Actions.GridAlign(sprites, {
    width: 5,
    height: 4,
    cellWidth: 64,
    cellHeight: 64,
    x: 100,
    y: 100
});

// Fade alpha from 0 to 1 across all sprites
Phaser.Actions.Spread(sprites, 'alpha', 0, 1);

// Offset each sprite's x by 10, with a step of 2 per item
Phaser.Actions.IncX(sprites, 10, 2);

// Works with Groups too
const group = this.add.group({ key: 'star', repeat: 11 });
Phaser.Actions.PlaceOnCircle(group.getChildren(), new Phaser.Geom.Circle(400, 300, 200));

Core Concepts

The Actions Pattern

Every Action in Phaser.Actions follows the same pattern:

  1. First argument is always an array of Game Objects (or any objects with the required public properties like x, y, alpha, etc.).
  2. Returns the same array, enabling chaining or pass-through.
  3. Works with Groups by passing group.getChildren().
  4. Actions do NOT store state. They are one-shot batch operations.

PropertyValueSet and PropertyValueInc

Most Set/Inc actions delegate to two core functions:

  • PropertyValueSet(items, key, value, step, index, direction) -- Sets items[i][key] = value + (i * step).
  • PropertyValueInc(items, key, value, step, index, direction) -- Adds items[i][key] += value + (i * step).

The step parameter adds an incremental offset per item. The index and direction parameters control iteration start point and order (1 = forward, -1 = backward).

Geometry-Based Placement

Actions like PlaceOnCircle, PlaceOnLine, RandomRectangle, etc. accept Phaser geometry objects (Phaser.Geom.Circle, Phaser.Geom.Line, etc.), NOT Game Object shapes. If using a Phaser.GameObjects.Circle, pass its .geom property instead.


All Actions

Property Setters

ActionSignatureDescription
SetX(items, value, step?, index?, direction?)Set x property
SetY(items, value, step?, index?, direction?)Set y property
SetXY(items, x, y?, stepX?, stepY?, index?, direction?)Set both x and y; y defaults to x
SetAlpha(items, value, step?, index?, direction?)Set alpha
SetBlendMode(items, value, index?, direction?)Set blend mode
SetDepth(items, value, step?, index?, direction?)Set render depth
SetHitArea(items, hitArea?, callback?)Set interactive hit area
SetOrigin(items, originX, originY?, stepX?, stepY?, index?, direction?)Set origin point
SetRotation(items, value, step?, index?, direction?)Set rotation (radians)
SetScale(items, scaleX, scaleY?, stepX?, stepY?, index?, direction?)Set both scale axes
SetScaleX(items, value, step?, index?, direction?)Set scaleX
SetScaleY(items, value, step?, index?, direction?)Set scaleY
SetScrollFactor(items, x, y?, stepX?, stepY?, index?, direction?)Set scroll factor
SetScrollFactorX(items, value, step?, index?, direction?)Set horizontal scroll factor
SetScrollFactorY(items, value, step?, index?, direction?)Set vertical scroll factor
SetTint(items, topLeft, topRight?, bottomLeft?, bottomRight?)Set tint color(s)
SetVisible(items, value, index?, direction?)Set visibility
PropertyValueSet(items, key, value, step?, index?, direction?)Generic: set any named property

Property Incrementers

ActionSignatureDescription
IncX(items, value, step?, index?, direction?)Add to x
IncXY(items, x, y?, stepX?, stepY?, index?, direction?)Add to x and y
IncY(items, value, step?, index?, direction?)Add to y
IncAlpha(items, value, step?, index?, direction?)Add to alpha
Angle(items, value, step?, index?, direction?)Add to angle (degrees)
Rotate(items, value, step?, index?, direction?)Add to rotation (radians)
ScaleX(items, value, step?, index?, direction?)Add to scaleX
ScaleXY(items, scaleX, scaleY?, stepX?, stepY?, index?, direction?)Add to both scale axes
ScaleY(items, value, step?, index?, direction?)Add to scaleY
PropertyValueInc(items, key, value, step?, index?, direction?)Generic: increment any named property

Placement on Geometry

ActionSignatureDescription
PlaceOnCircle(items, circle, startAngle?, endAngle?)Evenly space on circle perimeter
PlaceOnEllipse(items, ellipse, startAngle?, endAngle?)Evenly space on ellipse perimeter
PlaceOnLine(items, line)Evenly space along a line
PlaceOnRectangle(items, rect, shift?)Evenly space on rectangle perimeter
PlaceOnTriangle(items, triangle, stepRate?)Evenly space on triangle perimeter
RandomCircle(items, circle)Random positions within a circle
RandomEllipse(items, ellipse)Random positions within an ellipse
RandomLine(items, line)Random positions along a line
RandomRectangle(items, rect)Random positions within a rectangle
RandomTriangle(items, triangle)Random positions within a triangle

Layout and Alignment

ActionSignatureDescription
GridAlign(items, config)Arrange in grid; config: {width, height, cellWidth, cellHeight, position, x, y}
AlignTo(items, position, offsetX?, offsetY?)Chain-align each item next to the previous one using Phaser.Display.Align constants
FitToRegion(items, scaleMode?, region?, itemCoverage?)Scale/position each GO to fill a rectangle (v4.0.0+). scaleMode: 0=stretch, -1=fit inside, 1=cover outside

Distribution and Interpolation

ActionSignatureDescription
Spread(items, property, min, max, inc?)Linearly distribute a property from min to max across all items
SmoothStep(items, property, min, max, inc?)Distribute using Hermite smoothstep interpolation
SmootherStep(items, property, min, max, inc?)Distribute using Ken Perlin's smootherstep

Rotation and Movement

ActionSignatureDescription
RotateAround(items, point, angle)Rotate all items around a point (radians)
RotateAroundDistance(items, point, angle, distance)Rotate around a point at a fixed distance
ShiftPosition(items, x, y, direction?, output?)Snake-like: move head to x/y, each item takes position of the previous
WrapInRectangle(items, rect, padding?)Wrap x/y to stay within rectangle bounds

Queries and Iteration

ActionSignatureDescription
GetFirst(items, compare, index?)Find first item matching all properties in compare object
GetLast(items, compare, index?)Find last item matching all properties in compare object
Call(items, callback, context)Invoke callback for each item
Shuffle(items)Randomly reorder the array (Fisher-Yates)
ToggleVisible(items)Toggle visible on each item
PlayAnimation(items, key, ignoreIfPlaying?)Play animation on all items with an anims component

Effects (v4.0.0+)

ActionSignatureDescription
AddEffectBloom(items, config?)Add Bloom filter effect to a Camera or GO. Returns {parallelFilters, threshold, blur}[]
AddEffectShine(items, config?)Add Shine filter effect
AddMaskShape(items, config?)Apply a shape-based mask (circle, square, rectangle, ellipse) with optional blur

Array Utilities

Namespace: Phaser.Utils.Array

FunctionSignatureDescription
Add(array, item, limit?, callback?, context?)Add item(s) if not already present; optional size limit
AddAt(array, item, index?, limit?, callback?, context?)Insert item(s) at index
BringToTop(array, item)Move item to end of array
CountAllMatching(array, property, value, startIndex?, endIndex?)Count items where property equals value
Each(array, callback, context,...args)Iterate with callback; passes item + extra args
EachInRange(array, callback, context, startIndex, endIndex,...args)Iterate a slice with callback
FindClosestInSorted(value, array, key?)Binary-search style closest match in sorted array
Flatten(array, output?)Flatten nested arrays into a single array
GetAll(array, property?, value?, startIndex?, endIndex?)Filter items matching property/value
GetFirst(array, property?, value?, startIndex?, endIndex?)First item matching property/value
GetRandom(array, startIndex?, length?)Return a random element
MoveAbove(array, item1, item2)Move item2 directly above item1
MoveBelow(array, item1, item2)Move item2 directly below item1
MoveDown(array, item)Move item one position toward index 0
MoveTo(array, item, index)Move item to specific index
MoveUp(array, item)Move item one position toward end
NumberArray(start, end, prefix?, suffix?)Generate [start..end] range; optional string prefix/suffix
NumberArrayStep(start?, end?, step?)Generate range with custom step size
QuickSelect(array, k, left?, right?, compare?)Partial sort: kth smallest element in-place
Range(a, b, options?)Generate array from range config
Remove(array, item, callback?, context?)Remove item(s) from array
RemoveAt(array, index, callback?, context?)Remove item at index
RemoveBetween(array, startIndex, endIndex, callback?, context?)Remove items in range
RemoveRandomElement(array, startIndex?, length?)Remove and return a random element
Replace(array, oldItem, newItem)Swap one item for another
RotateLeft(array, total?)Shift elements left; last wraps to front
RotateRight(array, total?)Shift elements right; first wraps to end
SafeRange(array, startIndex, endIndex, throwError?)Validate index range is within bounds
SendToBack(array, item)Move item to index 0
SetAll(array, property, value, startIndex?, endIndex?)Set a property on all items in range
Shuffle(array)Fisher-Yates shuffle; modifies in-place
SortByDigits(array)Sort strings by embedded numeric values
SpliceOne(array, index)Fast single-element splice
StableSort(array, compare?)Guaranteed stable sort (merge sort fallback for engines without native stable sort)
Swap(array, item1, item2)Swap two items in-place

Also includes Phaser.Utils.Array.Matrix sub-namespace for 2D matrix operations.


Object Utilities

Namespace: Phaser.Utils.Objects

FunctionSignatureDescription
Clone(obj)Shallow clone of object
DeepCopy(obj)Recursive deep copy of object or array
Extend(target,...sources)jQuery-style extend; copies properties from sources to target
GetAdvancedValue(source, key, defaultValue)Like GetValue but resolves random/callback config values
GetFastValue(source, key, defaultValue?)Top-level-only property lookup; no dot-path support. Faster than GetValue
GetMinMaxValue(source, key, min, max, defaultValue)Get value clamped between min and max
GetValue(source, key, defaultValue, altSource?)Dot-path property lookup (e.g. 'render.screen.width'). Falls back to altSource then defaultValue
HasAll(source, keys)True if source has ALL listed keys
HasAny(source, keys)True if source has ANY listed key
HasValue(source, key)True if source has the key
IsPlainObject(obj)True if obj is a plain {} object (not DOM, not window)
Merge(obj1, obj2)Merge obj2 into a clone of obj1
MergeRight(obj1, obj2)Merge obj1 into a clone of obj2
Pick(source, keys)Return new object with only the specified keys
SetValue(source, key, value)Set a dot-path property value

String Utilities

Namespace: Phaser.Utils.String

FunctionSignatureDescription
Format(string, values)Replace %1, %2, etc. markers with array values
Pad(str, len?, pad?, dir?)Pad string to length. dir: 1=left, 2=right, default=both
RemoveAt(string, index)Remove character at index
Reverse(string)Reverse the string
UppercaseFirst(string)Capitalize first character
UUID()Generate RFC4122 v4 UUID string

Common Patterns

Using Actions with Groups

const enemies = this.add.group({ key: 'enemy', repeat: 9 });

// Position all children in a grid
Phaser.Actions.GridAlign(enemies.getChildren(), {
    width: 5, height: 2,
    cellWidth: 80, cellHeight: 80,
    x: 100, y: 50
});

// Fan out alpha across all enemies
Phaser.Actions.Spread(enemies.getChildren(), 'alpha', 0.3, 1);

Step Parameter for Staggered Values

// Place sprites starting at x=100, each one 50px further right
Phaser.Actions.SetX(sprites, 100, 50);
// Result: items[0].x=100, items[1].x=150, items[2].x=200, ...

// Increment rotation with increasing step
Phaser.Actions.Rotate(sprites, 0.1, 0.05);
// Result: items[0].rotation += 0.1, items[1].rotation += 0.15, items[2].rotation += 0.2, ...

Scatter Then Constrain

const bounds = new Phaser.Geom.Rectangle(0, 0, 800, 600);
// Random scatter
Phaser.Actions.RandomRectangle(sprites, bounds);
// Keep wrapped in bounds during update
Phaser.Actions.WrapInRectangle(sprites, bounds);

GetValue for Config Parsing

// Deep property access with fallback
const width = Phaser.Utils.Objects.GetValue(config, 'render.screen.width', 800);

// Fast top-level lookup (no dot-path, better performance)
const speed = Phaser.Utils.Objects.GetFastValue(config, 'speed', 100);

NumberArray for Asset Keys

// Generate frame key strings
const keys = Phaser.Utils.Array.NumberArray(1, 10, 'frame_', '.png');
// Result: ['frame_1.png', 'frame_2.png', ..., 'frame_10.png']

Gotchas

  • Actions operate on plain arrays, not Groups directly. Always call group.getChildren() to get the array.
  • PlaceOn/Random geometry actions need Phaser.Geom objects, not Game Object shapes. For a Phaser.GameObjects.Circle, pass circle.geom.
  • SetXY defaults y to x if y is undefined or null. Pass 0 explicitly if you want y=0 and x=something else.
  • Spread with a single item places it at the midpoint (min + max) / 2, not at min.
  • step is multiplied by iteration index, not added cumulatively. Item 0 gets value + 0*step, item 1 gets value + 1*step, etc.
  • StableSort uses native Array.sort when the engine supports stable sorting, falling back to merge sort only when needed.
  • Shuffle (both Actions and Utils.Array) modifies the array in-place and returns it.
  • GetValue vs GetFastValue: Use GetFastValue when the key is always top-level (no dots). It skips dot-path parsing and is faster in hot loops.
  • AddEffectBloom / AddEffectShine / AddMaskShape are v4-only filter-based effects. They return arrays of created effects instead of the input.

Source File Map

AreaPath
All Actionssrc/actions/
Actions indexsrc/actions/index.js
Core set/inc helperssrc/actions/PropertyValueSet.js, src/actions/PropertyValueInc.js
GridAlign config typedefsrc/actions/typedefs/
Array utilitiessrc/utils/array/
Array matrix utilssrc/utils/array/matrix/
Object utilitiessrc/utils/object/
String utilitiessrc/utils/string/

平台分布

Codex

39.35%
按下载量换算126

Claude

30.98%
按下载量换算99

Cursor

17.74%
按下载量换算57

Gemini CLI

8.94%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills