Compositional Layout Visualization Lens
Philosophical Mode: Compositional
Primary Question: "Which layout — small multiples vs overlay — best reveals the comparison?"
Focus: Small Multiples vs Overlay, Faceting Strategy (row/col), Shared-Axis Alignment,
Grouped vs Stacked Bars, Factorial Interaction Plots, Panel Reading Order
Arguments
/autoskillit:vis-lens-multi-compare [context_path] [experiment_plan_path]
- context_path (optional positional arg 1) — Absolute path to a lens context file
containing IV/DV tables, H0/H1 hypotheses, controlled variables, and success criteria.
If provided, read this file before beginning analysis to obtain structured context.
If omitted, discover context by exploring the CWD.
- experiment_plan_path (optional positional arg 2) — Absolute path to the full
experiment plan. If provided, read for complete experimental methodology and design.
If omitted, locate the experiment plan by exploring the CWD.
When to Use
- Designing layouts for experiments with multiple conditions, factors, or treatments
- Deciding whether to use small multiples or overlapping traces in a figure
- Planning faceted grids for factorial designs (2+ independent variables × 2+ levels)
- Evaluating whether grouped or stacked bars serve the comparison goal
- User invokes
/autoskillit:vis-lens-multi-compare
Critical Constraints
NEVER:
- Modify any source code files
- Do not litter the codebase with useless comments, TODO markers, or explanatory annotations — the skill output and diagram speak for themselves
- Create files outside
{{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/
- Use overlapping traces when ≥ 4 conditions are compared — prefer small multiples
- Use stacked bars for comparisons where the baseline shifts — use grouped bars instead
ALWAYS:
Prefer small multiples over overlays when: num_conditions ≥ 5, OR data series overlap
heavily, OR the comparison requires individual-panel annotation
Apply consistent shared-axis limits across all panels in a small-multiples layout
Enforce left-to-right, top-to-bottom panel reading order matching the experimental
factor order (main factor changes columns; secondary factor changes rows)
BEFORE creating any diagram, LOAD the /autoskillit:mermaid skill using the Skill tool — this is MANDATORY
If the Skill tool cannot be used (disable-model-invocation) or refuses this invocation, do NOT proceed with diagram creation. Abort this step and omit the diagram from output.
Write output to {{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/vis_spec_multi_compare_{YYYY-MM-DD_HHMMSS}.md (relative to the current working directory)
After writing the file, emit the structured output token as literal plain text with no
markdown formatting on the token name (the adjudicator performs a regex match):
diagram_path = /absolute/path/to/{{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/vis_spec_multi_compare_{...}.md
Analysis Workflow
Step 0: Parse optional arguments
If positional arg 1 (context_path) is provided and the file exists, read it to obtain
IV/DV tables, H0/H1 hypotheses, controlled variables, and success criteria. If positional
arg 2 (experiment_plan_path) is provided and exists, read the experiment plan for full
methodology. Use this structured context as the foundation for Steps 1–4; skip the CWD
exploration for these fields if the context file supplies them.
Step 1: Inventory Conditions and Factors
Scan experiment plan, context file, and codebase for:
Condition and Factor Count
- Count num_DVs (dependent variables), num_conditions (levels per factor), num_factors (IVs)
- Look for: condition lists, treatment arms,
conditions = [...], groups = [...], factor tables
Series Overlap
- Assess whether plotting all conditions on a single axes would create heavy visual overlap
- Look for: overlapping confidence bands, dense line clusters, label collisions
Factorial Structure
- Detect whether the design is factorial (2+ IVs × 2+ levels each)
- Look for: interaction terms, crossed factors,
factorial, grid_search
Step 2: Apply Small-Multiples vs Overlay Decision Rule
For each figure that shows multi-condition data, determine the layout strategy:
Overlay (single axes):
- ≤ 3 conditions, no label collision, primary message is aggregate trend
- Use when: the comparison is a single-axis trend, conditions are well-separated visually
Small Multiples (faceted grid):
- ≥ 4 conditions, OR heavy overlap, OR per-panel annotation needed
- OR factorial (2+ IVs × 2+ levels): always use small multiples
- Assign
row_factor and col_factor explicitly
Stacked vs Grouped Bars:
- Stacked bars: only when part-to-whole is the story AND baselines are shared
- Grouped bars: when individual comparison matters more than the total
Step 3: Assign Facet Layout
For small-multiples layouts:
- Assign
col_factor to the main independent variable (most levels or primary interest)
- Assign
row_factor to the secondary independent variable
- Set shared x-axis and y-axis limits across all panels
- Document reading order: left-to-right (col_factor levels), top-to-bottom (row_factor levels)
Step 4: Emit yaml:figure-spec Blocks
For each figure, emit one yaml:figure-spec fenced block with facet field populated.
Then LOAD /autoskillit:mermaid and create a panel-layout schematic diagram (boxes
representing panel grid with row/col labels).
Output Template
# Compositional Layout Spec: {System / Experiment Name}
**Lens:** Compositional Layout (Compositional)
**Question:** Which layout — small multiples vs overlay — best reveals the comparison?
**Date:** {YYYY-MM-DD}
**Scope:** {What was analyzed}
**num_conditions detected:** {N}
## Layout Decision Summary
| Figure | num_conditions | num_factors | Strategy | row_factor | col_factor |
|--------|---------------|-------------|----------|------------|------------|
| {fig-01} | 6 | 2 | small-multiples | method | dataset |
| {fig-02} | 3 | 1 | overlay | — | — |
## Figure Specs
```yaml
# yaml:figure-spec — canonical schema (spec_version: "1.0")
figure_id: "fig-01-factorial-accuracy"
figure_title: "Accuracy Across Methods × Datasets"
spec_version: "1.0"
chart_type: "line"
chart_type_fallback: "grouped-bar"
perceptual_justification: "Small multiples prevent overlap; shared y-axis enables cross-panel comparison."
data_source: "results/accuracy.csv"
data_mapping:
x: "epoch"
y: "accuracy"
color: "variant"
size: ""
facet: "col=dataset, row=method"
layout:
width_inches: 10.0
height_inches: 6.0
dpi: 300
stat_overlay:
type: "error_bar"
measure: "CI95"
n_seeds: 5
annotations: ["shared y-axis; panel grid: 3 cols × 2 rows"]
anti_patterns: ["ap-overplotting"]
palette: "okabe-ito"
format: "pdf"
target_dpi: 300
library: "matplotlib"
report_section: "Section 4 Results"
priority: "P1"
placement_tier: "main"
conflicts: []
metadata:
created_by: "vis-lens-multi-compare"
reviewed_by: ""
last_updated: "{YYYY-MM-DD}"
Compositional Layout Diagram
%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%
flowchart TB
%% CLASS DEFINITIONS %%
classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;
classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;
classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;
subgraph Conditions ["CONDITION COUNT"]
C1["num_conditions = {N}<br/>━━━━━━━━━━<br/>{factorial: yes/no}"]
end
subgraph Strategy ["LAYOUT STRATEGY"]
S1["overlay / small-multiples<br/>━━━━━━━━━━<br/>{decision rule applied}"]
end
subgraph Facet ["FACET ASSIGNMENT"]
F1["col_factor = {X}<br/>row_factor = {Y}<br/>━━━━━━━━━━<br/>shared axes: yes/no"]
end
subgraph Verdict ["VERDICT"]
V1["{layout type}<br/>━━━━━━━━━━<br/>{reading order note}"]
end
C1 --> S1
S1 --> F1
F1 --> V1
class C1 stateNode;
class S1 cli;
class F1 handler;
class V1 output;
Color Legend:
| Color |
Category |
Description |
| Dark Teal |
Condition Count |
Number of conditions and factorial structure |
| Dark Blue |
Strategy |
Overlay vs small-multiples decision |
| Orange |
Facet Assignment |
Row/col factor and shared-axis configuration |
| Teal |
Verdict |
Final layout recommendation |
---
## Pre-Diagram Checklist
Before creating the diagram, verify:
- [ ] LOADED `/autoskillit:mermaid` skill using the Skill tool
- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)
- [ ] Diagram will include a color legend table
- [ ] Every figure with ≥ 4 conditions has been assigned a small-multiples layout
- [ ] Every `yaml:figure-spec` has the `facet` field filled (or explicitly empty for overlays)
1---2name: vis-lens-multi-compare3description: Create Compositional Layout visualization planning spec showing small-multiples vs overlay decisions, faceting strategy (row/col), shared-axis alignment, grouped vs stacked bars, factorial interaction plots, and panel reading order. Compositional lens answering "Which layout best reveals the comparison structure?"4---56# Compositional Layout Visualization Lens78**Philosophical Mode:** Compositional9**Primary Question:** "Which layout — small multiples vs overlay — best reveals the comparison?"10**Focus:** Small Multiples vs Overlay, Faceting Strategy (row/col), Shared-Axis Alignment,11 Grouped vs Stacked Bars, Factorial Interaction Plots, Panel Reading Order1213## Arguments1415`/autoskillit:vis-lens-multi-compare [context_path] [experiment_plan_path]`1617- **context_path** (optional positional arg 1) — Absolute path to a lens context file18 containing IV/DV tables, H0/H1 hypotheses, controlled variables, and success criteria.19 If provided, read this file before beginning analysis to obtain structured context.20 If omitted, discover context by exploring the CWD.21- **experiment_plan_path** (optional positional arg 2) — Absolute path to the full22 experiment plan. If provided, read for complete experimental methodology and design.23 If omitted, locate the experiment plan by exploring the CWD.2425## When to Use2627- Designing layouts for experiments with multiple conditions, factors, or treatments28- Deciding whether to use small multiples or overlapping traces in a figure29- Planning faceted grids for factorial designs (2+ independent variables × 2+ levels)30- Evaluating whether grouped or stacked bars serve the comparison goal31- User invokes `/autoskillit:vis-lens-multi-compare`3233## Critical Constraints3435**NEVER:**36- Modify any source code files37- Do not litter the codebase with useless comments, TODO markers, or explanatory annotations — the skill output and diagram speak for themselves38- Create files outside `{{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/`39- Use overlapping traces when ≥ 4 conditions are compared — prefer small multiples40- Use stacked bars for comparisons where the baseline shifts — use grouped bars instead4142**ALWAYS:**43- Prefer small multiples over overlays when: num_conditions ≥ 5, OR data series overlap44 heavily, OR the comparison requires individual-panel annotation45- Apply consistent shared-axis limits across all panels in a small-multiples layout46- Enforce left-to-right, top-to-bottom panel reading order matching the experimental47 factor order (main factor changes columns; secondary factor changes rows)48- BEFORE creating any diagram, LOAD the `/autoskillit:mermaid` skill using the Skill tool — this is MANDATORY49- If the Skill tool cannot be used (disable-model-invocation) or refuses this invocation, do NOT proceed with diagram creation. Abort this step and omit the diagram from output.50- Write output to `{{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/vis_spec_multi_compare_{YYYY-MM-DD_HHMMSS}.md` (relative to the current working directory)51- After writing the file, emit the structured output token as **literal plain text** with no52 markdown formatting on the token name (the adjudicator performs a regex match):5354 ```55 diagram_path = /absolute/path/to/{{AUTOSKILLIT_TEMP}}/vis-lens-multi-compare/vis_spec_multi_compare_{...}.md56 ```5758---5960## Analysis Workflow6162### Step 0: Parse optional arguments6364If positional arg 1 (context_path) is provided and the file exists, read it to obtain65IV/DV tables, H0/H1 hypotheses, controlled variables, and success criteria. If positional66arg 2 (experiment_plan_path) is provided and exists, read the experiment plan for full67methodology. Use this structured context as the foundation for Steps 1–4; skip the CWD68exploration for these fields if the context file supplies them.6970### Step 1: Inventory Conditions and Factors7172Scan experiment plan, context file, and codebase for:7374**Condition and Factor Count**75- Count num_DVs (dependent variables), num_conditions (levels per factor), num_factors (IVs)76- Look for: condition lists, treatment arms, `conditions = [...]`, `groups = [...]`, factor tables7778**Series Overlap**79- Assess whether plotting all conditions on a single axes would create heavy visual overlap80- Look for: overlapping confidence bands, dense line clusters, label collisions8182**Factorial Structure**83- Detect whether the design is factorial (2+ IVs × 2+ levels each)84- Look for: interaction terms, crossed factors, `factorial`, `grid_search`8586### Step 2: Apply Small-Multiples vs Overlay Decision Rule8788For each figure that shows multi-condition data, determine the layout strategy:8990**Overlay (single axes):**91- ≤ 3 conditions, no label collision, primary message is aggregate trend92- Use when: the comparison is a single-axis trend, conditions are well-separated visually9394**Small Multiples (faceted grid):**95- ≥ 4 conditions, OR heavy overlap, OR per-panel annotation needed96- OR factorial (2+ IVs × 2+ levels): always use small multiples97- Assign `row_factor` and `col_factor` explicitly9899**Stacked vs Grouped Bars:**100- Stacked bars: only when part-to-whole is the story AND baselines are shared101- Grouped bars: when individual comparison matters more than the total102103### Step 3: Assign Facet Layout104105For small-multiples layouts:106- Assign `col_factor` to the main independent variable (most levels or primary interest)107- Assign `row_factor` to the secondary independent variable108- Set shared x-axis and y-axis limits across all panels109- Document reading order: left-to-right (col_factor levels), top-to-bottom (row_factor levels)110111### Step 4: Emit yaml:figure-spec Blocks112113For each figure, emit one `yaml:figure-spec` fenced block with `facet` field populated.114Then LOAD `/autoskillit:mermaid` and create a panel-layout schematic diagram (boxes115representing panel grid with row/col labels).116117---118119## Output Template120121```markdown122# Compositional Layout Spec: {System / Experiment Name}123124**Lens:** Compositional Layout (Compositional)125**Question:** Which layout — small multiples vs overlay — best reveals the comparison?126**Date:** {YYYY-MM-DD}127**Scope:** {What was analyzed}128**num_conditions detected:** {N}129130## Layout Decision Summary131132| Figure | num_conditions | num_factors | Strategy | row_factor | col_factor |133|--------|---------------|-------------|----------|------------|------------|134| {fig-01} | 6 | 2 | small-multiples | method | dataset |135| {fig-02} | 3 | 1 | overlay | — | — |136137## Figure Specs138139```yaml140# yaml:figure-spec — canonical schema (spec_version: "1.0")141figure_id: "fig-01-factorial-accuracy"142figure_title: "Accuracy Across Methods × Datasets"143spec_version: "1.0"144chart_type: "line"145chart_type_fallback: "grouped-bar"146perceptual_justification: "Small multiples prevent overlap; shared y-axis enables cross-panel comparison."147data_source: "results/accuracy.csv"148data_mapping:149 x: "epoch"150 y: "accuracy"151 color: "variant"152 size: ""153 facet: "col=dataset, row=method"154layout:155 width_inches: 10.0156 height_inches: 6.0157 dpi: 300158stat_overlay:159 type: "error_bar"160 measure: "CI95"161 n_seeds: 5162annotations: ["shared y-axis; panel grid: 3 cols × 2 rows"]163anti_patterns: ["ap-overplotting"]164palette: "okabe-ito"165format: "pdf"166target_dpi: 300167library: "matplotlib"168report_section: "Section 4 Results"169priority: "P1"170placement_tier: "main"171conflicts: []172metadata:173 created_by: "vis-lens-multi-compare"174 reviewed_by: ""175 last_updated: "{YYYY-MM-DD}"176```177178## Compositional Layout Diagram179180```mermaid181%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%182flowchart TB183 %% CLASS DEFINITIONS %%184 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;185 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;186 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;187 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;188 classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;189190 subgraph Conditions ["CONDITION COUNT"]191 C1["num_conditions = {N}<br/>━━━━━━━━━━<br/>{factorial: yes/no}"]192 end193194 subgraph Strategy ["LAYOUT STRATEGY"]195 S1["overlay / small-multiples<br/>━━━━━━━━━━<br/>{decision rule applied}"]196 end197198 subgraph Facet ["FACET ASSIGNMENT"]199 F1["col_factor = {X}<br/>row_factor = {Y}<br/>━━━━━━━━━━<br/>shared axes: yes/no"]200 end201202 subgraph Verdict ["VERDICT"]203 V1["{layout type}<br/>━━━━━━━━━━<br/>{reading order note}"]204 end205206 C1 --> S1207 S1 --> F1208 F1 --> V1209210 class C1 stateNode;211 class S1 cli;212 class F1 handler;213 class V1 output;214```215216**Color Legend:**217| Color | Category | Description |218|-------|----------|-------------|219| Dark Teal | Condition Count | Number of conditions and factorial structure |220| Dark Blue | Strategy | Overlay vs small-multiples decision |221| Orange | Facet Assignment | Row/col factor and shared-axis configuration |222| Teal | Verdict | Final layout recommendation |223```224225---226227## Pre-Diagram Checklist228229Before creating the diagram, verify:230231- [ ] LOADED `/autoskillit:mermaid` skill using the Skill tool232- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)233- [ ] Diagram will include a color legend table234- [ ] Every figure with ≥ 4 conditions has been assigned a small-multiples layout235- [ ] Every `yaml:figure-spec` has the `facet` field filled (or explicitly empty for overlays)