Practical GenAI · Part 2

Build research code
you can explain.

Work through a small project with a coding agent, learn how to check its work, and leave the next person a project they can pick up.

A Fritsche Lab teaching guide · University of Michigan

One working exampleA Python pipeline with synthetic BMI and demographics data.
Your choice of agentUse a supported coding tool with the same goals and checks.
Understand what changedWork out the answer, inspect the changes, and check the result.

Pick up where Part 1 leaves off

Part 1: Practical GenAI Coding Guide takes us through planning, prompting, reviewing, and documenting code, including work with coding agents. Here we put those habits to work in a project with several moving parts: a Python package, tests, documentation, and saved results.

We use one small example throughout, so you can follow a change from the original request to the files you would share with a collaborator. Along the way, you will give the agent useful context, catch plausible mistakes, and decide when the result is ready to keep.

If you are new to using GenAI for coding, begin with Part 1. If you can already run a script and inspect a change, start here.

A practical learning path

From the first run to a reviewed change

Keep the project small so you can see the whole workflow.

  1. Establish a working baseline

    Install the demo, run the tests, and inspect a completed run before asking an agent to edit anything.

    Run the quickstart
  2. Make the repository understandable

    Use a README, agent instructions, a repository map, and data contracts to make expectations explicit.

    Explore repository practices
  3. Choose one small improvement

    Describe the change and how you will check it. Review its plan and the files it changes.

    Work through the lessons
  4. Leave a useful result

    Run the checks, inspect the outputs, and leave enough detail for a labmate to rerun the work.

    Read the pipeline reference

Make it useful in your own work

Choose what you need next

Set up your agent

Prepare a coding tool to work with this repository.

Agent setup

Reuse the templates

Write a task brief, agree on the data, or hand off unfinished work.

Browse templates

Teach a lab session

Use the 45-minute runbook and a focused live exercise.

Teaching materials