PIC 18: Vibe Coding and Agentic Engineering
About
This new course follows on naturally from PIC 16A, our in-depth Python course. Vibe Coding and Agentic Engineering have been growing in popularity as the ability of AI agents to write code and solve other difficult problems has improved rapidly. Reports suggest that lots of software developers rarely write code themselves anymore, and that they act as a manager to an AI agent.
For the layperson, it is exciting that the barriers to entry for producing code have substantially lowered. However, it is still not safe for someone without a background in conventional coding to create an app that processes sensitive data or to produce code that drives a car. Those who use AI agents still need enough expertise to assess whether the code written by an AI agent accomplishes what it is supposed to do correctly. This course is ambitious because it addresses both of the points just made simultaneously. It has students experience the excitement of creating code beyond their own capabilities, and it shows them how they can learn from such code to increase their capabilities so that, eventually, they can develop the necessary experience to safely produce more involved code.
To assess whether students have successfully learned how to learn, the course makes sure to focus on some specific programming topics. Students will be examined on these topics as carefully as in a regular coding class.
Course Description
- Lecture, three hours; discussion, one hour. Requisites: PIC 16A (recommended) or PIC 10B or PIC 20A or PIC 40A.
- Teaches how to use chatbots to learn unfamiliar topics.
- Highlights features of a specific AI agent and different modes of operation that can be used to maximize the effectiveness of the agentic engineering process.
- Covers how to use Git, GitHub, gh, APIs, and API keys safely with an AI agent.
- Studies specifics of some Python libraries using AI written code, for example, Requests, Pandas, and Plotly.
- Highlights the importance of fast, independent, repeatable, self-validating, and thorough tests.
- Emphasizes modularity and a deep understanding of a project's architecture as essential for managing an AI agent during ambitious projects.
- P/NP or letter grading.
Learning Outcomes / Course Objectives / Core Competencies
After successful completion of PIC 18, students should be able to...
- Use chatbots to increase their learning rather than to cause cognitive decline, for example, by adding "skills" which explain to the AI Agent how to tutor in ways which are intelligent with respect to Educational Psychology.
- Use a chatbot to learn about a challenging and unfamiliar topic.
- Understand that being more skeptical and less trusting leads to becoming a better problem solver with AI.
- Appreciate that managerial qualities (like being a good communicator and decision-maker, having a clear vision and relevant technical skills, and focusing on results) are relevant to successfully using AI agents to accomplish a task.
- Appreciate the importance of making sure the AI is "comfortable" giving feedback; sycophancy is of little help to the development of a project.
- Appreciate that when a project has personal value, a lower barrier to entry does not necessarily equate to finishing a coding project quicker; instead it empowers one to fine-tune all the parts that matter.
- Create fast, independent, repeatable, self-validating, and thorough tests with the aid of an AI agent as well as their own thinking on a problem.
- Understand what is meant by a project's architecture and leverage their understanding of a project's architecture to assist the AI in its project development.
- Utilize features of a specific AI agent, like Claude, to maximize the effectiveness of the Agentic Engineering process, for example, use a project file like CLAUDE.md to keep track of project status and deploy a skill to cause desired behavior.
- Know how to use different modes of operation, for example, the Planning mode in Claude, to organize one's workflow and act as a better manager to the AI agent.
- Create something beyond their raw coding ability, and know how to probe the AI and test it to assess its correctness ("never delegate what you cannot check").
- Know how to configure Python for AI usage.
- Safely use Git, GitHub, gh, APIs, and API keys with an AI agent.
- Learn new programming techniques from AI generated code.
- Use common Pandas methods effectively and understand the fundamentals of Plotly.
General Course Outline
Configure Python for AI usage.
- Set up a conda environment that the AI Agent will be allowed to change.
Configure a chatbot for learning.
- Context matters. Share past coding courses and the topics covered. Comment on lack of experience or comfort where relevant so that the AI agent can communicate at the appropriate level of knowledge.
- Prompt for productive interactions. Ask the agent to avoid sycophancy. Ask for a tutor that is intelligent with respect to Educational Psychology.
Modes of interaction.
- Chatbots.
- A coding framework (for example, Claude Code).
- Planning before starting a project (for example, Planning Mode in Claude) including specifying the end goal and tests that need to be passed to regard the project as finished.
- Project files that keep track of progress and record relevant information discovered along the way (for example, CLAUDE.md).
- Giving an AI Agent even more context (for example, by using Memory and Skills in Claude).
Git, GitHub, gh, and AI agents.
Git and GitHub.
- A mental model for understanding the working tree, the staging area, and the commit history (commits are efficiently stored snapshots).
- What is local? Your computer: the working tree, the staging area, and its own version of the commit history, which can differ from GitHub's.
- What is remote? GitHub: its own version of the commit history. There is no working tree or staging area.
- A note on the word "repository" for Git and for GitHub.
- git clone, the local main branch, the main branch on GitHub, and the remote-tracking branch origin/main.
- git status, git add, git commit, and git push.
- Staging is like preparing to save. Committing is like saving without losing a record of previous saves. Committed work is difficult to lose; uncommitted work is easy to lose.
- How git status uses origin/main (and why it can be out of date); git pull.
- git diff, git log, and git show.
- .gitignore and secrets.
- Branches, a feature branch's commits (main..feature), HEAD, and detached HEAD.
- git switch, git merge, merge conflicts, and git pull == git fetch, then git merge.
- Rejected non-fast-forward pushes.
- Pull requests.
- git revert to undo commits and git reflog as a safety net.
- Destructive commands: discarding changes with restore or checkout, push --force, reset --hard, clean, and rewriting history that's already been pushed.
- Why small, atomic, single-purpose commits matter concretely for later operations rather than as an abstract best practice.
gh to operate GitHub's website features from the terminal.
- gh auth login, gh auth status, and gh auth setup-git.
- Read-only: list, view, status, and diff.
- Act immediately on GitHub, often visibly or irreversibly: create, comment, merge, close, edit, and delete.
- Warning: gh api can make arbitrary API calls.
- gh pr merge explained for conceptual purposes.
Supervising your AI Agent.
- Warning: anything the agent does with git or gh is done as you, using your account.
- Ask the agent to explain any command you do not understand before approving it.
- Check which repository and account a gh command will act on and whether a new repository will be public or private.
- Review git diff before commits and pushes.
- Have the agent work on a branch.
- Check git status before switching or pulling.
- Run tests after merges because clean merges can still break code.
- Recognize which commands are read-only and which act on GitHub.
Using APIs effectively and safely.
- HTTP requests, the requests library.
-
requests.get.
- The headers and params parameters of the get method.
- Status codes and text responses.
-
Using an API for the first time.
- API keys, .env files and .gitignore, python-dotenv, what can go wrong.
-
JSON and Python dictionaries.
- Investigating deeply nested JSON (dictionaries nested inside lists nested inside dictionaries) via direct indexing.
- requests.Session() compared with repeated calls to requests.get.
-
Pagination.
- Computing how many pages are needed from a total item count and a fixed page size.
- Correctly handling a final, partial page rather than assuming every page is full.
- Writing robust string comparisons (case and whitespace normalization) when matching against real-world, inconsistently formatted API, or user-provided text.
-
Exceptions and error handling.
- Reasoning precisely about what exception is raised, and where, when an expected key or list index is missing from a JSON response.
- Distinguishing a network-level failure (timeout, connection error), which the requests library raises as a Python exception, from an HTTP-level error response, which requires examining the response code.
- Adding respectful rate-limiting between paginated requests, and handling a rate-limit-specific HTTP status code differently from a generic server error.
- Involved applications, for example, using the setlist.fm API to write a class for a command-line tool that allows searching for any artist and retrieving the setlists from their past concerts.
Exploring data visualization.
Various data visualization tools.
- Tiles displaying numerical statistics.
- Grid heatmaps for two categorical/ordinal axes and a magnitude.
- Horizontal bar charts.
- Animated horizontal bar charts in which the horizontal bars' values change over time and their positions update according to rank.
- 100% stacked bar charts.
- Histograms.
- Line charts.
- Choosing a chart type appropriately for the data.
- Confirming by examining the raw data, that the graphics are displaying data accurately.
Common data analysis questions and tools.
- Identifying what a single number statistic hides.
- Assessing which of two single number statistics better allows one to answer a related question and/or identifying that the statistics cannot answer the question. For example, does "number of played tracks" or "total listening time" better answer "who is your favorite band?"
- Handling outliers in a way that is transparent rather than hidden.
- Using rolling averages to smooth out noisy time series.
- Identifying regions of substantially different behavior in a time series.
- Confirming that data processing has been done correctly on explicit examples.
Pandas.
-
Loading and combining multiple JSON files into a single DataFrame.
- Investigating the dataframes thoroughly to understand the benefits of one feature over another, for example, spotify_track_uri versus master_metadata_track_name.
-
Handling timestamps efficiently and effectively.
- Parsing raw timestamp strings into datatime values.
- Extracting hour-of-day and day-of-week from timestamp.
- Calculating time differences.
- Using boolean conditions to efficiently group near-in-time data.
- Using helpful methods: counts, unique counts, sums, mean.
-
Grouping data.
- Grouping by a single category.
- Grouping by two features at once.
- Applying methods per group.
- The difference between agg() and transform() after a groupby(...) call, and recognizing which one a given task requires.
- Computing a percentage within a group versus accidentally computing it against a global total.
- Reshaping long-format, one-row-per-event data using a pivot table.
- Recognizing the difference between a bug that crashes and one that silently produces a plausible-looking but incorrect result, and how to convert the latter into the former with an explicit check.
Plotly.
- The distinction between a categorical axis and continuous axis, and the specific consequence this has for how missing data renders.
-
Managing color schemes.
- Color scales.
- How a single outlier distorts a linear mapping for every other value.
- Non-linear scalings to make sure visualizations remain readable in the presence of one dominant value.
- Gaps between cells on heatmaps.
-
Fine control over data presentation.
- How Plotly animation frames are matched to a base figure's traces.
- Determining the stacking order of data in a bar chart and in its legend.
- Specifying the playback speed of an animation.
- Controlling the number of displayed values in an animation.
- Specifying which data uses the same color throughout an animation, and which data might change color upon disappearing and reappearing.
Customization and personalization throughout.
- Some suggested directions for further development.
- Original customizations are encouraged to highlight that when a project has personal value, a lower barrier to entry does not necessarily equate to finishing a coding project quicker; instead it empowers one to fine-tune all the parts that matter.
Project.
- A data tool, a game, a simulator, an app, or something else.
-
Several parts that work together.
Some ideas for parts that can be combined:
- Data in (API client, web scraping, parsing personal data export, public datasets, user input, sensors);
- Data handling (cleaning and validation, SQLite or JSON storage, caching, incremental updates);
- Logic (text processing, pandas analysis, scoring or ranking, statistics, simulation, game rules and AI opponents, optimization, pathfinding);
- Interface (command line interface, tkinter/PyQt GUI, HTML/CSS website, Plotly dashboard, Flask app);
- Engineering (README, modular structure, config and secrets handling, tests (pytest), logging, packaging);
- Automation (scheduled runs, emailed or posted digests);
- LLM inside the program (Claude API for classification, extraction, or dialogue, with prompt design and output validation).
-
"Owned components".
- Matter to the project's core. A handful of substantial pieces is better than many trivial ones. It is best to own at least one part that touches data and/or logic.
-
Without Claude, a student should be able to...
- Explain what their owned component does and why it is designed the way it is.
- Trace a specific input and predict the output.
- Say what happens on bad input (empty, missing, malformed).
- Modify the code live to handle new small requirements.
- Explain what the related testing code does.
- During presentations, students will be asked detailed questions about their owned components.
-
Claude-designed components.
- Anything that is not an owned components.
- During presentations, students will be asked to say in a sentence or two what each Claude component does and how they checked that it works.
- Will culminate in a GitHub repository.
- Claude conversations will also be submitted.
Expected Grade Scheme
- Homework assignments: 10% to 20%
- In-person proctored quizzes on learning from homework assignments: 40% to 50%
- Final project and presentation: 40%