Summary
API contracts already exist, and the repo can generate/validate OpenAPI. Raycast and MCP still carry their own parsing and response assumptions. Shared generated typed clients would reduce drift and make future backend changes safer.
Current state
- API route contracts live in
apps/web/src/lib/api/contracts.ts.
- OpenAPI generation exists through
scripts/generate-openapi.ts.
- Raycast has defensive local parsers in
integrations/raycast/src/feed.ts and jobs-feed.ts.
- MCP has separate zod schemas for tool inputs/outputs.
Desired behavior
- Generate a small shared client/schema package or artifact for public API response shapes consumed by Raycast and MCP.
- Keep runtime parsing strict enough for untrusted public responses.
- Make schema changes fail validation when clients drift.
Implementation notes
- Avoid heavy generated code if a compact shared schema module is enough.
- Prefer repo-local generated artifacts checked by
--check commands.
- Keep public package boundaries clean; do not make the published MCP package depend on private workspace-only code.
Acceptance criteria
- API response shape changes are caught by client contract tests.
- Raycast and MCP consume shared types/parsers where practical.
- The published MCP package remains self-contained and publishable.
- OpenAPI validation remains deterministic.
Validation
pnpm validate:openapi
pnpm test:mcp
npm test from the Raycast extension directory
- Add or update focused unit tests for the touched API/helper surface.
- Run the narrow relevant validation command for the changed package or route.
- Run
git diff --check before opening a PR.
Summary
API contracts already exist, and the repo can generate/validate OpenAPI. Raycast and MCP still carry their own parsing and response assumptions. Shared generated typed clients would reduce drift and make future backend changes safer.
Current state
apps/web/src/lib/api/contracts.ts.scripts/generate-openapi.ts.integrations/raycast/src/feed.tsandjobs-feed.ts.Desired behavior
Implementation notes
--checkcommands.Acceptance criteria
Validation
pnpm validate:openapipnpm test:mcpnpm testfrom the Raycast extension directorygit diff --checkbefore opening a PR.