Skills
Build software with AI coding agents without losing control: planning, prompting, context, git and tests.
A practical guide to building with AI coding tools such as Claude Code, Cursor and Copilot. It covers choosing tools, planning before prompting, managing context, debugging with the model, and the git and testing habits that keep AI-written code shippable.
The subjects follow the roadmap.sh Vibe Coding roadmap.
Building software mostly by describing what you want in plain language and letting an AI model write, run and fix the code, while you steer by reviewing results. Andrej Karpathy coined the term in early 2025. It is fast for prototypes, but shipped code still needs someone who can judge it.
Treat the model as a fast, tireless junior who never says "I am not sure". You own the product decisions, the review and the consequences. Work in small verifiable steps, read diffs before accepting them, and assume any confident answer can be wrong until a test or a run proves otherwise.
Tools range from autocomplete inside the editor, through chat panes that edit several files, to terminal agents that run commands, tests and git on their own. Agents give the most leverage but also need the most supervision. Most developers settle on one main agent plus editor completion.
Anthropic's agentic CLI: it reads the repo, edits files, runs shell commands and tests, and asks permission before risky actions. Project instructions live in CLAUDE.md; it supports subagents, hooks, skills and MCP servers, and also runs inside VS Code and JetBrains.
Google's models are available to coders through the open-source Gemini CLI terminal agent, Gemini Code Assist in IDEs, and AI Studio. Long context windows make them handy for reading large codebases in one pass.
OpenAI's coding agent, available as an open-source CLI, an IDE extension and a cloud version that works on tasks in sandboxes and opens pull requests. Instructions for it go in an AGENTS.md file at the repo root.
A VS Code fork built around AI: tab completion that predicts multi-line edits, a chat that edits across files, and an agent mode. Project rules in .cursor/rules keep conventions consistent; it lets you switch between models from several vendors.
Cognition's autonomous engineer that works in its own cloud machine with a shell, editor and browser, taking tickets from Slack or Linear and returning pull requests. Best for well-scoped, repetitive tasks; it is a paid team product.
GitHub Copilot offers inline completion, chat and an agent mode in VS Code, JetBrains and other editors, plus a coding agent that turns GitHub issues into pull requests. Repo-wide guidance goes in .github/copilot-instructions.md.
Browser-based builders that turn a prompt or screenshot into a running web UI you can preview instantly. Great for mockups, landing pages and quick MVPs; export the code to a real repo once the project needs custom backend logic or careful review.
Vercel's generator for React and Next.js interfaces styled with Tailwind and shadcn/ui. Iterate in chat, then deploy to Vercel or pull the code into your own project.
Builds full-stack web apps from chat, wiring a React frontend to Supabase for auth and data and syncing everything to a GitHub repo. Check its generated database rules carefully before real users arrive.
An agent given a vague goal will happily build the wrong thing quickly. Talk the idea through with the model first, have it ask you questions, then save the agreed plan to a file in the repo so every later session starts from the same document.
Write down the smallest version that proves the idea, then list later phases separately. A fixed scope keeps the AI from adding features nobody asked for.
Build one feature, run it, review it, commit it, then move on. Large one-shot requests produce sprawling diffs that are hard to review and harder to debug.
A screenshot, a wireframe or a snippet of the pattern you want removes far more ambiguity than another paragraph. Most coding agents accept images directly in the prompt.
Write a spec of requirements and acceptance criteria first, derive a technical plan and a task list from it, and let the agent implement task by task against that spec.
Models write best in what they have seen most. Set conventions early and review the first outputs hard: whatever patterns the AI lays down in the first files get copied into every file after.
Mainstream stacks like React, Next.js, Django or Postgres have huge amounts of training data and documentation, so suggestions are more accurate. New or niche libraries invite invented APIs and outdated usage.
Put naming rules, folder layout, libraries to prefer or avoid and formatting in the agent's instruction file (CLAUDE.md, AGENTS.md, Cursor rules). Back them with a linter and formatter so they are enforced, not just requested.
Ask for small files with one responsibility each. Small modules fit in the model's context, are easier to review, and limit how much a bad edit can break.
Agents tend to append rather than restructure. Schedule sessions where the only task is cleanup: split large files, delete dead code, remove duplication, with tests confirming behaviour stays the same.
Skills are packaged instructions and scripts an agent loads when a task matches, such as a deploy checklist or a design guide. Reuse well-reviewed public ones, but read them first, since they run with your permissions.
Generated code often works while being unsafe: missing auth checks, SQL built from strings, permissive CORS, open database rules. You cannot delegate responsibility for this, so review security-sensitive code yourself and keep secrets out of the repo.
Ask the AI to review the app against the OWASP Top 10: input validation, authorisation on every endpoint, injection, dependency vulnerabilities. Treat its list as a starting point and verify each finding.
API keys and passwords belong in environment variables or a secrets manager, never in source. Commit a .env.example, git-ignore .env, and rotate any key that was ever pushed.
Output quality tracks prompt quality. Say what to build, where, with which constraints and how you will check it. Short, concrete, single-purpose requests beat long wish lists.
Bundling several unrelated changes in one prompt leads to half-finished work on each. Send them one by one and verify each before the next.
Name the files, functions, expected behaviour and edge cases. "Add rate limiting to POST /login, 5 attempts per minute per IP, return 429" gets far better results than "make login safer".
When a model keeps repeating a mistake, such as adding a library you avoid or editing generated files, write that rule down explicitly and keep it in the instruction file for future sessions.
Attach mockups, API specs, sample payloads or an existing file that shows the pattern to follow. Pointing at real files with @path beats describing them from memory.
Asking the model to review as a security engineer or a UX researcher shifts what it pays attention to. Useful for reviews and critiques; it does not add knowledge the model lacks.
For tricky bugs or design choices, ask for analysis and options before any code. Many tools also expose extended thinking or a plan mode that separates planning from editing.
The model only knows what is in its context window: your instructions, the files it read and the conversation so far. Old, irrelevant history wastes tokens and degrades answers, so curate context deliberately and keep durable knowledge in files.
The project instruction file (CLAUDE.md, AGENTS.md) is loaded every session. When you catch yourself repeating an instruction, or a session teaches something useful, add it there.
Large windows let a model read many files at once for cross-cutting questions, but cost more and can still miss details buried in the middle. Load what the task needs, not the whole repo by default.
If several attempts at the same fix fail, the conversation is usually polluted with wrong assumptions. Start a new session with a short summary of what you learned instead of arguing on.
Clear the context (/clear in Claude Code) when switching to unrelated work. Answers get sharper, token costs drop, and leftover details stop leaking into the new task.
Subagents run a side task, like searching the codebase or reviewing a diff, in their own context and return only a summary, keeping the main conversation small and focused.
AI is good at reading stack traces and proposing fixes, but accepting a fix you do not understand just moves the bug. Make it explain the cause, confirm the explanation matches what you see, then apply the change.
Give the full error, stack trace and the command that produced it, unedited. Agents that can run the command themselves can then reproduce and verify the fix.
When quick fixes keep failing, stop patching and ask for a ranked list of hypotheses with a way to test each. Eliminating causes one at a time is faster than guessing.
Have the AI add targeted log lines around the failing path showing inputs, branches and state, run it, and read the output together. Remove the noise once the bug is found.
MCP servers let the agent act directly: Playwright MCP drives a real browser to click through the UI and read console errors, others query databases or logs. The agent then sees the bug instead of your description of it.
Git is your undo button when an agent makes a mess. Commit each working step with a clear message so you can always get back to the last good state and see exactly what the AI changed.
Commit after every task that works and passes its checks. Small commits make git diff reviews easy and turn git bisect into a quick way to find which change broke something.
Begin each feature with no uncommitted changes, ideally on its own branch, so the resulting diff contains only that feature and is trivial to discard.
Tool-native undo or checkpoints may not cover changes made by shell commands and are tied to one session. git restore, git revert and git reset are reliable and visible in history.
Agents can write commit messages from the diff, open pull requests with gh pr create, and summarise review comments. Keep force pushes and history rewrites behind your approval.
Left alone, agents ship features without tests. Tests are what let you accept AI changes with confidence and let the agent check its own work, so make writing them part of every task.
Request unit tests for logic and a few end-to-end tests for the main user flows with every feature. E2E tests in Playwright or Cypress catch the integration breaks that AI edits often cause.
Write or approve failing tests first, then have the agent implement until they pass. The tests become an unambiguous spec and stop the model from declaring success early.
Before fixing a bug, have the AI write a test that fails because of it. The fix is done when that test passes, and it guards against the bug returning.
A passing test suite turns refactoring from risky into routine: ask for the restructure, run the tests, and keep the change only if everything stays green.