Practical Roadmap

AI-Assisted Web Development

Use AI to plan, build, debug, and review a small web application while retaining the ability to explain and change the code yourself.

Before You Begin

  • Complete the first four web-development steps
  • Understand variables, functions, and events
  • A local project tracked in Git

What You Will Build

A reviewed local resource app with meaningful tests and a record of AI suggestions you verified or rejected.

YOUR COURSE PROJECT · 7 CONNECTED STAGES

Build StudyBoard with AI

Use an assistant to plan and review a static resource board while keeping control of the code. Build combined search, local bookmarks, accessible controls and explicit storage recovery, then implement a saved-only view independently. Record both verified AI help and suggestions you rejected.

What You Need

  • The understood HTML/CSS/JavaScript prototype from the first four web-development lessons
  • A browser with developer tools and a text editor
  • Git for local checkpoints
  • A supported Node.js release for the loopback preview
  • An AI assistant of your choice; no AI API integration or paid subscription is required by the project

Set Up Your Project

  1. Create a separate StudyBoard folder and copy your understood index.html, styles.css and app.js prototype into it. Copy shelf.png only if your page uses that optional local image.
  2. Use five fixed resources with IDs mdn, odin, fcc, academy and bandit. The first three use the web topic and the last two use security; retain reviewed HTTP or HTTPS resource URLs.
  3. Create BRIEF.md, acceptance-cases.json and ASSISTANCE-LOG.md as the lessons introduce them. Keep real secrets, private records and unrelated files out of assistant prompts.
  4. The second lesson supplies a complete serve.mjs. Run node serve.mjs and use http://127.0.0.1:4400 consistently; changing scheme, hostname or port changes the browser storage origin.
  5. Store bookmarks only under studyboard.saved.v1. Use a disposable profile or preserve your test state before deliberately corrupting storage. External links and cloud AI assistance need internet; prepared board files and local bookmarks do not.

Markdown file · all lessons, examples and project steps · no account needed

Open the project toolkit: templates, prompts and AI skills

01

Define One User Journey

Define StudyBoard's find-and-save journey before requesting generated code. Use a fixed five-resource dataset, observable acceptance cases and a clear first-version scope.

What You Will Learn

  • Describe one learner, one need and one complete journey.
  • Write observable acceptance cases before asking an assistant for code.
  • Keep the first version small enough to explain and verify.

Understand the Idea

AI assistance becomes easier to evaluate when you know what the application is supposed to do. StudyBoard will help a beginner find one resource and save it for later. That is a user journey: start with a question, narrow the list, inspect a result, save it and return. Each feature should help one of those actions rather than merely make the project look sophisticated.

Write behavior in terms a person can observe. 'Search is good' is difficult to test. 'Searching MDN with the web topic selected shows the MDN resource and excludes security resources' gives you inputs and expected output. Include no results, an unknown saved ID and a storage failure as separate situations. These cases keep optimistic generated code from defining the requirements for you.

Distinguish first-version scope from future ideas. Use five fixed resources, two topics and local bookmarks. Do not add accounts, a remote API, analytics or an AI API integration to this learning project. The assistant helps you build and reason, but visitors do not need an AI account just to use the resulting resource board.

Ask an assistant to challenge the brief before generating code. Give it the learner's need, the fixed dataset and your acceptance cases. Request missing states and contradictions rather than a finished application. You remain responsible for deciding which suggestions belong in scope. Save decisions so another conversation cannot silently replace them with a different product. Give the assistant a small visual brief as well as the behavior brief. Describe three qualities you want the interface to express, list the colors or components you intend to preserve, and explain one useful detail from a reference page. Separate an observation such as 'the labels are easy to scan' from an instruction to copy the entire layout. A reference is evidence for a design choice, not a replacement for StudyBoard's own purpose.

WORKED EXAMPLE

Acceptance Cases before Implementation

Save this valid JSON as acceptance-cases.json in StudyBoard. These are planning cases, not an automated test suite yet. They describe inputs and visible outcomes that later checks will exercise.

json
[
  { "case": "Find a web resource", "query": "mdn", "topic": "web", "expectedIds": ["mdn"] },
  { "case": "Combine both controls", "query": "mdn", "topic": "security", "expectedIds": [] },
  { "case": "Recover from no results", "query": "unknown-topic", "topic": "all", "expectedMessage": "No resources match. Clear the filters to try again." },
  { "case": "Remember a bookmark", "action": "Save mdn, then reload", "expectedSavedIds": ["mdn"] },
  { "case": "Storage unavailable", "action": "Attempt to save when storage throws", "expectedMessage": "Could not save on this device. Your saved list was not changed." }
]
  1. The fixed mdn ID links expected outcomes to a stable record rather than its current position.
  2. The wrong-topic case states that search and category conditions must both match.
  3. Storage failure has its own expected message and must not pretend that a bookmark was persisted.

Expected Result

The project has a reviewable definition of success before any AI-generated feature code is accepted.

PROJECT STAGE 01 / 7

Define StudyBoard's First Version

Builds on: A copy of the plain HTML/CSS/JavaScript resource prototype completed in the first four web-development lessons.

  1. Create a separate StudyBoard folder and copy the understood prototype files into it. Change the visible project name without adding new features; keep the five stable resource IDs.
  2. Write BRIEF.md naming the learner, the find-and-save journey, the two supported topics and the explicit first-version scope.
  3. Save acceptance-cases.json from the example and adjust resource IDs only to match your actual fixed collection. Keep a case where text matches but the category does not.
  4. Ask an assistant: 'Review this brief for missing states and contradictions. Suggest questions before code. Separate necessary journey behavior from optional features.' Evaluate each suggestion yourself.
  5. Add a decisions section to BRIEF.md explaining what you accepted or rejected and why. Commit the brief and baseline locally.
  6. Extend BRIEF.md with audience, primary action, preserved behavior, constraints and three visual qualities. Add a two-row reference table recording the useful detail and how you will adapt it. Keep the existing five acceptance cases as the definition of functional success.

Keep This Deliverable

A small product brief, five concrete acceptance cases and a baseline commit for StudyBoard.

Check Your Build

  • Every feature supports the chosen journey.
  • Each case names an observable result.
  • No generated code is accepted merely because it looks polished.
  • You can explain why each reference detail helps the find-and-save journey, and no sample business facts or unrelated pages enter the brief.

Common Mistakes and Fixes

The assistant adds accounts or a backend without a learning need.
Point back to the first-version scope and require a reason tied to the chosen journey.
The expected result uses a record index such as item 2.
Use stable resource IDs so filtering or reordering does not change what the test means.

Check Your Understanding

How does an acceptance case help you reject a plausible AI suggestion?

Reveal the explanation

It defines the required behavior independently of the generated implementation. You can ask whether the suggestion advances that behavior, preserves the other cases and stays within the agreed scope.

Ready to Move On?

Every feature supports the journey and each acceptance case describes an observable result.

Open the learning resource
02

Read the Existing Project before Editing

Inspect the actual StudyBoard files and trace its current filter before editing. Establish a stable loopback preview and verify the assistant's explanation against real code.

What You Will Learn

  • Identify the real files and data flow before requesting a change.
  • Verify an assistant's explanation against source and observed behavior.
  • Establish a stable local origin for later bookmark storage.

Understand the Idea

An assistant can explain only the code it can actually inspect. Give it the relevant files or excerpts and ask for a file map that cites concrete function and element names. If it describes a nonexistent router, database or component, stop and correct that assumption. Do not let a confident summary replace reading the project you will maintain. A file named DESIGN.md or PRD.md is still an ordinary text file; its name does not make an assistant read it or remember it. Explicitly provide the relevant files and ask the assistant to identify which ones it actually inspected. Keep a short index showing where the journey, visual rules, file map and decisions live. If two notes disagree, identify the conflict and update the correct source instead of letting the next generated answer silently choose a new direction.

Trace the existing filter from the HTML control to its event listener, then to filterResources and the render function. Identify the original resource array and the derived result. Write down where the visible count changes. This map lets you make a focused request later and notice if a generated rewrite removes useful behavior.

Run StudyBoard through a stable local HTTP origin before introducing saved state. Browser storage is associated with an origin, including its scheme, hostname and port. Switching between localhost and 127.0.0.1 or changing ports can show a different saved list. Use http://127.0.0.1:4400 consistently for this project, separate from LearningShelf's port.

The small server below serves an explicit list of static files. It does not add a backend API or upload anything. Read its routing table and identify which file each request can return. This is also a good example of a boundary an assistant must preserve: adding arbitrary filesystem access would be a meaningful behavior change, not harmless cleanup.

WORKED EXAMPLE

A Local Preview with a Known Origin

Install a supported Node.js release if it is not available. Save this complete file as serve.mjs in StudyBoard, run node serve.mjs in that folder, and open http://127.0.0.1:4400. Ctrl+C stops this particular server.

javascript
import { createServer } from "node:http";
import { readFile } from "node:fs/promises";
const files = {
  "/": ["index.html", "text/html; charset=utf-8"],
  "/styles.css": ["styles.css", "text/css; charset=utf-8"],
  "/app.js": ["app.js", "text/javascript; charset=utf-8"],
  "/shelf.png": ["shelf.png", "image/png"]
};
createServer(async (request, response) => {
  let pathname;
  try { pathname = new URL(request.url, "http://127.0.0.1:4400").pathname; }
  catch { response.writeHead(400).end("Invalid request URL"); return; }
  const route = files[pathname];
  if (request.method !== "GET" || !route) return response.writeHead(404).end("Not found");
  try {
    const bytes = await readFile(new URL(route[0], import.meta.url));
    response.writeHead(200, { "Content-Type": route[1] }).end(bytes);
  } catch {
    response.writeHead(500).end("Local file unavailable");
  }
}).listen(4400, "127.0.0.1");
  1. Only the named browser assets are served; planning documents and Git history are not in the allowlist.
  2. The loopback address confines the preview to this computer.
  3. Each path has an explicit content type, and missing routes do not silently become the homepage.

Expected Result

StudyBoard runs at a repeatable local address while its existing search behavior remains unchanged.

PROJECT STAGE 02 / 7

Map the Code You Already Have

Builds on: The baseline StudyBoard prototype and brief from the previous lesson.

  1. Start the local preview from the example and confirm that the baseline journey still works. Record the exact address in README.md.
  2. Write PROJECT-MAP.md listing index.html controls, styles.css presentation rules, app.js resource data and the functions that filter and render it.
  3. Ask the assistant to trace the search interaction using only the supplied files. Require it to say when a file or definition is missing instead of inventing one.
  4. Compare the explanation with your code. Change one search input, observe the result and identify the functions responsible; correct any inaccurate map entries.
  5. Make a baseline commit containing the local preview instructions and verified file map. Keep future changes separate from this known working state.
  6. Add a Documentation Map to PROJECT-MAP.md: BRIEF.md owns scope, acceptance-cases.json owns behavior cases, PROJECT-MAP.md owns file responsibilities, and the decisions section owns reasons for changes. Ask the assistant to report unavailable context and one possible contradiction before suggesting edits.

Keep This Deliverable

A working local preview, a verified file map and a baseline behavior record.

Check Your Build

  • You can locate the function that changes the visible results.
  • The map names actual files and functions.
  • You use one stable origin for all later storage checks.
  • The map names files that actually exist, and the assistant's explanation can be checked against those files.

Common Mistakes and Fixes

The assistant describes a framework the project does not use.
Supply the actual files, identify the unsupported claim and ask for a corrected explanation grounded in those files.
Saved state later appears missing on a different port.
Return to the documented origin before concluding that data was deleted.

Check Your Understanding

Why is verifying the existing data flow useful before asking AI to add bookmarks?

Reveal the explanation

Bookmarks must connect to stable resource IDs and the actual render path. Knowing those locations makes the requested change precise and helps detect accidental rewrites or duplicate state.

Ready to Move On?

You can locate the real filter and render functions, explain their inputs and outputs, and run the same local origin consistently.

Open the learning resource
03

Build One Understandable Slice

Add StudyBoard bookmarks as a small reviewed slice. Store stable resource IDs, use candidate state and show success only after persistence succeeds.

What You Will Learn

  • Request and review one functional slice at a time.
  • Add bookmark behavior without changing resource identity or filter semantics.
  • Handle persistence failure before displaying a success state.

Understand the Idea

A slice is a small behavior that works from input to visible result. For StudyBoard, first confirm rendering from the fixed array, then filtering, then bookmarking. Ask the assistant for one slice and the files it intends to change. Read the diff before moving on so a defect belongs to a small, understandable change. Give the next slice a small written task with three parts: the behavior being added, the files expected to change, and the check that will show it works. Leave the task open until that check has been performed. If the implementation reveals a genuine change in scope or design, record the reason in your decisions section and update the affected note. A generated checklist full of checked boxes is not a substitute for this evidence.

Bookmarks should store resource IDs rather than duplicate full records. The resource collection remains the source of titles, topics and URLs, while a Set of IDs describes what is saved. This reduces the chance that a title edit leaves an outdated copy inside saved data. Give each card a native button whose label communicates whether activating it will save or remove the bookmark.

Persistence is a separate operation that can fail. Create a candidate set, try writing it, and update the current set and interface only after the write succeeds. If storage throws, retain the existing state and show an honest message. This ordering avoids the confusing situation where a button says 'saved' but reloading loses the change.

Use AI as a reviewer of the narrow change rather than a generator of an entire replacement app. Ask it to explain the candidate-state approach and identify how errors reach the interface. Then test the acceptance cases yourself. Keep an assistance log recording the suggestion, your verification and any correction you made.

WORKED EXAMPLE

Save a Candidate Bookmark Set

This focused helper belongs in app.js above the bookmark event handlers. The caller supplies a Set and updates its live savedIds variable only when ok is true. It writes one StudyBoard-specific storage key.

javascript
const STORAGE_KEY = "studyboard.saved.v1";
function persistSavedIds(nextIds) {
  try {
    localStorage.setItem(STORAGE_KEY, JSON.stringify([...nextIds]));
    return { ok: true };
  } catch {
    return { ok: false, message: "Could not save on this device. Your saved list was not changed." };
  }
}
function toggleCandidate(currentIds, id) {
  const nextIds = new Set(currentIds);
  if (nextIds.has(id)) nextIds.delete(id);
  else nextIds.add(id);
  return nextIds;
}
  1. Cloning the Set keeps the current state untouched while a candidate is prepared.
  2. The write helper reports failure instead of swallowing it behind a success message.
  3. The event handler must assign savedIds = candidate and rerender only after a successful result.

Expected Result

The helpers let the caller preserve the old bookmark list when storage is unavailable. They do not render buttons or read saved data by themselves.

PROJECT STAGE 03 / 7

Add Reviewed Bookmarking in Small Changes

Builds on: The verified fixed collection, combined filter and stable local preview origin.

  1. Request a review of the existing rendering slice first. Commit any supported correction separately, then verify that combined search still passes acceptance-cases.json.
  2. Add a Save button to each card using its stable resource ID. Introduce savedIds as a Set and use the example helpers to prepare and persist candidate changes.
  3. Wire each button so a successful write updates savedIds, rerenders the saved state and updates a saved-count message. On failure display the returned explanation and leave the existing state unchanged.
  4. For initial reload support, parse the saved value inside try/catch, require an array of strings and keep only IDs in the fixed collection. On malformed data show a notice and start with an empty in-memory view without silently overwriting the stored value.
  5. Save and remove two different resources, change filters, then reload at the same origin. Record the actual results and one AI suggestion you verified or rejected.
  6. Create a short TASKS.md for rendering, filtering and bookmarking. For each item record expected files, a completion check and the actual result or 'not checked'. After the bookmark slice, update only the notes affected by its chosen storage behavior.

Keep This Deliverable

A bookmark feature with stable IDs, bounded initial read handling and honest write-failure feedback.

Check Your Build

  • Bookmarks survive reload at the same origin when storage succeeds.
  • A failed write does not display a false success.
  • Filtering never changes which resource an ID identifies.
  • A completed bookmark task points to an observed normal case and failure case; incomplete checks remain visible.

Common Mistakes and Fixes

The UI toggles before persistence and remains toggled after a failure.
Keep a candidate state and commit it to the interface only after a successful write.
Saved records contain full copies of changing resource metadata.
Store IDs and look up current metadata from the fixed collection.

Check Your Understanding

Why clone savedIds before toggling instead of changing the original Set immediately?

Reveal the explanation

The original represents the currently accepted state. A clone lets the application attempt persistence first and retain the old state if that attempt fails.

Ready to Move On?

Bookmarks restore after reload, filtering preserves identity, and a failed write leaves the accepted saved state unchanged.

Open the learning resource
04

Review the Interface with Real Interactions

Review StudyBoard's control names, keyboard behavior and focus after updates. Separate code-based suggestions from interaction checks you actually perform.

What You Will Learn

  • Review source-level accessibility concerns separately from observed interactions.
  • Preserve understandable focus when dynamic content changes.
  • Use real keyboard, narrow-screen and zoom checks to evaluate AI suggestions.

Understand the Idea

A source review can identify a missing label or a clickable div, but it cannot by itself show what happens when you press Tab through a changing interface. Ask the assistant for supported code findings and a separate list of browser checks. Keep those categories distinct in your notes so a recommendation is not later presented as an observed result.

StudyBoard's search, topic selector and bookmark buttons should have meaningful names. A button's name must describe its action for that resource, such as 'Save MDN Curriculum' or 'Remove MDN Curriculum from saved'. Visible text can carry the same meaning. Do not rely only on a color change or an unlabeled icon to indicate the saved state.

Rerendering a list can remove the element that currently has focus. If clicking Save rebuilds every card, the learner may lose their place. Prefer updating the affected button and saved count when possible. If a deliberate rerender is necessary, remember the focused resource ID and restore focus to the corresponding control when it remains in the results.

Test the complete journey with the keyboard, then repeat at a narrow width and 200% zoom. Read the no-results and storage-failure messages as instructions: do they tell someone what happened and what they can do next? Use the assistant to explain possible fixes, then verify the chosen repair yourself. A screenshot cannot establish keyboard order or focus recovery. Review consistency as well as individual controls. Write down the roles of the page background, card surface, text, border and focus treatment, then reuse those roles through CSS custom properties. Compare the resource title, description, metadata and button styles across cards using real copy. Test a long title and an intermediate window width, not only the smallest and largest views. If you introduce decorative motion, define a reduced-motion alternative and keep the task usable without the effect.

WORKED EXAMPLE

A Bookmark Button with a Useful Name

This focused browser helper belongs in app.js and updates an existing native button. Call it when a card is first created and after that resource's saved state changes; it does not create the event listener.

javascript
function updateSaveButton(button, resource, isSaved) {
  button.type = "button";
  button.dataset.resourceId = resource.id;
  button.textContent = isSaved ? "Remove from saved" : "Save resource";
  button.setAttribute("aria-label", isSaved
    ? `Remove ${resource.title} from saved`
    : `Save ${resource.title}`);
}
  1. The element remains a native button, so ordinary keyboard activation is available.
  2. The visible action changes with state, and the accessible name identifies the resource.
  3. After creating a card's button, call updateSaveButton(button, resource, savedIds.has(resource.id)). Reuse the element after toggling so focus is not unnecessarily discarded.

Expected Result

Each bookmark control communicates both its action and its target resource. The helper preserves the element rather than moving focus to a newly created replacement.

PROJECT STAGE 04 / 7

Make the Find-and-Save Journey Usable

Builds on: The search, topic filter, bookmarks and status feedback from the previous lesson.

  1. Ask the assistant to review actual markup and event handlers for native controls, labels, headings, focus and messages. Record code-supported findings separately from proposed browser checks.
  2. Apply the example naming approach to bookmark buttons. Make sure search and topic controls retain visible labels and all interactive elements show a visible focus indicator.
  3. Use only Tab, Shift+Tab, Enter and Space to search, select a topic, save a resource and remove it. Record where focus moves after each dynamic update.
  4. Repair any lost focus using a targeted button update or a deliberate ID-based restoration after rendering. Retest both saving and changing filters.
  5. Check narrow layout and 200% zoom, then read no-results and storage-failure messages. Add actual observations and remaining uncertainties to ACCESSIBILITY-NOTES.md.
  6. Add a concise DESIGN.md or a Visual Rules section in BRIEF.md covering typography roles, semantic color tokens, spacing and search/save states. Inspect the page with a long resource title, keyboard focus and a narrow-to-wide resize. Record one consistency repair and its verification in ACCESSIBILITY-NOTES.md.

Keep This Deliverable

Accessible control names, predictable focus behavior and a browser-verified interaction record.

Check Your Build

  • The main journey works without a mouse.
  • Bookmark state is understandable without color alone.
  • The report separates source findings from completed browser checks.
  • Repeated cards use the same roles, required text remains readable, and design changes preserve the verified keyboard journey.

Common Mistakes and Fixes

Every bookmark button is announced only as 'Save'.
Include the resource title in its accessible name so the action has a clear target.
A successful action drops focus to the page body.
Avoid replacing the focused control unnecessarily, or deliberately restore focus to its stable replacement.

Check Your Understanding

Why should an AI source review not claim that keyboard navigation was tested?

Reveal the explanation

Inspecting code can suggest likely behavior but does not perform the interaction. A keyboard test requires actual browser actions and observations, including focus movement after updates.

Ready to Move On?

Complete the find-and-save journey with the keyboard and retest each supported accessibility repair.

Open the learning resource
05

Debug from Observations

Investigate a planned StudyBoard filter regression from actual inputs and condition values. Use one observation to choose a cause, then retain a focused regression case.

What You Will Learn

  • Describe a failure using expected behavior, actual behavior and a minimal reproduction.
  • Use one observation to distinguish between competing explanations.
  • Repair the identified cause and retain a regression case.

Understand the Idea

When StudyBoard behaves unexpectedly, pause before asking for a rewrite. Record the exact inputs, the expected result and the actual result. Include the current origin and relevant error message. 'Search is broken' leaves many possible causes; 'MDN appears when query is mdn and topic is security' narrows the investigation to a particular interaction. Include the conditions that can change the result. For a layout or focus issue, note the viewport, zoom and input method; for a stored-state issue, note the origin and the relevant test state. Record whether the failure was reproduced, whether the proposed repair was applied and whether the same check was repeated afterward. This keeps 'fixed in code' separate from 'verified in the interface' when you resume the project later.

Ask the assistant for a few plausible causes and a check that would distinguish them. The topic control might have the wrong value, the callback might read an old value, or the condition might combine matches incorrectly. A useful next check observes one of those possibilities directly. Do not change all three at once, because a successful result would no longer explain which cause mattered.

Use a breakpoint in the filter callback or a temporary console observation to inspect the actual values. For the MDN record with a security topic selected, the text condition should be true and the topic condition false. If both are combined with AND, the record is excluded. Compare that model with what your actual program evaluates.

After the cause is established, make the smallest repair and rerun both the failing case and an ordinary successful case. Remove noisy temporary logging once the explanation is recorded. Keep the new regression case in acceptance-cases.json or your test notes so a later AI suggestion cannot quietly reintroduce the mistake.

WORKED EXAMPLE

Inspect the Two Conditions Separately

In browser developer tools, pause inside the existing filterResources callback after matchesText and matchesTopic have been assigned. For the query mdn and selected topic security, inspect the MDN iteration and paste this read-only expression into the Console.

javascript
console.table([{
  title: item.title,
  query: normalizedQuery,
  selectedTopic: topic,
  textMatches: matchesText,
  topicMatches: matchesTopic,
  expectedWithAnd: matchesText && matchesTopic
}]);
  1. The expression reads the paused callback's actual variables instead of reconstructing a different dataset.
  2. Separate columns reveal whether the input, category comparison or final combination is wrong.
  3. The final column is a prediction to compare with the function's real return expression; it does not repair the application.

Expected Result

For MDN with query mdn and topic security, textMatches is true, topicMatches is false and expectedWithAnd is false. Other values point to a different cause that needs investigation.

PROJECT STAGE 05 / 7

Investigate a Deliberate Filter Regression

Builds on: The working, accessible StudyBoard journey and its recorded acceptance cases.

  1. Create a disposable Git branch. Change the filter's final AND to OR to introduce the planned harmless regression, then reproduce the MDN/security mismatch.
  2. Write a short BUG-NOTES.md entry containing expected output, actual output, exact inputs, current commit and smallest reproduction. Keep the injected bug clearly labeled as a learning exercise.
  3. Ask the assistant for plausible causes and one discriminating observation. Pause in the real callback and use the example expression to capture actual values.
  4. Restore the correct combination only after explaining why it fits the evidence. Verify both the mismatch case and a normal MDN/web match; also confirm that clearing controls restores all items.
  5. Remove temporary logging, retain the regression case and commit the repair with a concise explanation. Record which assistant hypothesis was supported and which were rejected.
  6. Extend BUG-NOTES.md with environment, input method, relevant state, before-fix evidence and after-fix evidence. Link the matching TASKS.md item, but do not mark it complete until the original reproduction is checked again.

Keep This Deliverable

A documented reproduction, observed condition values, a focused repair and a retained regression check.

Check Your Build

  • The diagnosis cites an actual observation.
  • The repair restores both failure and normal cases.
  • No unexplained replacement of the whole application is required.
  • Another learner can recreate the reported conditions and distinguish a proposed fix from a verified repair.

Common Mistakes and Fixes

Several guessed fixes are applied together.
Choose a check that separates the hypotheses, then change the supported cause so the result remains explainable.
The assistant claims a console value without running or seeing the program.
Treat it as a prediction until you collect the actual value from your reproduction.

Check Your Understanding

Why is a disappearing symptom not always enough to confirm a good fix?

Reveal the explanation

A broad change may hide the symptom, break another case or leave the cause misunderstood. A good repair is tied to evidence and passes both the original regression case and relevant normal behavior.

Ready to Move On?

Show why the evidence supports the repair and demonstrate both the formerly failing case and a normal case.

Open the learning resource
06

Check Trust Boundaries and Dependencies

Harden StudyBoard's browser-storage boundary. Validate saved IDs, avoid silent data resets and trace fixed resource data into text and links.

What You Will Learn

  • Identify which values come from storage and which come from trusted project data.
  • Validate stored bookmark data before using it in the interface.
  • Review generated dependencies and rendering decisions with explicit limits.

Understand the Idea

StudyBoard is a static app, but it still crosses a data boundary when it reads browser storage. The stored value may be absent, malformed or left by an older version. Treat it as external input rather than assuming your own previous code always wrote a perfect array. The fixed resource collection defines which IDs are currently meaningful.

Parse saved state inside a guarded operation, require an array of strings and keep only known IDs. Distinguish an empty valid saved list from unreadable data. If reading fails, show a notice and do not silently overwrite the stored value during startup. Disable persistence actions until the learner explicitly chooses how to recover, such as resetting only this project's bookmark key.

Trace values all the way to their use. Resource titles belong in textContent, while link destinations need an allowed protocol. Saving only known IDs keeps arbitrary storage strings out of resource metadata. These choices address specific risks; they do not justify an assistant declaring the entire app secure. Record the actual checks and the features that do not exist, such as accounts or a server API. Trace files as well as values. Identify which files the local preview actually serves and which remain project notes. Private notes, credentials and backups should not become public assets because they happen to sit beside index.html. A route or crawler setting is not a substitute for controlling what is exposed. If you later offer a learning download, assemble the intended files deliberately and inspect its contents rather than archiving the entire working directory.

If an assistant proposes a new package for this work, ask which behavior requires it and consult its official documentation. This small project can use platform features. Avoid adding a dependency merely to hide a few understandable checks. Keep secrets and private records out of prompts, and do not embed an AI API key in the browser to make the finished app appear more advanced.

WORKED EXAMPLE

Read Saved IDs without Trusting Their Shape

Add this helper to app.js below the existing STORAGE_KEY declaration. Pass a Set of the fixed resource IDs. It reads only the StudyBoard key and returns a result; it never resets storage or displays UI by itself.

javascript
function readSavedIds(knownIds) {
  try {
    const raw = localStorage.getItem(STORAGE_KEY);
    if (raw === null) return { ok: true, ids: new Set(), ignored: 0 };
    const parsed = JSON.parse(raw);
    if (!Array.isArray(parsed) || !parsed.every(id => typeof id === "string")) {
      throw new Error("Invalid saved-list format");
    }
    const accepted = parsed.filter(id => knownIds.has(id));
    return { ok: true, ids: new Set(accepted), ignored: parsed.length - accepted.length };
  } catch {
    return { ok: false, ids: new Set(), message: "Saved data could not be read. The stored value was not changed." };
  }
}
  1. Access to localStorage and JSON parsing both happen inside try/catch.
  2. Type checks run before the data becomes a Set of accepted IDs.
  3. Unknown IDs are excluded from the displayed list without rewriting storage during the read operation.

Expected Result

A valid saved array is restored, absent data gives an empty list, and malformed or blocked storage produces an explicit failure result without deleting the original value.

PROJECT STAGE 06 / 7

Harden StudyBoard's Saved-State Boundary

Builds on: The bookmark write helper, current savedIds state and fixed resource collection.

  1. Draw a small data-flow map in DATA-NOTES.md: fixed resource data to cards, search controls to filtering, and stored ID strings to saved state. Mark each parsing and rendering decision.
  2. Replace the initial storage reader with the example helper and a known-ID Set. If reading fails, show its message and disable bookmark writes until the learner chooses an explicit recovery action.
  3. Implement a clearly labeled reset for this project's saved list only. Explain the effect, obtain a deliberate user action, remove or replace only STORAGE_KEY, and report whether that operation succeeded.
  4. In a disposable browser profile or after exporting your own test state, test absent data, a valid array, invalid JSON, a wrong-shaped object and an unknown ID. Restore the intended test state afterward.
  5. Review title rendering and fixed link protocols. Ask the assistant to identify evidence-backed issues and unnecessary dependencies, then document accepted changes and the limits of this review.
  6. Add a public-file inventory to DATA-NOTES.md and compare it with serve.mjs's allowlist. Check that planning notes and configuration are not served accidentally. For any proposed dependency or integration, record its purpose, data destination, failure behavior and why the current app needs it before adding it.

Keep This Deliverable

Validated bookmark restoration, explicit recovery behavior and a data-flow note grounded in actual checks.

Check Your Build

  • Malformed storage does not crash the page or get silently overwritten.
  • Unknown IDs do not become invented resource cards.
  • Reset affects only StudyBoard's saved-list key.
  • The inventory matches actual served assets, and no integration is presented as working merely because its button or configuration placeholder exists.

Common Mistakes and Fixes

Startup catches an error and immediately saves an empty array.
Return a failure state without rewriting the stored value; make recovery a separate deliberate action.
A broad localStorage.clear call resets unrelated data on the same origin.
Target only the documented StudyBoard key.

Check Your Understanding

Why is filtering stored IDs against the resource collection better than rendering those stored strings directly?

Reveal the explanation

The collection defines the valid resources and their current metadata. Known-ID lookup prevents malformed or retired entries from creating arbitrary cards, while keeping displayed titles and URLs tied to reviewed data.

Ready to Move On?

Malformed storage does not crash or silently overwrite data, and explicit recovery changes only the StudyBoard key.

Open the learning resource
07

Prove That You Own the Implementation

Implement StudyBoard's saved-only filter independently, then use AI for a grounded review. Finish with reproducible instructions and evidence that you can maintain the app.

What You Will Learn

  • Plan and implement a small variation without generated implementation code.
  • Use AI afterward to challenge your explanation and review evidence.
  • Prepare a maintainable handoff with setup, storage behavior and known limits.

Understand the Idea

The final exercise tests whether you can maintain StudyBoard after the conversation ends. Add a 'Show saved only' checkbox yourself. Predict which code needs to change, write the expected cases and implement the condition before requesting an AI review. The goal is not to avoid tools forever; it is to show that the implementation has become understandable to you.

The new checkbox combines with existing search and topic choices. When enabled, a resource must match both filters and belong to savedIds. When disabled, the earlier filtering behavior should remain unchanged. Decide what happens if the learner removes the final visible saved resource: the list should explain the empty saved view rather than suggesting that the entire collection vanished.

After your attempt works, ask the assistant to review the diff and your explanation. Require evidence for each claimed defect and separate suggested tests from tests actually run. Accept a correction only when you can explain it and verify the resulting behavior. Keep the original attempt and revision in Git so the learning process is inspectable.

Finish with a README and assistance log that another learner can follow. Document the stable origin, startup command, fixed dataset, bookmark key, reset behavior and completed checks. State that external resource links and cloud AI assistance require internet, while the prepared board itself uses local files and browser storage. This honest boundary is more useful than claiming the application works everywhere. Compare the finished app with its brief and notes before handing it off. Update the documented behavior to match the saved-only view and retain the reason for the change. A small SITEMAP.md can simply state that StudyBoard has one page; it does not require adding pages. For a future public release, keep SEO notes limited to accurate titles, descriptions and confirmed URLs. Local completion does not require a production domain, an XML sitemap or a promise about search rankings.

WORKED EXAMPLE

Cases for an Independent Saved-Only Filter

Save this JSON as saved-filter-cases.json before implementing the checkbox. It specifies behavior without supplying the implementation. Use the existing five-resource dataset with a valid mdn ID.

json
[
  { "query": "", "topic": "all", "savedOnly": true, "savedIds": ["mdn"], "expectedIds": ["mdn"] },
  { "query": "mdn", "topic": "security", "savedOnly": true, "savedIds": ["mdn"], "expectedIds": [] },
  { "query": "", "topic": "all", "savedOnly": true, "savedIds": [], "expectedIds": [] },
  { "query": "", "topic": "all", "savedOnly": false, "savedIds": [], "expectedCount": 5 }
]
  1. A saved resource still has to satisfy the selected category and query.
  2. An empty saved list is a valid state with its own useful message.
  3. Turning the checkbox off must restore the earlier five-resource baseline.

Expected Result

You have four reviewable cases for a feature you will implement independently, including a combination that must exclude an otherwise saved resource.

PROJECT STAGE 07 / 7

Complete and Explain Your Own Variation

Builds on: The verified search, accessible bookmark controls and guarded storage behavior from all previous steps.

  1. Write your predicted change plan in INDEPENDENT-CHANGE.md and save the example cases. Identify the HTML control, filter pipeline and empty-state feedback that will need attention.
  2. Implement the saved-only checkbox without asking for generated implementation code. Preserve the existing source collection and compute the visible result from controls plus savedIds.
  3. Exercise all four cases, then remove the final visible saved resource with the checkbox enabled. Confirm the message and focus remain understandable.
  4. Ask the assistant to review your actual diff and challenge your explanation. Verify supported feedback, reject unsupported claims and record one judgment in ASSISTANCE-LOG.md.
  5. Prepare README.md with node serve.mjs, the stable local URL, files, storage key, recovery behavior, tested cases and remaining limits. Commit the final variation and hand the instructions to another learner.
  6. Reconcile BRIEF.md, acceptance cases, DESIGN.md if created, PROJECT-MAP.md, TASKS.md and decisions with the final implementation. Add a one-page route note and mark public metadata as deferred while the project is local. Hand over only the deliberate source package and state what remains unverified.

Keep This Deliverable

An independently implemented saved-only view, verification notes and a reproducible StudyBoard handoff.

Check Your Build

  • You can explain the new condition without reading an AI response.
  • The feature passes normal, combined and empty cases.
  • Another learner can start the board and understand its data limits.
  • The handoff tells the same story as the running app, contains no fictional addresses or claims, and separates local completion from future publication.

Common Mistakes and Fixes

The independent exercise starts by requesting the complete feature.
Write and test your own attempt first; use AI for questions or a later review.
The new checkbox replaces the earlier topic and query filters.
Combine all active conditions and retain the earlier acceptance cases as regressions.

Check Your Understanding

What evidence shows that you own the implementation even though AI helped earlier?

Reveal the explanation

You can predict the affected files, implement a variation independently, explain the data flow, diagnose a failure and evaluate review feedback against actual behavior rather than accepting it on authority.

Ready to Move On?

Explain your own variation, pass its combined and empty cases, and hand off setup and storage instructions.

Open the learning resource

Project References

HACKTRONIAN_CLI // COMMAND PALETTE
QUICK_EXEC: