# Studio project format

A `.shortcutystudio` project is editable JSON. `entry` names the file to start from. File paths must be unique, ignoring case. See the [project format](/docs/project.schema.json) for the full structure.

```json
{
  "version": 1,
  "title": "Open a website",
  "shortcutName": "Open a website",
  "entry": "Main.shortcuty",
  "active": "Main.shortcuty",
  "files": [
    {"name": "Main.shortcuty", "contents": "shortcut:\n  apps.open(app: \"Safari\")\n"}
  ],
  "appReferences": {},
  "exactMetadata": false
}
```

`title`, `active`, and `updatedAt` help the editor. `shortcutName` sets the exported shortcut's name. `files` can include helper modules in folders. `appReferences` pins exact app identities for friendly `apps.open(app: "Name")` calls. A custom app alias must have a valid bundle identifier; imported projects can retain extra literal native app metadata under `parameters`. A standalone source file only knows the compiler's bundled app names.

`shortcutMetadata` is a Studio encoded binary plist. The Shortcut details dialog edits appearance, visibility, and accepted input while retaining unfamiliar imported metadata. Do not hand-edit its base64 data to guess Apple settings. `importInfo` records the imported link and conversion notes; it is not compiler source.

## From an agent

Ask Studio for a change, then review the generated actions and warnings. Keep secrets out of the project. Downloading a shortcut does not export editable source; use project export where available.

## Import report and original workflow

New imports include `originalShortcut`, an encoded unsigned binary plist with `encoding: "binary-plist"` and base64 `data`. It stays with the portable project and is sent with build snapshots for comparison. The server checks the decoded 8 MB / 10,000-action limits; the complete project must fit the 32 MB transport limit. Do not remove this record if you need review against the original.

`importInfo.report` describes every original action as editable, preserved, or review, with notes and imported source locations. `importInfo.sourceSHA256` identifies the source those locations refer to. Old import locations are not used after source edits; rebuilt action locations remain available.

Build produces a review of actions, variable fields, producer connections, and settings against the saved original. Download opens that comparison before signing. Native UUID regeneration is ignored; import normalization is included alongside your edits. A zero-change comparison is not runtime proof. Projects created before original baselines were saved need reimporting for a complete comparison.


### Generated media
Studio can create simple geometric PNG graphics and short synthesized WAV tones. They stay inside the project as validated `mediaAssets`, travel with its saved or downloaded project, and travel with an exported project file. `asset("Assets/<id>.shortcutyasset")` returns base64 text for native decoding. No temporary external URLs or media-generation API are required when running the shortcut. Limits are 16 assets, 2 MiB combined, 512×512 pixels per image and five seconds per sound. These tools do not generate photos or voices.


## Modular defaults for large projects

For new large or multi-feature shortcuts, the AI should start with several cohesive source files by default. Keep a short Main.shortcuty entry for input, orchestration and final delivery. Put substantial distinct responsibilities in helper modules, such as parsing and validation, data adapters, reusable calculations, or report/menu presentation. A simple linear shortcut should remain one file. Size is a design signal, not a fixed line-count rule: do not split every small function, add unused scaffolding, or duplicate logic to create more files.

A typical larger project might have Main.shortcuty, Data/Source.shortcuty, Logic/Report.shortcuty and UI/Presentation.shortcuty. Choose only the responsibilities the actual request needs; those names are an example, not mandatory files. New AI projects allow at most eight source files. Existing larger imports retain their supported file count; consult list_project_files instead of dropping files.

### Imports, data flow and first draft

Write all required modules together in the initial write_project call with check:true. The entry must name the existing main file. Imports go before shortcut:; paths are relative to the importing file, with an optional explicit alias. Helpers use def, not another shortcut entry. Pass runtime data explicitly through arguments and return values. Use literal module const or entry shared declarations for immutable configuration, not hidden mutable globals or reverse imports. See [Functions and imports](/docs#functions) for exact contracts.

This compact three-file example demonstrates the boundaries; a project this small would ordinarily stay single-file.

<!-- docs-project: modular-report file: Main.shortcuty entry: Main.shortcuty -->
```text
import "Logic/Analysis" as Analysis
import "UI/Presentation" as Presentation
shortcut:
  total = Analysis.count_items(["One", "Two", "Three"])
  message = Presentation.summary(total)
  result(message)
```

<!-- docs-project: modular-report file: Logic/Analysis.shortcuty entry: Main.shortcuty -->
```text
def count_items(items: List<Text>) -> Number:
  return lists.count(input: items, count_type: "Items")
```

<!-- docs-project: modular-report file: UI/Presentation.shortcuty entry: Main.shortcuty -->
```text
def summary(total: Number) -> Text:
  return "Items: \(total)"
```

### Editing modular projects without losing context

Keep existing organization for a small change. Use list_project_files and inspect_project imports mode to find the entry, dependencies and missing imports; read the relevant source before editing. If changing a helper signature or return contract, inspect its callers and dependent modules too. An explicit filename can produce a focused AI context containing only that file and the entry, plus the complete manifest. Omitted source is retained, not deleted and not proven irrelevant. Read it with read_project_file or locate uses with search_project; never overwrite a file from a preview.

When moving a helper file, update its imports and callers together. Check the whole project again, not just the changed file.

Your files build into one Apple Shortcut. Organize related functions into files so they’re easier to find and edit. Use a loop to run the same actions repeatedly without adding another copy of those actions to the shortcut. A `.shortcutystudio` export keeps the editable files together when that export is available.
