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.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ledgerly/AGENTS.mdAGENTS.md
- ledgerly/.cursor/rules/disposable-demo-prs.mdcCursor rule
- ledgerly/.cursor/rules/ledgerly.mdcCursor rule
- ledgerly/.cursor/rules/multitask-no-wrapper.mdcCursor rule
- choose-cursor-workflowSkill
- dispatch-subagentsSkill
- draft-collection-emailSkill
- hand-to-cloud-agentSkill
- present-runbooksSkill
- reset-demo-stateSkill
- stage-linearSkill
- start-ledgerlySkill
- write-prisma-querySkill
- standard-bug-fixSkill
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
- Very specific: line 22
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 …
- Very specific: line 27
Add/extend the aggregate in lib/dashboard.ts + expose it from getDashboard().
- Very specific: line 29
Verify at http://127.0.0.1:43173 and run npx eslint app components lib --max-warnings=0.
≈ “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.
Files
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 fromgetDashboard()inlib/data.ts). - KPI primitive:
components/kpi-card.tsx(label,value,hint, optionalchange,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 withformatUsd. No invented numbers, no fourth catalog price. - Icons from
lucide-react, sizedsize-4inside the tinted chip like the existing cards. - Age or window anything with the frozen clock in
lib/clock.ts, neverDate.now(). - If the KPI needs a new aggregate, add a pure helper to
lib/dashboard.tsand a small Vitest case intests/dashboard.test.ts(keep it passing — do not changelib/disputes/suggested-credit-api.tsortests/suggested-credit-api.test.ts).
Steps
- Pick the metric with the user (good demo picks: "Overdue count", "Disputed dollars", "Paid this week").
- Add/extend the aggregate in
lib/dashboard.ts+ expose it fromgetDashboard(). - Render one
KpiCard(or aCardwith a small list) in the matching grid section ofapp/page.tsx. - Verify at
http://127.0.0.1:43173and runnpx eslint app components lib --max-warnings=0.
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
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.

