Skip to content

Add an OpenAPI contract, agent guide and Claude Code setup; move to Node 24 - #4

Merged
vadim9999 merged 2 commits into
mainfrom
chore/ai-agent-setup
Nov 19, 2026
Merged

vadim9999 merged 2 commits into
mainfrom
chore/ai-agent-setup

Conversation

@vadim9999

Copy link
Copy Markdown
Contributor

What

  • API contract. openapi.json (OpenAPI 3.1) is built from the zod schemas the routers already validate with.
    • src/openapi.ts uses zod 4's built-in z.toJSONSchema; no new dependencies.
    • The document is served at GET /openapi.json and regenerated with npm run openapi.
    • test/openapi.test.ts fails 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, no console, ESM .js imports, tests), the contract and the workflow.
  • Claude Code:
    • .claude/settings.json: common checks run without a prompt; .env is not readable, .env.example still is;
    • PostToolUse hook: Prettier + eslint --fix after each edit, remaining errors go back to the agent;
    • add-endpoint skill: schema → service → controller → router → openapi → tests → README → frontend.
  • Node 24 (Active LTS) in .nvmrc, engines, @types/node, the Dockerfile and docker-compose.
  • CI: actions/checkout@v7, actions/setup-node@v7, Node version from .nvmrc, read-only token, concurrency.
  • GitHub: PR template, issue forms (bug with a curl reproduction, feature with the proposed API and acceptance criteria), CODEOWNERS.

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.json lists all 8 paths.
  • Hook: an edit that adds console.log comes back with the no-console error.

Pre-existing and unrelated: npm audit reports 9 moderate issues in dev tooling (minimatch through ESLint and typescript-eslint).

…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.
@vadim9999
vadim9999 merged commit 31177aa into main Nov 19, 2026
2 checks passed
@vadim9999
vadim9999 deleted the chore/ai-agent-setup branch November 19, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant