CMU 15-113: Effective Coding with AI
Goal: So far in 15-113, you've mostly used AI as a conversational partner: you ask it to help you build something, it gives you code, you copy/paste/modify, and repeat. In this assignment, you'll try a more structured, agentic approach: instead of chatting back and forth, you'll write a detailed plan first, hand it off to Copilot's Agent Mode (or Cursor, or any other tool with agentic capabilities) to implement with minimal hand-holding, and then use Copilot again with a new agent as a code reviewer that checks the first agent's work. This mirrors how software engineers increasingly work with AI in industry, with less "pair programming" and more "delegating and reviewing."
Why This Matters: After experiencing the difference between conversational AI coding and a multi-agent plan-delegate-review workflow, you should begin to develop your own opinion about when each approach works best.
A command-line Python quiz app with a local login system that reads questions from a JSON file, quizzes users, tracks scores and performance statistics securely (in a non-human-readable format), allows users to provide feedback on questions to influence future quiz selections, and saves results. You'll extend it with one additional feature of your choice.
While this might not be the most "original" app, it's complex enough to be interesting (file I/O, data structures, user interaction, error handling) and scoped enough that an AI agent can realistically build most of it from a good spec. Perhaps most importantly, it also produces clearly testable output, which makes the review phase meaningful.
Before you touch Copilot, write a detailed specification for the quiz app in a file
called SPEC.md. This is the most important phase. A good spec leads to
a good agentic result; a vague spec leads to a mess.
Your spec must include:
"difficulty"
or "hint" field), but keep the base structure.
{
"questions": [
{
"question": "What keyword is used to define a function in Python?",
"type": "multiple_choice",
"options": ["func", "define", "def", "function"],
"answer": "def",
"category": "Python Basics"
},
{
"question": "A list in Python is immutable.",
"type": "true_false",
"answer": "false",
"category": "Data Structures"
},
{
"question": "What built-in function returns the number of items in a list?",
"type": "short_answer",
"answer": "len",
"category": "Python Basics"
}
]
}Now hand your spec to Copilot and let it build. Here's how:
git init).
Commit your SPEC.md as the first commit.Give Copilot a prompt like this (adapt to your own spec):
Read SPEC.md in this project. Implement the full quiz application exactly as specified. Create all necessary files. Include the sample questions from the spec in the question bank JSON file. Make sure error handling matches what the spec describes. After creating the files, run the app to verify it starts without errors.
"Phase 2: Raw agentic build output". Don't fix anything first —
we want to see what the agent produced.Now switch roles. Instead of using Copilot as a builder, use it as a reviewer — an independent check on the code it just wrote.
Open a new Copilot Chat session (click "+" to start fresh — this is important so the reviewer doesn't have the builder's context). Then make sure you are in agent mode and give it a prompt similar to this (but probaby not exactly; e.g. you might want to check for usability / UX issues too):
Review the Python code in this project against the spec in SPEC.md. For each item in the acceptance criteria, check whether the code actually implements it correctly. Also check for: - Bugs or logic errors - Missing error handling - Code quality issues (unclear naming, repeated code, etc.) - Security concerns (e.g., unsafe file handling) Format your review as a numbered list of findings, each marked as [PASS], [FAIL], or [WARN]. Be specific — reference file names and line numbers.
Important: Save this review as REVIEW.md and add it to your repository!
"Phase 3: Fixes after AI review".Note: It is very important that you make multiple, frequent commits, at the very least at the points specified above. This is largely how we will know that you followed the correct process for this assignment.
| Item | Where | Notes |
|---|---|---|
| GitHub repo submitted through Google form | Submitted through Google form | Must show at least 3 commits (spec, raw build, post-review fixes with REVIEW.md) |
| Working quiz app | In repo | Should run with python quiz.py (or similar) |
| SPEC.md | In repo | Your spec, written without AI |
| REVIEW.md | In repo | Copy of the AI review output from Phase 3 |
| REFLECTION.md | In repo | Your reflection (see below). Write this yourself — do not use AI. |
| Portfolio | Your website | Add a short entry for this project (screenshot, description, link) |
In REFLECTION.md, answer the following. Be honest and specific; there
are no wrong answers here, but you must write this yourself, without AI. (Approx. 250-500 words total.)
| Grade | (Roughly) What We're Looking For |
|---|---|
| A (90-100) | High spec quality (clear, complete, specific acceptance criteria), app works reasonably well and includes required features + an extension, no egregious security concerns, 3+ commits showing the assignment phases, interventions are logged, and the reflection is honest, specific, and thoughtful. All submission requirements met. |
| B (80-89) | Good spec quality (clear, complete, specific acceptance criteria), app includes required features + an extension, and runs with few-or-no-bugs or security concerns, 2+ thoughtful commits documenting the assignment phases, interventions are logged, and the reflection is honest/thoughtful if a little vague. All or almost all submission requirements met. (If some required features do not yet work, it may be possible to achieve this grade with an exceptionally thoughtful reflection on what went wrong.) |
| C (70-79) | Assignment mostly complete but shallow or with less attention to detail. Spec quality is likely substandard or the instructions were either ignored or followed but not documened. May be missing a component, like the REVIEW.md file. |
| Below C | Incomplete submission or insufficient thoughtfulness in key components/phases (for example, a poor spec or reflection, multiple misdocumented items, or clear use of AI to produce the SPEC.md or REFLECTION.md files). |
If you finish early and want to explore further, try running multiple review passes with different prompts — one focused on bugs, one on code style, one on security. Compare what each reviewer catches. This is a simplified version of how agentic code review systems work in industry (parallel specialized reviewers). Document your findings in your reflection if you try this.