AGENT SKILL

pick

Recommends the right chart type for a dataset, with reasoning and pitfalls, drawing on a catalog of 174 visualization types. Use when the user has data and is deciding HOW to visualize it — "what chart should I use", "how should I visualize/plot/show this data", "best way to present these numbers", "which graph fits my data", "I have data and want to visualize it" — or asks what a chart type is or when to use it. Do NOT trigger when the chart type is already decided and they just want it built (use chartwise:build), when reviewing an existing chart or dashboard (use chartwise:critique), or when the question is purely about colors, styling, theming, or dashboard aesthetics for an already-chosen chart — that is visual design, not chart choice.

License 许可
MIT
最近更新
2026-09-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
pick
license
MIT
description
Recommends the right chart type for a dataset, with reasoning and pitfalls, drawing on a catalog of 174 visualization types. Use when the user has data and is deciding HOW to visualize it — "what chart should I use", "how should I visualize/plot/show this data", "best way to present these numbers", "which graph fits my data", "I have data and want to visualize it" — or asks what a chart type is or when to use it. Do NOT trigger when the chart type is already decided and they just want it built (use chartwise:build), when reviewing an existing chart or dashboard (use chartwise:critique), or when the question is purely about colors, styling, theming, or dashboard aesthetics for an already-chosen chart — that is visual design, not chart choice.

03 SKILL.md 正文

chartwise:pick — choose the right chart

Recommend from the catalog, never from memory alone: the references contain 174 chart types, 6 decision trees, and 37 pitfall rules — a recommendation that skips them wastes the plugin. Principles:

  • Message before chart. The reader's takeaway (compare / spread / relationship / evolution / composition / location / flow) drives the choice more than the data types do.
  • Always name at least one pitfall with the recommendation, by its caveat name, in plain language.
  • Never read a whole reference file into context. Grep for the section or entry, then Read ~20–70 lines at the matched offset. Recipes below.

All paths are under ${CLAUDE_PLUGIN_ROOT}/references/. Do every lookup with the built-in Grep tool (line numbers on) followed by Read at the matched offset — no shell involved, no permission prompts. Shell equivalents live in the fallback appendix at the end; use them only when the Grep tool is unavailable.

Step 1 — Establish the data shape (adaptive)

Inspect before asking. If a file, dataframe, table, query result, or pasted data is available in the conversation or project, examine it first:

  • columns and their types (numeric / categorical / datetime / geo)
  • cardinality of each categorical (2 groups? 40?)
  • row count (10 rows and 100,000 rows get different answers)
  • one observation per group, or several?
  • any inherent order (time, stages, age bands)?

Then ask ONLY what inspection could not settle, in one AskUserQuestion round. Typical unresolved questions:

  1. The message: what should the reader conclude? (comparison, distribution, relationship, evolution, part-to-whole, location, flow)
  2. Ordering/nesting you cannot infer: is this sequence meaningful? do these categories nest?
  3. Audience/medium when it changes the answer: expert exploration vs a general audience; static report vs interactive page.

With no data at hand at all, ask for shape + message together in one round.

Step 2 — Read the plugin config

Read ~/.config/alsheddi-claude-marketplace/chartwise/config.env with the Read tool. The file is tiny and may not exist — absence means defaults: EXOTIC_CHARTS=on, RECOMMENDATION_DETAIL=full, PREFERRED_LIBRARY=auto. EXOTIC_CHARTS=off means: do not propose tier:exotic types unless the user asks for unusual options. RECOMMENDATION_DETAIL=brief means: top pick + one alternative, compressed reasoning.

These settings are changed with the /chartwise:config command — point the user there if they want different behavior.

Step 3 — Route through the decision tree

Grep for pattern ^## tree-|^## router in ${CLAUDE_PLUGIN_ROOT}/references/decision-trees.md (line numbers on), then Read the router plus the ONE matching tree section at its offset. Walk it with the answers from Step 1 to a leaf — a ranked list of catalog slugs.

Step 4 — Pull the candidate entries

For each of the top 2–4 leaf slugs, two Grep steps:

  1. Grep for ^<slug> \| in references/INDEX.md — the row names the shard file.
  2. Grep for \{#<slug>\} in references/catalog/<shard> (line numbers), then Read ~20 lines at that offset.

For every caveat the entries list: Grep for \{#cv-<slug>\} in references/caveats.md and Read ~12 lines at the offset. If the user's context suggests extra risk (huge n, many groups, geographic bias), also Grep applies-to:.*<slug> in caveats.md and read whatever it turns up.

Step 5 — Recommend

Present (respecting RECOMMENDATION_DETAIL):

  1. Primary pick — why it fits THIS data shape and THIS message, in 2–3 sentences grounded in the entry's when: reasoning.
  2. What to watch out for — the relevant caveats by name, translated to this dataset ("with 12 groups this will spaghetti — highlight one line").
  3. 1–2 alternatives and the condition under which each wins.
  4. When apt and EXOTIC_CHARTS=on, one exotic-tier option flagged as such.

If the user asked "what is a <chart>?" rather than "what should I use?", resolve that one entry via Step 4 and answer from it directly — skip the interview.

Step 6 — Hand off

Offer to build the recommended chart. If accepted, follow the chartwise:build skill (invoke it by name) — it owns stack detection, encoding, and generation. Do not silently generate here.

Reference map

Question File Recipe
Which chart for this shape? decision-trees.md grep ^## tree-, read one section
What is chart X / when to use it INDEX.md → catalog/<shard>.md grep slug, read entry
Candidates by goal INDEX.md grep "fn:.*<function>"
Only mainstream options INDEX.md grep "tier:everyday|tier:common"
Pitfalls of chart X caveats.md grep "applies-to:.*<slug>"
Which library later libraries.md read (short file)

Shell fallback

Only if the Grep tool is unavailable, the same lookups as shell commands:

grep -n "^## tree-\|^## router" ${CLAUDE_PLUGIN_ROOT}/references/decision-trees.md
grep "^<slug> |" ${CLAUDE_PLUGIN_ROOT}/references/INDEX.md
grep -n "{#<slug>}" ${CLAUDE_PLUGIN_ROOT}/references/catalog/<shard>
grep -n "{#cv-<slug>}\|applies-to:.*<slug>" ${CLAUDE_PLUGIN_ROOT}/references/caveats.md

04 同仓库更多 Skills