apple-notes-reference-architecture
Reference architecture for Apple Notes automation systems. Trigger: "apple notes architecture".
Best use case
apple-notes-reference-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Reference architecture for Apple Notes automation systems. Trigger: "apple notes architecture".
Teams using apple-notes-reference-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/apple-notes-reference-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How apple-notes-reference-architecture Compares
| Feature / Agent | apple-notes-reference-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Reference architecture for Apple Notes automation systems. Trigger: "apple notes architecture".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Apple Notes Reference Architecture
## Overview
Apple Notes automation systems are fundamentally different from cloud SaaS integrations. There is no REST API, no server-side SDK, and no webhook infrastructure. Everything runs locally on macOS through the Apple Events IPC bridge. This reference architecture defines the standard layered approach: a Node.js application layer that calls JXA scripts via `osascript`, a local SQLite cache for fast queries, a change detection poller for event-driven workflows, and optional Shortcuts integration for cross-app automation.
## System Architecture
```
┌─────────────────────────────────────────────────────┐
│ macOS Machine │
│ │
│ ┌──────────┐ ┌───────────┐ ┌────────────────┐ │
│ │ Your App │──▶│ osascript │──▶│ Notes.app │ │
│ │ (Node.js)│ │ (JXA) │ │ (local DB) │ │
│ └────┬─────┘ └───────────┘ └───────┬────────┘ │
│ │ │ │
│ ┌────▼─────┐ ┌───────────┐ ┌───────▼────────┐ │
│ │ SQLite │ │ Shortcuts │ │ iCloud Sync │ │
│ │ Cache │ │ Automations│ │ (bird/cloudd) │ │
│ └──────────┘ └───────────┘ └────────────────┘ │
│ │ │ │
│ ┌────▼─────┐ ┌────────▼───────┐ │
│ │ Poller / │ │ Other Apple │ │
│ │ FSEvents │ │ Devices │ │
│ └──────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────┘
```
## Project Structure
```
apple-notes-automation/
├── src/
│ ├── notes-client.ts # JXA wrapper class (osascript calls)
│ ├── cache.ts # SQLite cache layer
│ ├── templates/ # Note templates (HTML fragments)
│ ├── export/ # Export to MD/JSON/SQLite/CSV
│ ├── events/ # Change detection via polling
│ └── server.ts # Optional: local HTTP API for remote access
├── scripts/
│ ├── notes-cli.sh # CLI wrapper for common operations
│ ├── health-check.sh # Monitoring and alerting
│ ├── export-all.sh # Full backup export
│ └── install.sh # launchd deployment installer
├── tests/
│ ├── mocks/ # Mock JXA client for CI (non-macOS)
│ └── unit/ # Unit tests (vitest)
├── config/
│ ├── environments.json # Account/folder per environment
│ └── launchd.plist # Service definition template
└── package.json
```
## Component Design
```typescript
// src/notes-client.ts — Core abstraction over osascript
import { execSync } from "child_process";
export class NotesClient {
private account: string;
constructor(account = "iCloud") { this.account = account; }
private exec(jxa: string): string {
return execSync(`osascript -l JavaScript -e '${jxa.replace(/'/g, "'\\''")}'`,
{ encoding: "utf8", timeout: 30000 }).trim();
}
count(): number {
return parseInt(this.exec(`Application("Notes").accounts().find(a => a.name() === "${this.account}").notes.length`));
}
list(): Array<{ id: string; title: string; modified: string }> {
return JSON.parse(this.exec(`
JSON.stringify(Application("Notes").accounts().find(a => a.name() === "${this.account}")
.notes().map(n => ({id: n.id(), title: n.name(), modified: n.modificationDate().toISOString()})))
`));
}
create(title: string, body: string, folder = "Notes"): string {
return this.exec(`
const Notes = Application("Notes");
const acct = Notes.accounts().find(a => a.name() === "${this.account}");
const f = acct.folders().find(f => f.name() === "${folder}") || acct.folders[0];
const n = Notes.Note({name: "${title}", body: "${body}"});
f.notes.push(n); n.id();
`);
}
}
```
## Key Constraints
| Constraint | Impact | Workaround |
|-----------|--------|------------|
| macOS only | No Linux/Windows servers | Run on Mac; export data for cross-platform consumption |
| No REST API | Cannot access remotely | Optional: expose local HTTP server; lock down to localhost |
| iCloud sync lag | Writes may take 5-30s to appear on other devices | Poll with delay; verify on target device |
| No webhooks | Cannot receive push notifications | Poll for changes every 60s; watch FSEvents on Notes DB |
| HTML-only body | No native Markdown support | Convert HTML to/from Markdown in export/import layer |
| No attachment export via JXA | Binary data inaccessible from scripting | Use Shortcuts for attachment extraction |
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Architecture requires macOS server | No cloud-native option | Dedicate a Mac mini as automation server; use Tailscale for remote access |
| Local HTTP API exposed to network | Security risk if not locked down | Bind to 127.0.0.1 only; use SSH tunnel for remote access |
| Cache out of sync with Notes | Polling interval too long | Reduce poll interval; use FSEvents on NoteStore.sqlite for faster detection |
| Template HTML rejected by Notes | Invalid HTML tags | Test templates with a canary note before bulk creation |
## Resources
- [Mac Automation Scripting Guide](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/)
- [JXA Cookbook](https://github.com/JXA-Cookbook/JXA-Cookbook)
- [macOS Security Architecture](https://support.apple.com/guide/security/welcome/web)
## Next Steps
For deploying this architecture as a service, see `apple-notes-deploy-integration`. For monitoring the running system, see `apple-notes-observability`.Related Skills
workhuman-reference-architecture
Workhuman reference architecture for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman reference architecture".
wispr-reference-architecture
Wispr Flow reference architecture for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr reference architecture".
windsurf-reference-architecture
Implement Windsurf reference architecture with optimal project structure and AI configuration. Use when designing workspace configuration for Windsurf, setting up team standards, or establishing architecture patterns that maximize Cascade effectiveness. Trigger with phrases like "windsurf architecture", "windsurf project structure", "windsurf best practices", "windsurf team setup", "optimize for cascade".
windsurf-architecture-variants
Choose workspace architectures for different project scales in Windsurf. Use when deciding how to structure Windsurf workspaces for monorepos, multi-service setups, or polyglot codebases. Trigger with phrases like "windsurf workspace strategy", "windsurf monorepo", "windsurf project layout", "windsurf multi-service", "windsurf workspace size".
webflow-reference-architecture
Implement Webflow reference architecture — layered project structure, client wrapper, CMS sync service, webhook handlers, and caching layer for production integrations. Trigger with phrases like "webflow architecture", "webflow project structure", "how to organize webflow", "webflow integration design", "webflow best practices".
vercel-reference-architecture
Implement a Vercel reference architecture with layered project structure and best practices. Use when designing new Vercel projects, reviewing project structure, or establishing architecture standards for Vercel applications. Trigger with phrases like "vercel architecture", "vercel project structure", "vercel best practices layout", "how to organize vercel project".
vercel-architecture-variants
Choose and implement Vercel architecture blueprints for different scales and use cases. Use when designing new Vercel projects, choosing between static, serverless, and edge architectures, or planning how to structure a multi-project Vercel deployment. Trigger with phrases like "vercel architecture", "vercel blueprint", "how to structure vercel", "vercel monorepo", "vercel multi-project".
veeva-reference-architecture
Veeva Vault reference architecture for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva reference architecture".
vastai-reference-architecture
Implement Vast.ai reference architecture for GPU compute workflows. Use when designing ML training pipelines, structuring GPU orchestration, or establishing architecture patterns for Vast.ai applications. Trigger with phrases like "vastai architecture", "vastai design pattern", "vastai project structure", "vastai ml pipeline".
twinmind-reference-architecture
Production architecture for meeting AI systems using TwinMind: transcription pipeline, memory vault, action item workflow, and calendar integration. Use when implementing reference architecture, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind reference architecture", "twinmind reference architecture".
together-reference-architecture
Together AI reference architecture for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together reference architecture".
techsmith-reference-architecture
TechSmith reference architecture for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith reference architecture".