siri-shortcut-editing
Skill2 starsChanged 36 days agoMITView on GitHub
Edit macOS Siri Shortcuts (.shortcut files) programmatically — decode to XML, modify, and re-sign. Handles AEA1 Apple Encrypted Archives, CMS signing, and bplist conversion.
In this repository9 other files it gives its agents.
- code-reviewSkill
- grill-meSkill
- handoff-conversationSkill
- himalaya-email-rustSkill
- markitdown-pythonSkill
- pptxSkill
- weread-skillsSkill
- yahoo-finance-pythonSkill
- youtube-dlp-pythonSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Use the bundled scripts/decode_shortcut.py:
- Distinctive: line 61
If doing it manually, the steps are:
- Very specific: line 138
ALWAYS consult this before writing XML: Only use identifiers that appear in the reference.
- Distinctive: line 162
After editing, advise rotating any exposed keys.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Siri Shortcut Editing Skill
Edit signed macOS Siri Shortcuts (.shortcut files) by decoding them to XML, making changes, and re-signing.
File Format
A .shortcut file is a signed Apple Encrypted Archive (AEA1) containing:
[0-3] "AEA1" magic
[4-7] zeros (reserved)
[8-11] plist length (uint32 LE)
[12-...] auth plist (bplist) — signing certificate chain
[after] CMS signature + encrypted payload (Apple Archive)The actual shortcut workflow is a bplist inside the Apple Archive, named Shortcut.wflow.
Prerequisites
- macOS with
aea,aa,shortcutsCLI tools (all built-in) plutil(built-in)- Python 3 with
plistlib(built-in)
Verify:
which aea aa shortcuts plutil python3Workflow: Decode .shortcut → XML
Use the bundled scripts/decode_shortcut.py:
python3 scripts/decode_shortcut.py INPUT.shortcut OUTPUT.xmlThis script performs all three steps automatically:
- Extracts the signing certificate's public key from the AEA1 auth plist
- Decrypts the Apple Archive via
aea decrypt -profile 0 - Locates the embedded bplist inside the decoded archive and converts to XML
If doing it manually, the steps are:
Step 1: Extract signing certificate public key
The first 12 bytes of a .shortcut file are the AEA1 header (magic + zeros + plist length as uint32 LE). The auth plist starts at byte 12. Parse it, grab the leaf certificate from SigningCertificateChain, derive the public key with openssl x509.
Step 2: Decrypt the Apple Archive
aea decrypt -profile 0 -sign-pub /tmp/signing_pub.pem \
-i INPUT.shortcut -o /tmp/decoded.binStep 3: Extract bplist → XML
The decoded archive starts with AA01 metadata; the actual workflow bplist is embedded further in. Find the bplist marker and parse from there with plistlib.
Workflow: Edit & Re-sign XML → .shortcut
⚠️
shortcuts signrequires the input file to use a.wflowextension, otherwise it fails.
Step 1: Convert XML back to bplist
plutil -convert binary1 -o /tmp/workflow.wflow OUTPUT.xmlStep 2: Sign the shortcut
shortcuts sign -m anyone \
-i /tmp/workflow.wflow \
-o OUTPUT.shortcutshortcuts sign accepts a bare bplist (old-format shortcut) and automatically wraps it in the AEA1 Apple Archive format with a new CMS signature.
Signing modes:
-m anyone— anyone can import the shortcut-m people-who-know-me— only your contacts (default)
XML Structure Overview
Key keys in the shortcut plist:
| Key | Description |
WFWorkflowActions | Array of action dicts — the core logic |
WFWorkflowActionIdentifier | Action type, e.g. is.workflow.actions.gettext |
WFWorkflowActionParameters | Per-action parameters |
WFWorkflowTypes | Where shortcut appears (e.g. WFWorkflowTypeShowInSearch) |
WFWorkflowInputContentItemClasses | Accepted input types |
WFWorkflowOutputContentItemClasses | Output types |
WFWorkflowMinimumClientVersion | Minimum iOS/macOS version |
WFWorkflowIcon | Icon glyph & color |
Variable References
There are two distinct ways to reference a value from earlier in the workflow. They use different fields and are NOT interchangeable:
| Reference Type | Type value | Required fields | When to use |
| Action Output | ActionOutput | OutputUUID + OutputName | Source action has a named output (CustomOutputName + UUID) |
| Named Variable | Variable | VariableName | Source is a SetVariable action (which has NO UUID on its output) |
Both types use WFSerializationType=WFTextTokenAttachment. This applies both in WFInput fields and in inline attachmentsByRange within WFTextTokenString strings.
Literal strings use WFTextTokenString with string field.
Action Reference
ALWAYS consult this before writing XML. Only use identifiers that appear in the reference. Guessing identifiers (e.g. is.workflow.actions.runpython) will produce "Unknown Action" in the Shortcuts app.
→ references/action-identifiers.md — Complete list of verified-valid WFWorkflowActionIdentifier values, required parameters, and XML templates.
WFItemType Reference
For dictionary value types, nested object syntax, and common failure modes, see:
→ references/dictionary-actions.md
Key points:
WFItemType=0= Text,1= Nested Object,2= Array,3= Number,5= Variable Reference- Nested objects require
WFItemType=1with double-wrappedWFDictionaryFieldValue WFItemType=5+ inlineWFDictionaryFieldValue→ crash
Security Warning
Shortcuts often contain hardcoded secrets (API keys, tokens). Always warn the user if you find:
- API keys in
WFTextActionTextfields - Bearer tokens in
Authorizationheaders - Any other credentials
After editing, advise rotating any exposed keys.
Complete Round-Trip Example
# Decode
python3 scripts/decode_shortcut.py MyShortcut.shortcut MyShortcut.xml
# Edit MyShortcut.xml manually or programmatically...
# Re-sign
plutil -convert binary1 -o /tmp/workflow.wflow MyShortcut.xml
shortcuts sign -m anyone -i /tmp/workflow.wflow -o MyShortcut.shortcutThe full decode logic lives in scripts/decode_shortcut.py — read that file if you need to understand or modify the internals.
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.

