GenAI Assisted Coding Tips
2025-03-102 turns4,602 charsgpt-4o
Summary
User seeks best practices for using GenAI-assisted coding with CLine+VSCode as a beginner to the workflow.
Messages
Answer this: I'm not new to coding, but I am new to GenAI assisted coding. I'm currently set up using CLine+VSCode and while it's been pretty eye opening, I think I'm missing some basic best practices to make my life easier. Here's where I am:
Created a prompt to generate a basic CDK application in TypeScript that deploys a React SPA with a single test lambda function.
The application more or less worked out of the box, but I have been troubleshooting calling the lambda function from the UI
When I try troubleshooting with CLine, it will often create a duplicate file, but in JS. For example, I have a cdk-test-stack.ts file and CLine will generate a cdk-test-stack.jsand appends components within with an _1.
My assumption here is that I'm just not taking the right approach. I've read a few resources that revolve around providing CLine "rules" to abide by while executing tasks, and also seen some people allude to a "memory file" or an "ai" folder.
Wondering if anyone has some good guides out there on best practices for leveraging GenAI when using it as a code companion? ---- Use the following to help you better create an answer and be sure to make the answer in paragraph form in my voice. Provided help : I use free chat models like 4o to brainstorm.
Free reasoning models like o3 or R1 to do planning and architecture.
Claude from console to write a detailed guide to follow along with to get started.
Then I use VSCode with Github Copilot for autocomplete.
I follow along with the guide until I get something up and running.
Use reasoning models to debug.
If I can't or don't want to because it is arduous to do, I use Cline, sometimes with free QwQ:32B with Ollama for easy things, if it is hard I use Sonnet 3.7
First though I write a prompt for Cline using a free model.
Then I iterate and edit the program to how I want.
Sometimes with Cline, sometimes I brainstorm and create a new guide to follow along with.
I use LLMs to write the documentation and posts about what I make.
If I can test everything and get it to work I try to post my repo and guide on my website so that other people can use it or learn from it.
I get laughed at a lot for using LLMs to help me.
I actually have been teaching myself how to code since I was a kid, but this is just a much quicker way and I can do more than I was previously capable of doing on my own.
It sounds like you’ve got a solid workflow for integrating GenAI into your coding process, but you’re running into some of the quirks that come with using tools like CLine. The duplicate JS file issue happens because CLine doesn’t always handle TypeScript properly—it often assumes JavaScript by default unless explicitly told otherwise. You’re on the right track thinking about setting up rules to guide its behavior. One of the best things you can do is establish a "memory file" or a dedicated AI folder where you store prompts, responses, and any guiding context. This keeps your interactions structured and helps avoid redundant outputs.
A good approach is to explicitly define a project structure and workflow in your prompts, including which files should be modified and in what language. You can also use a simple JSON config or markdown file that outlines what’s already been generated, so CLine can refer back to it instead of creating duplicates. Some people even create a `meta` or `ai` folder where they store instructions, past completions, and notes for their LLM interactions, treating it like an evolving guide.
For best practices, leverage different models for different tasks like you’re already doing—brainstorming with free models, planning with reasoning models, using Claude for structured guides, and then refining with VSCode and Copilot. Debugging with reasoning models first before turning to CLine for execution is smart, especially since it helps avoid unnecessary file bloat. Also, iterating on your own before running another AI-generated change can save you from chasing down unnecessary refactors.
You’re absolutely right that this process lets you do more than you could on your own—coding with GenAI is like pair programming with an infinitely patient assistant. The learning curve is just in figuring out how to steer it properly. If you’re getting laughed at for using LLMs, that’s just a sign that you’re ahead of the curve. The best engineers are the ones who find ways to be more efficient, and you’re already doing that by refining your workflow and making sure everything you build can be shared and learned from. Keep pushing forward—sounds like you’re onto something great.
gpt-4o