Forward mode — start from your starter code
How to use Forward mode when you already have a starter file with TODO markers. Most predictable of the four modes; the AI fills in solution, tests, and instructions while preserving your starter's structure.
Written By Alan Gandy
Last updated About 1 month ago
Forward mode is the most predictable of the four modes. You provide the starter code students will see; the AI generates everything else around it (solution, tests, instructions, workflow) in a way that respects your starter's structure.
Pick this mode when you already have starter code with explicit TODO markers (or FIXME, # YOUR CODE HERE) showing what students need to implement. Common cases: reusing a starter from last semester, adapting one from a textbook, or starting from your own pre-written scaffold.
If you have a working solution but no starter, use Backward mode instead. If you have both, use Both Provided. If you have only prose, use From Document.

The form
After clicking Forward on the mode card, the form changes to show Starter Code (required) as the main input. Three ways to provide it:
- Paste code — drop into the textarea (default tab)
- Upload — drag-drop or pick a file from disk
- From repo — pull from a public GitHub URL
The rest of the form (language, repo name, difficulty, objectives, description) is the same as the other modes. See Picking a generation mode for the cross-mode fields.
Starter code that generates well — five habits
The AI produces dramatically better solutions when your starter is clear. Five things to do before clicking Generate:
Use explicit, descriptive TODO markers. # TODO: implement bubble sort comparing adjacent elements and swapping if out of order is much better than # write your code here. The AI uses TODO text directly to plan both the solution and the test cases.
Include function signatures. A line like def sort_list(items: list[int]) -> list[int]: followed by a TODO tells the AI the contract: takes a list of ints, returns a list of ints. Without the signature, the AI has to guess what types are expected.
Keep the entry point intact. Whatever your main() / __main__ block does, leave it. The AI uses it to figure out how the program is invoked, which drives how the autograder runs the solution.
Include the imports the solution will need. If your assignment is about pandas, putting import pandas as pd at the top tells the AI it's allowed to use it. If you don't import something the AI thinks it needs, it'll add the import — but it might not match your conventions.
Add a comment block at the top explaining the assignment. A few lines describing what the student is building, in human terms. The AI reads this for context just like a student would, and it dramatically reduces ambiguity for vague TODOs.
What happens after you click Generate
CodeTeach runs four AI steps in sequence:
- Generate solution from your starter
- Generate tests that pass against the solution
- Generate
Instructions.mdscaled to the difficulty level you picked - Sandbox check — runs the solution against the tests in a Linux container to confirm it actually passes
Live progress shows in the wizard. The whole pipeline usually takes 1–3 minutes. When done, the assignment moves to Review & Edit — see The Review & Edit screen for what to look at.
Common starter mistakes that produce bad assignments
Empty starter. Submitting a file with no code at all gives the AI nothing to anchor to. The result is a generic solution that may not match what you'd have written. Either add at least an import block + function signature + TODO, or switch to From Document and describe the assignment in prose.
Starter that already implements the TODOs. If your "starter" is actually a working solution with no TODOs to fill in, the AI sees nothing to do. Use Backward mode — it'll strip your solution into a starter for you.
Multiple files but only one entry point named. If your starter has main.py and helpers.py but helpers.py is the file students will edit, make sure the TODO markers are clearly in helpers.py and that main.py calls it. The AI follows the import graph from the entry point.
Mixed TODO conventions. If half your starter uses # TODO and half uses // TODO and half says // YOUR CODE HERE, the AI may treat them inconsistently. Pick one convention and stick with it.
Where to go next
- Generation finished? → The Review & Edit screen — read each tab and edit before approving.
- Generation failed? → Check your starter for one of the common mistakes above. Often a fresh attempt with cleaner inputs works.
- Solution looks weird? → On the Review step, click the Solution tab → Regenerate. Or if the issue is structural, fix the starter and regenerate from the Starter tab.