Sub topic 11
Building projects with clear AI boundaries
This chapter assumes you have read the earlier chapters on the attempt-first workflow, reading AI code critically, and writing your own tests. It applies those habits to a project that runs over several days.
Why projects need explicit boundaries
In a short exercise, you can decide in the moment whether to ask the AI. In a project, that decision comes up dozens of times. Under deadline pressure, each case tends to resolve toward "just generate it." After a week, you may have a working program and no ability to change it without the assistant.
A boundary is a rule you write down before you start. It states which parts you write yourself, which parts the AI may help with, and which parts it may generate.
Sort the work by learning value
Not every task teaches the same amount. Sort the project's tasks by how much skill you gain from doing them.
| Task type | Learning value | Suggested AI role |
|---|---|---|
| Core logic you are trying to learn (parsing, algorithms, data structures) | High | Tutor only: questions and hints |
| Design decisions (function boundaries, data shapes) | High | Reviewer: critique your plan after you draft it |
| Glue code you already understand | Medium | Generator, then you read and test it |
| Boilerplate (argument parsing, config files, repeated setup) | Low | Generator |
| Tooling errors outside your project's focus | Low | Explainer |
The table is a starting point. If argument parsing is the skill you want to learn, move it to the top row.
The project loop
Two things stay the same on both paths: you write the tests, and you explain the result back. Generated code only counts as finished once you can say what each part does.
Write a boundary note
Put a short note in the project's README or a NOTES.md file. Here is an example for a word-frequency command-line tool.
Project: word-frequency CLI
I write myself:
- count_words() and its tests
- the choice of how to handle punctuation and case
AI may generate (I must read and test it):
- argparse setup
- file reading and error messages
AI may only hint or review:
- anything in count_words()
Rule: if I cannot explain a function, I do not commit it.The core function below is the kind of code you would write under this note. Tests that you write yourself come right after it.
import re
from collections import Counter
def count_words(text):
words = re.findall(r"[a-z']+", text.lower())
return Counter(words)
assert count_words("The cat. The dog!") == {"the": 2, "cat": 1, "dog": 1}
assert count_words("") == {}
assert count_words("Don't stop") == {"don't": 1, "stop": 1}The third test records a design decision: apostrophes stay inside words. An AI would not know whether you want that. You decide it, and the test records it.
Common errors
- Boundaries that drift. You start by asking for hints and end up pasting entire files. Review the note at the start of each session, and treat any change to it as a deliberate decision.
- Starting too big. A large project gives you many chances to hand off hard parts. Pick a project you could finish in a few sessions, with one core piece you find hard.
- Letting the AI choose the architecture. Generated structure tends to look reasonable and may not fit your goals. Draft your own plan first and ask for critique.
- Skipping the unaided check. At the end, close the assistant and add a small feature. How far you get shows what you learned.
Exercise
Choose a small project, such as a to-do list manager. Write a boundary note with three lists: what you write yourself, what the AI may generate, and what the AI may only hint on or review. Name one function you will put on the first list, and explain why.
Show answer
Answers vary. A good answer puts the central logic you are trying to learn (for example, the function that adds, completes and filters tasks) on the "write myself" list. It puts boilerplate (such as menu printing or file saving) on the "may generate" list. It puts design questions (such as how to store tasks) on the "hint or review" list. The reason given should refer to learning value, not convenience.