AI assistants and the agent skill
Cascade is built to be written by AI coding assistants as well as people. The API is small and regular, the package ships a guide written for assistants, and Pro can play animations described as validated JSON.
Install the Cascade agent skill
The skill teaches a coding agent how to use Cascade: which calls exist, the mistakes to avoid, and
how to check its own output. It works with Claude Code, Cursor, Codex, GitHub Copilot and any agent that
reads SKILL.md files.
npx skills add twitchedd/cascade-skill
Or copy skills/cascade/ from the repository into your agent's skills folder (for Claude
Code: .claude/skills/cascade/).
Skill on GitHub Skill on skills.sh
It writes code for your tier
The skill first checks Packages/manifest.json to see whether the project has Cascade
Lite or Cascade Pro, and writes only code that tier can compile. Ask a Lite project for a bouncy spring and
it says springs are in Pro and offers the closest Lite version, an Ease.OutBack overshoot.
Things to ask it
- "Make the settings panel slide up and fade in when it opens."
- "Stagger the inventory slots in from the right."
- "Make this button pop when pressed."
- "Shake the gold counter when the player can't afford an item."
- "Respect reduced motion in all our menu animations."
The AI guide inside the package
Both tiers ship Documentation~/AI-GUIDE.md, written for assistants: every verb, the
easing names, the rules that prevent the common mistakes, and examples from intent to code. Because it
comes with the package, it always matches the version you have installed. The skill reads it when it
exists. Without the skill, point your assistant at it:
Read Packages/com.twitched.cascade.lite/Documentation~/AI-GUIDE.md,
then fade the shop panel in when it opens.
(For Pro the folder is Packages/com.twitched.cascade/.)
The rule assistants most often miss
Every verb animates to a value, starting from the element's current value. "Fade in" on an element that is already visible animates from 1 to 1, and nothing happens. Entrances must state where they start:
panel.Animate().Fade(1f, 0.3f).From(0f).Ease(Ease.OutCubic); // not just Fade(1f, 0.3f)
The guide and the skill both teach this, and Pro's linter (below) catches it.
JSON animation sequences Pro
For self-contained effects such as an entrance, a shake or a pulse, an assistant can describe the animation as JSON instead of code. JSON is constrained and checked before it runs, so a mistake produces a precise error instead of code that fails to compile.
{ "steps": [ { "actions": [
{ "verb": "SlideIn", "edge": "Bottom", "distance": 40, "duration": 0.4, "ease": "OutCubic" },
{ "verb": "Fade", "from": 0, "to": 1, "duration": 0.4, "ease": "OutCubic" }
] } ] }
Steps run one after another; the actions inside a step run together. Durations are in seconds.
using Cascade;
SequencePreset.PlayJson(panel, json); // parse and play
if (SequencePreset.TryFromJson(json, out var preset, out string error)) // or check first
preset.Play(panel);
else
Debug.LogWarning(error); // e.g. "step 0, action 1: verb 'Fade' requires a numeric "to""
Let the assistant fix its own output
Errors name the exact step, action and field, and suggest the closest valid name for a typo, so an assistant can correct the JSON and try again:
MotionError err = SequencePreset.Validate(json);
if (err.IsError)
{
// err.Code: UnknownVerb, MissingField, OutOfRange, ...
// err.Path: "steps[0].actions[1].to"
// err.Suggestion: "Fade" for a misspelled verb, otherwise null
}
foreach (var advice in SequencePreset.Lint(json)) // valid, but would do nothing
Debug.Log(advice); // e.g. a fade-in without "from"
Validate answers "will this run". Lint answers "will this do what was meant",
for example a fade-in on an element that is already visible.
The full format is in a JSON Schema you can give to a model or a validator: cascade-sequence.schema.json.
From JSON to the inspector
A generated sequence can be saved as a preset asset, and designers pick it in the
UI Animator component's rules without writing code. The Documentation~
folder includes PROMPTS.md, a set of ready-made intents with their JSON.
For AI search and crawlers
This site publishes llms.txt, a plain-text index of these docs for language models and AI search tools.