skills/admin-dashboard/SKILL.md
Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.
npx skillsauth add curiositech/windags-skills admin-dashboardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps you extend the admin dashboard and build internal tools following the established patterns.
Adding New Admin Functionality:
├─ User needs read-only data view?
│ ├─ Data exists in current API? → Modify existing tab
│ ├─ New data type needed? → Add new tab + new endpoint
│ └─ Complex analytics required? → Create dedicated analytics tab
│
├─ User needs to modify system data?
│ ├─ Simple CRUD operations? → Add management tab
│ ├─ Bulk operations needed? → Create operations console tab
│ └─ Multi-step workflow? → Build wizard component
│
├─ Internal developer tooling?
│ ├─ Code inspection/docs? → Add to /dev portal
│ ├─ System monitoring? → Add to /ops console
│ └─ User support tools? → Add to admin dashboard
│
└─ External user functionality?
→ STOP: Use frontend-development skill instead
Tab Complexity Assessment:
├─ Simple stats display (< 5 metrics)?
│ → Use StatCard grid pattern
│
├─ Data table with filtering?
│ ├─ < 1000 rows? → Client-side filtering
│ └─ > 1000 rows? → Server-side pagination + search
│
├─ Real-time monitoring?
│ ├─ Updates every 30s+? → Use SWR with refresh interval
│ └─ Updates every 5s-? → Use WebSocket connection
│
└─ Interactive controls?
├─ Simple toggles/buttons? → Inline actions
└─ Complex forms? → Modal dialogs + confirmation flows
Symptom: Admin dashboard times out or loads slowly (>5 seconds) Detection: Monitor /api/admin/* response times >3s Fix: Add database indexes, implement pagination, cache aggregated stats
-- BAD: Full table scan
SELECT COUNT(*) FROM pageViews WHERE userId = ?
-- GOOD: Use indexed timestamp ranges
SELECT COUNT(*) FROM pageViews WHERE createdAt > NOW() - INTERVAL 24 HOUR
Symptom: Admin sees outdated metrics that don't match recent activity Detection: User reports stats don't change after known actions Fix: Implement cache invalidation on data mutations, add "Last Updated" timestamps
// Add cache busting to mutations
await updateUserData(userId);
await revalidateTag('admin-stats'); // Clear cache
Symptom: Admin actions aren't logged in auditLog table Detection: Check auditLog entries for admin actions in past 24h Fix: Add logAdminAction() calls to ALL admin endpoints
// Required in every admin endpoint
await logAdminAction(admin.id, AuditAction.USER_DATA_VIEW, 'users', userId);
Symptom: PHI visible in error messages, logs, or aggregated views Detection: Error contains user email/phone/medical data Fix: Sanitize all error responses, use hashed identifiers in admin views
// BAD: Exposes user email
{ error: "User [email protected] not found" }
// GOOD: Uses anonymous identifiers
{ error: "User ID hash_123abc not found" }
Symptom: Regular users can access admin endpoints Detection: Non-admin user receives admin data instead of 403 Fix: Add requireAdmin() check as first line of every admin endpoint
export async function GET(request: Request) {
const admin = await requireAdmin(); // Must be FIRST
if (!admin) return Response.json({ error: 'Forbidden' }, { status: 403 });
// ... rest of handler
}
Scenario: Add real-time API health monitoring with latency metrics, error rates, and service status.
1. Decision Point Navigation:
2. Implementation Steps:
Create endpoint with required patterns:
// src/app/api/admin/health/route.ts
export async function GET(request: Request) {
const admin = await requireAdmin(); // Security first
if (!admin) return Response.json({ error: 'Forbidden' }, { status: 403 });
const rateLimitResult = await rateLimiter.check(admin.id); // Rate limiting
if (!rateLimitResult.allowed) return Response.json({}, { status: 429 });
await logAdminAction(admin.id, 'HEALTH_VIEW', 'metrics', null); // Audit
const metrics = await getHealthMetrics(); // Data fetch
return Response.json(metrics);
}
Create tab component:
function ProductionHealthTab() {
const { data: health, error } = useSWR('/api/admin/health', fetcher, {
refreshInterval: 30000 // Real-time updates
});
return (
<div className="space-y-6">
<div className="grid grid-cols-4 gap-4">
<StatCard label="API Uptime" value="99.9%" status="good" />
<StatCard label="Avg Latency" value="45ms" trend="down" />
<StatCard label="Error Rate" value="0.1%" status="warning" />
<StatCard label="Active Services" value="12/12" status="good" />
</div>
</div>
);
}
3. Expert vs Novice Differences:
Do NOT use this skill for:
frontend-development insteadauth-security insteaddatabase-operations insteadcommunications insteadbackend-api insteadsecurity-compliance insteadoptimization insteadDelegate to other skills when:
frontend-developmentauth-securitybackend-apidevops-infrastructuretools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.