From apple-notes-pack
Monitors Apple Notes app health and automation metrics like note/folder counts, latency, and running status using bash/osascript/JXA scripts. Alerts on downtime.
How this skill is triggered — by the user, by Claude, or both
Slash command
/apple-notes-pack:apple-notes-observabilityThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
#!/bin/bash
# scripts/notes-health-check.sh — Run via cron or launchd
LOG_FILE="/tmp/notes-health.log"
timestamp=$(date -Iseconds)
notes_running=$(pgrep -x Notes > /dev/null && echo "true" || echo "false")
note_count=$(osascript -l JavaScript -e "Application(\"Notes\").defaultAccount.notes.length" 2>/dev/null || echo "0")
folder_count=$(osascript -l JavaScript -e "Application(\"Notes\").defaultAccount.folders.length" 2>/dev/null || echo "0")
echo "{\"timestamp\":\"$timestamp\",\"running\":$notes_running,\"notes\":$note_count,\"folders\":$folder_count}" >> "$LOG_FILE"
# Alert if Notes not running
if [ "$notes_running" = "false" ]; then
osascript -e "display notification \"Notes.app is not running\" with title \"Notes Health Alert\""
fi
// src/observability/metrics.ts
interface NotesMetrics {
timestamp: string;
noteCount: number;
folderCount: number;
accountCount: number;
latencyMs: number;
healthy: boolean;
}
function collectMetrics(): NotesMetrics {
const start = Date.now();
try {
const output = execSync("osascript -l JavaScript -e \"JSON.stringify({notes: Application(\\\"Notes\\\").defaultAccount.notes.length, folders: Application(\\\"Notes\\\").defaultAccount.folders.length, accounts: Application(\\\"Notes\\\").accounts().length})\"", { encoding: "utf8" });
const data = JSON.parse(output);
return { timestamp: new Date().toISOString(), noteCount: data.notes, folderCount: data.folders, accountCount: data.accounts, latencyMs: Date.now() - start, healthy: true };
} catch {
return { timestamp: new Date().toISOString(), noteCount: 0, folderCount: 0, accountCount: 0, latencyMs: Date.now() - start, healthy: false };
}
}
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin apple-notes-packRuns bash diagnostics for Apple Notes automation issues on macOS: app/accounts status, note/folder counts via osascript, TCC permissions. Trigger: 'apple notes debug'.
Automates Apple Notes via JXA. Use when asked to "create notes programmatically", "automate Notes app", "JXA notes scripting", or "organize notes with automation". Covers accounts/folders/notes, HTML bodies, queries, moves, and Objective-C/UI fallbacks for Notes.app automation on macOS.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.