summaryrefslogtreecommitdiff
path: root/SKILL.md
diff options
context:
space:
mode:
Diffstat (limited to 'SKILL.md')
-rw-r--r--SKILL.md56
1 files changed, 29 insertions, 27 deletions
diff --git a/SKILL.md b/SKILL.md
index e83bf47..6149b86 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -1,24 +1,36 @@
---
name: iphone-icloud-notes
description: >-
- Create real Apple Notes on the user's iPhone by driving icloud.com/notes from
- Linux with the Rust icloud-note CLI (headless Chromium). Use when the user asks
- to create a note, send/forward results to their iPhone, push text to Apple
- Notes, or mentions icloud.com/notes / iCloud Notes from Linux.
+ Create or update real Apple Notes on the user's iPhone by driving
+ icloud.com/notes from Linux with the Rust icloud-note CLI (headless Chromium).
+ Use when the user asks to create/update a note, send/forward results to their
+ iPhone, push text to Apple Notes, or mentions icloud.com/notes / iCloud Notes
+ from Linux.
---
# iPhone notes via icloud.com/notes (Rust)
## Goal
-When asked to create a note or forward prompt results to the iPhone, **create a
-real Apple Note** through the iCloud Notes web app using the **Rust**
+Drive real Apple Notes through the iCloud Notes web app using the **Rust**
`icloud-note` binary. Do not use LocalSend unless the user wants file transfer.
+## Create vs update (important)
+
+| User intent | Command |
+|---|---|
+| New note / first send | `icloud-note create …` |
+| Change / revise / refresh an existing note | `icloud-note update …` |
+
+**Never use `create` when the user asks to update** — that would add a duplicate
+note. `update` finds the note by title (case-insensitive) and replaces its
+content in place. If no matching note exists, report the error; do not fall back
+to `create` unless the user explicitly asks to create.
+
## Source of truth
Repo: `~/Code/iphone-notes`
-Binary: `~/.local/bin/icloud-note` (from `cargo build --release`)
+Binary: `~/.local/bin/icloud-note`
Skill link: `~/.agents/skills/iphone-icloud-notes` → that repo
## Helper
@@ -27,28 +39,21 @@ Skill link: `~/.agents/skills/iphone-icloud-notes` → that repo
icloud-note status
icloud-note login # ONE-TIME only — only command that opens a window
icloud-note create --title "Title" --body "Body text"
-icloud-note create --title "Title" --body-file /path/to.txt
-icloud-note create --title "Title" --body-file - # stdin
+icloud-note update --title "Title" --body "Revised body"
+icloud-note update --title "Title" --body-file /path/to.txt
+# optional: search under a different title than the new first line
+icloud-note update --match-title "Old Title" --title "New Title" --body "…"
```
-If missing from PATH:
-
-```bash
-"$HOME/Code/iphone-notes/target/release/icloud-note" …
-# or: cargo run --manifest-path "$HOME/Code/iphone-notes/Cargo.toml" -- …
-```
-
-`create` / `status` are **always headless**. Never run `login` unless the user
-must re-authenticate. Do **not** set `ICLOUD_NOTES_DRY_RUN=1` for real sends.
-
-Config: `~/.config/icloud-notes/` (browser profile; private)
+`create` / `update` / `status` are **always headless**. Never run `login` unless
+re-auth is required. Do **not** set `ICLOUD_NOTES_DRY_RUN=1` for real sends.
## Agent workflow
-1. Prepare title + body.
-2. `icloud-note status` — if not logged in, ask the user to run `icloud-note login`.
-3. `icloud-note create --title "$TITLE" --body-file "$TMPFILE"`
-4. Report the `created:` line. Syncs to iPhone when iCloud Notes is enabled.
+1. Decide **create** vs **update** from the user’s wording.
+2. `icloud-note status` — if not logged in, ask for `icloud-note login`.
+3. Run create or update with `--title` + `--body-file` for long text.
+4. Report the `created:` or `updated:` line.
## Setup (human / once)
@@ -56,6 +61,3 @@ Config: `~/.config/icloud-notes/` (browser profile; private)
"$HOME/Code/iphone-notes/scripts/setup.sh"
icloud-note login
```
-
-Requires Rust (`cargo`) and a Chromium binary (setup can install Playwright’s
-Chromium under `~/.cache/ms-playwright`).