/decision-first-dashboard:decision-first-dashboardfrom decision-first-dashboard
Reviews, redesigns, or evaluates KPI/BI/analytics dashboards using a decision-first methodology that prioritizes actionable insights and evidence-backed visual structures.
Ships in decision-first-dashboard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Decision-First does not mean Minimal-Data. Preserve rich evidence, create strong hierarchy, and expose only justified meaning.
Source / context → Worthiness Assessment → worthiness gate → Decision Brief → intake gate → Metric Routing Manifest → grounded evidence bundle → routing + grounding gates → deterministic renderer → canonical HTML / SVG + output.manifest.json
The agent may assess whether a dashboard is warranted, clarify decision intent, extract and classify evidence, and propose routing. It may not invent source support, bypass worthiness/intake/routing/grounding gates, or choose a free-form dashboard layout during ordinary compilation.
A dashboard earns first-view screen space only when the information can change a decision, trigger an action, surface an exception, explain a primary signal, or support deliberate drill-down.
Do not add bakery, sales, SaaS, executive, or monitoring renderer branches. There is one composition engine and one renderer entrypoint. Evolve the existing pipeline as Decision Brief → Semantic Nodes → Node Presentation → Composition Modifiers → Coverage Manifest → Context Preservation Gate → deterministic renderer → delivered-artifact verifier.
Semantic nodes may be MetricCluster, Trend, Distribution, Breakdown, Ranking, Relationship, ExceptionList, or Drilldown. Typing follows the axis each node expresses: when a set of observations is organized in temporal order by a real time index and expresses a state or trajectory changing over time, its semantic type must be Trend; Distribution covers category, bin, share, and frequency distributions and never substitutes for a temporal trajectory. Ordered is not Trend, and one source table may legitimately yield several semantic types — the node's axis semantics is what is typed, never its table origin. Audience and cadence modify priority, density, prominence, expansion, drilldown depth, and first-view budget; they are not renderer types and cannot discard context required by the confirmed decision.
Use structured contextRequirements on the existing Decision Brief when the decision and source structure require retained comparison, distribution, ranking, target, attribution, or decomposition context. Each requirement has a stable ctx_ id, subject, and minimum coverage. Infer unambiguous requirements, but ask only when an ambiguity would change the decision. Coverage is evaluated for the required subject, never satisfied by another node's compatible shape. Keep the full structure, use an explicit reachable drilldown, or fail closed; never silently replace it with a peak summary. The same source must keep its semantic nodes across audience/cadence changes; modifiers may alter priority, density, prominence, expansion, drilldown, or a node-owned presentation only when that variant preserves every required context.
Radar is only a MetricCluster presentation. It requires at least three comparable dimensions in one evaluation system, a shared meaningful scale or source-backed normalization, and a real profile/balance decision. Mixed counts, shares, ROI, and deltas fail the Profile Test and use comparison presentation. A local signal direction is not a visible overall business verdict in no-score mode. Every visible overall verdict must be a typed claim with claimType, scope, and source evidenceRefs, plus resolvable artifact markers; a verdict without evidence refs cannot render. Never synthesize IMPROVING, DETERIORATING, or MIXED without a source-backed score, target, health model, or explicitly confirmed user verdict.
The delivered gate reads the final HTML/SVG and a delivered manifest, not merely composition intent. Every delivered node must expose machine-readable data-semantic-node, data-presentation, data-coverage, and registered structure markers that cross-check the manifest and actual item markers in both artifacts. A manifest that says a node was delivered when the artifact does not show its marker or complete structure fails. The verifier alone issues the final verification block after success; it binds artifactHash and the final manifest manifestPayloadHash (with manifestHash compatibility), and a renderer- or composer-supplied stamp fails. Composition decisions use a stable reasonCode plus a parseable requirementRef or active modifierRef; unknown or unattributed promote/retain/collapse/drop decisions fail.
This contract applies whenever the skill is actually invoked for a dashboard redesign.
compile-dashboard.js owns canonical production delivery.compile-dashboard.js. Do not treat that HTML as a reference and redraw it afterward.output.manifest.json. A visually similar artifact without canonical provenance is not the official Decision-First output.Host-level skill discovery is outside the repository's control. A generic product request may still fail to invoke an installed skill in some environments; measure that separately with live product tests. Once this skill is invoked, the execution contract above is mandatory.
The agent may:
The agent must not render UI, fabricate score-model evidence, or decide its own worthiness transition. The agent does not choose or set the transition; the compiler owns the transition.
The production compiler validates, in order:
schemas/worthiness-assessment.schema.json plus semantic consistency rules;schemas/decision-brief.schema.json;schemas/metric-routing.schema.json and semantic rules;primary_signal metrics and visible center metrics/components;decisionState.supportingSignals;title + subtitle, both present or the run fails PAGE_HEADER_SEMANTICS_REQUIRED);Worthiness transitions:
BUILD_DECISION_BRIEFASK_WORTHINESS_QUESTIONREDIRECT_NON_DASHBOARDFIX_WORTHINESS_ASSESSMENTDecision Brief intake transitions:
ALLOW_ROUTINGASK_DECISION_BRIEF_QUESTIONFIX_DECISION_BRIEFDownstream transitions:
PASSFIX_METRIC_ROUTINGASK_SEMANTIC_TYPINGFIX_SEMANTIC_TYPINGRETURN_TO_EVIDENCE_EXTRACTIONFALLBACK_TO_NO_SCOREFIX_DECISION_STATErender.js consumes only validated decision state plus the selected semantic-node composition and fills deterministic SVG/HTML compositions. It does not inspect hidden routing inventory, source data, or invent business meaning. Node presentation variants belong to their semantic node; no use-case, audience, or fixture-specific template registry is allowed. Canonical delivery never invents page-level copy: the page header comes only from the atomic brief-sourced title/subtitle pair, and a missing or partial pair fails closed instead of falling back to generic text. Lower-level compatibility/test rendering that does not request the canonical semantic contract keeps its pre-existing generic header behavior and is not a production workflow.
drilldown, scorecard_only, and diagnostics routed on_demand remain preserved for traceability without becoming eager first-view clutter. Only diagnostics explicitly routed with visibility: "supporting" may enter the closed supportingSignals layer and render as subordinate context.
After composition selects the semantic nodes, the canonical compiler builds one Internal Visual Spec per selected node. The spec records nodeId, semanticType, presentation, mark, orientation, encoding, scale, comparability, and attributed layout. It is the only source of visual HOW; render-semantic.js must consume it and must not infer a chart from labels, audience, fixture, or use case.
The grammar uses one shared registry and one renderer pipeline. Trend full charts are ordered temporal plots, Distribution full charts preserve the complete ordered distribution, full Rankings compare ordered magnitudes, both-end Rankings use an explicit high/low pair, and MetricCluster comparison uses independent metric tiles. Temporal typing is an upstream contract, not a renderer choice: month- or quarter-indexed observations tracing one continuous span are Trend, and recurring period-category bins stay Distribution only with an explicit categorical axis declaration (references/semantic-visual-grammar.md). Radar remains legal only after the existing Profile Test. No G2, Vega-Lite, Observable Plot, Recharts, ECharts, or other external rendering dependency is permitted.
Shared position, length, area, or scale requires compatible unit, comparison group, comparability domain, normalization, and scale. Same unit is not sufficient. Mixed-unit metrics use independent scales; an illegal shared encoding or paired layout fails closed. Non-default layout patterns require a registered reasonCode plus a resolvable requirement, modifier, or evidence reference. The delivered verifier cross-checks these specs and their markers against both final HTML and SVG; a manifest-only composition claim is not delivery.
Before starting the Decision Brief or committing to dashboard output, ask whether the request deserves to become a persistent dashboard at all. Reuse context already supplied, ask one question at a time only when needed, and count Worthiness questions toward the same five-question total intake budget used by the Decision Brief.
A dashboard is justified when the workflow has a real recurring decision or recurring monitoring loop, a clear accountability path, and a meaningful response that changes when an important signal changes. An accountability path may be a single owner, an on-call team, a distributed responsible team, or a recurring shared decision forum.
Use three tests:
Visibility alone is not a decision and is not sufficient justification for a dashboard.
The compiler, not the agent, determines the transition. If the request fails the Worthiness Test, do not build or render a dashboard by default. Recommend the smallest fitting alternative such as a one-off analysis, scheduled summary, alert, report, or chat/query workflow.
If the user explicitly chooses a dashboard after seeing that trade-off, userOverride: true may enter the Decision Brief, but it does not bypass intake, Metric Router, grounding, or rendering contracts.
Worthiness is design context, not source evidence. The machine gate verifies schema and semantic consistency; it does not prove the agent interpreted natural-language intent correctly.
Before routing metrics or choosing a visual mode, establish the minimum decision context needed to design the dashboard. Ask one question at a time, ask no more than five questions total across Worthiness + Decision Brief intake, and stop immediately once enough information exists.
Intent-confirmation gate: a screenshot cannot satisfy the Decision Brief by itself. Unless the user has explicitly stated both the Decision and the Action in the request or prior conversation, ask at least one question and obtain confirmation before Metric Router classification or rendering.
The intake dimensions are a question pool, not a fixed questionnaire:
Use two notions of known:
Prefer plain business language for the first intent question:
When you open this dashboard, what are you trying to figure out or do next?
If the answer remains abstract, follow with:
What would make that job easier?
The abstract “What decision does this dashboard support?” wording is a fallback, not the only allowed intake phrasing. The goal is to confirm the user's real decision or next action without asking them to translate their work into framework terminology.
An inferred candidate requires confirmation. Do not use “inferable from the data” to skip confirmation of business intent.
After each answer, evaluate sufficiency. The zero-question path is narrow: use it only when the user's request or already-established context explicitly states both Decision and Action and Worthiness is already resolved. Source data alone never qualifies.
If the user is unsure:
Do not invent a threshold.
Support both intake orders:
The Decision Brief is internal design context. It is not automatically source evidence and no compiler/framework methodology labels in visible UI are permitted.
The structured brief must match schemas/decision-brief.schema.json. scripts/intake.js requires both Decision and Action to have status: "confirmed". Otherwise the pipeline returns ASK_DECISION_BRIEF_QUESTION and produces no dashboard artifact.
Page packaging contract. A canonical production page must carry its own page identity in the Decision Brief: title (≤ 40 characters) and subtitle (≤ 120 characters), supplied together as one atomic pair in plain business language grounded in the confirmed decision context and audience. Canonical delivery never synthesizes page copy: when the pair is missing, blank, or partial, canonical delivery fails closed at the delivery stage with PAGE_HEADER_SEMANTICS_REQUIRED and produces no artifact — there is no generic fallback text and no per-field substitution. If the user has not named the page, derive a defensible title/subtitle from the confirmed Decision/Action and include it in the brief before compiling; ask one intake question when the page identity is genuinely ambiguous.
The brief also carries structured intent slots questionShape and actionShape (same slot format). state+observe classifies a MONITOR archetype and priority+rank classifies a PRIORITIZE_READONLY archetype; anything else — missing, inferred, or an unsupported combination — returns ASK_COMPOSITION_INTENT with a ready-to-ask question and produces no artifact. Archetypes are compiler-owned: routing manifests cannot set them, and free-form decision/action prose never overrides the structured slots. A priority+rank intent additionally requires a grounded ordering basis (source-declared explicit ranks, or a grounded actual/target/gap structure); without one the pipeline asks for the basis instead of ever ordering candidates by raw values.
Capture only source-supported metrics, deltas, states, events, targets, thresholds, and score rules. Never invent scores, targets, thresholds, customer states, events, workflows, actions, or causal claims. Direction is not the same as health.
Use the Metric Router when the source exposes more metrics than a user can reasonably scan at first view. The canonical stress case is 70-KPI overload.
Preserve everything without showing everything.
The routing manifest must match schemas/metric-routing.schema.json. It contains the confirmed decision, confirmed action, inventoryCount, and one routing entry per extracted metric. inventoryCount must equal the inventory size.
Route every metric to exactly one role:
primary_signal — directly changes the main decision/action;diagnostic — explains a routed primary signal or exception;exception — breach, outlier, critical account/event, or hard-stop condition;drilldown — useful after deliberate investigation starts;scorecard_only — retained for completeness/audit but not promoted to the decision-first view.Apply the Action Trigger Test: if this metric changes materially, what decision or action changes?
Metric-level Worthiness reuses the Dashboard Worthiness logic for each metric's what changes, who cares, and what changes in response dimensions. Assessments are hypotheses by default (inferred) and may become confirmed or overridden; screenshot-only assumptions must be recorded, but they do not create one question per metric. The compiler adds at most one metric clarification to the shared five-question intake budget, and only when candidate route outcomes diverge mechanically and that divergence changes primary_signal or hero eligibility.
Do not treat demotion as deletion. A monitoring or compliance metric without an immediate action may lose primary/hero priority while remaining routed as diagnostic, drilldown, or scorecard_only and preserved in the grounded inventory. A user override is a new routing input: recompute the metric route, rebuild presentation hierarchy, and render the canonical HTML/SVG so promote and demote changes cannot remain only in intermediate JSON.
Do not promote metrics merely because they are relevant. If one mainly explains another primary signal, or is a complementary slice of the same distribution, route it as diagnostic unless a material change independently alters the confirmed decision or action.
Compiler-enforced routing rules:
primary_signal requires changesDecision: true, non-empty decisionImpact, and visibility: "first_view";changesDecision: false, an explains target, and supporting or on_demand visibility;supportingSignals must exactly equal diagnostics routed as supporting;on_demand;drilldown stays on_demand; scorecard_only stays scorecard;surfacePath to a rendered exception/event;A supporting semantic mismatch returns FIX_METRIC_ROUTING; missing evidence returns RETURN_TO_EVIDENCE_EXTRACTION.
Use composite only when the source already provides overall score/scale, normalized component scores, component weights, a weighted-average aggregation rule, and complete score bands.
If any required composite fact cannot be mechanically grounded, return FALLBACK_TO_NO_SCORE. Never invent score math.
For no_score, do not create a synthetic overall score or health band.
Radar eligibility is independent of overall-score eligibility. A no-score radar requires 3–6 peer dimensions describing the same object/condition, one shared source-backed numeric scale, and a source-grounded normalizedScore for every displayed dimension. Fewer than three dimensions are not radar-eligible.
A radar must pass:
Never connect heterogeneous raw KPIs merely because several numbers exist.
The grounded bundle stays separate from the routing inventory and must match schemas/grounded-bundle.schema.json; decisionState must independently match schemas/decision-state.schema.json.
Supported grounding:
json_pointer anchor;text_span anchor.The compiler verifies source SHA-256. Screenshot workflows should first create a verifiable text/JSON sidecar for claims that need byte-level grounding.
Ground every source-dependent field that becomes visible. Composite additionally grounds the complete score model. No-score radar additionally grounds radarScale.min/max and each normalizedScore.
Do not ground deterministic renderer synthesis or Metric Router roles as if they were source facts.
Canonical production execution:
node scripts/compile-dashboard.js <worthiness-assessment.json> <decision-brief.json> <routing-manifest.json> <grounded-bundle.json> <output-dir>
Before that, the individual preflight evaluators may be run directly:
node scripts/worthiness.js <worthiness-assessment.json>
node scripts/intake.js <decision-brief.json>
FIX_WORTHINESS_ASSESSMENT, ASK_WORTHINESS_QUESTION, REDIRECT_NON_DASHBOARD, FIX_DECISION_BRIEF, ASK_DECISION_BRIEF_QUESTION, ASK_COMPOSITION_INTENT, ASK_SEMANTIC_TYPING, or FIX_SEMANTIC_TYPING produces no final SVG/HTML. Only ALLOW_ROUTING may enter Metric Router validation.
On final PASS, the CLI writes:
no_score → output.no-score.html + output.no-score.svg;composite → output.composite.html + output.composite.svg;output.manifest.json.The primary After deliverable is HTML whenever file generation is available. Present or link the canonical output.no-score.html or output.composite.html first.
SVG is a deterministic preview/regression artifact. A screenshot, PNG, SVG, mockup, or concept image alone does not complete an ordinary redesign when the HTML renderer is available.
Every canonical HTML includes decision-first-renderer=canonical provenance metadata; SVG contains <metadata id="decision-first-provenance">; output.manifest.json records the source, Worthiness, Decision Brief, routing, grounded bundle, decision-state, HTML, and SVG hashes.
Do not regenerate a separate free-form image or app as the “real” After. If the runtime cannot execute the production compiler, do not fake a substitute.
Agent invocation compliance — behaviorally guarded, not runtime-enforced. Repository tests and this Skill contract improve invocation discipline, but they cannot attest that an unconstrained host actually used the canonical compiler. Runtime acceptance therefore must pass the independent provenance gate below before its artifact is treated as a valid acceptance result.
Schema green ≠ routing green ≠ canonical output green. A schema-valid object only proves that its shape is acceptable. It does not prove that routing made the correct decision, that composition preserved the required context, or that the final artifact actually delivered the selected result. Verification therefore proceeds in order: contract → behavior → canonical HTML/SVG. The final gate must inspect the delivered artifact and its manifest, including machine-readable semantic markers; an intended composition that is absent from the HTML/SVG is a delivery failure.
compile.js, validate.js, and render.js remain lower-level compatibility/testing tools. They are not substitutes for compile-dashboard.js in ordinary production workflows.
compile-dashboard.js is the production canonical entrypoint and always invokes the compiler with the required semantic-delivery contract. Missing or empty semantic nodes or composition fail at delivery; they cannot fall through to the legacy renderer. Direct compile.js and lower-level compileGroundedBundle calls may retain compatibility behavior when requireSemantic is not requested.
Before using a runtime-installed Skill for acceptance, prove the loaded package
identity with the independent scripts/runtime-provenance-preflight.js gate.
On Windows, bind %USERPROFILE%\.agents\skills\decision-first-dashboard to
the repository's skills\decision-first-dashboard directory with
scripts/bind-runtime-skill.js. Directory junctions are preferred, directory
symlinks are the fallback, and resolved physical targets must equal the
repository Skill directory. A copied directory can pass exact content equality
but must report stalenessRisk: true; it is not a zero-staleness-risk runtime.
The formal acceptance entrypoint is:
npm run run:acceptance -- --repo-root "$PWD" --runtime-skill-path "$env:USERPROFILE\.agents\skills\decision-first-dashboard" --expected-repo-head "<expected-40-char-commit>" --run node <acceptance-script.js>
run-acceptance.js invokes the canonical runtime-provenance-preflight.js
before the acceptance command and passes --reject-staleness-risk. A non-zero
provenance result terminates the formal acceptance; no business result or
canonical artifact may be produced. The JSON gate report includes the expected commit, binding and physical identity, complete
pre/post package tree hashes, clean pre/post status for
skills/decision-first-dashboard/, required files, and these exact runtime
invariants: SKILL.md contains Agent invocation compliance — behaviorally guarded, not runtime-enforced; scripts/compile-dashboard.js contains
requireSemantic: true; scripts/composition.js and
scripts/render-semantic.js exist. Its machine-readable result must be
RUNTIME_PROVENANCE_PASS with acceptanceValid: true before a fresh Bakery
acceptance session may begin. Keep acceptance logs, caches, and temporary files
outside the Skill package; the default hash exclude list is empty and does not
silently hide runtime-generated files. The lower-level
preflight:runtime-provenance command remains diagnostic-only; an exact copied
package reports stalenessRisk: true and is rejected by formal acceptance.
FIX_WORTHINESS_ASSESSMENT → repair the structured assessment;ASK_WORTHINESS_QUESTION → ask the minimum missing Worthiness question;REDIRECT_NON_DASHBOARD → stop dashboard compilation;BUILD_DECISION_BRIEF → continue to Decision Brief, not final render;FIX_DECISION_BRIEF → repair malformed intake state;ASK_DECISION_BRIEF_QUESTION → ask one high-information question for unresolved Decision/Action;ASK_COMPOSITION_INTENT → ask the returned askQuestion string verbatim; never surface internal reason codes, slot names, or archetype names in user-facing text;ASK_SEMANTIC_TYPING → ask the returned askQuestion string verbatim: whether the month- or quarter-labeled series traces one continuous span of time (type it Trend) or aggregates recurring periods (keep Distribution with axis.semantics: "categorical");FIX_SEMANTIC_TYPING → retype the flagged node as Trend (or correct its temporal evidence); never bypass the typing error;ALLOW_ROUTING → continue to Metric Router;FIX_METRIC_ROUTING → repair routing; do not bypass it;RETURN_TO_EVIDENCE_EXTRACTION → repair evidence/claims;FALLBACK_TO_NO_SCORE → abandon unsupported composite scoring;FIX_DECISION_STATE → repair contract/schema errors;PASS → deliver the exact canonical compiler outputs.The renderer owns layout only after all upstream gates have passed.
For no_score:
supportingSignals render as lower-weight diagnostic context and collapse when absent;For composite:
For both modes:
See references/visual-pattern.md and references/visual-stack-routing.md.
Safety, compliance, security, regulatory, contractual, or outage conditions override ordinary synthesis. Never average an active hard stop into a reassuring status.
The repository contains a recorded ambiguous-prompt regression based on a real Sales Dashboard screenshot and the user request:
帮我 redesign 一下这个 dashboard,感觉信息很多但不好用。
The passing first turn asks one question covering missing Decision/Action context and produces no artifact. A recorded native-artifact response that skips intake is rejected by scripts/agent-eval.js.
This harness verifies a recorded first-turn contract. It is not a live model benchmark and cannot guarantee that a host product will automatically invoke the skill for every generic dashboard prompt.
Before delivery, verify:
schemas/decision-brief.schema.json passes and intake.js returns ALLOW_ROUTING;schemas/metric-routing.schema.json passes and inventoryCount is complete;output.manifest.json exists;references/semantic-visual-grammar.md (opens in a new tab)references/visual-pattern.md (opens in a new tab)references/visual-stack-routing.md (opens in a new tab)schemas/decision-brief.schema.json (opens in a new tab)schemas/decision-state.schema.json (opens in a new tab)schemas/grounded-bundle.schema.json (opens in a new tab)schemas/metric-routing.schema.json (opens in a new tab)schemas/worthiness-assessment.schema.json (opens in a new tab)scripts/agent-eval.js (opens in a new tab)scripts/bind-runtime-skill.js (opens in a new tab)scripts/cli-entrypoint.js (opens in a new tab)scripts/compile-dashboard.js (opens in a new tab)scripts/compile.js (opens in a new tab)scripts/composition-intent.js (opens in a new tab)scripts/composition.js (opens in a new tab)scripts/encoding-contracts.js (opens in a new tab)scripts/encoding-geometry-verifier.js (opens in a new tab)scripts/encoding-router.js (opens in a new tab)scripts/geometry-verifier.js (opens in a new tab)scripts/grounding.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (fourleaf13-hue/decision-first-dashboard) — no native marketplace selected
npx claudepluginhub p/fourleaf13-hue-decision-first-dashboardOther plugins' skills for the same job