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…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,117 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 repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- swiftui-expert-skillSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- swiftui-expert-skillSkill
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
- Distinctive: line 9
When Claude Code is used in this repository, CLAUDE.md must remain a thin bootstrap file that imports AGENTS.md and does not duplicate …
- Distinctive: line 13
All agent communication and written outputs in this repository must be in English.
- Distinctive: line 19
Use ASCII punctuation by default.
- Very specific: line 21
Do not use em dashes (—) or en dashes (–) in prose, bullet lists, headings, commit messages, plans, or code comments.
- Very specific: line 23
Always use the plain ASCII hyphen (-) instead.
- Very specific: line 38
All iCloud files under per-account paths live in Tempo/accounts/<accountId>/.
- Distinctive: line 67
When identifiers such as iCloud container IDs, app group IDs, widget kinds, or deep-link routes are needed in multiple targets, define or …
- Very specific: line 81
Do not store OAuth credentials in UserDefaults, widgets, or iCloud.
- Very specific: line 82
Do not move watch relay or haptic logic into Shared/.
- Very specific: line 83
Do not break the distinction between updateApplicationContext for latest usage state and transferUserInfo for durable background delivery.
- Very specific: line 84
Do not bypass the RequestFreshRelay → iPhone → relay path by attempting direct iCloud access from watchOS.
- Distinctive: line 85
Do not duplicate app group IDs, iCloud paths, widget kind names, or route URLs across targets if a shared constant already exists.
- Very specific: line 86
Treat changes to entitlements, Info.plist values, bundle identifiers, app groups, iCloud containers, and .xcodeproj settings as high-risk …
- Very specific: line 99
Use legacy commands: /opsx:propose, /opsx:apply, /opsx:explore, /opsx:archive
- Very specific: line 100
Design: use openspec-propose (/skills or $openspec-propose) to draft before implementation
- Very specific: line 102
Implementation: use openspec-apply-change (/skills or $openspec-apply-change) to implement OpenSpec tasks
≈ “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.
Files
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; globalalert-preferences.json) → iOS companion → WatchConnectivity → watchOS UI and alerts - Session pipeline: macOS app reads Claude Code local data from
~/.claude/→ writes per-accountlatest.jsonto iCloud → iOS companion relays to watchOS for completion alerts - Watch on-demand refresh: watchOS sends
RequestFreshRelayviasendMessage→ iPhone restartsiCloudUsageReaderand re-relays the active account'sUsageStateviaupdateApplicationContext→ 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
| Folder | Target | Role |
Tempo macOS/ | macOS menu bar app | OAuth sign-in, usage polling, iCloud writer |
Tempo/ | iOS app | iCloud reader, dashboard/activity UI, WatchConnectivity sender |
Tempo Watch/ | watchOS app | Watch UI, WatchConnectivity receiver, haptic/session alerts |
Tempo macOS Widget/ | macOS widget extension | Desktop widgets backed by shared widget snapshots |
Tempo iOS Widget/ | iOS widget extension | iPhone widgets backed by shared widget snapshots |
Tempo Watch Widget/ | watchOS widget extension | Watch 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.swiftowns the macOS coordinator. It starts OAuth restore, polling, widget snapshot seeding, service monitoring, and local Claude session ingestion.Tempo/TempoApp.swiftowns the iOS coordinator. It startsiCloudUsageReader, writes iOS widget snapshots, and relays usage/session data to the watch.Tempo Watch/Tempo_WatchApp.swiftowns 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 aRequestFreshRelaymessage to the iPhone to pull fresh data without waiting for the next passive relay cycle.Tempo Watch/WatchRefreshCoordinator.swiftmanages the on-demand refresh lifecycle: sendsRequestFreshRelayviaWCSession.sendMessage, tracks in-progress/error/idle state, detects success whenTokenStore.lastRelayReceivedAtupdates, and times out after 10 seconds. The dashboard binds to its state for the refresh button UI.Shared/WidgetUsageSnapshot.swiftis the contract for widget snapshot persistence. Changes here must keep the iOS and macOS widget targets aligned.Tempo macOS/ClaudeLocalDBReader.swiftandTempo macOS/SessionEventWriter.swiftread from~/.claude/and rely on security-scoped access when sandboxed. Changes here must preserve the access-grant flow.Shared/AlertPreferencesSync.swiftandShared/TempoICloud.swiftdefine 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
updateApplicationContextfor latest usage state andtransferUserInfofor 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
.xcodeprojsettings 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
/skillsand 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
- In Codex, use
- OpenSpec in OpenCode:
- Use legacy commands:
/opsx:propose,/opsx:apply,/opsx:explore,/opsx:archive
- Use legacy commands:
- Design: use
openspec-propose(/skillsor$openspec-propose) to draft before implementation - SwiftUI: invoke
/swiftui-expert-skillwhen writing or reviewing any Swift/SwiftUI code - Implementation: use
openspec-apply-change(/skillsor$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.swiftwhen 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.
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
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.

