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
update(area-basic): refine spec optimization and update phases
- Renamed Phase 2 to "Spec Optimization" and added detailed steps for spec analysis.
- Updated Phase 3 to Phase 4 and adjusted task descriptions for clarity.
- Revised Phase 5 to Phase 6 and clarified the shipping process.
- Introduced Phase 7 for monitoring PRs and handling rejections.
- Enhanced documentation for library agent prompts and context handling.
`prompts/templates/specification.md`, `prompts/templates/specification.yaml`, and `prompts/spec-tags-generator.md`.
62
+
63
+
2.**Analyse the spec** against these dimensions:
64
+
65
+
| Dimension | What to check |
66
+
|-----------|---------------|
67
+
|**Wording**| Description clear and concise? Applications realistic? Data fields include types and sizes? Notes actionable? |
68
+
|**Missing sections**| All sections from `prompts/templates/specification.md` present? |
69
+
|**Tag completeness**| All 4 tag dimensions (`plot_type`, `data_type`, `domain`, `features`) have at least 1 value? |
70
+
|**Tag quality**| Naming conventions (lowercase, hyphens)? Values from recommended vocabulary in `prompts/spec-tags-generator.md`? Missing obvious tags? |
71
+
|**Tag accuracy**| Do existing tags actually match the spec content? |
72
+
73
+
3.**Present numbered suggestions** to the user (e.g., "1. Add `time-series` to data_type tags", "2. Clarify data size in Data section").
74
+
If the spec looks good, say so and move on.
75
+
76
+
4.**User responds** with one of:
77
+
-`all` — apply all suggestions
78
+
-`1,3` — apply only listed suggestions
79
+
-`none` or `skip` — skip spec optimization, proceed as-is
80
+
- Custom feedback — apply the user's specific instructions
81
+
82
+
5.**Apply accepted changes** to `specification.md` and/or `specification.yaml`, then proceed to Phase 3.
83
+
84
+
---
85
+
86
+
### Phase 3: Create Team & Spawn Agents
57
87
58
88
1.**Create team**: `TeamCreate` with name `update-{spec_id}`
59
89
@@ -63,10 +93,36 @@ Parse `$ARGUMENTS` using this format:
63
93
64
94
3.**Spawn one `general-purpose` opus agent per library** via `Task` tool with:
65
95
-`team_name`: `update-{spec_id}`
66
-
-`name`: `{library}-updater`
96
+
-`name`: `{library}`
67
97
-`subagent_type`: `general-purpose`
68
98
-`model`: `opus`
69
-
- The **library-updater prompt** (see below), with `{SPEC_ID}`, `{LIBRARY}`, and `{DESCRIPTION}` filled in
99
+
- The **library agent prompt** (see below), with `{SPEC_ID}`, `{LIBRARY}`, `{DESCRIPTION}`, `{CONTEXT7_LIBRARY}`,
100
+
`{PLOT_TYPE}`, and `{SPEC_TITLE}` filled in
101
+
102
+
**Template variable reference** (lead must fill these):
103
+
104
+
| Variable | Source |
105
+
|----------|--------|
106
+
|`{SPEC_ID}`| From Phase 1 parse |
107
+
|`{LIBRARY}`| Current library name |
108
+
|`{DESCRIPTION}`| User's description |
109
+
|`{CONTEXT7_LIBRARY}`| Mapped library name for Context7 (see mapping below) |
110
+
|`{PLOT_TYPE}`| Primary `plot_type` tag from `specification.yaml`|
111
+
|`{SPEC_TITLE}`| Title from `specification.md`|
112
+
113
+
**Context7 library name mapping:**
114
+
115
+
| Library | Context7 name |
116
+
|---------|---------------|
117
+
|`matplotlib`|`matplotlib`|
118
+
|`seaborn`|`seaborn`|
119
+
|`plotly`|`plotly`|
120
+
|`bokeh`|`bokeh`|
121
+
|`altair`|`altair`|
122
+
|`plotnine`|`plotnine`|
123
+
|`pygal`|`pygal`|
124
+
|`highcharts`|`highcharts-core`|
125
+
|`letsplot`|`lets-plot`|
70
126
71
127
4.**Assign tasks** to the corresponding agents via `TaskUpdate`
72
128
@@ -75,7 +131,7 @@ their designated directories (see file containment rules in the agent prompt).
75
131
76
132
---
77
133
78
-
### Phase 3: Collect & Present
134
+
### Phase 4: Collect & Present
79
135
80
136
Agents report back via `SendMessage` (auto-delivered to you). Agents may report either **completed work** (`STATUS: done`) or **a conflict** (`STATUS: conflict`). Once all agents have reported:
81
137
@@ -132,25 +188,25 @@ Agents report back via `SendMessage` (auto-delivered to you). Agents may report
132
188
133
189
---
134
190
135
-
### Phase 4: Iterate
191
+
### Phase 5: Iterate
136
192
137
193
For per-library feedback:
138
194
139
-
1. Send the feedback to the specific idle teammate via `SendMessage` (e.g., to `seaborn-updater`). This wakes them up.
140
-
2. The agent runs its conflict check again (Step 2) on the new feedback. If it detects a conflict, it reports back with `STATUS: conflict` instead of making changes — handle as in Phase 3.
195
+
1. Send the feedback to the specific idle teammate via `SendMessage` (e.g., to `seaborn`). This wakes them up.
196
+
2. The agent runs its conflict check again (Step 2) on the new feedback. If it detects a conflict, it reports back with `STATUS: conflict` instead of making changes — handle as in Phase 4.
141
197
3. If no conflict, the agent re-modifies, re-generates, reports back, and goes idle again.
142
198
4. Present updated results to the user.
143
199
5. Repeat until the user approves.
144
200
145
201
---
146
202
147
-
### Phase 5: Ship
203
+
### Phase 6: Ship
148
204
149
205
**Only proceed when the user explicitly approves shipping.**
150
206
151
207
The lead handles all shipping directly (no delegation to teammates):
152
208
153
-
#### 5a. Code Quality
209
+
#### 6a. Code Quality
154
210
155
211
Run ruff format and check **sequentially first**, before any parallel version-info commands.
156
212
If parallel Bash calls are used and one fails, all sibling calls get cancelled — so always run ruff alone.
@@ -163,7 +219,7 @@ uv run ruff check --fix plots/{spec_id}/implementations/*.py
163
219
If there are unfixable errors, fix them manually and re-run. The agents should have already run ruff in their
164
220
lint step, but this is a safety net.
165
221
166
-
#### 5b. Update Metadata YAML
222
+
#### 6b. Update Metadata YAML
167
223
168
224
For each updated library, edit `plots/{spec_id}/metadata/{library}.yaml`:
169
225
@@ -190,7 +246,7 @@ For each updated library, edit `plots/{spec_id}/metadata/{library}.yaml`:
190
246
| highcharts |`highcharts-core`|
191
247
| letsplot |`lets-plot`|
192
248
193
-
#### 5c. Update Implementation Header
249
+
#### 6c. Update Implementation Header
194
250
195
251
For each updated library, ensure the implementation file starts with:
- Call `resolve-library-id` with `libraryName: "{CONTEXT7_LIBRARY}"` and `query: "how to create {PLOT_TYPE} chart with {CONTEXT7_LIBRARY}"`
575
+
- Call `query-docs` with the resolved library ID and `query: "idiomatic patterns for creating {SPEC_TITLE} ({PLOT_TYPE}) with {CONTEXT7_LIBRARY}, including best practices for styling and layout"`
576
+
- Use the returned documentation **together with** (not instead of) the static library rules from step 4
399
577
400
578
If `preview_url` exists in the metadata, view the current preview image to understand what the plot currently looks
4.**Spec Compliance** — Point-by-point check against `specification.md`
456
634
5.**Library Feature Usage** (LF-01) — Does the code leverage distinctive library strengths? Basic usage is not enough
457
635
6.**Code Transferability** — Can a user easily adapt this to their own data? Clear separation of data vs. plot logic? Meaningful variable names?
636
+
-**Respect the spec variant:** If the spec-id contains `basic`, the plot must stay basic. Do NOT add annotations, trendlines, regression lines, callout boxes, or other embellishments. Basic means clean and simple — storytelling comes from well-chosen data and visual clarity, not added elements.
458
637
-**No changes for the sake of changes:** If you find nothing meaningful to improve, report "no improvements needed" and leave the code unchanged. Do not make cosmetic or unnecessary changes just to show activity.
459
638
460
639
If the specification genuinely needs changes to improve the result, edit `plots/{SPEC_ID}/specification.md` and
- Consider adding annotations to highlight key data points or trends
366
365
- Use visual emphasis (color, size) to guide the viewer's eye
367
-
- Tell a story, don't just display data
366
+
- Tell a story through good data choice and clear visual hierarchy
367
+
-**Respect the spec variant:** If the spec-id contains `basic`, storytelling comes from well-chosen data and clean design — NOT from adding annotations, trendlines, or extra visual elements. A basic scatter plot should remain a basic scatter plot.
0 commit comments