AI Coding for Beginners

To code with AI as a beginner, pick a small project, describe it in a short written plan, and let an AI assistant write the first version one feature at a time. Your job is to run the code, review what changed, test it against your plan and ask the AI to explain anything you don’t understand. In this tutorial you’ll build a one-page habit tracker that runs in any browser, then try the same workflow in Cursor and GitHub Copilot.

On this page
  1. What AI Coding and Vibe Coding Mean
  2. Plan a Small Project and Set Up a Workspace
  3. Build and Review a First Version
  4. Try Cursor and GitHub Copilot
  5. Test Debug and Improve the Project
  6. Sources

Course overview

  • One finished project: a habit tracker in a single HTML file
  • No installs needed for the main project; a free code editor is optional
  • Mini-lessons for Cursor and GitHub Copilot
  • The core skill: accepting code is not the same as checking it

What AI Coding and Vibe Coding Mean

AI coding means using an AI assistant to write, explain, fix or review code. It ranges from autocomplete suggestions while you type to agents that edit many files and run commands.

Vibe coding is a term popularized by AI researcher Andrej Karpathy in early 2025 for building software by describing what you want and accepting the AI’s code without reading it closely. It’s fun for quick experiments and throwaway prototypes. It’s risky for anything that handles real users, money or personal data, because problems you never looked at end up in the product.

Vibe codingReviewed AI coding
GoalSee something work fastBuild something you can trust and maintain
You read the code?RarelyYes, at least the parts that changed
Testing“It seems to work”Checks against a written plan, plus automated tests where possible
Good forPersonal toys, demosWork projects, anything shared with others

This tutorial teaches reviewed AI coding. You’ll move fast, but you’ll always know what changed and why.

Which tool to use

  • A chat assistant (ChatGPT, Claude, Gemini): paste code in and out. Easiest start, used in the main project below.
  • An AI code editor such as Cursor or VS Code with GitHub Copilot: the AI sees your files and suggests edits in place.
  • A coding agent such as Claude Code: works across a whole project, runs tests and uses Git with your approval.

Plan a Small Project and Set Up a Workspace

Small, specific projects succeed. “Build me an app” fails. Write a one-paragraph plan with a short list of features and how you’ll know each one works.

Project plan (copy and adapt)
Project: a habit tracker in ONE HTML file (HTML, CSS and JavaScript together), no frameworks, no server.
Features:
1. Add a habit by typing a name and pressing Enter or an Add button
2. Show the last 7 days as checkboxes for each habit
3. Clicking a checkbox marks that day done; it stays after reloading the page (use localStorage)
4. Delete a habit with a confirmation
Acceptance tests:
- Adding an empty name does nothing
- After reload, habits and checkmarks are still there
- Works on a phone-sized screen

Set up your workspace

  1. Create a folder called habit-tracker on your computer.
  2. Install a free code editor such as Visual Studio Code (optional but recommended), or use any plain text editor.
  3. Create an empty file named index.html in the folder.
  4. Optional: if you know Git, run git init in the folder so you can track every change.

Build and Review a First Version

Step 1: Build feature by feature

Prompt 1
Here is my project plan:
[paste the plan]
Build only features 1 and 2 for now, in a single index.html file.
Keep the code simple and add short comments explaining each part.
After the code, list what I should test manually.

Copy the code into index.html, save, and double-click the file to open it in your browser.

Step 2: Review before adding more

Before you ask for features 3 and 4, make sure you understand version one:

  • Run every manual test the AI listed; note anything that fails
  • Ask: “Explain how the 7-day checkboxes are generated, step by step”
  • Ask: “What happens if two habits have the same name?” Edge cases like this reveal hidden bugs
  • Skim the code for anything that loads files from the internet you didn’t ask for

Step 3: Add the next feature

Prompt 2
Version 1 works. Now add feature 3 (save to localStorage so data survives reloads)
and feature 4 (delete with confirmation).
Show me only the parts of the file that change, and explain each change in one sentence.

Why “show only what changes”

Smaller changes are easier to review. If the AI rewrites the whole file every time, it can silently drop or alter code that already worked.

Try Cursor and GitHub Copilot

Once you’re comfortable with the chat workflow, an AI-enabled editor saves copying and pasting. Both tools below have free tiers with usage limits; check their official pricing pages for current details.

Cursor tutorial: edit your project with an AI editor

Cursor is a code editor built around AI. It looks and works much like VS Code and can import your VS Code settings.

  1. Download Cursor from its official website (cursor.com) and create an account. A free tier is available with limited AI usage.
  2. Choose File → Open Folder and select your habit-tracker folder.
  3. Open the AI chat or agent panel and ask: “Read index.html and summarize how data is stored.” Cursor uses your open files as context.
  4. Ask for a small change: “Add a counter showing how many days in the last 7 each habit was completed.”
  5. Cursor shows the proposed edits as a diff in the file. Review each change and accept or reject it.
  6. Reload the page in your browser and test the feature.

Tip: as you type code, Cursor suggests completions. Press Tab to accept, or keep typing to ignore.

GitHub Copilot tutorial: AI suggestions in VS Code

GitHub Copilot is an AI coding assistant from GitHub. The free plan (checked November 18, 2026) includes up to 2,000 code completions per month plus Copilot Chat; Copilot Pro is listed at $10 per month.

  1. Create a free GitHub account if you don’t have one.
  2. In Visual Studio Code, open the Extensions view, install GitHub Copilot, and sign in with GitHub when prompted.
  3. Open your habit-tracker folder. In index.html, type a comment such as // function that returns the last 7 dates as YYYY-MM-DD and press Enter. Copilot shows a gray suggestion; press Tab to accept.
  4. Open Copilot Chat and ask: “Explain this function and write two test cases for it.”
  5. Read the suggestion before accepting, just as you would review a coworker’s code.

How they compare for beginners

Chat assistantCursorGitHub Copilot (VS Code)
SetupNoneInstall a new editorExtension in VS Code
Sees your filesOnly what you pasteYesYes
Best forLearning and small scriptsMulti-file edits with diffsInline suggestions and chat in a familiar editor

Test Debug and Improve the Project

Test against your plan

Go through every acceptance test from your plan. Then test in a phone-sized window: in Chrome or Edge, open Developer Tools and switch on the device toolbar.

Debug with the AI, not around it

Debugging prompt
When I reload the page, the checkmarks for today disappear but older days stay.
Here is the relevant code: [paste the function that saves and loads data]
Explain the most likely cause before writing a fix. Then give the smallest change that fixes it.

Asking for the cause first stops the AI from piling on random changes. Bugs with dates and time zones are common in this kind of project.

Improve it

  • Ask for an accessibility review: “Check labels, keyboard use and color contrast.”
  • Ask for a simple automated test of the date function, and run it.
  • Ask: “What would break if 50 habits were added?” and decide if it matters.

Next step: try a coding agent that works across a real project with Git and tests in our Claude Code tutorial for beginners. For structured courses on building with AI, see AI courses.

Sources