You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 657530f
Browse filesBrowse the repository at this point in the historyBrowse files
Check that the repair keeps the four category labels and group assignments unchanged: Group A counts are 42, 31, 18, 9; Group B counts are 64, 18, 12, 6. Preserve category order and show Group A above Group B within each category. Trace plotting options, function calls, and output handling. Do not open data tables, participant records, or study logs, and do not explain why an individual value failed.
9
9
10
+
Review whether the change is proportionate to this figure repair and understandable to a Python or R researcher. Check new dependencies, configuration, classes, helpers, duplicated logic, and extra processing against actual requirements. Flag concrete unnecessary complexity with its source location, maintenance or execution cost, and a simpler alternative that preserves behavior, validation, and accessibility. Do not infer a defect from line count alone or recommend terse code at the expense of clarity. Passing checks does not establish maintainability or efficiency; require measurements or a specific account of the operations involved for performance claims, and distinguish estimates from measurements.
11
+
10
12
When tools permit, run `python -m unittest discover -s plotting/tests` or `Rscript plotting/tests/run_tests.R` and use the pass/fail evidence. Run the selected language's `plotting/check_figure.py` or `plotting/check_figure.R` with `--output` and an ignored PNG path when execution is permitted. The starter intentionally fails this stricter acceptance check. Inspect the rendered chart against every fictional journal requirement, including grouping, legend, and full readable labels. Record image inspection as untested when image tools are unavailable. A passing test suite alone does not establish visual quality.
11
13
12
14
Review accessibility explicitly: black text on white, visible bar outlines, readable labels at the intended size, and group identification that survives grayscale. Read `runs/with-fix/summary.alt.txt` and compare its group names, values, and summary with the invented constants and chart. Check that the description will be attached when the image is used; a sidecar file alone does not provide screen-reader access. Record visual or assistive-technology checks that were unavailable.
Copy file name to clipboardExpand all lines: AGENTS.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ Read `README.md`, `REPO_MAP.md`, and the relevant page in `docs/paths/python/` o
8
8
9
9
The starting chart deliberately overlaps two groups and clips long labels. Preserve that unfinished exercise during maintenance unless the user asks to solve it. For a learner's repair, change the plotting function to make the grouped chart follow `docs/reference/figure-specifications.md` while preserving categories, counts, group assignments, and order.
10
10
11
+
## Keep the repair proportionate
12
+
13
+
Make the smallest clear change that meets the figure requirements and that a Python or R researcher can explain and maintain. Work in the existing plotting function. Prefer direct code and the current dependencies; justify any new dependency, configuration, class, helper, or extra processing by a concrete need in this task. Do not turn a figure repair into an unrequested production pipeline or reusable framework. If the task appears to require broader work, explain the scope increase and a simpler alternative and wait for the learner's decision before expanding the scope.
14
+
15
+
Simplicity includes readable names and useful comments, validation, and accessibility. Do not remove these to reduce line count or compress code into clever expressions. Avoid repeated work and unnecessary computation; do not optimize hypothetical future workloads. Passing tests does not establish maintainability or efficiency. Support performance claims with measurements or a specific explanation of the operations involved, and label estimates as estimates.
16
+
11
17
## Explore code and the chart
12
18
13
19
Explain source files, function calls, and tests. Do not open individual-level data, inspect participant records, or diagnose why a data point failed. This exercise has no participant records or data-file inputs. Its fixed aggregate counts are invented and embedded in source code.
@@ -16,6 +22,12 @@ Use the supplied chart to discuss labels, spacing, axes, and readability. Run th
16
22
17
23
When reusing this workflow, work in a separate workspace with code permitted for the selected service and invented examples. Keep study data, exports, logs, credentials, and sensitive code literals outside the agent's access. A local terminal, read-only mode, or `.gitignore` is not a data-sharing permission. See `docs/reference/lab-data-policy.md`.
18
24
25
+
## Keep the learner in control
26
+
27
+
Follow the chosen client and the learner's current stage. The default walkthrough uses VS Code with Copilot's Local Ask → Plan → Agent roles, Explorer, and Source Control; complete terminal instructions are in `docs/appendix/command-line.md`. Explanation, planning, and verification-only requests do not authorize repairs.
28
+
29
+
Use `docs/reference/agent-control.md` for permission and independence guidance. Explain the purpose, affected files or network access, and duration of a permission request without encouraging automatic approval. Honor existing authorization; do not broaden access, disable safeguards, or change global settings to bypass a failure. Instructions and skills do not enforce a sandbox. Leave the learner able to explain and maintain the code: provide checkable reasoning, actual evidence, and the requested opportunity to review before proceeding.
30
+
19
31
## Verify and hand off
20
32
21
33
From the repository root, run the chosen language's checks:
Also run the selected language's separate figure checker as described in `docs/appendix/command-line.md`. Its rejection of the unfinished starter is intentional; a completed repair must pass both behavior and figure checks against the latest source. Verification-only requests must report failures without making further repairs.
44
+
31
45
Render a new image, compare it with the saved baseline, and inspect the code diff. Follow the journal's accessibility requirements: review contrast, legibility, and group identification without color, and write accurate alternative text in `runs/with-fix/summary.alt.txt`. Attach that text when placing the image in a document or slide. Consider accessibility whenever creating an artifact for others to use. Keep `runs/` and `tmp/` ignored. Use `.agents/skills/plot-review/SKILL.md` for a requested independent review. The optional `lab-r-refactor` skill applies the local R template without changing behavior.
32
46
33
47
Preserve unrelated work and agree on file ownership with other agents. Finish with what changed, actual commands and outcomes, visual observations, and anything untested. Do not publish or modify external services without authorization.
Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,25 @@
1
1
# Practical GenAI Agentic Coding Example
2
2
3
-
**Fix a plotting function and see the improvement.** Start with a chart whose groups overlap and long labels are clipped. Use a short request, a local journal brief, and checks you can inspect.
3
+
**Fix a plotting function and see the improvement.** Start with a chart whose groups overlap and long labels are clipped. Use VS Code + GitHub Copilot to discuss the repair in Chat, inspect charts in Explorer, and review color-coded code changes in Source Control.
4
4
5
5
This is the runnable exercise for [Part 2 of the Fritsche Lab Practical GenAI series](https://fritschelab.org/practical-genai-agentic-coding-guide/), by [Lars G. Fritsche](https://medschool.umich.edu/profile/4980/lars-fritsche) and the [Fritsche Lab](https://fritschelab.org/) at the University of Michigan. [Part 1](https://fritschelab.org/practical-genai-coding-guide/) introduces planning, context, and checking an assistant's work. Accessibility belongs in the brief and review: consider contrast, legibility, and alternative text whenever creating something others will use.
6
6
7
+
**Practising what we teach:** this guide and exercise were developed with substantial AI assistance in writing, coding, testing, and review. They are provided **as is, without warranty**, to the extent permitted by applicable law. Review the code, agent instructions, permissions, and results before use. Read the [AI-assistance disclosure, use guidance, and warranty notice](docs/reference/agent-control.md#about-ai-assistance-in-this-guide).
8
+
7
9
## Choose your path
8
10
11
+
Start with the [detailed VS Code + GitHub Copilot setup](docs/setup/vscode-copilot.md). It covers Windows, macOS, Git installation, Copilot access, cloning, and the **Ask / Plan / Agent** controls. VS Code includes Git controls and uses a separately installed Git program.
| Python | Python 3.10–3.12, Git, and Matplotlib |[Python walkthrough](https://fritschelab.org/practical-genai-agentic-coding-guide/docs/paths/python/)|[Python setup and six lessons](docs/paths/python/index.md)|
12
16
| R | R 4.1 or later and Git; no extra R packages |[R walkthrough](https://fritschelab.org/practical-genai-agentic-coding-guide/docs/paths/r/)|[R setup and six lessons](docs/paths/r/index.md)|
13
17
14
-
Install only your chosen language. Its setup page gives the commands to create the starting chart. Both paths follow the same six stages: orient, specify, implement, verify, review, and hand off.
18
+
Install only your chosen language. Have Copilot prepare it and run the starting code, then inspect the result yourself. Both paths follow six stages: **Ask** to orient, **Plan** the repair, **Agent** to implement and verify, then **Source Control** to review diffs, stage source files, and commit locally.
19
+
20
+
Prefer a terminal? The [CLI appendix](docs/appendix/command-line.md) keeps complete Python and R setup, rendering, checking, and Git commands, plus optional Copilot CLI guidance.
21
+
22
+
Read [permissions and independent work](docs/reference/agent-control.md) before approving agent actions. Keep repairs small enough to understand and practise without AI too: working output does not establish that you can maintain the code if access becomes unavailable or prohibited.
15
23
16
24
## What the agent works with
17
25
@@ -22,7 +30,7 @@ Install only your chosen language. Its setup page gives the commands to create t
22
30
-[Plot repair brief](docs/lessons/02-specify.md): the visible problem and acceptance criteria.
23
31
-[Plotting contract](docs/reference/io_contract.md): fixed counts, command interface, and output expectations.
24
32
-[Journal specifications for figures](docs/reference/figure-specifications.md): the fictional journal's precise layout, styling, accessibility, and alternative-text requirements.
25
-
-[Repository map](REPO_MAP.md): files, tests, and commands.
33
+
-[Repository map](REPO_MAP.md): source files, tests, outputs, and instructions.
26
34
-[AGENTS.md](AGENTS.md): focused instructions for your coding agent.
27
35
-[Invented summary counts](docs/reference/synthetic-data.md): what the chart represents.
28
36
-[Templates](docs/templates/index.md): optional briefs, contracts, and handoffs.
Start with `README.md`, then follow your chosen language through `docs/paths/python/` or `docs/paths/r/`.
3
+
Start with [VS Code + GitHub Copilot setup](docs/setup/vscode-copilot.md), then follow [Python](docs/paths/python/index.md) or [R](docs/paths/r/index.md). Use Explorer for source files and charts, Copilot Chat for Ask/Plan/Agent, and Source Control for changed files, diffs, staging, and local commits.
4
4
5
5
## Plotting exercise
6
6
@@ -10,12 +10,15 @@ Start with `README.md`, then follow your chosen language through `docs/paths/pyt
10
10
|`plotting/plot_summary.R`| The equivalent base-R plotting function and CLI. |
11
11
|`plotting/tests/`| Independent behavioral checks for both languages. |
|`examples/r_refactor/`| Optional compact R starter, formatted reference, and behavior verifier. |
20
23
21
24
## Reusable instructions
@@ -29,14 +32,15 @@ Start with `README.md`, then follow your chosen language through `docs/paths/pyt
29
32
-`.codex/config.toml`: shared Codex defaults; actual access depends on the session.
30
33
-`CLAUDE.md`, `GEMINI.md`, `.github/copilot-instructions.md`: client pointers to the common instructions.
31
34
32
-
## Checks from this repository root
35
+
## Checks and generated files
33
36
34
-
```bash
35
-
python -m unittest discover -s plotting/tests
36
-
```
37
+
Use the [Python verification lesson](docs/paths/python/04-verify.md) or [R verification lesson](docs/paths/r/04-verify.md). Its Agent prompt runs behavior tests and the separate figure checker against the current workspace. The [CLI appendix](docs/appendix/command-line.md) supplies exact terminal commands.
37
38
38
-
```bash
39
-
Rscript plotting/tests/run_tests.R
40
-
```
39
+
| Path | Where to inspect it |
40
+
| --- | --- |
41
+
|`runs/baseline/summary.png`| Explorer: preserve the starting chart for comparison. |
42
+
|`runs/with-fix/summary.png`| Explorer: inspect the repaired chart after the latest checks. |
43
+
|`runs/with-fix/summary.alt.txt`| Explorer: read the separately authored description and check every value. |
44
+
| Modified or new source files | Source Control: inspect each diff before staging and committing. |
41
45
42
-
Use your language path to render baseline and repaired images. Passing checks confirms tested behavior; inspect the image separately for readable labels and layout. Keep `runs/`, `tmp/`, environments, and caches out of Git.
46
+
The starter passes behavior tests and fails the figure checker. Inspect readability and accessibility yourself even after both pass. `runs/`, `tmp/`, environments, and caches are ignored by Git, so generated figures and alt text appear in Explorer but stay out of Source Control and source commits.
0 commit comments