Repository navigation
Add an OpenAPI contract, agent guide and Claude Code setup; move to Node 24 - #4
Merged
Merged
Conversation
…ode 24 - openapi.json (OpenAPI 3.1) is built from the zod schemas the routers validate with (src/openapi.ts, z.toJSONSchema), served at GET /openapi.json and regenerated with `npm run openapi`. test/openapi.test.ts fails when the committed file is stale or documents a route the app does not have. - AGENTS.md: stack, layers, rules, the contract and the workflow. - .claude/settings.json (common checks without a prompt, .env unreadable), a PostToolUse format-and-lint hook, and an add-endpoint skill with the schema → service → controller → router → openapi → tests checklist. - Node 24 (Active LTS): .nvmrc, engines, @types/node 24, Dockerfile, docker-compose. CI: checkout/setup-node v7, Node from .nvmrc, read-only token, cancel superseded runs. - PR template, issue forms and CODEOWNERS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
openapi.json(OpenAPI 3.1) is built from the zod schemas the routers already validate with.src/openapi.tsuses zod 4's built-inz.toJSONSchema; no new dependencies.GET /openapi.jsonand regenerated withnpm run openapi.test/openapi.test.tsfails if the committed file is stale, and if it documents a route the app does not have.AGENTS.md: stack, layers (router → controller → service → store), rules (zod validation,AppError, noconsole, ESM.jsimports, tests), the contract and the workflow..claude/settings.json: common checks run without a prompt;.envis not readable,.env.examplestill is;eslint --fixafter each edit, remaining errors go back to the agent;add-endpointskill: schema → service → controller → router → openapi → tests → README → frontend..nvmrc,engines,@types/node, the Dockerfile and docker-compose.actions/checkout@v7,actions/setup-node@v7, Node version from.nvmrc, read-only token,concurrency.Why
The frontend's request types were written by hand against a table in the README. Agents in both repos now have one machine-checked contract.
How to verify
npm run lint,typecheck,format:check,npm test(55 passed),npm run build.node dist/server.js→curl localhost:9000/openapi.jsonlists all 8 paths.console.logcomes back with theno-consoleerror.Pre-existing and unrelated:
npm auditreports 9 moderate issues in dev tooling (minimatchthrough ESLint and typescript-eslint).