Orchard

From okooo5km/Skills4U · View interactive version

Orchard is an AI agent skill from the GitHub repository okooo5km/Skills4U. Use the local Orchard app to interact with macOS Apple apps and services: Calendar, Reminders, Clock, Mail, Contacts, Notes, Music, Weather, Messages, Location/Maps, and Apple Shortcuts. Two execution paths reach the same running Orchard.app: the `orchard` CLI (default — use this if you have a Bash/

How to use this skill

Skill file

Orchard

Orchard exposes 52 Apple-app tools (Calendar, Reminders, Mail, Notes, Messages, Music, Weather, Contacts, Clock, Location/Maps, Shortcuts) through one running Orchard.app, reachable over two transports that carry the same tool set. Default to the CLI. Read "Which Channel" below first — it costs you nothing to check and prevents wasted turns.

Which Channel

Decide by looking at your own tool list first. Having a Bash tool is NOT enough to prove you can reach the CLI — sandboxed agents (e.g. Claude Cowork) have a Bash that runs inside an isolated Linux VM where the macOS CLI does not exist, while Orchard's MCP tools are still bridged in by the host.

If you have Bash but scripts/resolve-orchard.sh --route reports missing_app, check your tool list for Orchard MCP tools before concluding anything:

Quick Start (CLI)

Resolve the CLI path first, then call that path for every command.

Run the bundled resolver first. If your current working directory is not this skill directory, use the absolute path to scripts/resolve-orchard.sh.

ORCHARD_BIN="$(./scripts/resolve-orchard.sh --bin)"
ORCHARD_ROUTE="$(./scripts/resolve-orchard.sh --route)"
ORCHARD_APP_PATH="$(./scripts/resolve-orchard.sh --app)"
"$ORCHARD_BIN" --version

Route rules:

Prefer --json for machine-readable output. Orchard returns an outer JSON envelope:

{"output":"...string, object, or array...","success":true}

The output value may already be a JSON object/array, plain text, JSON text, or prose followed by JSON such as Found 2 events:\n{...}. If output is a string that contains JSON, strip text before the first JSON object/array and parse the nested payload before reasoning over records. (This envelope is a CLI-only convenience — see references/mcp-tools.md if you're on the MCP channel instead, where results look different.)

For the full command matrix, read references/commands.md.

Known Pitfalls (CLI)

Core Rules

These describe the tools themselves, not either transport — they apply whether you're on the CLI or the MCP channel.

Calendar and Reminder Date Safety (Orchard 0.6.3+)

Common Workflows (CLI)

Daily Context

"$ORCHARD_BIN" clock time --timezone Asia/Shanghai --json
"$ORCHARD_BIN" weather get --location Jinan --granularity daily --start-date YYYY-MM-DD --end-date YYYY-MM-DD --json
"$ORCHARD_BIN" calendar info --type events --from YYYY-MM-DDT00:00:00+08:00 --to YYYY-MM-DDT00:00:00+08:00 --json
"$ORCHARD_BIN" reminder info --type reminders --status incomplete --json

When summarizing reminders, filter stale/completed/noisy records yourself if Orchard returns more than requested.

Mail Triage

"$ORCHARD_BIN" mail refresh --json
"$ORCHARD_BIN" mail read --type list --limit 100 --json
"$ORCHARD_BIN" mail read --type list --date-from 2026-07-01T00:00:00+08:00 --date-to 2026-07-15T00:00:00+08:00 --limit 100 --json
"$ORCHARD_BIN" mail read --type content --message-id MESSAGE_ID --json

Mail listing supports --limit, --mailbox, --account, --offset for pagination, and --date-from/--date-to (ISO 8601) for time windows. If the result count equals the limit, page with --offset or say the scan may be truncated instead of pretending coverage is complete. On older builds that reject the date/offset flags, fall back to --limit plus local date_sent filtering.

Only fetch full email bodies for likely important mail: accounts, billing, support, customer, legal, platform review, security, collaboration, or anything the user asked to inspect.

Calendar And Reminder Writes

"$ORCHARD_BIN" calendar info --type calendars --json
"$ORCHARD_BIN" calendar create --title "Call" --start 2026-06-03T15:00:00+08:00 --end 2026-06-03T15:30:00+08:00 --calendar-id CALENDAR_ID --alarms 15 --json

"$ORCHARD_BIN" reminder info --type lists --json
"$ORCHARD_BIN" reminder create --title "Follow up" --list-id LIST_ID --due-date 2026-06-03T18:00:00+08:00 --priority 5 --json

Priority is 0-9, but lower is more urgent: 0 = none, 1 = high, 5 = medium, 9 = low. Mark complete with:

"$ORCHARD_BIN" reminder update --reminder-id REMINDER_ID --completed true --json

Repeating events and reminders use the --repeat flag family (same rules as Calendar.app's Custom repeat sheet):

# Every 2 weeks on Mon and Fri, 10 occurrences
"$ORCHARD_BIN" calendar create --title "Standup" --start 2026-06-01T10:00:00+08:00 --end 2026-06-01T10:30:00+08:00 \
  --repeat weekly --repeat-interval 2 --repeat-days-of-week mon,fri --repeat-count 10 --json

# First Monday of each month, until a date (inclusive)
"$ORCHARD_BIN" calendar create --title "Review" --start 2026-06-01T14:00:00+08:00 --end 2026-06-01T15:00:00+08:00 \
  --repeat monthly --repeat-days-of-week mon --repeat-set-positions 1 --repeat-until 2027-06-30 --json

# Daily reminder — recurring reminders REQUIRE --due-date
"$ORCHARD_BIN" reminder create --title "Drink water" --due-date 2026-06-01T09:00:00+08:00 --repeat daily --json

--repeat is daily|weekly|monthly|yearly (on update, none removes recurrence). Companions: --repeat-interval N · --repeat-days-of-week mon,fri · --repeat-days-of-month 1,15,-1 (monthly; -1 = last day) · --repeat-months 1-12 / --repeat-weeks-of-year / --repeat-days-of-year (yearly) · --repeat-set-positions 1 or -1 (combine with another repeat field) · end with --repeat-until DATE or --repeat-count N (mutually exclusive).

All occurrences of a recurring event share one event id. calendar update/calendar delete take --occurrence-date DATE to target a specific occurrence (without it, the first occurrence is used) and --span this-event|future-events to control reach — delete defaults to this-event (only that occurrence); update defaults to this-event unless the repeat rule itself changes, which applies to future-events automatically.

Notes And Contacts

Search before creating duplicates:

"$ORCHARD_BIN" contacts search --query "Alice" --limit 10 --json
"$ORCHARD_BIN" notes search --query "project name" --limit 20 --json

Notes content is HTML for create/update. If the user gives Markdown, convert it to simple HTML first.

Messages

"$ORCHARD_BIN" messages read --type messages --unread-only --start-date YYYY-MM-DD --json   # unread catch-up
"$ORCHARD_BIN" messages read --type messages --contact "Alice" --limit 30 --json            # by contact name
"$ORCHARD_BIN" messages read --type chats --limit 20 --json                                 # empty query = recent chats
"$ORCHARD_BIN" messages send --contact-name "Alice" --text "Text here" --json
"$ORCHARD_BIN" messages send --chat-guid "iMessage;+;chat123" --text "Text here" --json     # groups / exact chat

Reads accept --chat-guid, --contact, --query, date range, --from-me, --has-attachments, --offset; --type thread --message-guid returns a reply thread. Tapbacks come aggregated as reactions. If a send reports an ambiguous contact with candidates, pick one and re-send with its chat_guid — never guess.

Attachments: messages send ... --attachment PATH (repeatable, up to 10 files, 100MB each; --text optional). Read disposition and safe_to_retry in every send result: retry only when safe_to_retry is true. sent_verified = done; sent_unverified = may have been sent: re-check later with messages read (e.g. --since-rowid) and read send_status on your outgoing message (sent/delivered/pending/failed + error_code) instead of resending; failed_not_sent = nothing sent; failed_partial = some items already sent, don't resend everything; failed_after_send = Messages flagged it failed (iMessage: try SMS or check the number; SMS relayed via iPhone: the user can retry it in Messages). SMS/RCS sends wait up to ~20s for confirmation.

What's new since last check: every type=messages result has a cursor. Save it, then messages read --type messages --since-rowid CURSOR --json returns only newer messages (oldest first) plus new_reactions and updated (edited/retracted); repeat with the new cursor while has_more. Bootstrap by reading one page without --since-rowid. Not combinable with --offset.

Voice messages (kind=audio) include transcription {text, source apple|on_device, locale} when available. --transcribe-audio (optional --transcribe-locale zh-CN) transcribes the rest on-device (first use prompts for Speech Recognition permission; max 5 per call; cached).

Confirm before sending unless the user directly instructs sending exact text.

Shortcuts

"$ORCHARD_BIN" shortcuts list --summary --json
"$ORCHARD_BIN" shortcuts open --name "Shortcut name" --json
"$ORCHARD_BIN" shortcuts run --name "Shortcut name" --input "Text" --confirm --reason "User requested this exact shortcut run" --json

Prefer shortcuts list --summary before running. Use --input-path and --output-path for file handoff.

Troubleshooting (CLI)

MCP Channel (No Bash — e.g. Claude Cowork)

If "Which Channel" routed you here (no Bash tool, or Bash is sandboxed away from this Mac while Orchard MCP tools are present): read references/mcp-tools.md now. It is self-contained — real tool names, required parameters, parameter-shape gotchas — because this channel has no --help to discover syntax from. Two things worth knowing before you start:

Everything in Core Rules above still applies — it describes the tools, not the transport.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.