AI Learning Hub › Learn AI › Self-Paced Courses › Cursor: Plan, Build, Debug, and Review › Read the Code, Then Ask About It
Module 2 ยท Beginner to intermediate
Read the Code, Then Ask About It
Three files, one page. Change something by hand and watch it happen, then use Ask to find the piece of this project nothing is using yet.
By the end
- Say what each of the three files in the project is responsible for
- Change something visible by hand and see the result in a browser
- Use Ask to find a piece of this project that nothing is currently using
You can supervise an agent writing code you could not write yourself, but not code you cannot read. This module is about getting to the reading threshold, which for a project this size takes about ten minutes.
Three files, three jobs
Open the practice project in Cursor and look at the file tree.
index.html
The content and its structure. Every resource card on the page is written out here, along with the heading, the category dropdown and the footer.
styles.css
How it all looks. Colors, spacing, typography, the card borders. The five colors used on the page are defined once at the top and referred to by name everywhere else.
script.js
What happens when you interact with it. In this project that means one thing: choosing a category hides the cards that do not match.
There is also a README.md, which describes the project in prose, and private-notes.txt, which you will use in Module 3.
Run it
Double-click index.html in Finder and it opens in your browser. That works for this project because nothing in it needs a web server.
For the later modules you will want a local address instead, which you can start from a terminal in the project folder:
python3 -m http.server 8000Then visit http://localhost:8000. Leave that running in its own terminal tab; stopping it is Control-C, which Terminal on Mac covers.
Exercise: change something by hand
In index.html, find the card for the Community Kitchen. It looks like this:
<li class="card" data-category="food" data-evenings="no">
<h2>Community Kitchen</h2>
<p class="meta">Food · 37 Harbor Lane</p>
<p>Hot meals served daily at midday.</p>
<p class="hours">Daily 11:30–13:30</p>
</li>Change the description to something else — Hot meals, no referral needed. will do. Save the file, reload the page in your browser, and see it change.
That loop is the whole of web development at this scale: edit a file, save, reload, look. Everything the agent does later is a faster version of the same thing, and knowing what it feels like by hand is what lets you tell a good result from a plausible one.
The attribute nothing uses
Look again at that card and notice it carries two labels:
data-category="food" data-evenings="no"A data- attribute is a way of attaching information to an element without displaying it. The category one is doing work — it is what the dropdown filters on. The evenings one is the subject of the next four modules, and rather than explain it, the exercise is to have Cursor tell you about it.
Exercise: Ask about the project
Open the agent panel and switch to Ask mode. In Cursor 3.27 the mode is shown as a labeled chip at the bottom left of the message box, and pressing Shift+Tab in the message box moves through the available modes until Ask comes up.
Ask is for understanding a codebase. In testing for this course it answered questions and read files without changing any of them, which makes it a reasonable place to start on a project you have not seen.
Prompt to try
Explain how this site is structured and where the resource cards come from. Show me which files matter. Do not change any files.
Read the answer against the file tree. It should name the three files and describe roughly what you worked out above. Now the question that matters:
Prompt to try
Three resource cards contain data-evenings="yes". What is that attribute currently used for? Show me the relevant code before changing anything.
Course example — what Cursor answered, captured with Cursor 3.27.12
Asked that question in the practice project on 23 October 2026, Cursor listed the six cards with both attributes, then said:
The filter in
script.jsonly checksdata-category. It never callsgetAttribute("data-evenings")or readsdataset.evenings, andstyles.csshas no rule for the attribute either.
It quoted lines 10 to 14 of script.js, and finished:
So today the attribute marks whether a service is open past 18:00, and it has no effect on filtering or styling.
Your wording will differ. What should match is the finding: three cards are labeled as open in the evening, and no code reads the label.
Check the claim yourself rather than taking it. Open script.js — it is twenty-one lines — and look for the word evenings. It is not there.
Confirm that nothing changed
Run git status in the project folder. It should report a clean working tree, apart from the edit you made by hand if you have not reverted it yet.
Doing this once is worth the trouble. It is the difference between having read that Ask does not edit files and having watched it not edit them.
Before the next module
- You have edited a file by hand, saved, and seen the page change
- Ask has told you that nothing reads
data-evenings, and you have confirmed it inscript.js git statusshows no changes you did not make yourself