scpl-updated-mcp-server 1.0.17 → 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 CHANGED
@@ -248,10 +248,41 @@ Case "Option 2"
248
248
  Text "You chose 2"
249
249
  End Menu
250
250
 
251
- # Loops
252
- RepeatWithEachItem
253
- ShowResult
254
- End Repeat
251
+ # Loops - IMPORTANT: name the loop variable!
252
+ List ["a", "b", "c"]
253
+ RepeatWithEach -> mv:Item
254
+ ShowResult "\(mv:Item)"
255
+ End RepeatWithEach
256
+ ```
257
+
258
+ ### ⚠️ Common Gotchas
259
+
260
+ ```scpl
261
+ # ❌ WRONG: mv:RepeatItem doesn't exist
262
+ RepeatWithEach
263
+ Text "\(mv:RepeatItem)"
264
+
265
+ # ✅ CORRECT: Name your loop variable
266
+ RepeatWithEach -> mv:Item
267
+ Text "\(mv:Item)"
268
+
269
+ # ❌ WRONG: Multi-line text can't use ->
270
+ Text
271
+ | Line 1
272
+ | Line 2
273
+ -> v:MyVar
274
+
275
+ # ✅ CORRECT: Use SetVariable on next line
276
+ Text
277
+ | Line 1
278
+ | Line 2
279
+ SetVariable v:MyVar
280
+
281
+ # ❌ WRONG: Wait only takes integers
282
+ Wait 0.5
283
+
284
+ # ✅ CORRECT: Use whole numbers
285
+ Wait 1
255
286
  ```
256
287
 
257
288
  ## Examples
@@ -320,6 +351,31 @@ Check the error message for line numbers and syntax issues. Common mistakes:
320
351
  - Using wrong parameter names (use `list_actions` to check)
321
352
  - Missing quotes around text values
322
353
 
354
+ ## Skill Architecture (For AI Maintainers)
355
+
356
+ The ScPL skills are distributed through **three different mechanisms**:
357
+
358
+ | Platform | Skill Source | Update Process |
359
+ |----------|--------------|----------------|
360
+ | **Claude Code** | `.claude/shortcuts-creator/skills/create-shortcut.md` | Edit file directly |
361
+ | **Claude Desktop** | `claude-desktop-skill/scpl-shortcuts.zip` (contains Skill.md + REFERENCE.md) | Edit files, regenerate zip |
362
+ | **Codex** | Generated dynamically from `SCPL_REFERENCE.md` by `index.js` | Edit SCPL_REFERENCE.md |
363
+
364
+ ### Source of Truth
365
+ - **`SCPL_REFERENCE.md`** - The master reference document. Codex skill is generated from this.
366
+ - **`claude-desktop-skill/scpl-shortcuts/REFERENCE.md`** - Should match SCPL_REFERENCE.md
367
+ - All platforms should have the same gotcha documentation (RepeatWithEach, multi-line text, etc.)
368
+
369
+ ### Updating Skills
370
+ 1. Edit `SCPL_REFERENCE.md` and `create-shortcut.md` with fixes
371
+ 2. Copy changes to `claude-desktop-skill/scpl-shortcuts/REFERENCE.md`
372
+ 3. Update `claude-desktop-skill/scpl-shortcuts/Skill.md` if needed
373
+ 4. Regenerate zip: `cd claude-desktop-skill && zip -r scpl-shortcuts.zip scpl-shortcuts/`
374
+ 5. Bump version in `package.json` and publish to npm
375
+
376
+ ### How Codex Skill Works
377
+ The `setupCodex()` function in `index.js` (line ~315) reads `SCPL_REFERENCE.md` at runtime and wraps it with YAML frontmatter to create `~/.codex/skills/scpl-shortcuts/SKILL.md`. There is no separate Codex skill file in the repo.
378
+
323
379
  ## Contributing
324
380
 
325
381
  Found a bug or want to add features? See [CONTRIBUTING.md](../CONTRIBUTING.md)
package/SCPL_REFERENCE.md CHANGED
@@ -113,9 +113,19 @@ End Repeat
113
113
 
114
114
  ### Repeat with Each
115
115
 
116
+ **IMPORTANT:** You must name the loop variable using `->` syntax. `mv:RepeatItem` is NOT a predefined variable.
117
+
116
118
  ```scpl
117
- RepeatWithEach [item1, item2, item3]
118
- ShowResult "Processing: \(mv:RepeatItem)"
119
+ # Correct: Name the loop variable with arrow
120
+ List ["item1", "item2", "item3"]
121
+ RepeatWithEach -> mv:Item
122
+ ShowResult "Processing: \(mv:Item)"
123
+ End RepeatWithEach
124
+
125
+ # Also works: Use bare RepeatItem as direct reference (not in interpolation)
126
+ List ["a", "b", "c"]
127
+ RepeatWithEach
128
+ ShowResult RepeatItem
119
129
  End RepeatWithEach
120
130
  ```
121
131
 
@@ -341,7 +351,8 @@ End If
341
351
  URL "https://api.example.com/items"
342
352
  GetContentsOfURL -> mv:Response
343
353
  GetDictionaryValue key="items"
344
- RepeatWithEach
354
+ RepeatWithEach -> mv:Item
355
+ GetVariable mv:Item
345
356
  GetDictionaryValue key="name" -> mv:ItemName
346
357
  Text "\(mv:ItemName)" -> mv:Output
347
358
  AddToVariable v:AllItems
@@ -523,13 +534,19 @@ ShowResult
523
534
 
524
535
  ```scpl
525
536
  GetSelectedFiles -> mv:Files
526
- RepeatWithEach mv:Files
537
+ GetVariable mv:Files
538
+ RepeatWithEach -> mv:CurrentFile
539
+ GetVariable mv:CurrentFile
527
540
  GetDetailsOfFiles detail="File Extension" -> mv:Ext
528
541
 
542
+ GetVariable mv:Ext
529
543
  If Equals "pdf"
544
+ GetVariable mv:CurrentFile
530
545
  MoveFile destination="~/Documents/PDFs/"
531
546
  Otherwise
547
+ GetVariable mv:Ext
532
548
  If Equals "jpg"
549
+ GetVariable mv:CurrentFile
533
550
  MoveFile destination="~/Pictures/"
534
551
  End If
535
552
  End If
@@ -631,8 +648,11 @@ End If
631
648
  URL "https://api.example.com/data"
632
649
  GetContentsOfURL -> mv:Response
633
650
  GetDictionaryValue key="items"
634
- RepeatWithEach
635
- # Process each item
651
+ RepeatWithEach -> mv:Item
652
+ # Process each item using mv:Item
653
+ GetVariable mv:Item
654
+ GetDictionaryValue key="name" -> mv:Name
655
+ ShowResult mv:Name
636
656
  End RepeatWithEach
637
657
  ```
638
658
 
@@ -681,7 +701,7 @@ End RepeatWithEach
681
701
  - Space-separate params: `a="1" b="2"` not `a="1", b="2"`
682
702
 
683
703
  ## HTTP API Requests
684
- **Headers**: Use `headers=true headers2={Key: "value"}` (not `headers={...}`)
704
+ **Headers**: Use `headers={Key: "value"}` (expanding toggles are auto-set)
685
705
  **Complex JSON**: Use shell scripts with curl instead of jsonvalues with nested arrays
686
706
  ```scpl
687
707
  Text "curl -s URL -H 'Auth: Bearer KEY' -d '{...}' | python3 -c 'import sys,json; print(json.load(sys.stdin)[\"key\"])'"
@@ -775,4 +795,80 @@ open MyShortcut_signed.shortcut
775
795
 
776
796
  ---
777
797
 
798
+ # Known Limitations & Workarounds
799
+
800
+ ## Multi-line Text Cannot Use Arrow Assignment
801
+
802
+ Multi-line text blocks (using `|` syntax) cannot use `->` directly. Use `SetVariable` on the next line instead.
803
+
804
+ ```scpl
805
+ # WRONG - will fail to parse
806
+ Text
807
+ | Line 1
808
+ | Line 2
809
+ -> v:MyVar
810
+
811
+ # CORRECT - use SetVariable
812
+ Text
813
+ | Line 1
814
+ | Line 2
815
+
816
+ SetVariable v:MyVar
817
+ ```
818
+
819
+ ## Calculate Operand Cannot Use String Interpolation
820
+
821
+ The `operand` parameter in Calculate must use direct variable reference, not string interpolation.
822
+
823
+ ```scpl
824
+ Number 10 -> v:Base
825
+ Number 5 -> v:Addend
826
+
827
+ # WRONG - string interpolation fails
828
+ GetVariable v:Base
829
+ Calculate operation="+" operand="\(v:Addend)"
830
+
831
+ # CORRECT - direct variable reference
832
+ GetVariable v:Base
833
+ Calculate operation="+" operand=v:Addend
834
+ ```
835
+
836
+ ## RepeatWithEach Loop Variable
837
+
838
+ `mv:RepeatItem` is NOT a predefined magic variable. You must name your loop variable explicitly using the `->` syntax.
839
+
840
+ ```scpl
841
+ # WRONG - mv:RepeatItem doesn't exist
842
+ List ["a", "b", "c"]
843
+ RepeatWithEach
844
+ Text "\(mv:RepeatItem)" # ERROR: not defined
845
+ End RepeatWithEach
846
+
847
+ # CORRECT - name the variable
848
+ List ["a", "b", "c"]
849
+ RepeatWithEach -> mv:Item
850
+ Text "\(mv:Item)"
851
+ End RepeatWithEach
852
+
853
+ # ALSO WORKS - bare RepeatItem (not in interpolation)
854
+ List ["a", "b", "c"]
855
+ RepeatWithEach
856
+ ShowResult RepeatItem # Works as direct reference
857
+ End RepeatWithEach
858
+ ```
859
+
860
+ ## Wait/Stepper Fields Require Integers
861
+
862
+ Stepper fields (like `Wait`) only accept positive integers, not decimals.
863
+
864
+ ```scpl
865
+ # WRONG - decimal fails
866
+ Wait 0.5
867
+
868
+ # CORRECT - integer only
869
+ Wait 1
870
+ ```
871
+
872
+ ---
873
+
778
874
  **495 total actions available.** Use `list_actions` tool to search by category or keyword.
package/index.js CHANGED
@@ -1140,14 +1140,15 @@ GetDictionaryValue key="result"
1140
1140
  ShowResult
1141
1141
  \`\`\`
1142
1142
 
1143
- ## POST with JSON
1143
+ ## POST with JSON and Headers
1144
1144
  \`\`\`scpl
1145
1145
  URL "https://api.example.com/submit"
1146
1146
  GetContentsOfURL method="POST" headers={
1147
1147
  "Content-Type": "application/json"
1148
- } body={
1148
+ "Authorization": "Bearer my-token"
1149
+ } requestbody="JSON" jsonvalues={
1149
1150
  "name": "Test"
1150
- "value": 123
1151
+ "value": "123"
1151
1152
  }
1152
1153
  \`\`\`
1153
1154
  `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scpl-updated-mcp-server",
3
- "version": "1.0.17",
3
+ "version": "1.1.0",
4
4
  "description": "AI-powered Apple Shortcuts creation with Claude Code! Generate macOS shortcuts using natural language. 495 actions available. MCP server for text-based shortcut programming. Vibe code your automation workflows.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -27,6 +27,6 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@modelcontextprotocol/sdk": "^0.5.0",
30
- "scpl-macos-updated": "^2.3.1"
30
+ "scpl-macos-updated": "^2.4.0"
31
31
  }
32
32
  }