Practical GenAI · Part 1

Teaching guide

Practical GenAI Coding Guide

An eight-step workflow for AI-assisted research code, covering planning, prompting, review, testing, version control, and documentation.

The guide treats coding assistants as one part of a research workflow. Researchers remain responsible for scientific decisions.

What is included

  • Eight chapters covering planning, background research, prompting, review, refinement, testing, standardization, and documentation.
  • Prompt examples, plus templates for planning, R code, refactoring, and documentation.
  • Guidance on version control, review, testing, and iteration.
  • A script that generates synthetic EHR and demographic records for practice.

Follow the complete workflow or use individual chapters and templates as needed.

Continue with Part 2

The Practical GenAI Agentic Coding Guide takes the next step: work with a coding agent in a small, runnable research repository. Its six lessons cover a task brief, implementation, tests, review, and handoff, with setup guidance for several coding clients and materials for a lab workshop.

Keep sensitive data in an approved environment

The included practice data are synthetic. Do not send protected health information (PHI), restricted research data, credentials, or other sensitive information to an AI service unless your institution has approved both the service and the full workflow for that data.

License and contact

Lars G. Fritsche is the guide’s author and maintainer, and the Fritsche Lab maintains the repository. The guide is licensed under GPL-3.0. Citation details are available in the repository and its CITATION.cff file. Questions and corrections are welcome in the repository’s issue tracker or discussions.