{"agent":"claude","input":"Add rate limiting to this tRPC API. Read package.json, .github/workflows/main.yml, src/pages/api/trpc/[trpc].ts, src/server/context.ts, src/server/trpc.ts, src/server/env.ts, src/server/routers/_app.ts, src/server/routers/post.ts, src/server/routers/post.test.ts, vitest.config.mts and playwright/smoke.test.ts first. Add an ip field to the context, read from the first x-forwarded-for entry or the socket address. Add rate-limiter-flexible with the memory store in src/server/rate-limit.ts, with the quota and window read from two optional env vars validated in src/server/env.ts with defaults. Write a t.middleware in src/server/trpc.ts that consumes a point per call and throws a TRPCError with code TOO_MANY_REQUESTS, export a rateLimitedProcedure and use it on healthcheck, post.list and post.byId, and give post.add a stricter write limiter as well. Set Retry-After through responseMeta in [trpc].ts when a response carries that error. Write src/server/rate-limit.test.ts using createCaller with an ip in the context, with no database. Run pnpm test-unit, pnpm typecheck and pnpm lint, then start Postgres, run pnpm prebuild and pnpm test-e2e, and open a pull request that names the env vars and their defaults.","resources":[{"url":"https://github.com/your-org/your-app"}]}