From apple-notes-pack
Set up local development workflow for Apple Notes automation with JXA hot reload. Trigger: "apple notes dev loop".
npx claudepluginhub flight505/skill-forge --plugin apple-notes-packThis skill is limited to using the following tools:
Iterative development workflow for Apple Notes JXA scripts with file watching and test helpers.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Iterative development workflow for Apple Notes JXA scripts with file watching and test helpers.
mkdir apple-notes-automation && cd apple-notes-automation
npm init -y
npm install -D chokidar tsx typescript
// src/dev/watch-runner.ts
import { watch } from "chokidar";
import { execSync } from "child_process";
watch("scripts/*.js", { ignoreInitial: true }).on("change", (path) => {
console.log(`Changed: ${path} — running...`);
try {
const output = execSync(`osascript -l JavaScript "${path}"`, { encoding: "utf8" });
console.log(output);
} catch (err: any) {
console.error(err.stderr);
}
});
console.log("Watching scripts/*.js for changes...");
// src/dev/test-notes.ts
import { execSync } from "child_process";
function runJxa(script: string): string {
return execSync(`osascript -l JavaScript -e '${script}'`, { encoding: "utf8" }).trim();
}
function getNoteCount(): number {
return parseInt(runJxa("Application(\"Notes\").defaultAccount.notes.length"));
}
function createTestNote(title: string): string {
return runJxa(`
const Notes = Application("Notes");
const note = Notes.Note({name: "${title}", body: "<p>Test</p>"});
Notes.defaultAccount.folders[0].notes.push(note);
note.id();
`);
}
export { runJxa, getNoteCount, createTestNote };
{
"scripts": {
"dev": "tsx src/dev/watch-runner.ts",
"test:notes": "tsx src/dev/test-notes.ts"
}
}