.md file to compare - side-by-side diff against snappy-chart
snappy-chart
What it does for you
Turns your data into a clear chart.
What it produces
A recent result, so you can see the kind of work it returns.
loading…
How to get it
These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.
For developers how this skill is built, graded, and how it runs
at a glance- the short version
what's inside - the parts that make up a skill 3/4 present
A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.
state/skills/snappy-chart/SKILL.md
present
state/skills/snappy-chart/api.ts
present
state/bin/snappy-chart/
not present
state/skills/snappy-chart/AGENTS.md
present
how it runs - the shared frame every skill uses 5/5 present
Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.
state/log/evals.ndjson what it has learned - fixes written back in over time sample
When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.
- Loading feedback rows…
how the work flows- who makes it, who checks it
what this step does
SKILL.md- the skill, written out in plain English
snappy-chart
The chart skill - purpose TBD.
One paragraph: what this skill does, why it exists, and what failure mode it prevents. If you can't name a failure mode, the skill probably doesn't need to exist - leave it out. Replace this paragraph as soon as the first agent runs the skill and discovers the real shape.
Observed user requests
These are the prompts that triggered this skill being scaffolded:
- "make that chart better with trend arrows for each skill"
- "now make that chart better - show it as a grouped bar chart with trend arrows for each skill"
- "show me a bar chart with three data points: A=10, B=25, C=15"
The Steps section below is a first-draft response to this cluster - refine as eval scores accumulate.
Steps
1. Parse request
Extract the data and chart type from the prompt. Support bar, line, area, pie, and radar charts. Normalize data shape to {labels, datasets}.
2. Compose OpenUI Lang
Emit a [[TOOL:Lang]]...[[/TOOL]] block containing OpenUI primitive chart composition (BarChart, LineChart, PieChart, etc. from the genui-library).
3. Render in cockpit
The chart appears inline in snappy-chat as a generative-UI card via the Lang renderer in dispatch-card.tsx.
4. Score
score("snappy-chart", run_id, {
score: valid_chart ? 1.0 : 0.0,
primary_issue: valid_chart ? null : "invalid-data-shape",
});
Eval
Actor: the thing that produces the output (a dispatch model, a CLI, or the state/lib/snappy-chart.ts library if one exists). Auditor: the thing that judges (must be different - see CONSTITUTION invariant #3). Name both explicitly.
Score convention:
| Outcome | Score |
|---|---|
| Pass on first try | 1.0 |
| Failed first, auto-fix applied, re-check passed | 0.5 |
| Still failing or unrecoverable | 0.0 |
If you cannot name a deterministic auditor, switch the frontmatter to eval: manual and log to state/log/pending-eval.ndjson - but fight to avoid manual. Manual is the escape hatch that leaks the thesis.
Gotchas
- List concrete failure modes you hit while building. Examples: "API
returns 200 with empty body"; "round-tripped text has a , artifact where em-dashes used to be"; "cache file is stale after 12h."
- If a gotcha matches an entry in user memory (see
~/.claude/CLAUDE.md),
cite the memory name so future agents can follow the trail.
AGENTS.md- what the AI loads when this skill comes up
snappy-chart - loader
Per-turn rules for snappy-chart. Full reference: state/skills/snappy-chart/SKILL.md.
Critical Rules
- Compose via OpenUI Lang, not raw components. Emit
[[TOOL:Lang]]...[[/TOOL]]containing BarChart/LineChart/AreaChart/PieChart/RadarChart from the genui-library. No custom TSX. - Data normalization required. Normalize input to
{labels: string[], datasets: [{label, data: number[]}]}before composing. Reject malformed data with score 0.0. - Trend arrows via annotation layer. If user requests trend arrows, use a Stack wrapper around chart primitive with Tag elements per datapoint showing delta vs prior value.
- Scope-only by default (apply:false). Render preview in chat; no writes unless explicitly confirmed.
- Eval row mandatory. After run:
score("snappy-chart", run_id, { score: valid_chart ? 1.0 : 0.0 }).
Commands
| ui dashboard | state/skills/snappy-chart/resources/ui.openui |
| operation | command | |
|---|---|---|
| list chart primitives | `grep -oE '"[A-Z][a-zA-Z]+Chart[^"]*"' web/node_modules/@openuidev/react-ui/dist/genui-lib/openuiChatLibrary.js \ | sort -u` |
| verify chart renders | `curl -s -XPOST 127.0.0.1:3147/dispatch/chat -d '{"intent":"show a bar chart A=10 B=25 C=15"}' \ | grep toolCallName` |
| eval log | state/log/evals.ndjson (skill: snappy-chart) | |
| writeback | state/log/loader-feedback.log |
Self-Test
An agent reading this should correctly:
- [ ] Compose charts via OpenUI Lang markers, not raw TSX?
- [ ] Normalize data to labels/datasets shape before composing?
- [ ] Write eval row with score 1.0 for valid charts?
- [ ] Use Tag elements for trend arrows rather than custom SVG?
Self-correcting loader (PID feedback)
Before exit: edit this file if any gap found, then log:
echo "[$(date -u +%FT%TZ)] snappy-chart: <what was missing or fixed> [FIXED|LOGGED] action_kind=<kind>" >> state/log/loader-feedback.log
OpenUI Resource
- Skill-owned OpenUI Lang resource:
state/skills/snappy-chart/resources/ui.openui. Read it before rendering or editing this skill's generated component surface. - Treat this resource as a first-class artifact of the skill, not a generic chat response. Improve it when the skill's user-facing output needs to become richer.
- System resources compose OpenUI primitives and inherit SnappyChat tokens. Use
ui_contract: brandedin SKILL.md only for deliberate platform or client visuals.
api.ts- the code it can call
#!/usr/bin/env npx tsx
/**
* state/skills/snappy-chart/api.ts — sidecar stub for the snappy-chart skill.
*
* This file is created by the scaffolder so a fresh skill folder is
* structurally valid. Replace the placeholder with the real implementation
* the moment the skill needs executable logic, OR move the implementation
* to `state/lib/snappy-chart.ts` (preferred — the lib path is what
* `eval: shape` validates against).
*
* If this skill has no backing code (prose-only slash command), delete this
* file and rely on `eval: auto-shape` in SKILL.md.
*/
export const SKILL_NAME = "snappy-chart" as const;
export function describe(): string {
return "The chart skill — purpose TBD.";
}
if ((() => { try { return import.meta.url === `file://${process.argv[1]}`; } catch { return false; } })()) {
console.log(JSON.stringify({ skill: SKILL_NAME, describe: describe() }, null, 2));
}
scripts- helper scripts it can run
prose-only skill - 1 inline code block live in SKILL.md above (no state/bin/ sidecar yet).
how we check it- the checks, plus the last 10 runs
no recent runs logged - the eval contract is declared but nothing has been graded yet