From a62ed06659bf7f97e9d1e9b8fa028b87f01a9b0a Mon Sep 17 00:00:00 2001 From: Dmytro Soroka Date: Fri, 22 May 2026 12:28:08 +0200 Subject: [PATCH] refactor: align structure with macos-reminders-skill - Move orphan applescripts from scripts/account/, scripts/application/, scripts/attachment/ to scripts/applescripts/ - Add missing command wrappers for account, application, attachment - Update README.md and SKILL.md with new entities and JSON Contract --- README.md | 18 +++++++ SKILL.md | 51 +++++++++++++++++++ .../account/default-account.applescript | 0 .../account/default-folder.applescript | 0 .../application/selection.applescript | 0 .../attachment/get.applescript | 0 .../attachment/list.applescript | 0 .../attachment/save.applescript | 0 scripts/commands/account/default-account.sh | 4 ++ scripts/commands/account/default-folder.sh | 4 ++ scripts/commands/application/selection.sh | 4 ++ scripts/commands/attachment/get.sh | 4 ++ scripts/commands/attachment/list.sh | 4 ++ scripts/commands/attachment/save.sh | 4 ++ 14 files changed, 93 insertions(+) rename scripts/{ => applescripts}/account/default-account.applescript (100%) rename scripts/{ => applescripts}/account/default-folder.applescript (100%) rename scripts/{ => applescripts}/application/selection.applescript (100%) rename scripts/{ => applescripts}/attachment/get.applescript (100%) rename scripts/{ => applescripts}/attachment/list.applescript (100%) rename scripts/{ => applescripts}/attachment/save.applescript (100%) create mode 100755 scripts/commands/account/default-account.sh create mode 100755 scripts/commands/account/default-folder.sh create mode 100755 scripts/commands/application/selection.sh create mode 100755 scripts/commands/attachment/get.sh create mode 100755 scripts/commands/attachment/list.sh create mode 100755 scripts/commands/attachment/save.sh diff --git a/README.md b/README.md index c8dfcf8..9b1e0be 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,29 @@ scripts/commands//.sh [args...] ## Backend Map +- `scripts/commands/account/*` → AppleScript in `scripts/applescripts/account/*` +- `scripts/commands/application/*` → AppleScript in `scripts/applescripts/application/*` +- `scripts/commands/attachment/*` → AppleScript in `scripts/applescripts/attachment/*` - `scripts/commands/folder/*` → AppleScript in `scripts/applescripts/folder/*` - `scripts/commands/note/*` → AppleScript in `scripts/applescripts/note/*` ## Command Surface +Account: + +- `scripts/commands/account/default-account.sh` +- `scripts/commands/account/default-folder.sh` + +Application: + +- `scripts/commands/application/selection.sh` + +Attachment: + +- `scripts/commands/attachment/get.sh` +- `scripts/commands/attachment/list.sh` +- `scripts/commands/attachment/save.sh` + Folder: - `scripts/commands/folder/create.sh` diff --git a/SKILL.md b/SKILL.md index 1c5af21..2cf4292 100644 --- a/SKILL.md +++ b/SKILL.md @@ -21,11 +21,35 @@ Do not call `scripts/applescripts` directly. Run commands from `scripts/commands`: +- `scripts/commands/account/*` +- `scripts/commands/application/*` +- `scripts/commands/attachment/*` - `scripts/commands/folder/*` - `scripts/commands/note/*` ## Commands +### Account + +```bash +scripts/commands/account/default-account.sh +scripts/commands/account/default-folder.sh +``` + +### Application + +```bash +scripts/commands/application/selection.sh +``` + +### Attachment + +```bash +scripts/commands/attachment/get.sh +scripts/commands/attachment/list.sh +scripts/commands/attachment/save.sh +``` + ### Folder ```bash @@ -51,6 +75,33 @@ scripts/commands/note/show.sh scripts/commands/note/update.sh ``` +## JSON Contract + +Note object: + +- `id` (string) +- `name` (string) +- `body` (string) +- `creation_date` (string, ISO 8601) +- `modification_date` (string, ISO 8601) +- `folder` (string) + +Folder object: + +- `id` (string) +- `name` (string) +- `account` (string) + +Account object: + +- `name` (string) +- `default_folder` (string) + +Scalar envelopes: + +- `count`: `{"count": N}` +- `success/failure`: `{"success": true/false, "error": "..."}` + ## Safety Boundaries - Note delete and write actions must be explicit. diff --git a/scripts/account/default-account.applescript b/scripts/applescripts/account/default-account.applescript similarity index 100% rename from scripts/account/default-account.applescript rename to scripts/applescripts/account/default-account.applescript diff --git a/scripts/account/default-folder.applescript b/scripts/applescripts/account/default-folder.applescript similarity index 100% rename from scripts/account/default-folder.applescript rename to scripts/applescripts/account/default-folder.applescript diff --git a/scripts/application/selection.applescript b/scripts/applescripts/application/selection.applescript similarity index 100% rename from scripts/application/selection.applescript rename to scripts/applescripts/application/selection.applescript diff --git a/scripts/attachment/get.applescript b/scripts/applescripts/attachment/get.applescript similarity index 100% rename from scripts/attachment/get.applescript rename to scripts/applescripts/attachment/get.applescript diff --git a/scripts/attachment/list.applescript b/scripts/applescripts/attachment/list.applescript similarity index 100% rename from scripts/attachment/list.applescript rename to scripts/applescripts/attachment/list.applescript diff --git a/scripts/attachment/save.applescript b/scripts/applescripts/attachment/save.applescript similarity index 100% rename from scripts/attachment/save.applescript rename to scripts/applescripts/attachment/save.applescript diff --git a/scripts/commands/account/default-account.sh b/scripts/commands/account/default-account.sh new file mode 100755 index 0000000..299b9d6 --- /dev/null +++ b/scripts/commands/account/default-account.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend account default-account "$@" diff --git a/scripts/commands/account/default-folder.sh b/scripts/commands/account/default-folder.sh new file mode 100755 index 0000000..abd5ea8 --- /dev/null +++ b/scripts/commands/account/default-folder.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend account default-folder "$@" diff --git a/scripts/commands/application/selection.sh b/scripts/commands/application/selection.sh new file mode 100755 index 0000000..3b85012 --- /dev/null +++ b/scripts/commands/application/selection.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend application selection "$@" diff --git a/scripts/commands/attachment/get.sh b/scripts/commands/attachment/get.sh new file mode 100755 index 0000000..3729c11 --- /dev/null +++ b/scripts/commands/attachment/get.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend attachment get "$@" diff --git a/scripts/commands/attachment/list.sh b/scripts/commands/attachment/list.sh new file mode 100755 index 0000000..1a05bf6 --- /dev/null +++ b/scripts/commands/attachment/list.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend attachment list "$@" diff --git a/scripts/commands/attachment/save.sh b/scripts/commands/attachment/save.sh new file mode 100755 index 0000000..f053918 --- /dev/null +++ b/scripts/commands/attachment/save.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/_lib/common.sh" +run_backend attachment save "$@"