How I Use AI to Ship Code
Stop trying to write clever prompts. Start engineering context.
Most people use AI the wrong way. They ask for a feature in one sentence. The AI returns code that uses the wrong libraries, breaks your naming conventions, and re-introduces old bugs. You spend your afternoon fixing the mess.
An AI without context is a junior developer who has never read your codebase. It forgets everything from yesterday. You would not hand a new hire a one-line ticket and expect perfect code. You would give them an onboarding document.
I use a project memory file in my repo. This file acts as an onboarding doc that the AI reads every time. It contains project-specific rules that an outsider would not know:
• Non-negotiables: How URLs must look and how slugs must match production. • Logic rules: Deriving values from configs instead of hardcoding numbers. • Edge cases: Specific CDN settings or file paths that prevent silent breaks.
Every mistake I make becomes a line in this file. This turns the file into a compounding asset. The quality of the AI output improves over time because I stop repeating myself.
My workflow follows these steps:
- Bootstrap the context: Ask the AI to draft the memory file from your code, then you edit it.
- Restate the task: Ask the AI to summarize the goal before it writes code. This catches errors early.
- Improve the prompt: Ask the AI what is ambiguous about your request.
Use AI for these tasks:
- Writing boilerplate and scaffolding.
- Pattern-following refactors.
- Explaining unfamiliar code.
- Mechanical sweeps across a repo.
- Writing tests and fixtures.
Avoid using AI for these tasks:
- Making novel architecture decisions.
- Making taste or product calls.
- Anything where being wrong is expensive.
- Security-critical design.
- The final review before shipping.
The discipline is simple:
- Scope tasks small. Do not say "build this feature." Say "perform this specific change."
- Give context upfront.
- Verify every output. Run the build and read the diff.
- Review it like a junior developer's PR. Never commit code without a human reading it.
- Feed lessons back into your context file.
The leverage is not in the prompt. The leverage is in the context you maintain.
Optional learning community: https://t.me/GyaanSetuAi
