Code with AI: small tasks, current files & real tests

Grades 6–12 · Three 35–45 minute sessions · Partner or individual project

You can ask an AI to compose complete files and still understand your project. Give it one clear job, supply the current code it needs, review what changed, and run a test. Code Bridge helps you carry that information between your existing Google AI chat and VS Code. It does not call an AI service.

Open Code Bridge practice

Before you begin

Complete Build Your Game-Dev Base. You need a project folder, VS Code with your usual way to run the project, and your teacher-approved Google AI chat if you are using AI. Account access follows your classroom's existing arrangement; this activity creates no AI account and needs no API key. A supplied practice answer lets you rehearse without signing in to an AI service.

Session 1: fix one bug and explain the change

Question: How can we tell whether an AI's answer actually fixed our problem?

  1. Reproduce, 5 minutes. Open the practice project in Code Bridge and download its loaded source ZIP. Extract it, open the extracted folder in VS Code, and launch index.html with Live Server. Tap Space or Jump repeatedly. Describe how the player can jump in midair.
  2. Inspect, 5 minutes. In Code Bridge, read player.js and main.js. Find who calls jump(), who stores grounded, and where landing resets it. Both files are selected so the AI sees the function and its callers.
  3. Request, 8 minutes. Read the prefilled goal, current behavior, and success test. Prepare the request and inspect its size. Copy it into your approved Google AI chat. If AI access is unavailable, go to Review answer and choose Use practice answer.
  4. Review, 7 minutes. Paste the complete response and choose Review response. Find the added grounded check. Explain what if (!player.grounded) return; does before approving player.js. A new filename must be separately reviewed as a new file.
  5. Apply and test, 8 minutes. Download approved changes and backups. Copy changes/player.js over the matching file in the VS Code project. Keep backup/player.js. Jump once, attempt a second jump in midair, land, and jump again. Test both keyboard and button input. Inspect the browser console for new errors.
  6. Checkpoint, 5 minutes. In Test & checkpoint, record the actual result and explain the changed condition. Save your session. Before the next request, open or reload the actual project folder so Code Bridge has the version you just tested.

Exit ticket: Show the changed line, explain why it stops the second jump, and demonstrate that jumping still works after landing. Receiving a plausible answer is not test evidence.

Session 2: keep context useful as the project grows

Question: Which files does a helper need to make this change without guessing?

A context window is the material an AI can consider for a request. Code Bridge uses a character budget to make your input size visible; its token estimate is approximate and is not the provider's exact limit. Start with the relevant code, its imports or callers, the goal, and a concrete test. If dependencies are missing, supply them before accepting a guessed fix.

Turn a broad wish into a task you can check
Broad wishSmall taskEvidence
Make my game better.Show the score in the top-left corner.Collect one item; the displayed score increases once.
Add multiplayer and levels.Load a second level after the first exit.Reach the exit; level 2 starts with its own player spawn.
Fix everything.Fix the first reproducible console error.Repeat its trigger; the error is gone and movement still works.

Workshop, 25 minutes: choose one improvement in your own project or your browser game. Write a brief, map the files and what they do, select the source you can justify, and prepare one request. Explain every selected file to a partner. If the request exceeds the budget, reduce the task or deliberately include more context; do not cut source halfway through a function to make it fit.

When one file does too much: plan a separate refactoring task. Move one responsibility, such as player movement, into its own module. Include the original file, imports, and callers. Test that behavior stays the same before requesting a new feature. Splitting files changes dependencies, so move one responsibility at a time.

Exit ticket: identify a file you included, one you left out, and what additional file the AI might need. Explain the tradeoff between too little context and unrelated material.

Session 3: hand off a project to a fresh conversation

Question: Can another person continue your project without reading your entire chat?

  1. Write a brief, 5 minutes. Describe what the project does, its main files, and behavior that must remain intact. Keep it factual and short.
  2. Record evidence, 8 minutes. Add a checkpoint with the task, actual test result, changed function, and next small step. Failed and not-yet-tested results belong in the record too.
  3. Refresh, 5 minutes. Reload the project folder after VS Code edits or ZIP replacements. A saved session is a snapshot; it does not watch VS Code. After reopening a session, use Refresh source and choose the same project folder to keep your notes while loading the latest files. New requests should use the newest actual files.
  4. Handoff, 12 minutes. Prepare a new request. It includes the current selected code, file map, brief, and latest checkpoint. Give it to a partner or a fresh approved AI conversation. Ask the partner to state what the project does and the next test before coding.
  5. Keep your work, 5 minutes. Download the session and project notes. Keep your project folder and its non-code assets separately. For longer projects, use GitHub collaboration and version history as well.

Exit ticket: show that a new helper can identify the next task from the request alone. Explain why a checkpoint marked “passed” still describes a student's report rather than a verification performed by Code Bridge.

When an answer does not fit

Show your learning

Teacher assessment: 0 = missing, 1 = developing, 2 = demonstrated
SkillEvidence for 2 points
Task designOne observable goal and a specific success test.
Context selectionCurrent source and dependencies are included; student can justify the selection.
Review and explanationStudent identifies the changed function and explains its effect before approval.
TestingRecords actual requested-behavior and regression-test results, including failures.
Project continuityProvides a saved session, brief, checkpoint, and a clear next task. Can locate a backup.

Scaffolding: younger or new coders can use the practice answer with teacher guidance, explain a condition in their own words, and demonstrate the test. Experienced students can inspect module boundaries, compare two possible fixes, and add a repeatable automated test. Assess reasoning and evidence rather than the volume of generated code.

Open Code Bridge · Return to the coding pathway