agentleFS
me-cedricme-cedric/agent-compass/skills/api-contract-sync/SKILL.md

api-contract-sync

Skill3 starsChanged 27 days agoMITView on GitHub

Keep API code, OpenAPI, Bruno, Gherkin, mocks and client types in step. Use when an endpoint, DTO, payload, status code, query parameter or auth rule changes.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Update all layers in the same task.

    line 14
  2. Distinctive:

    Run this skill when you change any of these:

    line 18
  3. Very specific:

    Check only the layers that exist in the repository.

    line 27
  4. Distinctive:

    Read the repository AGENTS.md, the module README and the nearby specs and features.

    line 44
  5. Very specific:

    Write not present for a layer that does not exist.

    line 47
  6. Distinctive:

    Run the smallest declared checks: lint, typecheck, the API tests, the contract tests.

    line 48
  7. Very specific:

    Run the Bruno collection against the running API: bru run <collection-dir> --env <env>.

    line 49
  8. Distinctive:

    After a decorator change, check that the app still starts and the OpenAPI document builds.

    line 50
  9. Distinctive:

    Before the handoff, answer four questions:

    line 54
  10. Distinctive:

    If code changed and an existing layer did not, report the task as partial.

    line 61

≈ “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

api-contract-sync

An endpoint is not done until the code, the docs, the client examples and the behavior specs agree. Update all layers in the same task. Never defer a layer to a follow-up PR.

Trigger

Run this skill when you change any of these:

  • A route path, method, auth rule, ownership rule, status code, header or query parameter.
  • A payload, DTO, schema, error shape, pagination, sorting or filtering.
  • Controller or service behavior that an API shows.
  • Generated shared types or API client contracts.

Layers

Check only the layers that exist in the repository. The OpenAPI file is in {{OPENAPI_DIR}} when the project keeps one there.

  1. Controller docs and DTO metadata (OpenAPI, Swagger or Scalar decorators):
    • Each endpoint documents its purpose, all response codes, its query and path parameters and its auth scheme.
    • Each DTO field has a description and an example, and says if it is required.
    • A new module is registered in the OpenAPI bootstrap, with its tags.
  2. Bruno requests (*.bru):
    • The URL, method, query parameters, body and headers match the controller and the DTO.
    • The docs block and the pre-request and post-response scripts are current.
    • A new endpoint gets a new request file. A deleted endpoint loses its file. Keep the seq order in folder.bru.
  3. Gherkin (*.feature): add or change a Scenario for each new or changed behavior. Update Examples tables.
  4. Mocks and client types:
    • Mockoon: start a mock from the OpenAPI file with npx @mockoon/cli start --data <openapi-file>. Check that the mock answers the new shape.
    • Shared client types: update each consumer that imports the changed symbol.

Steps

  1. Read the repository AGENTS.md, the module README and the nearby specs and features.
  2. Find every layer for the changed route or DTO.
  3. Change the code and the layers together.
  4. Write not present for a layer that does not exist. Never write skipped.
  5. Run the smallest declared checks: lint, typecheck, the API tests, the contract tests.
  6. Run the Bruno collection against the running API: bru run <collection-dir> --env <env>. Report each failing request.
  7. After a decorator change, check that the app still starts and the OpenAPI document builds.

Review gate

Before the handoff, answer four questions:

  • Which endpoints and DTOs changed?
  • Which layers did you update?
  • Which layers are not present?
  • Which commands ran, and did they pass?

If code changed and an existing layer did not, report the task as partial.

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.

Reviews can't be read right now.

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.