iChart.js
Use the public Agent contract as the source of truth. Do not infer capabilities from renderer internals or duplicate chart-selection logic in generated code.
Read the usage scenarios when the request is ambiguous about whether the output should be a live project component, a Coding Agent change, a Skill-generated artifact, or a scheduled report.
Source and Runtime Setup
- Official repository:
https://github.com/wanghetommy/ichartjs
- Official Skill source:
https://github.com/wanghetommy/ichartjs/tree/master/skills/ichartjs
- Supported Skill hosts include Codex, WorkBuddy, and other Agent Skills-compatible environments.
Recommended installation:
npx skills add wanghetommy/ichartjs --skill ichartjs
Use --agent codex --global --yes for global non-interactive Codex installation. Use the tagged directory https://github.com/wanghetommy/ichartjs/tree/v2.0.11/skills/ichartjs when reproducibility matters. WorkBuddy can import the same directory through its Skill interface; do not assume a --agent workbuddy adapter unless the installed CLI declares it.
The Skill is a workflow adapter, not the chart runtime. If the current JavaScript or TypeScript project does not already depend on iChart.js, install the matching runtime from GitHub:
npm install @taylorwong/ichartjs@^2
Do not install the unscoped npm registry package named ichartjs; it is currently a security holding package and is not this project.
Workflow
- Locate the package or repository root. Read
docs/agent/quickstart.md when available.
- Call
getCapabilities() before selecting a chart or interaction.
- Call
inspectData() and preserve stable record IDs.
- Discover
getCapabilities().intents; map natural-language requests to an exact registered token before calling planChart(data, { intent, renderer, context }).
- Inspect the complete planning result, including
styleRecommendation, warnings, and fallback status.
- Stop when
requiredFields is non-empty; request data or explain a supported alternative.
- Build a JSON-serializable Spec using
suggestedEncodings, the selected capability, and an applicable recipe.
- Use chart-specific channels: Cartesian
x/y, Pie/Funnel category/value, Gauge value, Heatmap x/y/color, and Radar indicators[].field. To load a recipe, use import catalog from '@taylorwong/ichartjs/recipes/minimal-specs' with { type: 'json' } and select catalog.examples[type].
- Keep titles/formats under
xAxis/yAxis, labels under labels, and legend under legend; do not place them inside encoding.
- Call
validateSpec() before rendering. Repair UNSUPPORTED_ENCODING_CHANNEL, MISSING_ENCODING_FIELD, MISSING_GAUGE_DOMAIN, UNKNOWN_INTENT, misplaced-option, and unsupported-axis warnings before presenting the chart.
- Call
createChart() only after validation succeeds. Gauge Specs must declare a meaningful domain.
- Self-check with
chart.explain(), chart.getState(), health.renderable, and JSON export. Treat VALUE_CLAMPED, LABELS_SUPPRESSED, NEGATIVE_VALUE_DROPPED, and ZERO_TOTAL as material diagnostics to report.
- Provide an exact preview URL or artifact path and report assumptions, warnings, and deferred checks.
- Prefer
theme: { mode: 'auto', preset, palette }; preserve explicit user style choices and use chart.setTheme() for live switching.
- For post-creation visual changes, call
getPreferenceCapabilities(chartType, { locale }), validate the patch with validatePreferences(), apply it with chart.setPreferences(..., { source: 'agent' }), and verify chart.getState().preferences.
Use @taylorwong/ichartjs for package imports. Use examples/agent-workflow.mjs as the executable baseline when working in the repository.
Task Routing
Route by requested output:
Live product component: modify the host JavaScript project and mount createChart(); return changed files and the host preview URL.
Coding Agent change: inspect the repository, use the Runtime, run focused checks, and return the validated Spec plus changed files.
One-off artifact: generate SVG/JSON directly; use browser PNG export or exportAsync() with optional canvas for Node PNG/JPEG.
Project or Diagram workflow: load the matching scenario guide and preserve all stable IDs.
CI/report output: keep JSON as the reproducible checkpoint and SVG/PNG as presentation artifacts.
For standard data analysis, read references/chart-selection.md and use foundational recipes.
For Gantt, Timeline, Milestone, Burndown, capacity, release, risk, or aging, use project capabilities and agent-recipes/project-management.json.
For Flow or Swimlane, preserve node, edge, lane, group, and port IDs; use diagram recipes and validated edit commands.
For business edits, preview first, preserve the preview ID and revision, require confirmation when declared, then commit or reject atomically.
For browser deliverables, start npm run playground and return the exact maintained Playground URL.
Release workflow (npm publish + develop→master merge) is AUTHOR ONLY. Read the release SOP. Never initiate any release step unless the author explicitly instructs.
Guardrails
- Never invent fields, units, dates, dependencies, calendar rules, domains, or forecast confidence.
- Never silently drop validation errors, warnings, assumptions, normalizations, or unsupported requests.
- Treat
getCapabilities().intents as an allowlist; never pass a natural-language sentence as planChart().intent.
- If planning returns
fallbackUsed: true, use intentSuggestions to remap or ask for confirmation; never silently accept the fallback chart.
- Keep axis titles/formats under
xAxis/yAxis, labels under labels, and legend settings under legend.
- Repair
UNKNOWN_INTENT, misplaced-option, and unsupported-axis warnings before presenting a chart. For numeric y-axes, prefer the default readable domain; use yAxis.domain: [min, max] for an explicit range, yAxis.nice: false for raw boundaries, and yAxis.ticks for a stable label count.
- Add stable string
id values to tabular rows when lineage or linked updates are part of the deliverable.
- Avoid Pie for high-cardinality categories; prefer Bar for comparison.
- Require explicit Radar domains when units differ.
- Distinguish missing Heatmap values from zero.
- Set
locale explicitly when output needs localization; the default is en-US, and input dates must be ISO-8601 strings.
- Use categorical, sequential, diverging, or status palettes by data semantics; do not invent arbitrary color sets or rely on color alone.
- Surface theme contrast diagnostics and high-cardinality color warnings.
- Do not generate Map or 3D Specs unless capabilities explicitly add them.
- Prefer SVG for accessibility, DOM interaction, and diagram editing; prefer Canvas for larger mark counts when supported.
- Destroy replaced charts and verify lifecycle cleanup.
Deliverable
Return:
- the selected chart and reasons;
- the validated Spec or structured repair request;
- assumptions, warnings, and unsupported requests;
- explanation lineage and runtime self-check;
- changed files when coding;
- the exact preview URL and acceptance actions.
Read references/agent-contract.md for the required API sequence and response checklist. Read references/chart-selection.md only when selecting or challenging a chart type.
1---2name: ichartjs3description: Plan, validate, render, explain, and safely edit iChart.js visualizations from tabular, project, or diagram data. Use when Codex needs to choose a chart, create or repair an iChart.js Spec, build a browser preview, produce Gantt or project analytics, create Flow or Swimlane diagrams, or verify visualization accessibility, diagnostics, lineage, and runtime state.4---56# iChart.js78Use the public Agent contract as the source of truth. Do not infer capabilities from renderer internals or duplicate chart-selection logic in generated code.910Read the [usage scenarios](https://github.com/wanghetommy/ichartjs/blob/master/docs/agent/usage-scenarios.md) when the request is ambiguous about whether the output should be a live project component, a Coding Agent change, a Skill-generated artifact, or a scheduled report.1112## Source and Runtime Setup1314- Official repository: `https://github.com/wanghetommy/ichartjs`15- Official Skill source: `https://github.com/wanghetommy/ichartjs/tree/master/skills/ichartjs`16- Supported Skill hosts include Codex, WorkBuddy, and other Agent Skills-compatible environments.1718Recommended installation:1920```bash21npx skills add wanghetommy/ichartjs --skill ichartjs22```2324Use `--agent codex --global --yes` for global non-interactive Codex installation. Use the tagged directory `https://github.com/wanghetommy/ichartjs/tree/v2.0.11/skills/ichartjs` when reproducibility matters. WorkBuddy can import the same directory through its Skill interface; do not assume a `--agent workbuddy` adapter unless the installed CLI declares it.2526The Skill is a workflow adapter, not the chart runtime. If the current JavaScript or TypeScript project does not already depend on iChart.js, install the matching runtime from GitHub:2728```bash29npm install @taylorwong/ichartjs@^230```3132Do not install the unscoped npm registry package named `ichartjs`; it is currently a security holding package and is not this project.3334## Workflow35361. Locate the package or repository root. Read `docs/agent/quickstart.md` when available.372. Call `getCapabilities()` before selecting a chart or interaction.383. Call `inspectData()` and preserve stable record IDs.394. Discover `getCapabilities().intents`; map natural-language requests to an exact registered token before calling `planChart(data, { intent, renderer, context })`.405. Inspect the complete planning result, including `styleRecommendation`, warnings, and fallback status.416. Stop when `requiredFields` is non-empty; request data or explain a supported alternative.427. Build a JSON-serializable Spec using `suggestedEncodings`, the selected capability, and an applicable recipe.438. Use chart-specific channels: Cartesian `x`/`y`, Pie/Funnel `category`/`value`, Gauge `value`, Heatmap `x`/`y`/`color`, and Radar `indicators[].field`. To load a recipe, use `import catalog from '@taylorwong/ichartjs/recipes/minimal-specs' with { type: 'json' }` and select `catalog.examples[type]`.449. Keep titles/formats under `xAxis`/`yAxis`, labels under `labels`, and legend under `legend`; do not place them inside `encoding`.4510. Call `validateSpec()` before rendering. Repair `UNSUPPORTED_ENCODING_CHANNEL`, `MISSING_ENCODING_FIELD`, `MISSING_GAUGE_DOMAIN`, `UNKNOWN_INTENT`, misplaced-option, and unsupported-axis warnings before presenting the chart.4611. Call `createChart()` only after validation succeeds. Gauge Specs must declare a meaningful `domain`.4712. Self-check with `chart.explain()`, `chart.getState()`, `health.renderable`, and JSON export. Treat `VALUE_CLAMPED`, `LABELS_SUPPRESSED`, `NEGATIVE_VALUE_DROPPED`, and `ZERO_TOTAL` as material diagnostics to report.4813. Provide an exact preview URL or artifact path and report assumptions, warnings, and deferred checks.4914. Prefer `theme: { mode: 'auto', preset, palette }`; preserve explicit user style choices and use `chart.setTheme()` for live switching.5015. For post-creation visual changes, call `getPreferenceCapabilities(chartType, { locale })`, validate the patch with `validatePreferences()`, apply it with `chart.setPreferences(..., { source: 'agent' })`, and verify `chart.getState().preferences`.5152Use `@taylorwong/ichartjs` for package imports. Use `examples/agent-workflow.mjs` as the executable baseline when working in the repository.5354## Task Routing5556Route by requested output:5758- **Live product component**: modify the host JavaScript project and mount `createChart()`; return changed files and the host preview URL.59- **Coding Agent change**: inspect the repository, use the Runtime, run focused checks, and return the validated Spec plus changed files.60- **One-off artifact**: generate SVG/JSON directly; use browser PNG export or `exportAsync()` with optional `canvas` for Node PNG/JPEG.61- **Project or Diagram workflow**: load the matching scenario guide and preserve all stable IDs.62- **CI/report output**: keep JSON as the reproducible checkpoint and SVG/PNG as presentation artifacts.6364- For standard data analysis, read `references/chart-selection.md` and use foundational recipes.65- For Gantt, Timeline, Milestone, Burndown, capacity, release, risk, or aging, use project capabilities and `agent-recipes/project-management.json`.66- For Flow or Swimlane, preserve node, edge, lane, group, and port IDs; use diagram recipes and validated edit commands.67- For business edits, preview first, preserve the preview ID and revision, require confirmation when declared, then commit or reject atomically.68- For browser deliverables, start `npm run playground` and return the exact maintained Playground URL.69- Release workflow (npm publish + develop→master merge) is **AUTHOR ONLY**. Read the [release SOP](https://github.com/wanghetommy/ichartjs/blob/master/docs/agent/development/release-sop.md). Never initiate any release step unless the author explicitly instructs.7071## Guardrails7273- Never invent fields, units, dates, dependencies, calendar rules, domains, or forecast confidence.74- Never silently drop validation errors, warnings, assumptions, normalizations, or unsupported requests.75- Treat `getCapabilities().intents` as an allowlist; never pass a natural-language sentence as `planChart().intent`.76- If planning returns `fallbackUsed: true`, use `intentSuggestions` to remap or ask for confirmation; never silently accept the fallback chart.77- Keep axis titles/formats under `xAxis`/`yAxis`, labels under `labels`, and legend settings under `legend`.78- Repair `UNKNOWN_INTENT`, misplaced-option, and unsupported-axis warnings before presenting a chart. For numeric y-axes, prefer the default readable domain; use `yAxis.domain: [min, max]` for an explicit range, `yAxis.nice: false` for raw boundaries, and `yAxis.ticks` for a stable label count.79- Add stable string `id` values to tabular rows when lineage or linked updates are part of the deliverable.80- Avoid Pie for high-cardinality categories; prefer Bar for comparison.81- Require explicit Radar domains when units differ.82- Distinguish missing Heatmap values from zero.83- Set `locale` explicitly when output needs localization; the default is `en-US`, and input dates must be ISO-8601 strings.84- Use categorical, sequential, diverging, or status palettes by data semantics; do not invent arbitrary color sets or rely on color alone.85- Surface theme contrast diagnostics and high-cardinality color warnings.86- Do not generate Map or 3D Specs unless capabilities explicitly add them.87- Prefer SVG for accessibility, DOM interaction, and diagram editing; prefer Canvas for larger mark counts when supported.88- Destroy replaced charts and verify lifecycle cleanup.8990## Deliverable9192Return:9394- the selected chart and reasons;95- the validated Spec or structured repair request;96- assumptions, warnings, and unsupported requests;97- explanation lineage and runtime self-check;98- changed files when coding;99- the exact preview URL and acceptance actions.100101Read `references/agent-contract.md` for the required API sequence and response checklist. Read `references/chart-selection.md` only when selecting or challenging a chart type.