agentleFS
onegunsamuraionegunsamurai/OpenLearning/.claude/skills/api-sync/SKILL.md

api-sync

Skill1 starsChanged 8 months agoMITView on GitHub

Verify OpenAPI spec and generated frontend client are in sync with backend routes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Eleven-M/flowmind★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify the OpenAPI codegen pipeline is in sync: backend routes → OpenAPI spec → generated frontend client → type re-exports.

    line 8
  2. Very specific:

    Read backend/openapi.json and compare:

    line 24
  3. Distinctive:

    Every backend route should have a corresponding path in the spec

    line 25
  4. Very specific:

    If mismatched, the spec is stale — recommend running: python scripts/export-openapi.py

    line 27
  5. Very specific:

    Verify frontend/src/lib/generated/ matches the OpenAPI spec:

    line 31
  6. Very specific:

    If mismatched, the client is stale — recommend running: make generate-api

    line 33
  7. Distinctive:

    All types used by frontend components should be re-exported here

    line 38
  8. Distinctive:

    If any step found drift:

    line 44
  9. Distinctive:

    Verify the regenerated client passes typecheck.

    line 51
  10. Distinctive:

    Recommendation: If anything is out of sync, provide the exact commands to fix it.

    line 62

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

Verify the OpenAPI codegen pipeline is in sync: backend routes → OpenAPI spec → generated frontend client → type re-exports.

Steps

1. Extract Backend Routes

List all routes defined in backend/app/routes/:

grep -rn '@router\.' backend/app/routes/ --include='*.py'

Record each endpoint's method, path, request model, and response model.

2. Compare Against OpenAPI Spec

Read backend/openapi.json and compare:

  • Every backend route should have a corresponding path in the spec
  • Request/response schemas should match Pydantic model definitions
  • If mismatched, the spec is stale — recommend running: python scripts/export-openapi.py

3. Check Frontend Generated Client

Verify frontend/src/lib/generated/ matches the OpenAPI spec:

  • Compare operation IDs and type names in types.gen.ts and sdk.gen.ts
  • If mismatched, the client is stale — recommend running: make generate-api

4. Verify Type Re-exports

Check frontend/src/lib/types.ts:

  • All types used by frontend components should be re-exported here
  • Imports should reference @/lib/generated/, not use types inline
  • Flag any generated type used directly in components without going through the re-export barrel

5. Full Pipeline Test

If any step found drift:

make generate-api
cd frontend && npx tsc --noEmit

Verify the regenerated client passes typecheck.

Output

LayerStatusDetails
Backend routesN endpoints foundList any unregistered routes
OpenAPI specIn sync / StaleMissing or extra paths
Generated clientIn sync / StaleMismatched operations or types
Type re-exportsComplete / GapsMissing re-exports

Recommendation: If anything is out of sync, provide the exact commands to fix it.

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.