agentleFS
tenondecrpctenondecrpc/tempo-for-claude/AGENTS.md

tempo-for-claude

AGENTS.md4 starsChanged 8 months agoMITView on GitHub

Guidelines for agentic coding agents operating in this repository. AGENTS.md is the single source of truth for repository instructions. When Claude Code is used in this repository, CLAUDE.md must remain a thin bootstrap file that imports AGENTS.md and does not duplicate repository rules. All agent communication and written outputs in this repository must be in English. These formatting rules apply to all agent-written output in this repository, including Codex, OpenCode, and Claude Code. Use ASCII punctuation by default. Do not…

The file

Show its rules and text

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

16 rules. About 0 are common, 5 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When Claude Code is used in this repository, CLAUDE.md must remain a thin bootstrap file that imports AGENTS.md and does not duplicate …

    line 9
  2. Distinctive:

    All agent communication and written outputs in this repository must be in English.

    line 13
  3. Distinctive:

    Use ASCII punctuation by default.

    line 19
  4. Very specific:

    Do not use em dashes (—) or en dashes (–) in prose, bullet lists, headings, commit messages, plans, or code comments.

    line 21
  5. Very specific:

    Always use the plain ASCII hyphen (-) instead.

    line 23
  6. Very specific:

    All iCloud files under per-account paths live in Tempo/accounts/<accountId>/.

    line 38
  7. Distinctive:

    When identifiers such as iCloud container IDs, app group IDs, widget kinds, or deep-link routes are needed in multiple targets, define or …

    line 67
  8. Very specific:

    Do not store OAuth credentials in UserDefaults, widgets, or iCloud.

    line 81
  9. Very specific:

    Do not move watch relay or haptic logic into Shared/.

    line 82
  10. Very specific:

    Do not break the distinction between updateApplicationContext for latest usage state and transferUserInfo for durable background delivery.

    line 83
  11. Very specific:

    Do not bypass the RequestFreshRelay → iPhone → relay path by attempting direct iCloud access from watchOS.

    line 84
  12. Distinctive:

    Do not duplicate app group IDs, iCloud paths, widget kind names, or route URLs across targets if a shared constant already exists.

    line 85
  13. Very specific:

    Treat changes to entitlements, Info.plist values, bundle identifiers, app groups, iCloud containers, and .xcodeproj settings as high-risk …

    line 86
  14. Very specific:

    Use legacy commands: /opsx:propose, /opsx:apply, /opsx:explore, /opsx:archive

    line 99
  15. Very specific:

    Design: use openspec-propose (/skills or $openspec-propose) to draft before implementation

    line 100
  16. Very specific:

    Implementation: use openspec-apply-change (/skills or $openspec-apply-change) to implement OpenSpec tasks

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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

AGENTS.md

Guidelines for agentic coding agents operating in this repository.

Instruction Source

AGENTS.md is the single source of truth for repository instructions.

When Claude Code is used in this repository, CLAUDE.md must remain a thin bootstrap file that imports AGENTS.md and does not duplicate repository rules.

Language

All agent communication and written outputs in this repository must be in English.

Formatting

These formatting rules apply to all agent-written output in this repository, including Codex, OpenCode, and Claude Code.

Use ASCII punctuation by default.

Do not use em dashes (—) or en dashes (–) in prose, bullet lists, headings, commit messages, plans, or code comments.

Always use the plain ASCII hyphen (-) instead.

Preferred example:

  • Describe Chart - overview of axes and data series

Project

Apple Watch app that tracks Claude Code token/credit usage and delivers haptic alerts when a session ends.

Pipelines:

  • Usage pipeline: macOS app (OAuth + poll) → iCloud JSON (per-account usage.json, usage-history.json; global alert-preferences.json) → iOS companion → WatchConnectivity → watchOS UI and alerts
  • Session pipeline: macOS app reads Claude Code local data from ~/.claude/ → writes per-account latest.json to iCloud → iOS companion relays to watchOS for completion alerts
  • Watch on-demand refresh: watchOS sends RequestFreshRelay via sendMessage → iPhone restarts iCloudUsageReader and re-relays the active account's UsageState via updateApplicationContext → watchOS receives fresh data within seconds

All iCloud files under per-account paths live in Tempo/accounts/<accountId>/. The flat legacy paths (Tempo/usage.json, Tempo/usage-history.json, Tempo/latest.json) are no longer read or written. See docs/CONVENTIONS.md for the full iCloud layout.

The hook/session data and the OAuth usage data solve different problems. Do not collapse them into a single source.

Build

Open Tempo.xcodeproj in Xcode for normal development.

CI builds with xcodebuild for the Tempo macOS and Tempo schemes. There is no comprehensive automated test suite, but there is a repo smoke test at tools/widget_smoke_test.swift for widget snapshot and route validation.

Targets

FolderTargetRole
Tempo macOS/macOS menu bar appOAuth sign-in, usage polling, iCloud writer
Tempo/iOS appiCloud reader, dashboard/activity UI, WatchConnectivity sender
Tempo Watch/watchOS appWatch UI, WatchConnectivity receiver, haptic/session alerts
Tempo macOS Widget/macOS widget extensionDesktop widgets backed by shared widget snapshots
Tempo iOS Widget/iOS widget extensioniPhone widgets backed by shared widget snapshots
Tempo Watch Widget/watchOS widget extensionWatch widget surfaces

Shared Logic

Code shared between targets lives in Shared/ (auto-synced via PBXFileSystemSynchronizedRootGroup).

Belongs in Shared/: data models, pure business logic, shared enums/constants, shared formatting/presentation helpers, widget snapshot storage, and cross-target route definitions.

Does NOT belong in Shared/: app screens, WCSession session ownership, NSMetadataQuery lifecycle code, AppKit/UIKit/watchOS alert delivery, or target-specific entitlement/bookmark access code.

When identifiers such as iCloud container IDs, app group IDs, widget kinds, or deep-link routes are needed in multiple targets, define or update them in shared constants instead of duplicating string literals.

Architecture Notes

  • Tempo macOS/TempoMacApp.swift owns the macOS coordinator. It starts OAuth restore, polling, widget snapshot seeding, service monitoring, and local Claude session ingestion.
  • Tempo/TempoApp.swift owns the iOS coordinator. It starts iCloudUsageReader, writes iOS widget snapshots, and relays usage/session data to the watch.
  • Tempo Watch/Tempo_WatchApp.swift owns the watch coordinator. The watch receives data from iPhone relay code and is responsible for watch-side alert state and presentation. On scene activation, the coordinator sends a RequestFreshRelay message to the iPhone to pull fresh data without waiting for the next passive relay cycle.
  • Tempo Watch/WatchRefreshCoordinator.swift manages the on-demand refresh lifecycle: sends RequestFreshRelay via WCSession.sendMessage, tracks in-progress/error/idle state, detects success when TokenStore.lastRelayReceivedAt updates, and times out after 10 seconds. The dashboard binds to its state for the refresh button UI.
  • Shared/WidgetUsageSnapshot.swift is the contract for widget snapshot persistence. Changes here must keep the iOS and macOS widget targets aligned.
  • Tempo macOS/ClaudeLocalDBReader.swift and Tempo macOS/SessionEventWriter.swift read from ~/.claude/ and rely on security-scoped access when sandboxed. Changes here must preserve the access-grant flow.
  • Shared/AlertPreferencesSync.swift and Shared/TempoICloud.swift define cross-device sync locations. Treat path, container, and file-name changes as high-risk.

Guardrails

  • Do not store OAuth credentials in UserDefaults, widgets, or iCloud. The macOS app uses dedicated local credential storage.
  • Do not move watch relay or haptic logic into Shared/.
  • Do not break the distinction between updateApplicationContext for latest usage state and transferUserInfo for durable background delivery.
  • Do not bypass the RequestFreshRelay → iPhone → relay path by attempting direct iCloud access from watchOS. watchOS does not reliably support ubiquity containers for third-party apps (url(forUbiquityContainerIdentifier:) returns nil).
  • Do not duplicate app group IDs, iCloud paths, widget kind names, or route URLs across targets if a shared constant already exists.
  • Treat changes to entitlements, Info.plist values, bundle identifiers, app groups, iCloud containers, and .xcodeproj settings as high-risk changes that must be called out explicitly.

References

  • Code style, patterns, and architecture: docs/CONVENTIONS.md
  • Full roadmap and backlog: docs/PLAN.md

Workflow

  • OpenSpec in Codex (stable alternative):
    • In Codex, use /skills and select: openspec-propose, openspec-apply-change, openspec-explore, openspec-archive-change
    • You can also invoke skills directly by name: $openspec-propose, $openspec-apply-change, $openspec-explore, $openspec-archive-change
  • OpenSpec in OpenCode:
    • Use legacy commands: /opsx:propose, /opsx:apply, /opsx:explore, /opsx:archive
  • Design: use openspec-propose (/skills or $openspec-propose) to draft before implementation
  • SwiftUI: invoke /swiftui-expert-skill when writing or reviewing any Swift/SwiftUI code
  • Implementation: use openspec-apply-change (/skills or $openspec-apply-change) to implement OpenSpec tasks

Verification

  • For macOS or iOS code changes, prefer building the affected Xcode scheme locally.
  • For widget or deep-link changes, run or update tools/widget_smoke_test.swift when relevant.
  • For watch, iCloud, entitlement, or notification changes, include manual verification notes because simulator behavior is incomplete for some flows.
  • UI changes should include screenshots or a short note describing what was manually verified.

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.