Skip to content

Commit 34830a3

Browse files
committed
Enhance Fritsche Lab coding guide with new features and updates
- Added custom footer and title includes for branding consistency. - Introduced a new SCSS file for shared visual styles, aligning with Fritsche Lab's identity. - Created setup SCSS for body font and color palette. - Added favicon and brand mark SVGs for visual identity. - Implemented accessibility improvements for table navigation. - Developed "Agentic Coding Playbook" and "Hands-on Quick Start" documentation for practical coding tasks. - Updated "Guide Updates" to reflect September 2026 revisions and evidence for changes. - Introduced templates for Agent Task Brief and Session Handoff to standardize task delegation.
1 parent ec42b4c commit 34830a3

47 files changed

Lines changed: 1432 additions & 380 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CITATION.cff‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ authors:
66
- family-names: "Fritsche"
77
given-names: "Lars G."
88
affiliation: "University of Michigan"
9-
website: "https://medschool.umich.edu/profile/4980/lars-fritsche"
9+
website: "http://fritschelab.org"
1010
repository-code: "https://github.com/FritscheLab/practical-genai-coding-guide"
11-
url: "https://FritscheLab.github.io/practical-genai-coding-guide/"
11+
url: "https://fritschelab.org/practical-genai-coding-guide/"
1212
license: "GPL-3.0-only"
1313
keywords:
1414
- "generative AI"

‎README.md‎

Lines changed: 36 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,43 @@
1-
# GenAI Tools for Coding & Research Workflows — A Practical 8-Step Process
1+
# Practical GenAI Coding Guide
22

3-
Welcome to this repository containing a **practical textbook** on integrating Large Language Models (LLMs) into coding and research workflows. This guide is geared toward **biostatisticians, bioinformaticians, and data scientists**, providing hands-on steps and examples to enhance productivity and maintain rigorous standards when employing GenAI tools.
3+
A Fritsche Lab guide to using AI assistants in biostatistics, bioinformatics, and research coding. Follow eight steps from a clear analysis plan to reviewed code, tested behavior, and reproducible documentation.
44

5-
## Authorship and Maintainer
5+
**[Read the guide](https://fritschelab.org/practical-genai-coding-guide/)** · **[Fritsche Lab](https://fritschelab.org/)**
66

7-
This guide is created and maintained by [Lars G. Fritsche, PhD](https://medschool.umich.edu/profile/4980/lars-fritsche), 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](https://github.com/FritscheLab).
7+
## Start here
88

9-
## How to Cite
9+
- **[Try the hands-on quick start](docs/QuickStart.md):** a small synthetic dataset, an R task, and checks with independently specified results.
10+
- **[Read the eight chapters](chapters/index.md):** planning, research, prompting, review, refinement, testing, standardization, and documentation.
11+
- **[Use the coding agent playbook](docs/AgenticCodingPlaybook.md):** task scope, context handoffs, review, permissions, and reproducible R workflows.
12+
- **[Copy a template](docs/templates/index.md):** task briefs, handoffs, project plans, code review, and documentation prompts.
1013

11-
If you use this guide in teaching, documentation, analysis workflows, or publications, please cite the repository:
14+
The [September 2026 update notes](docs/Updates.md) explain the source-backed content changes and alignment with the lab website. The guide uses synthetic examples; keep protected data in its approved environment.
1215

13-
> 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.
16+
## Repository map
1417

15-
Citation metadata is available in [`CITATION.cff`](CITATION.cff) for GitHub and reference managers.
18+
| Path | Contents |
19+
| --- | --- |
20+
| `chapters/` | The eight-step learning sequence and conclusions. |
21+
| `docs/` | Quick start, playbook, appendices, references, and contributor setup. |
22+
| `docs/templates/` | Copyable prompts, project plans, and an R script skeleton to adapt and test. |
23+
| `scripts/` | Synthetic EHR and demographic data generator. |
24+
| `_sass/custom/`, `_includes/`, `assets/` | Lab styling and Just the Docs extension hooks. |
1625

17-
## Repository Overview
26+
## Build and preview
1827

19-
- **Chapters**
20-
1. [Chapter 1: Laying the Foundation — Plan & Context](chapters/Chapter01_PlanAndContext.md)
21-
2. [Chapter 2: Knowledge is Power — Do Your Research](chapters/Chapter02_KnowledgeIsPower.md)
22-
3. [Chapter 3: The AI Assistant — Prompt LLM to Generate Code](chapters/Chapter03_TheAIAssistant.md)
23-
4. [Chapter 4: Critical Eye — Review & Understand the Code](chapters/Chapter04_CriticalEye.md)
24-
- Introduces **Git-based version control** practices for managing LLM-generated code iterations.
25-
5. [Chapter 5: Making it Better — Refine Code & Add Features](chapters/Chapter05_MakingItBetter.md)
26-
6. [Chapter 6: The Iterative Journey — Iterate Until Satisfied](chapters/Chapter06_TheIterativeJourney.md)
27-
7. [Chapter 7: Standardization — Refactor to Lab Template](chapters/Chapter07_Standardization.md)
28-
- Explains using the **R Code Refactoring Prompt** and an **R Code Template** to enforce lab-wide coding standards.
29-
8. [Chapter 8: Sharing Your Work — Generate Documentation](chapters/Chapter08_SharingYourWork.md)
30-
- Demonstrates how to leverage the **GitHub Repository Documentation Guidelines** for creating robust project docs.
31-
- [Conclusions](chapters/Conclusions.md)
32-
- A concise, **optimized conclusion** summarizing the eight-step process and emphasizing the importance of version control, collaboration, and reproducibility.
28+
Use Ruby 3.3 and Bundler from the repository root:
3329

34-
- **Docs**
35-
- [Appendix A: Recommended LLM Tools and Platforms](docs/AppendixA_RecommendedLLMTools.md)
36-
- [Appendix B: Prompt Library for Biostatistics, Bioinformatics, and Data Science](docs/AppendixB_PromptLibrary.md)
37-
- [Appendix C: Further Reading and Resources](docs/AppendixC_FurtherReading.md)
38-
- [Appendix D: Project Plans and Code Templates](docs/AppendixD_ProjectPlansAndTemplates.md)
39-
- Directs you to the individual plan and template files under `docs/templates`.
40-
- [References](docs/References.md)
41-
- Hyperlinked citations used throughout the textbook.
42-
43-
- **Templates** (in `docs/templates/`)
44-
- **R Code Templates & Prompts**
45-
- [`R_CodeTemplate.R`](docs/templates/R_CodeTemplate.R): A production-quality script template featuring metadata, library management, CLI parsing, and more.
46-
- [`R_CodeRefactoringPromptExample.md`](docs/templates/R_CodeRefactoringPromptExample.md): Guidance for prompting an LLM to refactor your existing code according to lab standards.
47-
- **GitHub Documentation Guide**
48-
- [`GitHubRepoDocumentationGuidelines.md`](docs/templates/GitHubRepoDocumentationGuidelines.md): A prompt and template for creating comprehensive `README.md` files, environment setup instructions, and usage docs.
49-
- **Project Plans**
50-
- [`ProjectPlan_InitialDraft.md`](docs/templates/ProjectPlan_InitialDraft.md)
51-
- [`ProjectPlan_Improved.md`](docs/templates/ProjectPlan_Improved.md)
52-
- [`ProjectPlan_Advanced.md`](docs/templates/ProjectPlan_Advanced.md)
53-
- **Coding Prompt**
54-
- [`CodingPromptForRScript.md`](docs/templates/CodingPromptForRScript.md): An example prompt for generating production-ready R scripts with `data.table` and `optparse`.
55-
56-
## How to Use This Repository
57-
58-
1. **Follow the 8-Step Process**
59-
Read the chapters in order to learn how to plan, prompt, refine, and document your AI-assisted code effectively.
60-
61-
2. **Leverage the Appendices**
62-
- Check out the recommended LLM tools, curated prompts, further reading, and code templates to accelerate your workflow.
63-
64-
3. **Explore the Templates**
65-
- Use the R templates, refactoring prompts, and documentation guidelines in `docs/templates/` to standardize your code and streamline collaboration.
66-
67-
4. **Apply Version Control**
68-
- As described in [Chapter 4](chapters/Chapter04_CriticalEye.md), store each LLM-generated or refined code iteration in Git (e.g., GitHub) to maintain a clear history, review diffs, and revert if needed.
69-
70-
5. **Stay Tuned for References**
71-
- All references are hyperlinked and listed in [docs/References.md](docs/References.md).
72-
73-
## Data Simulation Script
30+
```bash
31+
bundle install
32+
bundle exec jekyll build
33+
bundle exec jekyll serve --host 127.0.0.1 --port 4000
34+
```
7435

75-
If you'd like to **test your workflows** or the 8-step process on example data, we provide a script that **simulates EHR and demographic records** with realistic data quality issues:
36+
Open `http://127.0.0.1:4000/practical-genai-coding-guide/`. See [Development Setup](docs/DevelopmentSetup.md) for platform-specific setup, the Conda/Miniforge compiler workaround, and GitHub Pages deployment. Generated site and dependency directories stay ignored.
7637

77-
- **Script**: [`scripts/simulate_ehr_data.R`](scripts/simulate_ehr_data.R)
78-
- **Purpose**: Generates BMI, height, weight, and demographic data for a specified number of individuals, optionally introducing missing or implausible values.
38+
## Practice with larger synthetic data
7939

80-
### Example Usage
40+
The [EHR simulator](scripts/simulate_ehr_data.md) creates measurements, demographic records, and data dictionaries. Install its documented R dependency before running, then use explicit output paths:
8141

8242
```bash
8343
Rscript scripts/simulate_ehr_data.R \
@@ -89,27 +49,20 @@ Rscript scripts/simulate_ehr_data.R \
8949
--n_individuals 1000
9050
```
9151

92-
**Explanation of Arguments:**
52+
For a first exercise requiring no R packages, use the [quick start](docs/QuickStart.md).
9353

94-
- `--output_ehr`: Where to save the simulated EHR (BMI) data (TSV).
95-
- `--output_ehr_dict`: Where to write the EHR data dictionary (TXT).
96-
- `--output_demo`: Where to save the demographics data (TSV).
97-
- `--output_demo_dict`: Where to write the demographics data dictionary (TXT).
98-
- `--seed`: Random seed for reproducibility.
99-
- `--n_individuals`: Number of unique individuals to simulate (default=1000).
54+
## Contribute
10055

101-
By running this script, you can quickly produce **synthetic data** for testing code-refinement prompts, checking your data-cleaning pipelines, or practicing the entire 8-step process from ingestion to documentation.
56+
Open an issue or pull request with a concrete correction, a useful research-code example, or a source-backed workflow improvement. Keep existing page paths, use synthetic fixtures, and build the site before submitting. Repository conventions are in [AGENTS.md](AGENTS.md); [Codex Agent Setup](docs/CodexAgentSetup.md) describes the project's automation support.
10257

103-
## Contributing
58+
## Authorship and citation
10459

105-
- We welcome pull requests for refinements, corrections, or extensions.
106-
- Please open issues for any questions, or join discussions to keep this textbook accurate and helpful.
107-
- To build or preview the Just the Docs site locally, see [Development Setup](docs/DevelopmentSetup.md).
60+
Created and maintained by [Lars G. Fritsche](https://medschool.umich.edu/profile/4980/lars-fritsche) and the [Fritsche Lab](https://fritschelab.org/) at the University of Michigan.
10861

109-
## License
62+
> 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.org/practical-genai-coding-guide/. Accessed YYYY-MM-DD.
11063
111-
This repository is licensed under the [GNU General Public License v3.0](./LICENSE).
64+
[CITATION.cff](CITATION.cff) provides citation metadata for GitHub and reference managers.
11265

113-
---
66+
## License
11467

115-
**Happy learning and coding with GenAI tools!**
68+
[GNU General Public License v3.0](LICENSE).

‎_config.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
title: Practical GenAI Coding Guide
22
description: A practical 8-step process for integrating GenAI tools into coding and research workflows.
33
theme: just-the-docs
4+
color_scheme: light
45

56
author:
67
name: "Lars G. Fritsche"
@@ -9,7 +10,7 @@ author:
910
biostat_profile_url: "https://sph.umich.edu/faculty-profiles/fritsche-lars.html"
1011
github_org: "https://github.com/FritscheLab"
1112

12-
url: "https://FritscheLab.github.io"
13+
url: "https://fritschelab.org"
1314
baseurl: "/practical-genai-coding-guide"
1415
repository: FritscheLab/practical-genai-coding-guide
1516

@@ -41,7 +42,7 @@ back_to_top_text: "Back to top"
4142

4243
footer_content: >-
4344
Maintained by <a href="https://medschool.umich.edu/profile/4980/lars-fritsche">Lars G. Fritsche, PhD</a>
44-
and the <a href="https://github.com/FritscheLab">Fritsche Lab</a>
45+
and the <a href="https://fritschelab.org/">Fritsche Lab</a> at the University of Michigan
4546
(<a href="https://sph.umich.edu/faculty-profiles/fritsche-lars.html">Biostatistics profile</a>).
4647
Distributed under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL v3.0</a>.
4748
@@ -67,6 +68,8 @@ mermaid:
6768
version: "9.1.3"
6869

6970
aux_links:
71+
"Fritsche Lab":
72+
- "https://fritschelab.org/"
7073
"Repository":
7174
- "https://github.com/FritscheLab/practical-genai-coding-guide"
7275
aux_links_new_tab: true

‎_includes/head_custom.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<meta name="theme-color" content="#00274c">
2+
<link rel="icon" type="image/svg+xml" href="{{ '/assets/images/fritsche-lab-favicon.svg' | relative_url }}">
3+
<script src="{{ '/assets/js/guide-accessibility.js' | relative_url }}" defer></script>

‎_includes/mermaid_config.js‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
2-
theme: "default",
2+
theme: "base",
3+
themeVariables: {
4+
background: "#ffffff",
5+
primaryColor: "#eaf2f8",
6+
primaryTextColor: "#00274c",
7+
primaryBorderColor: "#006f78",
8+
secondaryColor: "#e5f2f1",
9+
secondaryTextColor: "#00274c",
10+
secondaryBorderColor: "#006f78",
11+
tertiaryColor: "#f4f7fa",
12+
tertiaryTextColor: "#00274c",
13+
tertiaryBorderColor: "#8495a6",
14+
lineColor: "#52606d",
15+
edgeLabelBackground: "#ffffff"
16+
},
317
flowchart: {
418
curve: "basis",
519
htmlLabels: true

‎_includes/nav_footer_custom.html‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="guide-lab-note">
2+
<a href="https://fritschelab.org/">Fritsche Lab <span aria-hidden="true">↗</span></a>
3+
<span>University of Michigan</span>
4+
<span>Research · Methods · Teaching</span>
5+
</div>

‎_includes/title.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<img class="guide-brand-mark" src="{{ '/assets/images/fritsche-lab-mark.svg' | relative_url }}" alt="" width="42" height="42">
2+
<span class="guide-brand-copy"><strong>Fritsche Lab</strong><span>Practical GenAI coding</span></span>

0 commit comments

Comments
 (0)