Skip to content

IvanCampos/agents / skills/apple-notes

apple-notes

Flagged

Read Apple Notes content and execute checklist-driven automations in order. Use when a user asks to run tasks from an Apple Note (especially a checklist note like "AGENT TODO LIST"), or to fetch a specific note body for automation.

FileKindSize
SKILL.mdskill md3.1 KB
agents/openai.yamlconfig201 B
scripts/dispatch_skill_item.shexecutablescript20.0 KB
scripts/manage_notes.applescriptother8.9 KB
scripts/manage_notes.shexecutablescript8.1 KB
scripts/run_checklist_note.shexecutablescript5.8 KB

scripts/manage_notes.sh

View on GitHub
#!/usr/bin/env bash
set -euo pipefail

usage() {
  cat <<'USAGE'
Usage:
  manage_notes.sh create --title "Title" [--body "Body"] [--account "Account"] [--folder "Folder"]
  manage_notes.sh read (--id "<note-id>" | --title "Title") [--format plaintext|body] [--all] [--account "Account"] [--folder "Folder"]
  manage_notes.sh update (--id "<note-id>" | --title "Title") [--title-new "New Title"] [--body "New Body"] [--all] [--account "Account"] [--folder "Folder"]
  manage_notes.sh delete (--id "<note-id>" | --title "Title") [--all] [--account "Account"] [--folder "Folder"]
  manage_notes.sh search --query "text" [--field any|title|body] [--limit N] [--account "Account"] [--folder "Folder"]
  manage_notes.sh list [--limit N] [--account "Account"] [--folder "Folder"]

Notes:
  - By title operations match exact note title.
  - If multiple notes share a title, pass --all or use --id.
  - Default read format is plaintext.
USAGE
}

ACTION="${1:-}"
if [[ -z "$ACTION" ]]; then
  usage
  exit 2
fi
shift || true

account=""
folder=""
title=""
note_id=""
body=""
body_set="false"
title_new=""
title_new_set="false"
query=""
field="any"
format="plaintext"
limit="20"
all="false"

require_arg() {
  local flag="$1"
  local value="${2:-}"
  if [[ -z "$value" ]]; then
    echo "Missing value for $flag" >&2
    exit 2
  fi
}

parse_common_scope_flags() {
  while [[ $# -gt 0 ]]; do
    case "$1" in
      --account)
        require_arg "$1" "${2:-}"
        account="$2"
        shift 2
        ;;
      --folder)
        require_arg "$1" "${2:-}"
        folder="$2"
        shift 2
        ;;
      --all)
        all="true"
        shift
        ;;
      *)
        return 1
        ;;
    esac
  done
  return 0
}

case "$ACTION" in
  create)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --title)
          require_arg "$1" "${2:-}"
          title="$2"
          shift 2
          ;;
        --body)
          require_arg "$1" "${2:-}"
          body="$2"
          body_set="true"
          shift 2
          ;;
        --account|--folder)
          parse_common_scope_flags "$@" || true
          case "$1" in
            --account)
              require_arg "$1" "${2:-}"
              account="$2"
              shift 2
              ;;
            --folder)
              require_arg "$1" "${2:-}"
              folder="$2"
              shift 2
              ;;
          esac
          ;;
        *)
          echo "Unknown arg for create: $1" >&2
          usage
          exit 2
          ;;
      esac
    done

    if [[ -z "$title" ]]; then
      echo "create requires --title" >&2
      exit 2
    fi
    ;;

  read)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --id)
          require_arg "$1" "${2:-}"
          note_id="$2"
          shift 2
          ;;
        --title)
          require_arg "$1" "${2:-}"
          title="$2"
          shift 2
          ;;
        --format)
          require_arg "$1" "${2:-}"
          format="$2"
          shift 2
          ;;
        --account|--folder|--all)
          if [[ "$1" == "--all" ]]; then
            all="true"
            shift
          elif [[ "$1" == "--account" ]]; then
            require_arg "$1" "${2:-}"
            account="$2"
            shift 2
          else
            require_arg "$1" "${2:-}"
            folder="$2"
            shift 2
          fi
          ;;
        *)
          echo "Unknown arg for read: $1" >&2
          usage
          exit 2
          ;;
      esac
    done

    if [[ -z "$note_id" && -z "$title" ]]; then
      echo "read requires --id or --title" >&2
      exit 2
    fi
    if [[ "$format" != "plaintext" && "$format" != "body" ]]; then
      echo "Invalid --format: $format (use plaintext or body)" >&2
      exit 2
    fi
    ;;

  update)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --id)
          require_arg "$1" "${2:-}"
          note_id="$2"
          shift 2
          ;;
        --title)
          require_arg "$1" "${2:-}"
          title="$2"
          shift 2
          ;;
        --title-new)
          require_arg "$1" "${2:-}"
          title_new="$2"
          title_new_set="true"
          shift 2
          ;;
        --body)
          require_arg "$1" "${2:-}"
          body="$2"
          body_set="true"
          shift 2
          ;;
        --account|--folder|--all)
          if [[ "$1" == "--all" ]]; then
            all="true"
            shift
          elif [[ "$1" == "--account" ]]; then
            require_arg "$1" "${2:-}"
            account="$2"
            shift 2
          else
            require_arg "$1" "${2:-}"
            folder="$2"
            shift 2
          fi
          ;;
        *)
          echo "Unknown arg for update: $1" >&2
          usage
          exit 2
          ;;
      esac
    done

    if [[ -z "$note_id" && -z "$title" ]]; then
      echo "update requires --id or --title" >&2
      exit 2
    fi
    if [[ "$title_new_set" != "true" && "$body_set" != "true" ]]; then
      echo "update requires at least one of --title-new or --body" >&2
      exit 2
    fi
    ;;

  delete)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --id)
          require_arg "$1" "${2:-}"
          note_id="$2"
          shift 2
          ;;
        --title)
          require_arg "$1" "${2:-}"
          title="$2"
          shift 2
          ;;
        --account|--folder|--all)
          if [[ "$1" == "--all" ]]; then
            all="true"
            shift
          elif [[ "$1" == "--account" ]]; then
            require_arg "$1" "${2:-}"
            account="$2"
            shift 2
          else
            require_arg "$1" "${2:-}"
            folder="$2"
            shift 2
          fi
          ;;
        *)
          echo "Unknown arg for delete: $1" >&2
          usage
          exit 2
          ;;
      esac
    done

    if [[ -z "$note_id" && -z "$title" ]]; then
      echo "delete requires --id or --title" >&2
      exit 2
    fi
    ;;

  search)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --query)
          require_arg "$1" "${2:-}"
          query="$2"
          shift 2
          ;;
        --field)
          require_arg "$1" "${2:-}"
          field="$2"
          shift 2
          ;;
        --limit)
          require_arg "$1" "${2:-}"
          limit="$2"
          shift 2
          ;;
        --account|--folder)
          if [[ "$1" == "--account" ]]; then
            require_arg "$1" "${2:-}"
            account="$2"
            shift 2
          else
            require_arg "$1" "${2:-}"
            folder="$2"
            shift 2
          fi
          ;;
        *)
          echo "Unknown arg for search: $1" >&2
          usage
          exit 2
          ;;
      esac
    done

    if [[ -z "$query" ]]; then
      echo "search requires --query" >&2
      exit 2
    fi
    if [[ "$field" != "any" && "$field" != "title" && "$field" != "body" ]]; then
      echo "Invalid --field: $field (use any, title, or body)" >&2
      exit 2
    fi
    ;;

  list)
    while [[ $# -gt 0 ]]; do
      case "$1" in
        --limit)
          require_arg "$1" "${2:-}"
          limit="$2"
          shift 2
          ;;
        --account|--folder)
          if [[ "$1" == "--account" ]]; then
            require_arg "$1" "${2:-}"
            account="$2"
            shift 2
          else
            require_arg "$1" "${2:-}"
            folder="$2"
            shift 2
          fi
          ;;
        *)
          echo "Unknown arg for list: $1" >&2
          usage
          exit 2
          ;;
      esac
    done
    ;;

  -h|--help|help)
    usage
    exit 0
    ;;

  *)
    echo "Unknown action: $ACTION" >&2
    usage
    exit 2
    ;;
esac

if ! [[ "$limit" =~ ^[0-9]+$ ]]; then
  echo "Invalid --limit: $limit" >&2
  exit 2
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APPLESCRIPT_FILE="$SCRIPT_DIR/manage_notes.applescript"

if [[ ! -f "$APPLESCRIPT_FILE" ]]; then
  echo "Missing AppleScript file: $APPLESCRIPT_FILE" >&2
  exit 1
fi

osascript "$APPLESCRIPT_FILE" \
  "$ACTION" \
  "$title" \
  "$note_id" \
  "$body" \
  "$body_set" \
  "$title_new" \
  "$title_new_set" \
  "$query" \
  "$field" \
  "$format" \
  "$all" \
  "$limit" \
  "$account" \
  "$folder"
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall