Practical GenAI Coding Guide
This guide presents a practical 8-step process for using Large Language Models (LLMs) in coding and research workflows while preserving rigor, reproducibility, and human review. It is written for biostatisticians, bioinformaticians, data scientists, and research teams working with analytical code.
About This Guide
This guide is created and maintained by Lars G. Fritsche, PhD, Research Associate Professor of Anesthesiology in the University of Michigan Medical School and Research Associate Professor of Biostatistics in the University of Michigan School of Public Health. Repository stewardship is through the Fritsche Lab.
flowchart TB
accTitle: Eight-step GenAI coding workflow
accDescr: A vertical overview of the eight-step GenAI coding workflow, with review and iteration feeding back before standardization and documentation.
A[Plan and context] --> B[Research methods and tools]
B --> C[Prompt the LLM]
C --> D[Review generated code]
D --> E[Refine and add features]
E --> F[Test and iterate]
F --> G{Meets success criteria?}
G -->|No| D
G -->|Yes| H[Refactor to lab template]
H --> I[Generate documentation]
D -.-> J[(Git history)]
E -.-> J
F -.-> J
Start Reading
- Chapter 1: Laying the Foundation - Plan & Context
- Chapter 2: Knowledge is Power - Do Your Research
- Chapter 3: The AI Assistant - Prompt LLM to Generate Code
- Chapter 4: Critical Eye - Review & Understand the Code
- Chapter 5: Making it Better - Refine Code & Add Features
- Chapter 6: The Iterative Journey - Iterate Until Satisfied
- Chapter 7: Standardization - Refactor to Lab Template
- Chapter 8: Sharing Your Work - Generate Documentation
Supporting Materials
- Appendices collect recommended tools, prompt libraries, further reading, project plans, and references.
- Templates provide reusable project plans, prompting examples, and an R script template.
- Scripts documents the included synthetic EHR data simulation script.
How to Cite
Please cite the guide as:
Fritsche, Lars G. Practical GenAI Coding Guide: A practical 8-step process for integrating GenAI tools into coding and research workflows. Fritsche Lab, University of Michigan. https://FritscheLab.github.io/practical-genai-coding-guide/. Accessed YYYY-MM-DD.
Citation metadata is available in CITATION.cff.