agentleFS
xAIKnown publisherxai-org/customer-education-workshops/ledgerly/.cursor/skills/add-dashboard-widget/SKILL.md

add-dashboard-widget

Skill3 starsChanged 7 days agoApache-2.0View on GitHub

Add a new KPI card or panel to the Ledgerly dashboard using the existing indigo design tokens and seed data. Use when someone asks to "add a widget/card/stat to the dashboard" during a demo — it keeps the result on-brand instead of hand-rolled.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the KPI needs a new aggregate, add a pure helper to lib/dashboard.ts and a small Vitest case in tests/dashboard.test.ts (keep it passing …

    line 22
  2. Very specific:

    Add/extend the aggregate in lib/dashboard.ts + expose it from getDashboard().

    line 27
  3. Very specific:

    Verify at http://127.0.0.1:43173 and run npx eslint app components lib --max-warnings=0.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add a dashboard widget

Ship one new widget on app/page.tsx that looks native to the existing dashboard. Do not restyle anything else.

Where things live

  • Page: app/page.tsx (server component, data from getDashboard() in lib/data.ts).
  • KPI primitive: components/kpi-card.tsx (label, value, hint, optional change, icon, tone: "indigo" | "success" | "danger").
  • Cards/tables: components/ui/card.tsx, components/ui/table.tsx. Charts: components/charts/.
  • Tokens: CSS variables in app/globals.css (--indigo, --success, --danger, radius, shadow). Use Tailwind classes bound to them (bg-indigo-soft, text-indigo, text-muted-foreground). Never hard-code a new hex.

Rules

  • Data must come from the seed via Prisma (lib/data.ts) — compute in cents, format with formatUsd. No invented numbers, no fourth catalog price.
  • Icons from lucide-react, sized size-4 inside the tinted chip like the existing cards.
  • Age or window anything with the frozen clock in lib/clock.ts, never Date.now().
  • If the KPI needs a new aggregate, add a pure helper to lib/dashboard.ts and a small Vitest case in tests/dashboard.test.ts (keep it passing — do not change lib/disputes/suggested-credit-api.ts or tests/suggested-credit-api.test.ts).

Steps

  1. Pick the metric with the user (good demo picks: "Overdue count", "Disputed dollars", "Paid this week").
  2. Add/extend the aggregate in lib/dashboard.ts + expose it from getDashboard().
  3. Render one KpiCard (or a Card with a small list) in the matching grid section of app/page.tsx.
  4. Verify at http://127.0.0.1:43173 and run npx eslint app components lib --max-warnings=0.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.