From c24f7549663b82d59a483a4d1ef4f288b8643bfc Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Sun, 17 May 2026 22:39:43 +0200 Subject: [PATCH 1/2] feat(prompts): include language in plot title format (closes #6958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rendered plot titles change from `{spec-id} · {library} · anyplot.ai` to `{spec-id} · {Language} · {library} · anyplot.ai` so viewers can tell Python from R at a glance — necessary now that R/ggplot2 implementations sit alongside the Python libraries (and because plotnine is the Python port of ggplot, the library name alone is ambiguous). Updated all four prompts that pin the canonical format: the generator spec + Python script example, plus the SC-04 title-format check in the quality-evaluator, quality-criteria, and ai-quality-review prompts so review doesn't flag the new pattern. Existing R impls keep their old titles; only generations after this merge use the new format. Co-Authored-By: Claude Opus 4.7 (1M context) --- prompts/plot-generator.md | 19 +++++++++++-------- prompts/quality-criteria.md | 2 +- prompts/quality-evaluator.md | 2 +- prompts/workflow-prompts/ai-quality-review.md | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/prompts/plot-generator.md b/prompts/plot-generator.md index b9d87bd8e7..f1ac6c004c 100644 --- a/prompts/plot-generator.md +++ b/prompts/plot-generator.md @@ -118,7 +118,7 @@ ax.scatter(study_hours, exam_scores, alpha=0.7, s=200, # Style ax.set_xlabel('Study Hours per Day', fontsize=20, color=INK) ax.set_ylabel('Exam Score (%)', fontsize=20, color=INK) -ax.set_title('scatter-basic · matplotlib · anyplot.ai', +ax.set_title('scatter-basic · Python · matplotlib · anyplot.ai', fontsize=24, fontweight='medium', color=INK) ax.tick_params(axis='both', labelsize=16, colors=INK_SOFT) ax.spines['top'].set_visible(False) @@ -138,23 +138,26 @@ plt.savefig(f'plot-{THEME}.png', dpi=300, bbox_inches='tight', facecolor=PAGE_BG **Always use this format for the plot title:** ``` -{spec-id} · {library} · anyplot.ai +{spec-id} · {Language} · {library} · anyplot.ai ``` +`{Language}` is the implementation's language, capitalized: `Python` or `R`. The language token is **required** — viewers cannot tell from `ggplot2` alone whether a chart is Python or R (`plotnine` is the Python ggplot port), and going forward every rendered title must surface the runtime language. + Examples: -- `scatter-basic · matplotlib · anyplot.ai` -- `bar-grouped · seaborn · anyplot.ai` -- `heatmap-correlation · plotly · anyplot.ai` +- `scatter-basic · Python · matplotlib · anyplot.ai` +- `bar-grouped · Python · seaborn · anyplot.ai` +- `heatmap-correlation · Python · plotly · anyplot.ai` +- `biplot-pca · R · ggplot2 · anyplot.ai` **Optional descriptive prefix**: If the spec-id alone doesn't explain the example data well, add a descriptive title before it: ``` -{Descriptive Title} · {spec-id} · {library} · anyplot.ai +{Descriptive Title} · {spec-id} · {Language} · {library} · anyplot.ai ``` Examples: -- `Tesla Stock 2024 · candle-ohlc · matplotlib · anyplot.ai` -- `Sales by Region · bar-grouped · seaborn · anyplot.ai` +- `Tesla Stock 2024 · candle-ohlc · Python · matplotlib · anyplot.ai` +- `Sales by Region · bar-grouped · Python · seaborn · anyplot.ai` Only add the descriptive prefix when it adds value - most basic plots don't need it. diff --git a/prompts/quality-criteria.md b/prompts/quality-criteria.md index 26da279d78..41fbf15b82 100644 --- a/prompts/quality-criteria.md +++ b/prompts/quality-criteria.md @@ -332,7 +332,7 @@ This category evaluates aesthetic sophistication beyond mere correctness. A plot | Points | Criterion | |--------|-----------| -| 3 | Title format `{spec-id} · {library} · anyplot.ai` AND legend labels correct | +| 3 | Title format `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R}) AND legend labels correct | | 2 | Title format correct but legend issues, or vice versa | | 1 | Partially correct | | 0 | Missing or wrong | diff --git a/prompts/quality-evaluator.md b/prompts/quality-evaluator.md index 9fd2bd07c9..526f897d04 100644 --- a/prompts/quality-evaluator.md +++ b/prompts/quality-evaluator.md @@ -204,7 +204,7 @@ If found: `auto_reject: "AR-08"`, score = 0, stop evaluation. | SC-01 | Plot Type | 5 | Correct chart type? | | SC-02 | Required Features | 4 | All spec features present? | | SC-03 | Data Mapping | 3 | X/Y correctly assigned? All data visible? | -| SC-04 | Title & Legend | 3 | `{spec-id} · {library} · anyplot.ai`? Legend labels correct? | +| SC-04 | Title & Legend | 3 | `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R})? Legend labels correct? | ### Step 4: Data Quality (15 pts) diff --git a/prompts/workflow-prompts/ai-quality-review.md b/prompts/workflow-prompts/ai-quality-review.md index f4c4c3d8d9..f42e27b60d 100644 --- a/prompts/workflow-prompts/ai-quality-review.md +++ b/prompts/workflow-prompts/ai-quality-review.md @@ -107,7 +107,7 @@ Read `prompts/quality-criteria.md` and evaluate: | SC-01 | Plot Type | 5 | Correct chart type? | | SC-02 | Required Features | 4 | All features from spec? | | SC-03 | Data Mapping | 3 | X/Y correct? Axes show all data? | -| SC-04 | Title & Legend | 3 | `{spec-id} · {library} · anyplot.ai`? Legend labels match? | +| SC-04 | Title & Legend | 3 | `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R})? Legend labels match? | #### Data Quality (15 pts) | ID | Criterion | Max | Check | From b09288ae8f6f2e779e13b7d731f8e7c68db284c5 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Sun, 17 May 2026 23:01:15 +0200 Subject: [PATCH 2/2] review: accept descriptive-prefix title variant + fix ggplot2 skeleton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot review on #7141 flagged two issues: 1. SC-04 hard-coded `{spec-id} · {Language} · {library} · anyplot.ai` as the only acceptable form, but plot-generator.md still permits an optional `{Descriptive Title} · ` prefix. Without aligning the review-side rubric, valid prefixed titles would lose points. Updated the SC-04 cell in quality-evaluator.md, quality-criteria.md, and ai-quality-review.md to explicitly accept both shapes. 2. prompts/library/ggplot2.md's labs() example showed a generic `title = "Basic Scatter"` placeholder, which could steer ggplot2 generations away from the canonical title format. Updated the example to the new form so the skeleton is self-consistent with the Title Format MANDATORY block. Co-Authored-By: Claude Opus 4.7 (1M context) --- prompts/library/ggplot2.md | 2 +- prompts/quality-criteria.md | 2 +- prompts/quality-evaluator.md | 2 +- prompts/workflow-prompts/ai-quality-review.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prompts/library/ggplot2.md b/prompts/library/ggplot2.md index b31f5af664..54bd795666 100644 --- a/prompts/library/ggplot2.md +++ b/prompts/library/ggplot2.md @@ -222,7 +222,7 @@ df <- tibble::tibble( # --- Plot ------------------------------------------------------------------- p <- ggplot(df, aes(x, y)) + geom_point(color = OKABE_ITO[1], size = 4, alpha = 0.7) + - labs(title = "Basic Scatter", x = "X", y = "Y") + + labs(title = "scatter-basic · R · ggplot2 · anyplot.ai", x = "X", y = "Y") + theme_minimal(base_size = 14) + theme( plot.background = element_rect(fill = PAGE_BG, color = PAGE_BG), diff --git a/prompts/quality-criteria.md b/prompts/quality-criteria.md index 41fbf15b82..2713225682 100644 --- a/prompts/quality-criteria.md +++ b/prompts/quality-criteria.md @@ -332,7 +332,7 @@ This category evaluates aesthetic sophistication beyond mere correctness. A plot | Points | Criterion | |--------|-----------| -| 3 | Title format `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R}) AND legend labels correct | +| 3 | Title is `{spec-id} · {Language} · {library} · anyplot.ai`, optionally prefixed with `{Descriptive Title} · ` (Language ∈ {Python, R}). Legend labels correct | | 2 | Title format correct but legend issues, or vice versa | | 1 | Partially correct | | 0 | Missing or wrong | diff --git a/prompts/quality-evaluator.md b/prompts/quality-evaluator.md index 526f897d04..a0d964ae34 100644 --- a/prompts/quality-evaluator.md +++ b/prompts/quality-evaluator.md @@ -204,7 +204,7 @@ If found: `auto_reject: "AR-08"`, score = 0, stop evaluation. | SC-01 | Plot Type | 5 | Correct chart type? | | SC-02 | Required Features | 4 | All spec features present? | | SC-03 | Data Mapping | 3 | X/Y correctly assigned? All data visible? | -| SC-04 | Title & Legend | 3 | `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R})? Legend labels correct? | +| SC-04 | Title & Legend | 3 | Title is `{spec-id} · {Language} · {library} · anyplot.ai`, optionally prefixed with `{Descriptive Title} · ` (Language ∈ {Python, R}). Legend labels correct? | ### Step 4: Data Quality (15 pts) diff --git a/prompts/workflow-prompts/ai-quality-review.md b/prompts/workflow-prompts/ai-quality-review.md index f42e27b60d..e5e0d3e066 100644 --- a/prompts/workflow-prompts/ai-quality-review.md +++ b/prompts/workflow-prompts/ai-quality-review.md @@ -107,7 +107,7 @@ Read `prompts/quality-criteria.md` and evaluate: | SC-01 | Plot Type | 5 | Correct chart type? | | SC-02 | Required Features | 4 | All features from spec? | | SC-03 | Data Mapping | 3 | X/Y correct? Axes show all data? | -| SC-04 | Title & Legend | 3 | `{spec-id} · {Language} · {library} · anyplot.ai` (Language ∈ {Python, R})? Legend labels match? | +| SC-04 | Title & Legend | 3 | Title is `{spec-id} · {Language} · {library} · anyplot.ai`, optionally prefixed with `{Descriptive Title} · ` (Language ∈ {Python, R}). Legend labels match? | #### Data Quality (15 pts) | ID | Criterion | Max | Check |