n-dashboard: Skill for Claude Code

.claude/skills/write-widget/SKILL.md

write-widget is a skill for Claude Code from devapro/n-dashboard. It costs 71 tokens per session (2,696 once invoked), scanned A, original, MIT.

A guide for writing an n-dashboard widget: a TypeScript function that returns the data for a dashboard card.

In plain words
What is it for?
Use it to add or change dashboard cards, choose how they are triggered or whether they keep history, and debug widgets that fail or show old data.
Why use it?
It helps you follow the widget's required data types and validation rules, reducing errors such as rejected results, wrong card shapes, or stale data.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is devapro/n-dashboard's own configuration. It tells Claude Code how to work on n-dashboard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything n-dashboard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to devapro/n-dashboard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/devapro/n-dashboard/main/.claude/skills/write-widget/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/devapro/n-dashboard

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-widget

README.md
[![agentmods](https://agentmods.dev/badge/skills/devapro/n-dashboard/write-widget/github.svg)](https://agentmods.dev/skills/devapro/n-dashboard/write-widget)
Your own site
<a href="https://agentmods.dev/skills/devapro/n-dashboard/write-widget"><img src="https://agentmods.dev/badge/skills/devapro/n-dashboard/write-widget/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for write-widget

Your own site · 80×15
<a href="https://agentmods.dev/skills/devapro/n-dashboard/write-widget"><img src="https://agentmods.dev/badge/skills/devapro/n-dashboard/write-widget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.02696
Opus 5.5 $0.00028 $0.01078
Sonnet 5.5 $0.00014 $0.00539
Haiku 4.5 $0.00007 $0.00270

Measured 2mo ago against content hash 7e375381fa68, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

write-widget scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST localhost:8080/api/widgets -H 'content-type: application/json' \
.claude/skills/write-widget/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing an n-dashboard widget

A widget is one function on disk. The platform decides when to call it (clock, MQTT message, webhook, manual), validates what it returns against its kind's schema, and pushes the result to open tabs over SSE. There is no plugin format and no config-driven renderer, so summing a field, joining two APIs and remembering what you already saw are all ordinary code.

Read these first, in this order

Do not write a widget from memory of this file — the API is defined in the repo and this skill can drift from it.

  1. src/shared/ctx.d.ts — the single source of truth for Ctx and for every kind's data type. Read the type you are about to return, in full.

  2. src/shared/kinds/<kind>.ts — the runtime Zod schema, the sample and the starter template for that kind. The schema is what actually rejects a result.

  3. The closest examples/*/widget.ts — each one exists to teach a specific part of the API and is heavily commented. Pick by what you need:

    need example
    HTTP JSON → one number crypto-price
    an API key stock-quote
    summing / reshaping an array api-sum
    MQTT, plus recorded history office-temp
    reading history back as a chart temp-history
    GraphQL (and why res.ok is not enough) github-prs, github-approvals
    a webhook and a poll in one widget slack-unread
    signed JWT + a token cached in ctx.state bigquery-query
    Google Calendar (same code on either auth path) next-meetings
    threshold bands disk-usage
    HTTP Basic + asking an API for fewer fields jira-jql

The two files

data/widgets/<id>/
  widget.json      config — kind, triggers, history, timeout
  widget.ts        the function
  state.json       ctx.state, written back after each successful scheduled run
  history.ndjson   append-only, trimmed to the retention window

widget.json, validated by widgetConfigSchema in src/shared/widget.ts:

Read the full file on GitHub · 201 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 201 lines · 71 tokens per session scan A 7e375381fa68

Subscribe to this mod's changes

write-widget is a skill published in the GitHub repository devapro/n-dashboard (12 stars, last pushed 3mo ago), licensed MIT. It adds 71 tokens to every session and 2,696 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

write-widget compared with skills from other repositories

write-widget next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
write-widgetdevapro/n-dashboardSkill123mo agoMITA71Claude Code
olares-chartbeclab/OlaresSkill5.3kyesterdayAGPL-3.0A85Claude Code, Codex
olares-routerbeclab/OlaresSkill5.3kyesterdayAGPL-3.0A202Claude Code, Codex
olares-clusterbeclab/OlaresSkill5.3kyesterdayAGPL-3.0A77Claude Code, Codex
olares-filesbeclab/OlaresSkill5.3kyesterdayAGPL-3.0A77Claude Code, Codex
olares-knowledgebeclab/OlaresSkill5.3kyesterdayAGPL-3.0A80Claude Code, Codex
olares-marketbeclab/OlaresSkill5.3kyesterdayAGPL-3.0A66Claude Code, Codex