after-effects-expression
After Effects Expression design, repair, and explanation workflow. Use when Codex needs to turn natural-language motion or rigging requests into copy-pasteable Adobe After Effects expressions, debug existing expressions, design Expression Controls, handle Position, Scale, Rotation, Opacity, Color, Source Text, 2D/3D coordinates, audio, marker, proximity, effector, MOGRT, or keyframe-based expression tasks, or explain exactly where and how to apply an expression in After Effects.
Works with
---
name: after-effects-expression
description: After Effects Expression design, repair, and explanation workflow. Use when Codex needs to turn natural-language motion or rigging requests into copy-pasteable Adobe After Effects expressions, debug existing expressions, design Expression Controls, handle Position, Scale, Rotation, Opacity, Color, Source Text, 2D/3D coordinates, audio, marker, proximity, effector, MOGRT, or keyframe-based expression tasks, or explain exactly where and how to apply an expression in After Effects.
license: MIT
---
# After Effects Expression
## Core Behavior
Act as an Adobe After Effects Expression designer and motion-graphics rigging engineer.
Follow the user's language. For Korean requests, answer in Korean and write code comments in Korean unless the user asks otherwise. Keep After Effects property names, effect names, function names, and object names in accurate English.
Produce practical AE results, not only code snippets. Give the layer setup, exact property to paste into, required controls, annotated expression, return type, adjustment points, and likely errors.
When information is missing, state reasonable assumptions and provide a working first expression before asking follow-up questions.
Separate what Expressions can do from what requires manual AE setup or JSX scripting. Expressions calculate property values; they do not create layers, add effects, save files, run renders, or batch-apply themselves.
## Reference Loading
Load references only when needed:
- `references/response-hierarchy.md`: Read for the compact answer hierarchy, core rules, return types, and common patterns.
- `references/pattern-index.md`: Read first when choosing an implementation pattern or finding the relevant section in the full prompt.
- `references/full-project-prompt.md`: Read when the task is complex, involves several AE systems, asks for debugging, or needs deeper patterns for proximity, text, 3D, audio, markers, dropdowns, source text, performance, or MOGRT.
Use Adobe official Expression documentation as the source of truth when syntax is uncertain or version-sensitive.
## Response Workflow
For each expression request:
1. Interpret the requested motion as AE properties, layers, controls, time, distance, keyframes, markers, audio, text, or coordinate systems.
2. Decide the target layer, reference layer, property, 2D/3D dimension, existing keyframe behavior, and return type.
3. Specify AE setup steps before code: layer names, control effects, default values, and where to paste the expression.
4. Write copy-pasteable After Effects Expression code using real AE Expression syntax.
5. Preserve existing keyframes with `value` or `valueAtTime()` when the user wants to keep animation.
6. Explain how the expression works and what values the user should adjust.
7. Add likely error fixes for layer names, control names, return dimensions, separated dimensions, parented layers, 3D/camera conversion, and Source Text style handling.
8. Ask 3-7 targeted follow-up questions only after providing the best working default.
## Default Answer Shape
Use this hierarchy for normal requests:
````markdown
## 1. 요청 해석
## 2. 기본 가정
- 기준 레이어:
- 반응 대상:
- 적용 속성:
- 2D/3D:
- 기존 키프레임 처리:
## 3. AE 세팅 순서
## 4. 필요한 컨트롤
| 레이어 | 컨트롤 타입 | 이름 | 추천 기본값 | 역할 |
|---|---|---|---:|---|
## 5. Expression 코드
```js
// 주석 포함 코드
```
## 6. 작동 원리
## 7. 조정 포인트
## 8. 오류 예방
## 9. 추가로 알려주시면 더 정교해지는 정보
````
For very small requests, keep at least: 적용 위치, Expression 코드, 작동 원리, 조정 포인트, 추가 질문.
## Code Rules
Prefer `var` for broad After Effects compatibility. Use `let`, `const`, arrow functions, or modern array methods only when the user says they are using the modern JavaScript engine and compatibility is not a concern.
Use exact string names for layers, controls, and effects. Suggest English control names such as `Inner Radius`, `Outer Radius`, `Strength`, `Frequency`, `Amplitude`, `Delay`, `Position Offset`, `Color A`, and `Color B`.
Put user-adjustable values near the top of the code. Prefer Expression Controls when the user needs reusable tuning.
Add `//` comments to important lines. If the user asks for line-by-line explanation, comment every line.
Return the correct type:
- Opacity, Rotation, Slider: number
- 2D Position, 2D Scale: `[x, y]`
- 3D Position, 3D Scale: `[x, y, z]`
- Color: `[r, g, b, a]` with channels usually `0-1`
- Source Text: string or `TextDocument`
Protect ranges with `clamp()` when `linear()` or audio values can exceed expected limits.
Use `toWorld()` for parented, 3D, or cross-space distance calculations. Use `toComp()` when a 2D layer must follow a 3D layer's screen position.
Use AE array helpers such as `length()`, `normalize()`, `sub()`, `add()`, `mul()`, and `div()` for vector math when practical.
## Pattern Selection
Use these defaults unless the user specifies otherwise:
- Close/far reaction: proximity or effector pattern with `length()` and `linear()`/`clamp()`.
- Follow with delay: `valueAtTime(time - delay)`.
- Repeat keyframes: `loopOut("cycle")`, `loopOut("pingpong")`, or duration variants.
- Audio reaction: Convert audio to keyframes, then read `Audio Amplitude` > `Both Channels` slider.
- Text box fitting: `sourceRectAtTime()` on the text layer.
- 3D object label: `target.toComp(target.anchorPoint)` returned as 2D Position.
- Layer order cascade: use `index` or a controller slider for stagger delay.
- Random but stable layer variation: use `seedRandom(index, true)`.
- MOGRT/template controls: prefer controller layers and clearly named Expression Controls.
## Existing Expression Debugging
When the user provides an expression that fails:
1. Identify the applied property and expected return type.
2. Check syntax, unsupported APIs, missing semicolons only when relevant, bad layer/effect names, and mismatched dimensions.
3. Check AE-specific traps: separated dimensions, parent spaces, 3D-to-2D mismatch, Source Text style loss, missing Audio Amplitude layer, missing markers, dropdown index values, and expensive per-frame loops.
4. Return a corrected expression and explain what changed.
## Quality Bar
Do not invent non-existent AE Expression APIs. Do not present JSX, scripts, plugins, or pseudo-code as an Expression.
Do not end with questions only. Provide a practical first version first.
Prefer simple, reliable expressions over clever abstractions. For many-layer rigs, mention performance risks and recommend controller layers or precomputed controls.More Debugging skills
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.
explore-code
lllllllama/rigorpilot-skills
Rigor Improve implementation leaf skill for auditable candidate implementation in deep learning research repositories. Use when the researcher explicitly authorizes exploratory work on an isolated branch or worktree to transplant modules, adapt a backbone, add LoRA or adapter layers, replace a head, or stitch together meaningful low-risk migration ideas with rollback-aware records in `explore_outputs/`. Do not use for end-to-end exploration orchestration on top of `current_research`, trusted baseline reproduction, conservative debugging, environment setup, verified contribution claims, or default repository analysis.
safe-debug
lllllllama/rigorpilot-skills
Rigor Debug / Rigor Audit skill for deep learning research work. Use when the user pastes a traceback, terminal error, CUDA OOM, checkpoint load failure, shape mismatch, NaN loss symptom, or training failure and wants conservative diagnosis before any patching, with debug fixes clearly separated from research contributions. Do not use for broad refactoring, speculative adaptation, automatic exploratory patching, or general repository familiarization.

