premiere-pro
Skill4 starsChanged 7 months agoMITView on GitHub
Automate Adobe Premiere Pro via ExtendScript. Use when the user asks to create, modify, or query anything in a Premiere Pro project — sequences, tracks, clips, effects, transitions, markers, captions, import, export. Generates and executes JSX ExtendScript via osascript on macOS.
In this repositoryOne other file it gives its agents.
- after-effectsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
32 rules. About 0 are common, 16 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Run scripts/runner.sh with any query script to detect the Premiere Pro version
- Very specific: line 22
If multiple versions are installed, the user must choose one — runner.sh will prompt
- Distinctive: line 23
Ensure Premiere Pro Preferences > Scripting > "Enable scripting" is checked
- Very specific: line 31
Use --background for all query scripts — this skips ppro.activate() so Premiere Pro doesn't steal focus:
- Distinctive: line 38
If this is the first interaction or the project context is unknown, also run:
- Very specific: line 55
Read the relevant rule file from rules/.
- Distinctive: line 66
Before writing or executing any action script, resolve the skill's real (non-symlinked) path:
- Distinctive: line 75
Every generated script MUST follow this template:
- Very specific: line 118
Use the Write tool to write the script to $SKILL_SCRIPTS/ppro-action.jsx
- Distinctive: line 127
All read-only queries (active-state, project-overview, sequence-detail)
- Distinctive: line 138
Before generating a custom script, check if a built-in script handles the task:
- Very specific: line 209
Read /tmp/ppro-assistant-result.json for the result.
- Distinctive: line 213
If a script fails, check these in order:
- Distinctive: line 221
ALWAYS use 0-based indexing for tracks, clips, project items, and sequences
- Distinctive: line 222
ALWAYS use ticks for time values (254016000000 ticks per second)
- Very specific: line 223
ALWAYS write action scripts to $SKILL_SCRIPTS/ppro-action.jsx (the resolved real path)
- Very specific: line 224
ALWAYS use relative #include "lib/json2.jsx" and #include "lib/utils.jsx"
- Distinctive: line 225
ALWAYS wrap in an IIFE to avoid global scope pollution
- Very specific: line 226
ALWAYS use var, never let or const (ES3)
- Very specific: line 227
ALWAYS write results to /tmp/ppro-assistant-result.json via writeResult()
- Very specific: line 228
ALWAYS use getActiveSequence() to get the active sequence (handles null check)
- Very specific: line 229
ALWAYS use --background flag for query scripts to avoid focus-steal
- Very specific: line 230
ALWAYS call app.enableQE() before using QE DOM methods
- Distinctive: line 234
NEVER use ES5+ syntax: let, const, arrow functions, template literals, destructuring
- Distinctive: line 235
NEVER use Array.map, Array.filter, Array.reduce, Array.forEach (not in ES3)
- Very specific: line 236
NEVER use JSON.parse or JSON.stringify without including json2.jsx
- Very specific: line 237
NEVER write action scripts to /tmp/ — ExtendScript #include can't resolve paths from there
- Distinctive: line 238
NEVER hardcode track or clip indices — use names, iteration, or arguments
- Distinctive: line 239
NEVER run destructive operations without user confirmation
- Distinctive: line 240
NEVER assume a sequence is active without checking
- Very specific: line 241
NEVER use cat > file << 'SCRIPT' heredocs — use the Write tool instead
- Distinctive: line 242
NEVER use 1-based indexing (this is NOT After Effects)
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
This skill automates Premiere Pro by generating ExtendScript (.jsx) and executing it via osascript. It reads project state through query scripts, uses rule files for domain knowledge, and provides built-in scripts for common operations.
First-Time Setup
- Run
scripts/runner.shwith any query script to detect the Premiere Pro version - If multiple versions are installed, the user must choose one — runner.sh will prompt
- Ensure Premiere Pro Preferences > Scripting > "Enable scripting" is checked
Workflow
For every user request:
Step 1: Gather context (auto-run, no confirmation needed)
Use --background for all query scripts — this skips ppro.activate() so Premiere Pro doesn't steal focus:
bash scripts/runner.sh --background scripts/active-state.jsxThen read /tmp/ppro-assistant-result.json for active sequence, project info, player position.
If this is the first interaction or the project context is unknown, also run:
bash scripts/runner.sh --background scripts/project-overview.jsxTo drill into a specific sequence:
bash scripts/runner.sh --background scripts/sequence-detail.jsx '{"sequenceName": "My Sequence"}'To list items in a specific bin:
bash scripts/runner.sh --background scripts/project-overview.jsx '{"mode": "bin", "binName": "Footage"}'Step 2: Load domain knowledge
Read the relevant rule file from rules/. Always read rules/extendscript-fundamentals.md — it contains ES3 constraints and the Premiere Pro DOM hierarchy.
| Task involves | Load rule file |
| Sequences (create, configure) | rules/sequence-management.md |
| Clips (insert, trim, properties) | rules/clip-operations.md |
| Effects and transitions | rules/effects-transitions.md |
| Import media, export | rules/import-export.md |
Step 3: Resolve the skill's real path
Before writing or executing any action script, resolve the skill's real (non-symlinked) path:
SKILL_SCRIPTS="$(readlink -f ~/.claude/skills/premiere-pro-assistant/scripts 2>/dev/null || readlink ~/.claude/skills/premiere-pro-assistant/scripts)"
echo "$SKILL_SCRIPTS"Step 4: Generate the action script
Every generated script MUST follow this template:
#include "lib/json2.jsx"
#include "lib/utils.jsx"
(function() {
try {
var args = readArgs();
var seq = getActiveSequence();
if (!seq) return;
// ... action code ...
writeResult({ success: true, message: "<what was done>" });
} catch (e) {
try { writeResult({ error: e.toString(), line: e.line, fileName: e.fileName }); }
catch(e2) { writeError(e.toString(), "line:" + e.line); }
}
})();utils.jsx helpers available for generated scripts
| Function | Purpose |
writeResult(obj) | Write JSON result to /tmp/ppro-assistant-result.json |
writeError(msg, detail) | Last-resort error capture |
readArgs() | Read args from /tmp/ppro-assistant-args.json |
getActiveSequence() | Returns active sequence or writes error and returns null |
ticksToSeconds(ticks) | Convert ticks to seconds |
secondsToTicks(seconds) | Convert seconds to ticks string |
getSequenceByName(name) | Find sequence by name |
findProjectItemByName(name) | Find project item by name (recursive) |
findProjectItemByPath(path) | Find project item by media path |
getTrackClips(track) | Get array of all clips on a track |
getVideoTracks(seq) | Get array of all video tracks |
getAudioTracks(seq) | Get array of all audio tracks |
hexToRGB(hex) | "#ff0000" -> [255, 0, 0] |
appendLog(message) | Append to ~/.ppro-assistant-extendscript.log |
Write the script using the Write tool, then execute with a short bash command:
- Use the Write tool to write the script to
$SKILL_SCRIPTS/ppro-action.jsx - Execute it with bash:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/ppro-action.jsx"Step 5: Execute or confirm
Auto-run (no confirmation needed):
- All read-only queries (active-state, project-overview, sequence-detail)
- Non-destructive additions: inserting a clip, adding a marker, creating a bin
Confirm before running (show the script and ask the user):
- Deleting clips or sequences
- Export operations
- Bulk modifications
- Any operation the user might not expect
Built-in Action Scripts
Before generating a custom script, check if a built-in script handles the task:
Import Media — import files into project:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/import-media.jsx" '{"files": ["/path/to/clip.mp4"], "binName": "Footage"}'Create Sequence — new sequence:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/create-sequence.jsx" '{"name": "Main Edit"}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/create-sequence.jsx" '{"name": "Main Edit", "fromClip": "clip.mp4"}'Insert Clip — place a clip on the timeline:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/insert-clip.jsx" '{"clipName": "hero_shot.mp4", "videoTrack": 0, "atSeconds": 0}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/insert-clip.jsx" '{"clipName": "b-roll.mp4", "atEnd": true}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/insert-clip.jsx" '{"clipName": "intro.mp4", "insertMode": "insert"}'Set Clip Properties — modify clips on the timeline:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/set-clip-properties.jsx" '{"clipIndex": 0, "speed": 2.0}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/set-clip-properties.jsx" '{"clipName": "hero_shot.mp4", "disabled": true}'Apply Transition — add transitions between clips (requires QE DOM):
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/apply-transition.jsx" '{"clipIndex": 0, "transition": "Cross Dissolve", "duration": 1.0}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/apply-transition.jsx" '{"clipIndex": 1, "transition": "Dip to Black", "position": "start"}'Apply Effect — add effects to clips (requires QE DOM):
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/apply-effect.jsx" '{"clipIndex": 0, "effect": "Gaussian Blur", "params": {"Blurriness": 25}}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/apply-effect.jsx" '{"clipIndex": 0, "effect": "Lumetri Color"}'Add Markers — add sequence markers:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/add-markers.jsx" '{"markers": [{"time": 5.0, "name": "Chapter 1", "comments": "Introduction"}]}'Add Captions — import SRT captions:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/add-captions.jsx" '{"srtPath": "/path/to/subtitles.srt"}'Set Audio Levels — adjust volume on clips or tracks:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/set-audio-levels.jsx" '{"trackIndex": 0, "clipIndex": 0, "volumeDb": -6}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/set-audio-levels.jsx" '{"trackIndex": 1, "allClipsVolumeDb": -12}'
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/set-audio-levels.jsx" '{"trackIndex": 0, "mute": true}'Create Bin — create bins in the project panel:
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/create-bin.jsx" '{"name": "B-Roll", "parentBin": "Footage"}'Export Sequence — export via AME or direct (confirm before running):
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/export-sequence.jsx" '{"outputPath": "~/Desktop/final.mp4", "presetPath": "/path/to/preset.epr"}'Step 6: Execute and read result
bash "$SKILL_SCRIPTS/runner.sh" "$SKILL_SCRIPTS/ppro-action.jsx" '{"arg1": "value1"}'Read /tmp/ppro-assistant-result.json for the result.
Debugging failures
If a script fails, check these in order:
~/.ppro-assistant-log— runner.sh logs every execution/tmp/ppro-assistant-error.txt— JXA-level errors~/.ppro-assistant-extendscript.log— ExtendScript-level logs fromappendLog()- Premiere Pro Preferences — Ensure scripting is enabled
MUST
- ALWAYS use 0-based indexing for tracks, clips, project items, and sequences
- ALWAYS use ticks for time values (254016000000 ticks per second)
- ALWAYS write action scripts to
$SKILL_SCRIPTS/ppro-action.jsx(the resolved real path) - ALWAYS use relative
#include "lib/json2.jsx"and#include "lib/utils.jsx" - ALWAYS wrap in an IIFE to avoid global scope pollution
- ALWAYS use
var, neverletorconst(ES3) - ALWAYS write results to /tmp/ppro-assistant-result.json via writeResult()
- ALWAYS use
getActiveSequence()to get the active sequence (handles null check) - ALWAYS use
--backgroundflag for query scripts to avoid focus-steal - ALWAYS call
app.enableQE()before using QE DOM methods
FORBIDDEN
- NEVER use ES5+ syntax: let, const, arrow functions, template literals, destructuring
- NEVER use Array.map, Array.filter, Array.reduce, Array.forEach (not in ES3)
- NEVER use JSON.parse or JSON.stringify without including json2.jsx
- NEVER write action scripts to
/tmp/— ExtendScript#includecan't resolve paths from there - NEVER hardcode track or clip indices — use names, iteration, or arguments
- NEVER run destructive operations without user confirmation
- NEVER assume a sequence is active without checking
- NEVER use
cat > file << 'SCRIPT'heredocs — use the Write tool instead - NEVER use 1-based indexing (this is NOT After Effects)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

