Most people think “AI-assisted coding” means asking a chatbot for tiny snippets: “Write this function… fix this bug… why is TypeScript crying again?” That’s toy usage.
But the people doing 300k-line refactors, solo, in weeks? They treat the AI like a full junior developer team — with structure, files, plans, rules, and strict control.
The catch? Most tutorials rely on expensive tools like Claude Code and paid automation.
This guide gives you the same power using free or standalone models like Gemini, Qwen, DeepSeek, Codestral, etc.
This is a complete workflow — not a prompt.
Using one model for everything is the reason most people get garbage results. Large projects need a split:
Use: Gemini 2.5 Pro or whatever SOTA you use Role:
This model is your Senior Engineer.
Use: Qwen 2.5 Coder, DeepSeek Coder V2, or coder model of your choice Role:
This model is your Junior Developer.
Paid tools keep the AI “on track” automatically. You can replicate this manually using a single file:
AI_RULES.md.Paste this at the start of every coding session.
Examples:
Examples:
Examples:
npm run devnpm run testdocker compose upnode scripts/seed.jsThis becomes the AI’s “company handbook.”
AI forgets. Long tasks drift. Refactors get derailed.
You fix this by creating three files for every major task:
TASK-PLAN.md — Your Master PlanGenerated by the Architect model. Contains:
TASK-CONTEXT.md — Your ScratchpadYou paste into it:
This prevents hallucinated variable names.
TASK-CHECKLIST.md — Reality TrackerA simple list you tick off manually.
“Read
auth.ts. CreatePLAN.md,TASKS.md, and list risks. Don’t write code yet.”
You give Qwen/DeepSeek:
AI_RULES.mdPLAN.mdTASK-CONTEXT.mdWhen hallucinations start → paste the plan again. This resets the AI’s “mental state.”
You are now the “QA team.”
Ask the model:
“Review your own output. Check for missing imports, TypeScript errors, broken types, or insecure patterns. Give me the fixed version.”
This eliminates 70% of runtime errors.
Don’t say “it doesn’t work.”
Instead paste the full stack trace.
Example prompt:
“Here is the stack trace. Fix only the errors mentioned. Do not refactor unrelated code.”
This keeps the model focused.
Never waste tokens. Use your IDE.
If you run backend services (Node/Go/Python), logs get messy. Crashes are missed. Terminals get flooded.
npm install pm2 -g
pm2 start app.js --name backend --log-date-format 'YYYY-MM-DD HH:mm:ss'
When something breaks:
pm2 logs backend --lines 100
Paste that into your Architect model:
“Here are the last 100 lines. Diagnose the crash.”
Paid systems run specialized agents. You can simulate them with targeted system prompts.
“You are
strategic-plan-architect. Produce a detailed plan. Minimize technical debt.”
“You are
senior-react-dev. Write clean code followingAI_RULES.md.”
“You are
build-error-resolver. Fix only the errors in the logs below.”
This “persona shifting” keeps the model sharp.
AI performs better when it has your project’s cumulative memory.
Maintain two files:
AI_RULES.mdGeneric rules about how code should be written.
ARCHITECTURE.mdProject-specific documentation:
Ask:
“Summarize everything we changed today so I can save it to
ARCHITECTURE.md.”
This becomes your “save game.”
This is the workflow in 10 seconds:
AI_RULES.mdFollow this, and even free models become real engineering partners — not autocomplete toys.
Enjoyed the article? I write about 1-2 a month. Subscribe via email or RSS feed.