Communitygithub.com

管理後台與開發工具套件開發

擴充與修改管理後台、開發者入口與維運主控台。在新增管理分頁、指標、監控功能或內部工具時使用。適用於儀表板開發、數據分析、用戶管理及內部工具製作。

管理後台與開發工具套件開發 是什麼?

此技能專注於協助開發者擴充管理後台及建構內部工具,遵循既定的模式與最佳實務。它提供明確的決策指南,幫助判斷何時該新增分頁、修改端點或建立全新工具,並根據資料類型(唯讀、CRUD、批次操作)與使用者(管理員、開發者、維運人員)給出適當的建議。技能文件中詳細列出了五種關鍵的失敗模式,包括資料庫查詢效能、快取失效、稽核日誌遺漏、HIPAA 資料暴露與權限提升,並提供具體的偵測方法與修正範例(如 SQL 與 TypeScript 程式碼)。此外,透過一個「生產環境健康監控分頁」的完整工作範例,示範如何同時實作安全檢查(requireAdmin)、速率限制、稽核日誌與即時更新(SWR)。此技能適用於 Claude Code 等 AI 代理工具,幫助開發者避免常見陷阱,並確保內部工具的安全性、效能與合規性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/admin-dashboard

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

管理後台與開發工具套件開發 是做什麼的?

此技能幫助您遵循既有模式,擴充管理後台並建構內部工具。

決策點

何時新增分頁 vs 修改端點 vs 建立新工具

新增管理功能:
├─ 使用者需要唯讀資料檢視?
│  ├─ 資料存在於目前 API?→ 修改現有分頁
│  ├─ 需要新的資料類型?→ 新增分頁 + 新端點
│  └─ 需要複雜分析?→ 建立專用分析分頁
│
├─ 使用者需要修改系統資料?
│  ├─ 簡單 CRUD 操作?→ 新增管理分頁
│  ├─ 需要批次操作?→ 建立維運主控台分頁
│  └─ 多步驟工作流程?→ 建構精靈元件
│
├─ 內部開發者工具?
│  ├─ 程式碼檢視/文件?→ 加入 /dev 入口
│  ├─ 系統監控?→ 加入 /ops 主控台
│  └─ 用戶支援工具?→ 加入管理後台
│
└─ 外部使用者功能?
   → 停止:請改用前端開發技能

分頁內容實作策略

分頁複雜度評估:
├─ 簡單統計顯示 (< 5 個指標)?
│  → 使用 StatCard 網格模式
│
├─ 含篩選功能的資料表格?
│  ├─ < 1000 行?→ 客戶端篩選
│  └─ > 1000 行?→ 伺服器端分頁 + 搜尋
│
├─ 即時監控?
│  ├─ 每 30 秒以上更新?→ 使用含重新整理間隔的 SWR
│  └─ 每 5 秒以下更新?→ 使用 WebSocket 連線
│
└─ 互動式控制項?
   ├─ 簡單開關/按鈕?→ 行內動作
   └─ 複雜表單?→ 模態對話框 + 確認流程

失敗模式

1. 資料庫查詢效能惡性循環

症狀: 管理後台逾時或載入緩慢(>5 秒) 偵測: 監控 /api/admin/* 回應時間 >3 秒 修正: 新增資料庫索引、實作分頁、快取彙總統計

-- 錯誤:全表掃描
SELECT COUNT(*) FROM pageViews WHERE userId = ?

-- 正確:使用索引時間範圍
SELECT COUNT(*) FROM pageViews WHERE createdAt > NOW() - INTERVAL 24 HOUR

2. 過期快取顯示錯誤資料

症狀: 管理員看到過時的指標,與近期活動不符 偵測: 使用者回報已知操作後統計數據未改變 修正: 在資料變動時實作快取失效,加上「最後更新」時間戳

// 為資料變動操作加入快取清除
await updateUserData(userId);
await revalidateTag('admin-stats'); // 清除快取

3. 稽核日誌遺漏

症狀: 管理員操作未記錄在 auditLog 表中 偵測: 檢查過去 24 小時內管理員操作的 auditLog 條目 修正: 在所有管理端點中加入 logAdminAction() 呼叫

// 每個管理端點必備
await logAdminAction(admin.id, AuditAction.USER_DATA_VIEW, 'users', userId);

4. HIPAA 違規資料暴露

症狀: 錯誤訊息、日誌或彙總檢視中出現受保護健康資訊(PHI) 偵測: 錯誤訊息包含用戶電子郵件/電話/醫療資料 修正: 淨化所有錯誤回應,在管理檢視中使用雜湊識別碼

// 錯誤:暴露用戶電子郵件
{ error: "User [email protected] not found" }

// 正確:使用匿名識別碼
{ error: "User ID hash_123abc not found" }

5. 管理員權限提升

症狀: 一般使用者可以存取管理端點 偵測: 非管理員用戶收到管理資料而非 403 錯誤 修正: 在每個管理端點的第一行加入 requireAdmin() 檢查

export async function GET(request: Request) {
  const admin = await requireAdmin(); // 必須是第一行
  if (!admin) return Response.json({ error: 'Forbidden' }, { status: 403 });
  // ... 其餘處理邏輯
}

工作範例

新增生產環境健康監控分頁

情境: 加入即時 API 健康監控,包含延遲指標、錯誤率與服務狀態。

1. 決策點導航:

  • 使用者需要即時監控 → 使用 SWR 並設定 30 秒重新整理
  • 系統資料,非用戶資料 → 加入管理後台
  • 新的資料類型(API 指標) → 建立新分頁 + 端點

2. 實作步驟:

建立包含必要模式的端點:

// src/app/api/admin/health/route.ts
export async function GET(request: Request) {
  const admin = await requireAdmin(); // 安全優先
  if (!admin) return Response.json({ error: 'Forbidden' }, { status: 403 });
  
  const rateLimitResult = await rateLimiter.check(admin.id); // 速率限制
  if (!rateLimitResult.allowed) return Response.json({}, { status: 429 });
  
  await logAdminAction(admin.id, 'HEALTH_VIEW', 'metrics', null); // 稽核
  
  const metrics = await getHealthMetrics(); // 資料擷取
  return Response.json(metrics);
}

建立分頁元件:

function ProductionHealthTab() {
  const { data: health, error } = useSWR('/api/admin/health', fetcher, {
    refreshInterval: 30000 // 即時更新
  });
  
  return (
    <div className="space-y-6">
      <div className="grid grid-cols-4 gap-4">
        <StatCard label="API 正常運作時間" value="99.9%" status="good" />
        <StatCard label="平均延遲" value="45ms" trend="down" />
        <StatCard label="錯誤率" value="0.1%" status="warning" />
        <StatCard label="活躍服務" value="12/12" status="good" />
      </div>
    </div>
  );
}

3. 專家 vs 新手差異:

  • 新手會遺漏: 稽核日誌、速率限制、HIPAA 安全錯誤處理
  • 專家會抓到: 快取失效策略、效能監控設定、正確的錯誤邊界

品質關卡

  • 管理員存取控制:requireAdmin() 檢查在管理員用戶通過,一般用戶失敗
  • 速率限制:超過速率限制時端點回傳 429(預設 60 次/分鐘)
  • 稽核日誌:管理員操作已記錄至 auditLog 表,包含正確的動作類型
  • 效能基線:在實際資料量下,分頁載入時間 <2 秒
  • HIPAA 合規:錯誤訊息或偵錯輸出中未暴露 PHI
  • 資料驗證:無效請求回傳適當的 400 錯誤及安全訊息
  • 快取行為:後端變更後,資料在 30 秒內更新
  • 錯誤邊界:UI 能優雅處理 API 失敗,不會崩潰
  • 行動裝置響應式:分頁佈局在平板尺寸(768px+)上正常工作
  • 即時更新:自動重新整理在 10 分鐘以上不會造成記憶體洩漏

非適用範圍

請勿使用此技能處理:

  • 外部使用者面向功能 → 使用 frontend-development 代替
  • 驗證/登入流程 → 使用 auth-security 代替
  • 資料庫結構變更 → 使用 database-operations 代替
  • 電子郵件/通知系統 → 使用 communications 代替
  • API 速率限制設定 → 使用 backend-api 代替
  • HIPAA 合規設定 → 使用 security-compliance 代替
  • 效能最佳化 → 使用 optimization 代替

有下列情況時,請委派給其他技能:

  • 新增公開用戶功能 → frontend-development
  • 修改用戶驗證 → auth-security
  • 為外部使用建立新的 API 端點 → backend-api
  • 設定監控基礎設施 → devops-infrastructure

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

Build production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations. Use PROACTIVELY for LLM features, chatbots, AI agents, or AI-powered applications.

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

相關技能