Communitygithub.com

spine-motion-authoring

分析现有 Spine 动物及类动物角色的骨架和动作规范,以稀疏关键姿势和版本兼容曲线生成、修改或迁移动作。用于四足、禽类、飞行、昆虫、软体等角色;禁止逐帧采样生成和固定时间步密集写键。

spine-motion-authoring 是什么?

spine-motion-authoring is a Claude Code agent skill that 分析现有 Spine 动物及类动物角色的骨架和动作规范,以稀疏关键姿势和版本兼容曲线生成、修改或迁移动作。用于四足、禽类、飞行、昆虫、软体等角色;禁止逐帧采样生成和固定时间步密集写键。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/tonyfly321/spine-motion/tree/HEAD/spine-motion-authoring

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Spine Animal Motion Authoring

Create new motions that respect the current animal's body type, forces, and rhythm while preserving an editable sparse timeline. Learn from the author's existing decisions; do not treat one animal's bone names, curve encoding, or gait as universal for all animals.

Mandatory Generation Constraints

  • Prohibit frame-by-frame sampling generation of Spine keyframes. When creating keyframes, do not build fps × duration, frameCount, frame number loops, fixed dt, or range(per frame) time arrays; do not output keyframes at every time step.
  • Do not evaluate mathematical functions, video poses, IK, or player states frame by frame and write animation; do not use the workaround of "dense sampling first, then decimate/delete keys." Dense sampling must not be used as training data generation method for this skill.
  • First list the limited semantic events and key poses, then write keys for each channel's required subset. Each new key must correspond to contact, lift-off, swing extreme, force, buffer, attachment switch, end state, or another clear turning point, and have a reason for existence.
  • FPS may only be used to align already selected key moments; it does not determine the number of keys. The number of keys may only increase when there are real additional steps, wingbeats, or action phases. Simply slowing down the same action must not add sampling keys.
  • Reading existing keyframes from files is allowed. IK solving only for planned key poses is allowed. Normal continuous playback rendering for viewing is allowed. Do not write intermediate preview/player states back as keyframes. When checking for foot sliding, do not scan a fixed time grid and generate a full set of correction keys.
  • Rendering a completed animation to GIF/video pixels at display frame rate is allowed only as read-only output. Display frame count does not determine Spine key count; rendering state must not be written back as keyframes or a dense training pose library.
  • Do not fill all channels with the same time set. Static initial/reset keys should only be retained when truly needed for switching, blending, or current control range; do not repeat constant values for the sake of "rich motion."

Choosing How to Work

  • Learning materials or extended animal library: read learning-method.md to build traceable motion cards; for local materials, read corpus-guide.md.
  • Generating or modifying motion: first read sparse-authoring.md to work with key poses and curves; for cross-body-type or control structure changes, read species-profiles.md.
  • JSON version, curves, skin, attachment, or mesh operations: read the relevant section of spine-json.md for the current format. In particular, do not use 3.x angle and normalized curves for 4.1 data.
  • When the user provides a GIF motion reference or requests an animated GIF export, read gif-reference.md to distinguish observation, key pose creation, and pixel rendering.
  • To inspect existing specific animations, use scripts/inspect_spine.py. Do not load the entire corpus-index.json or all reference files by default.

Data and Target Identification

Prioritize reading the user-specified skeleton, assets, and reference animation directory. When no reference library is specified, first check relevant materials in the current task directory; only ask when the target cannot be determined or necessary resources are missing. Historical source index is only for statistics; additional examples in the repository should be read according to their case description, not relying on the author's computer directory. Different exports/different skins must not be automatically identified as the final version by "largest file" or "highest number"; clarify the target when necessary.

Read the actual JSON, associated atlas (including .atlas.txt), and images. .spine filenames and directory names do not prove version or animal structure; binary projects should be handled by matching the editor operations, not fabricated. When atlas is missing, learning from JSON is still possible, but do not claim to have completed runtime visual verification.

First determine the motion name, animal/skin, duration, single or loop, in-place or root displacement, intensity/emotion, and end state. When these can be determined from the request and selected materials, proceed directly; only ask about missing items that affect the output.

Establish a semantic mapping of the current skeleton: body/center of gravity, chest/abdomen/neck, head, each support limb and its end, tail/nose/wing/clothing, decorations and effects. The mapping should be based on parent-child hierarchy, constraints, weights, attachments, and poses, not names or IK indices. Preserve exact spelling, spaces, slash prefixes, bending direction, solving order, transform inheritance, and occlusion.

In-place/displacement should match the current purpose. In-place loops have net displacement driven by the scene; root displacement must explicitly specify displacement per cycle and the caller's accumulation method. Do not convert a genuine retreat requirement into a direction flip or reverse walk just to simplify looping.

Authoring and Checking

  1. Select the closest motion, read its existing key moments and curves, distinguishing original exports, conversions, static resets, empty actions, and homologous aliases. Base decisions on reference phases, contact relationships, and phases, not absolute pixel values.
  2. Create a sparse plan: semantic events, phases/timings, current bone roles, target poses, curves/tangents, and key budget per channel. Only select necessary events for each channel. See the sparse-authoring reference for paradigms.
  3. First establish main poses, center of gravity, and contact, then add head, flexible appendages, and necessary local adjustments. Migrate displacement based on limb length/body height; determine angles based on actual constraints and meshes; tail swing can be synchronized or delayed, chosen according to reference and motion purpose.
  4. Solve and write keys only for planned poses, using Bezier, linear, or stepped of the current version to express motion between keys. If issues are found, first adjust poses, timing distribution, or curves; only add keys with justification when a genuine new semantic turn or contact failure occurs.
  5. By default, deep-copy the user-selected full JSON, add the new animation, and save separately; when modifying an existing animation, only modify the authorized scope. Preserve all original animations, skeleton, constraints, meshes, skins, and resources. Add events/attachments only when required by the task, do not assume game logic based on event names.
  6. Validate structure, sparse plan, key count, loop state, and necessary tangents; in matching runtime/editor real-time playback, check key poses, contact boundaries, and seams. Matching endpoint values alone does not imply continuous velocity. Clearly state when playback checking is incomplete.

When only extending or slowing the same motion, keep the number of key events, retime the keyframes and their curve control points according to the current format. When appending genuine cycles, you may copy semantic key poses per cycle, but not copy frames.

Read-Only Analysis and Generation Validation Tools

The two tools only read existing keys, plans, and files, without fixed-timestep pose sampling or animation generators; they use the Python standard library.

Execute in the skill directory, or modify the scripts to their full path:

python -X utf8 scripts/inspect_spine.py "animal directory or JSON" --rig
python -X utf8 scripts/inspect_spine.py "animal.json" --animation "existing animation name" --output "analysis.json"
python -X utf8 scripts/validate_motion.py --source "original.json" --output "result.json" --animation "new animation name" --plan "key pose plan.json"

inspect_spine.py distinguishes versions and skin types, lists actual keyframes, curves, and suspected fixed-interval dense tracks; animation hashes are used to discover identical aliases. Total key count, 30 fps alignment, or a small number of equally spaced keys alone cannot determine baking.

validate_motion.py checks source data preservation, new animation references, duration, keys corresponding to the semantic plan, format fields, and deform ranges. Dense timings are a review signal, but single interval spacing alone cannot prove frame-by-frame keying; requires_review=true/exit code 2 indicates a need to check real events and the creation process. When default values for transform/path constraints are not fully covered, they must also be checked according to the current format, and endpoint inequality must not be misjudged. The tool does not prove foot contact, mesh naturalness, or seamless tangents, nor can it prove that the generation code never sampled. Use --replace only when modifying an already authorized existing animation; use --allow-event-definitions only when truly necessary to add new event definitions.

Delivery

Provide the complete JSON or user-specified fragment, motion name, duration, playback loop/displacement recommendation, actual references used, and validation results. Reuse the original atlas/textures or attach necessary resources. Explain motion performance and available results, avoiding filling the user's workflow with internal script details.

When only performing structural checks, state: "Structure and sparse plan validated; visual playback pending confirmation." Do not replace full motion playback with static textures or key lists. Do not add a non-existent loop field to the JSON.

相关技能