agentleFS
FradSerFradSer/mcp-server-apple-events/AGENTS.md

mcp-server-apple-events

AGENTS.md214 starsChanged 3 months agoMITView on GitHub

Source lives in src/, segmented into clean architecture rings so dependencies flow inward. Transport adapters sit in src/server/, the vendored Swift CLI binary (bin/event) is built from the vendor/event git submodule, and automation workflows stay under src/tools/. Shared helpers live in src/utils/ (including eventCli.ts — the wrapper around bin/event), while src/validation/ enforces Zod contracts on every reminder payload. Tests co-locate as *.test.ts beside subjects to keep TDD feedback immediate, and generated binaries rebuild instead of touching dist/. Run pnpm install…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If authorized: proceeds directly

    line 31
  2. Very specific:

    If notDetermined: requests permission automatically via requestFullAccessToReminders / requestFullAccessToEvents

    line 32
  3. Very specific:

    If denied / restricted / write-only: emits Error: Permission denied: … on stderr with a non-zero exit code

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Structure & Module Organization

Source lives in src/, segmented into clean architecture rings so dependencies flow inward. Transport adapters sit in src/server/, the vendored Swift CLI binary (bin/event) is built from the vendor/event git submodule, and automation workflows stay under src/tools/. Shared helpers live in src/utils/ (including eventCli.ts — the wrapper around bin/event), while src/validation/ enforces Zod contracts on every reminder payload. Tests co-locate as *.test.ts beside subjects to keep TDD feedback immediate, and generated binaries rebuild instead of touching dist/.

Build, Test, and Development Commands

Run pnpm install to sync the locked dependency graph (and to build the vendored event CLI via the postinstall hook). Use pnpm dev for watch-mode TypeScript development without recompiling the Swift binary. Execute pnpm test to run the Jest suite through ts-jest and the __mocks__/eventCli.ts mock. Run pnpm exec biome check before commits to enforce formatting, linting, and import ordering, and rebuild the native helper with pnpm build:event whenever the vendor/event submodule pin moves.

Coding Style & Naming Conventions

Biome enforces two-space indentation, single quotes, and sorted imports across .ts files. Choose camelCase for variables and functions, PascalCase for classes, and reuse screaming snake constants from src/utils/constants.ts when system identifiers need emphasis. Prefer composition, dependency injection, and repository abstractions to keep outer layers independent of inner logic, and comment only to justify architectural trade-offs or business rules.

Testing Guidelines

Follow strict RED-GREEN-REFACTOR cycles by writing a failing Jest spec beside each new unit. Use the fixtures under src/__mocks__/ to stabilize reminder schema behavior and initialize shared state through src/test-setup.ts. Narrow prompt template changes by targeting pnpm test -- src/server/prompts.test.ts. Name specs <module>.test.ts for discoverability and prioritize schema and error-path coverage before happy paths.

Commit & Pull Request Guidelines

Craft conventional commits such as feat: add transport validator, keeping titles lowercase and under 50 characters. Ensure every commit leaves pnpm test and pnpm exec biome check green to maintain CI parity. PRs require actionable descriptions, verification command logs, and linked issues for traceability, and provide screenshots or logs when modifying transport flows or reminder outputs. Merge via merge commits only after CI and security checks pass.

Security & Configuration Tips

Store secrets exclusively in .env.local and load them through typed contracts to avoid leaking reminder data. Grant macOS Reminders and Calendar permissions locally; the Swift bridge aborts before integration tests without them. Run pnpm audit --prod ahead of release branches to surface Swift toolchain CVEs, and stub external services via dependency injection instead of hardcoding tokens or calendar IDs.

Permission Handling

macOS permissions for Reminders and Calendar are requested by the vendored event CLI when needed. It checks permission status before each operation:

  • If authorized: proceeds directly
  • If notDetermined: requests permission automatically via requestFullAccessToReminders / requestFullAccessToEvents
  • If denied / restricted / write-only: emits Error: Permission denied: … on stderr with a non-zero exit code

src/utils/eventCli.ts maps that stderr message into a domain-typed CliPermissionError. TypeScript handlers do not duplicate permission checks. eventCli.ts spawns bin/event through the bin/event-disclaim TCC shim (falling back to a direct, host-attributed spawn when the shim is absent), so permission prompts are attributed to event itself (it embeds an Info.plist with the EventKit usage strings) rather than to the host MCP client (issue #93).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.