Ask HN: How can I get better at using AI for programming?
471 pointsI've had a fairly steady process for doing this: look at each route defined in Django, build out my `+page.server.ts`, and then split each major section of the page into a Svelte component with a matching Storybook story. It takes a lot of time to do this, since I have to ensure I'm not just copying the template but rather recreating it in a more idiomatic style.
This kind of work seems like a great use case for AI assisted programming, but I've failed to use it effectively. At most, I can only get Claude Code to recreate some slightly less spaghetti code in Svelte. Simple prompting just isn't able to get AI's code quality within 90% of what I'd write by hand. Ideally, AI could get it's code to something I could review manually in 15-20 minutes, which would massively speed up the time spent on this project (right now it takes me 1-2 hours to properly translate a route).
Do you guys have tips or suggestions on how to improve my efficiency and code quality with AI?
Comments (469) 111 threads
Earlier comments1. get the LLM to generate a spec from the code (the spec is your new source code). Take your time here, make sure it is correct. Split out implementation details unless they are critical to the business logic.
2. Using the spec, begin crafting an ARCHITECTURE.md -- you put all your non-critical implementation details here. If you need to track requirements, require the LLM to reference the paragraph number(s) of the spec file as it writes the architectural spec. Take your time here as well (this is the second layer of your new source code).
3. Create a high level TODO from the architecture doc.
4. Create a mid-level TODO from the architecture doc (you'll know if this is necessary, perhaps chunk work up by function, feature, or architectural layer).
5. Create a granular level TODO where each task is very tight in scope (write this function, create a translator for this JSON de-serializer to create the app-level model for this object, etc.)
Then let a model go to town.
In the mean-time, you should also require testing. If you have the opportunity, you should have an LLM inspect, spec, and write comprehensive tests for the old code on the external API/interface. You'll be able to use this to test your new implementation to ensure all the corner cases and functionality are covered.
The most important is to use Claude Code with Claude Max plan to have almost unlimited access to Opus 4.5 :) the agent and DX is top notch. It one shot most of my tasks with correct code quality. If you prefer Cursor like DX, you can use Zed with the free Claude Code integration in its UI. Before, I was multiplying $20 plans but it was really annoying to switch between products to get worse quality than Opus. Best investment I made this year.
Then as Boris told: give the model a way to verify its work, just telling it explicitly 'to test, run X command / check the db in container Y / make curl request with Z access token to test your endpoint'. Game changer.
Don't overload context. When switching tasks, clear and start fresh. Mixing old task context with new one creates confusion and worse output.
One observation on Gemini 3 vs Claude 4.5 Opus: Gemini is great for one-shot on fresh projects and UIs, but struggles more on large codebases and can get easily confused (might be the Windsurf agent though).
Just experiment a lot. Like coding itself, you build intuition over time on what works and what doesn't.
I like Augment Code for it's context engine - it is a lot better at finding where in the codebase changes need to be made without the planning.
It's the central thesis to what we're doing at Cortex.build - our local model can compete with large SOTA models because of how much work we do on mapping the codebase and creating just in time context for our LLM to make small and precise changes.
All comments shown.
Couldn't load more comments. Check your connection and try again.