agentleFS
amitray007amitray007/headroom/.agents/skills/app-api-compatibility/SKILL.md

app-api-compatibility

Skill83 starsChanged 11 days agoMITView on GitHub

Keep every supported Headroom for Mac release working with every supported server. Use before changing the Mac app API (`packages/view-model/src/app-feed.ts`, `apps/server/src/routes/app.ts`, `scripts/app-contract.ts`), Mac code that reads a server, the minimum server version, or the oldest supported Mac release.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add fields and endpoints. Keep every field a released Mac requires, at its type and as always sent.

    line 17
  2. Very specific:

    Run mise run mac:contract and commit apps/macos/Contract/openapi.json.

    line 20
  3. Distinctive:

    Read a new field as optional, and leave the feature out when it is absent.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

App API compatibility

A server and a Mac app ship separately, so any pairing of a supported server and a supported Mac release must work. The rules hold in two directions:

  • Old Macs, new server. Each macos-vX.Y.Z tag holds the contract that release decodes with. mise run mac:compat checks today's server against every tagged release from oldestSupportedMac in apps/macos/Contract/compatibility.json onward.
  • New Mac, old server. ServerCompatibility.minimumServer in HeadroomKit names the oldest server this build reads. Tests/HeadroomKitTests/Fixtures/Servers/<minimum>.json is that server's feed, frozen.

The app never refuses a server by its version number. A server built from main reports the last release while it already has newer endpoints. The app decides from what the server answers and uses versions only in messages: a missing endpoint or a missing field asks for a server update, and a value or type it does not know asks for an app update. The decision record is D47.

Server change: keep /api/app/v1 additive

  1. Add fields and endpoints. Keep every field a released Mac requires, at its type and as always sent. Keep every request a released Mac makes accepted.
  2. For a field whose values grow with the server, such as providers, list it in openEnumFields in scripts/app-contract.ts. Then the app decodes it as a plain string and shows an unknown value plainly. Values added to a closed enum break each Mac release that knows the old list. The check flags them.
  3. For a change that cannot be additive, add /api/app/v2 beside v1. Keep v1 until oldestSupportedMac passes every release that reads it.
  4. Run mise run mac:contract and commit apps/macos/Contract/openapi.json.

Mac change: read what the minimum server sends

  1. Read a new field as optional, and leave the feature out when it is absent. Treat a 404 from a new endpoint the same way. The rest of the source keeps reading.
  2. When a feature cannot work without the new field or endpoint, raise ServerCompatibility.minimumServer to the first server release that has it. That server release ships first. Replace the frozen feed in Fixtures/Servers/ with one from that release. A feed regenerated from today's server would hide a broken older one.
  3. Say "Needs server X.Y.Z or later" in the Mac release notes when the minimum rises.

Dropping old Macs

Raise oldestSupportedMac in apps/macos/Contract/compatibility.json only when the owner agrees to stop supporting those releases.

Done when

  • mise run check passes. It includes mac:contract:check and mac:compat.
  • mise run mac:test passes, including the frozen feed test.
  • The minimum server and the oldest supported Mac match in three places: ServerCompatibility, compatibility.json, and the tables in the Mac app architecture and the install guide.

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.