Claude Code Prompt Improver
Dump your rough notes or half-formed idea. Get back a clean, structured prompt ready to paste into Claude Code, Codex, or any coding agent.
New to this? Read the guide.
What it produces
Real output from this tool, not a mock-up.
What went in
- Your rough notes or idea
- need to add rate limiting to the api route that runs the tools. right now anyone signed in can just hammer it. thinking per user not per ip since they have to be signed in for the paid ones. but guests use it too and they are per ip already for the daily limit. maybe reuse that? not sure if it should be in the route or middleware. also do not want to break the existing guest quota thing which uses a supabase rpc. should probably return a 429 with something useful rather than just failing
- Project context
- Next.js 16 app router, Supabase for auth and postgres, the route is src/app/api/tools/run/route.ts. There is an existing consume_guest_quota RPC that does IP based daily limits for logged out users. No redis, trying to avoid adding infrastructure.
The prompt
Add rate limiting to src/app/api/tools/run/route.ts for signed-in users. Right now any authenticated user can hammer this route with no limit. Requirements: - Rate limit signed-in users per user ID, not per IP. Guests already go through the existing consume_guest_quota RPC for IP-based daily limits; leave that path untouched. - Implement the limit check inside the route handler itself, not in middleware, so it can use the authenticated user's ID and stay close to the existing guest quota logic. - Use Postgres/Supabase for tracking the limit (a table plus an RPC, similar in spirit to consume_guest_quota). Do not introduce Redis or other new infrastructure. - When a user exceeds the limit, return a 429 with a JSON body that tells the caller why (for example the limit, how many requests remain, and when it resets), not just a bare error. - Confirm the guest flow through consume_guest_quota still works unchanged after this change. Open questions: - What should the per-user limit be (requests per minute, per hour, per day)? - Should the limit vary by plan/tier, or is it the same for every signed-in user?
What it changed and why
Turned a stream-of-consciousness brain dump into a scoped task with explicit requirements and flagged the two decisions (limit window, per-tier vs flat) the notes left unresolved instead of guessing at them.
When to use it
Use this before handing a task to a coding agent, when you know what you want but have only half-formed notes. It turns them into a structured prompt with the context, the constraints and the things not to break stated explicitly, which is where most agent tasks go wrong.