agentleFS
OrlojHQOrlojHQ/orloj/.cursor/rules/openapi-sync.mdc

orloj / rules

Cursor rule126 starsChanged 6 months agoApache-2.0View on GitHub

Keep OpenAPI in sync when the v1 API or CLI-exposed HTTP surface changes

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,373 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 repository5 other files it gives its agents.

The file

We split this openapi-sync.mdc into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you change any of the following, update openapi/ so paths and schemas stay accurate, then run the same check as CI:

    line 11

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule 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
openapi-sync.mdc
---
description: Keep OpenAPI in sync when the v1 API or CLI-exposed HTTP surface changes
globs: api/**/*.go,cli/**/*.go,cmd/orlojctl/**/*.go,openapi/**/*,resources/**/*.go
alwaysApply: false
---

# OpenAPI and API surface

Shared agent guidance lives in [.agents/rules.md](../../.agents/rules.md). Keep this Cursor rule consistent with that file.

When you change any of the following, update **[openapi/](openapi/)** so paths and schemas stay accurate, then run the same check as CI:

`npx --yes @redocly/cli@1.28.5 lint openapi/openapi.yaml`

**Usually requires OpenAPI updates**

- **`api/`** — new or changed routes, status codes, query params, or JSON bodies on the control-plane API.
- **Resource JSON** shipped over the API — Go types in **`resources/`** (and related handlers) when they change serialized shape fields users or `orlojctl apply` send/receive.
- **`orlojctl`** — new subcommands or flags that call **new or changed** HTTP endpoints or bodies (extend the spec to match what the server actually does).

**Often does not require OpenAPI updates**

- **Offline-only CLI** (e.g. manifest parse/validate with no new HTTP contract).
- Internal refactors with identical wire format.
- Docs-only changes outside the spec.

When unsure, compare **`api/server.go`** route registration and handler payloads to **`openapi/openapi.yaml`** (and split schemas under **`openapi/schemas/`**). OpenAPI lint can pass even when a newly added Go resource field is missing from `openapi/schemas/`, so check resource schema changes manually. Regenerate the bundled root doc when your workflow uses **`openapi/build_openapi.py`**.

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.