@coppsary/motionly 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -80
- package/bin/motionly.js +77 -22
- package/package.json +1 -1
- package/templates/motionly-skill/SKILL.md +22 -0
- package/templates/project/AGENTS.md +20 -0
package/README.md
CHANGED
|
@@ -210,14 +210,15 @@ Open Motionly Assistant beside Assets, enter your own provider key, and describe
|
|
|
210
210
|
|
|
211
211
|
**Model quality matters.** The AI model you choose directly affects composition, timing, and correct preset use. Smaller models may generate valid syntax but weaker visual decisions. Prefer a current, high-capability model with strong code-generation and instruction-following performance.
|
|
212
212
|
|
|
213
|
-
For agents working inside the
|
|
213
|
+
For coding agents working inside a project, install the skill with `npx motionly skills add` (or `npx motionly init`, which asks which agent). This writes the `SKILL.md` contract plus a full `references/` library into your agent's folder — Codex (`.agents/`), Claude Code (`.claude/`), Gemini CLI (`.gemini/`), opencode (`.opencode/`), or Kiro (`.kiro/`):
|
|
214
214
|
|
|
215
215
|
| Path | Purpose |
|
|
216
216
|
|---|---|
|
|
217
|
-
|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
220
|
-
|
|
217
|
+
| `<agent>/skills/motionly/SKILL.md` | Quick `.motion` contract |
|
|
218
|
+
| `<agent>/skills/motionly/references/llms.txt` | Discovery index for the focused skills |
|
|
219
|
+
| `<agent>/skills/motionly/references/skills/*/SKILL.md` | Full library: `motion-dsl`, `svg`, `animation`, `timeline`, and more |
|
|
220
|
+
|
|
221
|
+
Point the agent at `AGENTS.md` and the installed `SKILL.md`, then let it load `references/llms.txt` and the reference skills the task needs. Working inside a clone of this repository instead? The same guidance lives at `AGENTS.md` and `.agents/skills/write-motionly/`. See the [AI Authoring Guide](docs/agents/ai-authoring.mdx) for prompting details.
|
|
221
222
|
|
|
222
223
|
Use this short prompt with an LLM or agent working inside the repository:
|
|
223
224
|
|
|
@@ -317,79 +318,29 @@ Known limitations:
|
|
|
317
318
|
|
|
318
319
|
---
|
|
319
320
|
|
|
320
|
-
## Install
|
|
321
|
+
## Install and use
|
|
322
|
+
|
|
323
|
+
Motionly ships on npm — no clone and no global install. It needs Node.js `20.19.0` or newer, and every command runs through `npx`.
|
|
321
324
|
|
|
322
|
-
|
|
325
|
+
### Create a project
|
|
323
326
|
|
|
324
327
|
```bash
|
|
325
328
|
npx motionly init demo
|
|
326
329
|
```
|
|
327
330
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
1. Enter `2` to install the skills inside the new project.
|
|
331
|
-
2. Enter `1` to install them for all supported agents.
|
|
331
|
+
`init` scaffolds the project and asks **which agent you're using**, then installs the Motionly agent skill for just that one (or choose "All supported agents"). Supported agents: **Codex, Claude Code, Gemini CLI, opencode, and Kiro**. The install is not a single file: it writes the `SKILL.md` contract plus a full `references/` library (`motion-dsl`, `svg`, `animation`, `timeline`, and more) with an `llms.txt` discovery index.
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
```text
|
|
336
|
-
$ npx motionly init demo
|
|
337
|
-
Created /path/to/workspace/demo
|
|
338
|
-
|
|
339
|
-
Install Motionly agent skills?
|
|
340
|
-
1. Skip
|
|
341
|
-
2. Project — inside the new project
|
|
342
|
-
3. Global — every project for this user
|
|
343
|
-
Select [1]: 2
|
|
344
|
-
|
|
345
|
-
Which agents should receive the Motionly skill?
|
|
346
|
-
1. All supported agents
|
|
347
|
-
2. Claude Code
|
|
348
|
-
3. Codex
|
|
349
|
-
4. Gemini CLI
|
|
350
|
-
5. Kiro CLI
|
|
351
|
-
Select [1]: 1
|
|
352
|
-
|
|
353
|
-
Added claude: /path/to/workspace/demo/.claude/skills/motionly/SKILL.md
|
|
354
|
-
Added codex: /path/to/workspace/demo/.agents/skills/motionly/SKILL.md
|
|
355
|
-
Added gemini: /path/to/workspace/demo/.gemini/skills/motionly/SKILL.md
|
|
356
|
-
Added kiro: /path/to/workspace/demo/.kiro/skills/motionly/SKILL.md
|
|
357
|
-
|
|
358
|
-
To reopen later: cd demo && npx motionly dev
|
|
359
|
-
|
|
360
|
-
Motionly is running.
|
|
361
|
-
Open this URL in your browser: http://localhost:4173/editor
|
|
362
|
-
Project: /path/to/workspace/demo
|
|
363
|
-
Press Ctrl+C to stop.
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
Open `http://localhost:4173/editor` in your browser. Keep the terminal running while you edit and
|
|
367
|
-
press `Ctrl+C` when finished.
|
|
368
|
-
|
|
369
|
-
Other wizard choices:
|
|
370
|
-
|
|
371
|
-
- Choose **Skip** to create the project without agent skills.
|
|
372
|
-
- Choose **Global** to make the selected skills available to every project for your user.
|
|
373
|
-
- Choose one agent instead of **All supported agents** if you only use that agent.
|
|
374
|
-
|
|
375
|
-
To install skills without creating a project:
|
|
333
|
+
Skip the prompt with flags:
|
|
376
334
|
|
|
377
335
|
```bash
|
|
378
|
-
motionly
|
|
336
|
+
npx motionly init demo --provider opencode # install for one agent, no prompt
|
|
337
|
+
npx motionly init demo --all # every supported agent
|
|
338
|
+
npx motionly init demo --skip-skills # no agent skills
|
|
379
339
|
```
|
|
380
340
|
|
|
381
|
-
|
|
341
|
+
Provider names are `codex`, `claude`, `gemini`, `opencode`, and `kiro`. Use `--scope project` (default) or `--scope global` to install for every project on your machine.
|
|
382
342
|
|
|
383
|
-
|
|
384
|
-
motionly skills add --all --scope project
|
|
385
|
-
motionly skills add --provider codex --scope global
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
Supported provider names are `claude`, `codex`, `gemini`, and `kiro`.
|
|
389
|
-
|
|
390
|
-
### 3. Project layout
|
|
391
|
-
|
|
392
|
-
The project contains:
|
|
343
|
+
The scaffolded project:
|
|
393
344
|
|
|
394
345
|
```text
|
|
395
346
|
demo/
|
|
@@ -400,29 +351,24 @@ demo/
|
|
|
400
351
|
└── README.md
|
|
401
352
|
```
|
|
402
353
|
|
|
403
|
-
###
|
|
354
|
+
### Add skills to an existing project
|
|
404
355
|
|
|
405
356
|
```bash
|
|
406
|
-
|
|
407
|
-
motionly
|
|
357
|
+
npx motionly skills add # pick scope and agents
|
|
358
|
+
npx motionly skills add --all --scope project
|
|
359
|
+
npx motionly skills add --provider codex --scope global
|
|
408
360
|
```
|
|
409
361
|
|
|
410
|
-
|
|
362
|
+
Re-running is safe: existing skill files are kept, never overwritten.
|
|
411
363
|
|
|
412
|
-
###
|
|
413
|
-
|
|
414
|
-
You can use the public package directly through `npx` instead:
|
|
364
|
+
### Open and edit
|
|
415
365
|
|
|
416
366
|
```bash
|
|
417
|
-
|
|
418
|
-
npx motionly
|
|
367
|
+
cd demo
|
|
368
|
+
npx motionly dev
|
|
419
369
|
```
|
|
420
370
|
|
|
421
|
-
For the no-setup browser editor
|
|
422
|
-
|
|
423
|
-
```bash
|
|
424
|
-
npx motionly
|
|
425
|
-
```
|
|
371
|
+
Motionly opens `http://localhost:4173/editor`, loads `project.motion`, serves media from `assets/`, and saves editor changes back to the project. Add `--port <n>` to change the port or `--no-open` to skip launching the browser. For the no-setup browser editor, run `npx motionly`.
|
|
426
372
|
|
|
427
373
|
## Development from source
|
|
428
374
|
|
package/bin/motionly.js
CHANGED
|
@@ -14,14 +14,27 @@ const root = normalize(join(here, '..'));
|
|
|
14
14
|
const dist = join(root, 'dist');
|
|
15
15
|
const skillTemplatePath = join(root, 'templates', 'motionly-skill', 'SKILL.md');
|
|
16
16
|
const projectTemplateRoot = join(root, 'templates', 'project');
|
|
17
|
+
// The full, maintained skill library (llms.txt index + focused SKILL.md files).
|
|
18
|
+
// It ships inside the published package and is installed beside the top-level
|
|
19
|
+
// SKILL.md as a `references/` bundle so agents get real depth, not one file.
|
|
20
|
+
const skillsLibraryRoot = join(root, 'motionly-skills');
|
|
17
21
|
|
|
18
22
|
const PROVIDERS = {
|
|
19
|
-
claude: '.claude/skills/motionly/SKILL.md',
|
|
20
23
|
codex: '.agents/skills/motionly/SKILL.md',
|
|
24
|
+
claude: '.claude/skills/motionly/SKILL.md',
|
|
21
25
|
gemini: '.gemini/skills/motionly/SKILL.md',
|
|
26
|
+
opencode: '.opencode/skills/motionly/SKILL.md',
|
|
22
27
|
kiro: '.kiro/skills/motionly/SKILL.md',
|
|
23
28
|
};
|
|
24
29
|
|
|
30
|
+
const AGENT_LABELS = {
|
|
31
|
+
codex: 'Codex',
|
|
32
|
+
claude: 'Claude Code',
|
|
33
|
+
gemini: 'Gemini CLI',
|
|
34
|
+
opencode: 'opencode',
|
|
35
|
+
kiro: 'Kiro',
|
|
36
|
+
};
|
|
37
|
+
|
|
25
38
|
const MIME = {
|
|
26
39
|
'.html': 'text/html; charset=utf-8',
|
|
27
40
|
'.js': 'text/javascript; charset=utf-8',
|
|
@@ -103,10 +116,12 @@ async function installSkills(base, providers) {
|
|
|
103
116
|
throw new Error(`Unknown provider "${unknown}". Use: ${Object.keys(PROVIDERS).join(', ')}`);
|
|
104
117
|
|
|
105
118
|
const source = await readFile(skillTemplatePath, 'utf8');
|
|
119
|
+
const libraryAvailable = await exists(skillsLibraryRoot);
|
|
106
120
|
for (const provider of providers) {
|
|
107
121
|
const relative = PROVIDERS[provider];
|
|
108
122
|
const target = join(base, relative);
|
|
109
|
-
|
|
123
|
+
const skillDir = dirname(target);
|
|
124
|
+
await mkdir(skillDir, { recursive: true });
|
|
110
125
|
try {
|
|
111
126
|
await writeFile(target, source, { encoding: 'utf8', flag: 'wx' });
|
|
112
127
|
console.log(`Added ${provider}: ${target}`);
|
|
@@ -114,7 +129,38 @@ async function installSkills(base, providers) {
|
|
|
114
129
|
if (error.code !== 'EEXIST') throw error;
|
|
115
130
|
console.log(`Kept ${provider}: ${target} already exists`);
|
|
116
131
|
}
|
|
132
|
+
if (libraryAvailable) {
|
|
133
|
+
const added = await copyReferenceLibrary(skillsLibraryRoot, join(skillDir, 'references'));
|
|
134
|
+
if (added) console.log(` + reference library: ${added} file${added === 1 ? '' : 's'}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Recursively copy the discovery index and focused SKILL.md files from the
|
|
141
|
+
* skill library into an installed `references/` folder. Provider-specific
|
|
142
|
+
* `agents/` metadata is skipped, and existing files are never overwritten so
|
|
143
|
+
* user edits survive re-running the installer. Returns the number of new files.
|
|
144
|
+
*/
|
|
145
|
+
async function copyReferenceLibrary(source, destination) {
|
|
146
|
+
let copied = 0;
|
|
147
|
+
await mkdir(destination, { recursive: true });
|
|
148
|
+
for (const entry of await readdir(source, { withFileTypes: true })) {
|
|
149
|
+
if (entry.name === 'agents') continue;
|
|
150
|
+
const from = join(source, entry.name);
|
|
151
|
+
const to = join(destination, entry.name);
|
|
152
|
+
if (entry.isDirectory()) {
|
|
153
|
+
copied += await copyReferenceLibrary(from, to);
|
|
154
|
+
} else if (entry.name === 'SKILL.md' || entry.name === 'llms.txt' || entry.name === 'AGENTS.md') {
|
|
155
|
+
try {
|
|
156
|
+
await writeFile(to, await readFile(from), { flag: 'wx' });
|
|
157
|
+
copied += 1;
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (error.code !== 'EEXIST') throw error;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
117
162
|
}
|
|
163
|
+
return copied;
|
|
118
164
|
}
|
|
119
165
|
|
|
120
166
|
async function choose(terminal, question, options) {
|
|
@@ -141,10 +187,7 @@ async function selectSkillOptions(terminal, providers, scope) {
|
|
|
141
187
|
if (!selectedProviders.length) {
|
|
142
188
|
const provider = await choose(terminal, 'Which agents should receive the Motionly skill?', [
|
|
143
189
|
{ label: 'All supported agents', value: 'all' },
|
|
144
|
-
{ label:
|
|
145
|
-
{ label: 'Codex', value: 'codex' },
|
|
146
|
-
{ label: 'Gemini CLI', value: 'gemini' },
|
|
147
|
-
{ label: 'Kiro CLI', value: 'kiro' },
|
|
190
|
+
...Object.keys(PROVIDERS).map((id) => ({ label: AGENT_LABELS[id], value: id })),
|
|
148
191
|
]);
|
|
149
192
|
selectedProviders = provider === 'all' ? Object.keys(PROVIDERS) : [provider];
|
|
150
193
|
}
|
|
@@ -194,19 +237,15 @@ async function resolveSkillOptions(argv) {
|
|
|
194
237
|
return options;
|
|
195
238
|
}
|
|
196
239
|
|
|
197
|
-
async function
|
|
198
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY) return;
|
|
199
|
-
|
|
240
|
+
async function promptForAgent(scope) {
|
|
200
241
|
const terminal = createInterface({ input: process.stdin, output: process.stdout });
|
|
201
242
|
try {
|
|
202
|
-
const
|
|
203
|
-
{ label:
|
|
204
|
-
{ label: '
|
|
205
|
-
{ label: 'Global — every project for this user', value: 'global' },
|
|
243
|
+
const choice = await choose(terminal, 'Which agent are you using?', [
|
|
244
|
+
...Object.keys(PROVIDERS).map((id) => ({ label: AGENT_LABELS[id], value: id })),
|
|
245
|
+
{ label: 'All supported agents', value: 'all' },
|
|
206
246
|
]);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
await installSkills(skillBase(options.scope, target), options.providers);
|
|
247
|
+
const providers = choice === 'all' ? Object.keys(PROVIDERS) : [choice];
|
|
248
|
+
return { providers, scope };
|
|
210
249
|
} finally {
|
|
211
250
|
terminal.close();
|
|
212
251
|
}
|
|
@@ -231,7 +270,21 @@ async function initProject(name, argv = []) {
|
|
|
231
270
|
}
|
|
232
271
|
await mkdir(join(target, 'assets'));
|
|
233
272
|
console.log(`Created ${target}`);
|
|
234
|
-
|
|
273
|
+
// Skills install unless opted out. Explicit --provider/--all/--scope flags win
|
|
274
|
+
// (non-interactive/CI). Otherwise, in a terminal, ask which agent to set up;
|
|
275
|
+
// with no terminal and no flags, default to every supported agent.
|
|
276
|
+
if (!argv.includes('--skip-skills') && !argv.includes('--no-skills')) {
|
|
277
|
+
const explicit = parseSkillOptions(argv);
|
|
278
|
+
const scope = explicit.scope ?? 'project';
|
|
279
|
+
let providers = explicit.providers;
|
|
280
|
+
if (!providers.length) {
|
|
281
|
+
providers =
|
|
282
|
+
process.stdin.isTTY && process.stdout.isTTY
|
|
283
|
+
? (await promptForAgent(scope)).providers
|
|
284
|
+
: Object.keys(PROVIDERS);
|
|
285
|
+
}
|
|
286
|
+
if (providers.length) await installSkills(skillBase(scope, target), providers);
|
|
287
|
+
}
|
|
235
288
|
if (process.stdin.isTTY && process.stdout.isTTY) {
|
|
236
289
|
console.log(`\n To reopen later: cd ${name} && npx motionly dev`);
|
|
237
290
|
await serveEditor(argv, target);
|
|
@@ -367,12 +420,14 @@ async function serveEditor(argv, projectFolder = null) {
|
|
|
367
420
|
function printHelp() {
|
|
368
421
|
console.log(`Motionly
|
|
369
422
|
|
|
370
|
-
npx motionly
|
|
371
|
-
npx motionly
|
|
372
|
-
npx motionly
|
|
423
|
+
npx motionly init <project-folder> Create a project; asks which agent to set up
|
|
424
|
+
npx motionly init <folder> --provider codex Create a project; install for one agent (no prompt)
|
|
425
|
+
npx motionly init <folder> --all Create a project; install for every agent
|
|
426
|
+
npx motionly init <folder> --skip-skills Create a project without agent skills
|
|
427
|
+
npx motionly skills add Install agent skills into an existing project
|
|
373
428
|
npx motionly skills add --all
|
|
374
|
-
npx motionly
|
|
375
|
-
npx motionly dev [project-folder]
|
|
429
|
+
npx motionly skills add --provider <codex|claude|gemini|opencode|kiro>
|
|
430
|
+
npx motionly dev [project-folder] Reopen and edit a local project
|
|
376
431
|
|
|
377
432
|
Options: --scope <project|global>, --port <number>, --no-open`);
|
|
378
433
|
}
|
package/package.json
CHANGED
|
@@ -7,6 +7,28 @@ description: Create, edit, validate, and preview editable Motionly .motion anima
|
|
|
7
7
|
|
|
8
8
|
Motionly is a visual motion-graphics editor. Its editable source is `project.motion`; normal users refine it in the editor rather than hand-writing it. Keep generated source readable and load it through Motionly's parser and renderer.
|
|
9
9
|
|
|
10
|
+
## Deep reference library
|
|
11
|
+
|
|
12
|
+
This skill ships a full reference library beside this file at `references/`. This
|
|
13
|
+
SKILL.md is only the quick contract — **before any non-trivial `.motion` work,
|
|
14
|
+
open `references/llms.txt` and load the focused skills it lists**, then follow
|
|
15
|
+
`references/AGENTS.md` for routing by intent:
|
|
16
|
+
|
|
17
|
+
- `references/skills/motion-dsl/SKILL.md` — canvas, imports, elements, tracks, clips, audio, animations, keyframes, validation (load this first for any authoring or repair)
|
|
18
|
+
- `references/skills/svg/SKILL.md` — logos, icons, diagrams, vector artwork, drawSVG, fill/stroke, local zoom/pan
|
|
19
|
+
- `references/skills/animation/SKILL.md` and `references/skills/easing/SKILL.md` — choreography, presets, keyframes, timing
|
|
20
|
+
- `references/skills/camera/SKILL.md` — global camera vs. local artwork focus
|
|
21
|
+
- `references/skills/composition/SKILL.md` — hierarchy, spacing, color, brand, scene review
|
|
22
|
+
- `references/skills/typography/SKILL.md` — titles, captions, kinetic type, narration timing
|
|
23
|
+
- `references/skills/transitions/SKILL.md` — scene changes, wipes, crossfades, continuity
|
|
24
|
+
- `references/skills/timeline/SKILL.md` — tracks, clips, trim, retime, overlap, audio placement
|
|
25
|
+
- `references/skills/assets/SKILL.md` — PNG/JPEG, SVG, GIF, MP4, WebM, MOV, Lottie, codecs
|
|
26
|
+
- `references/skills/rendering/SKILL.md` — preview, scrub, export, inspection, limitations
|
|
27
|
+
- `references/skills/templates/SKILL.md` — product launch, logo reveal, diagram, social-stat storyboards
|
|
28
|
+
|
|
29
|
+
Load only the topics the current task needs. The library is authoritative when it
|
|
30
|
+
is more detailed than the summary below.
|
|
31
|
+
|
|
10
32
|
## Project and asset workflow
|
|
11
33
|
|
|
12
34
|
- Read `AGENTS.md`, `project.motion`, and relevant files in `assets/` before editing.
|
|
@@ -4,6 +4,26 @@ Keep Motionly simple and visual.
|
|
|
4
4
|
|
|
5
5
|
Read the installed `motionly` skill before creating or substantially editing `project.motion`.
|
|
6
6
|
|
|
7
|
+
## Agent Skill
|
|
8
|
+
|
|
9
|
+
Installing the skill placed it at `.<agent>/skills/motionly/SKILL.md` (Codex uses
|
|
10
|
+
`.agents/`, plus `.claude/`, `.gemini/`, `.opencode/`, or `.kiro/`). That file is the
|
|
11
|
+
quick contract; a full reference library sits beside it under `references/` (`llms.txt`
|
|
12
|
+
index plus focused skills: `motion-dsl`, `svg`, `animation`, `easing`, `camera`, `composition`,
|
|
13
|
+
`typography`, `transitions`, `timeline`, `assets`, `rendering`, `templates`).
|
|
14
|
+
|
|
15
|
+
Before writing or repairing `.motion` beyond a trivial edit:
|
|
16
|
+
|
|
17
|
+
1. Read this file and `project.motion`.
|
|
18
|
+
2. Open the skill `SKILL.md`, then `references/llms.txt`, and load
|
|
19
|
+
`references/skills/motion-dsl/SKILL.md` plus only the other reference skills the
|
|
20
|
+
task needs.
|
|
21
|
+
3. Treat the reference library and Motionly's parser/renderer as authoritative over
|
|
22
|
+
the short summary below.
|
|
23
|
+
|
|
24
|
+
If the skill was not installed, run `npx motionly skills add` to add it (with its
|
|
25
|
+
reference library) for your agent.
|
|
26
|
+
|
|
7
27
|
## Product Rule
|
|
8
28
|
|
|
9
29
|
Motionly is a motion graphics editor around `.motion`. The user edits visually; `.motion` is the saved source format underneath.
|