Langsung ke konten
Skillpedia
Website & UI (frontend)7.8k Β· #13041

create-full-stack-panel-feature-with-server-wiring

Fungsinya

Skill ini memandu agent AI melalui penambahan panel dasbor baru yang menyentuh backend, frontend, dan wiring server. Skill ini ditujukan untuk pengembang yang ingin panel baru sesuai dengan kode yang sudah ada.

Kapan dipakai

  • βœ“Saat Anda menambahkan jenis panel baru ke dasbor atau antarmuka admin.
  • βœ“Saat sebuah fitur mencakup rute server, layanan, dan komponen UI.
  • βœ“Saat server memakai dispatch permintaan manual, bukan routing Express.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-full-stack-panel-feature-with-server-wiring/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-full-stack-panel-feature-with-server-wiring/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTambahkan panel metrik baru ke dasbor saya, dengan rute server dan layanannya, lalu hubungkan rutenya ke server agar berfungsi.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mencari contoh yang sudah ada untuk rute, layanan, komponen, dan titik masuk server. Agent membacanya untuk mempelajari konvensinya, lalu membuat file baru dan menambahkan penangan rute baru ke tabel dispatch server.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Create Full-Stack Panel Feature (with Server Wiring)

This skill guides you through creating a complete, pattern-consistent panel feature across all application layers: backend API routes, service logic, frontend components, registration, styling β€” and crucially, wiring the new route handler into the server's dispatch table, whether that uses Express or a manual http.createServer pattern.

When to Use

  • Adding a new panel type to a dashboard or admin interface
  • Creating a feature that spans multiple architectural layers
  • Ensuring consistency with existing codebase patterns across the stack
  • Projects that use a manual http.createServer dispatch loop instead of Express router mounting

Workflow Steps

1. Identify Pattern Files

Locate existing examples for each layer you need to implement:

# Find existing server routes
find . -name "*route*.js" -o -name "*routes*.js" -o -name "*route*.ts" -o -name "*routes*.ts" | grep -E "(panel|dashboard|server)"

# Find service files
find . -name "*service*.js" -o -name "*service*.ts" | grep -E "(panel|dashboard|server)"

# Find UI components
find . -name "*.jsx" -o -name "*.tsx" -o -name "*.ts" | grep -i panel

# Find the server entry point (critical for wiring step)
find . -name "index.ts" -o -name "index.js" -o -name "server.ts" -o -name "server.js" | grep -v node_modules | head -10

# Find registration/config files
find . -name "*config*.js" -o -name "*registry*.js" -o -name "*config*.ts" -o -name "*registry*.ts"

# Find styling files
find . -name "*.css" -o -name "*.scss" | grep -i panel

2. Read and Analyze Patterns

Read 1-2 representative examples from each layer to understand:

  • Naming conventions (e.g., MetricsPanel, metrics-service.ts)
  • Code structure and organization
  • Import/export patterns
  • Registration mechanisms
  • API endpoint patterns
  • Error handling approaches
  • Styling conventions

Also read the server entry point (server/index.ts, src/server.ts, etc.) to determine which dispatch pattern is used:

# Read the server entry point to identify routing mechanism
cat server/index.ts   # or server/index.js, src/server.ts, etc.

Example analysis checklist:

Server Route Pattern:
- βœ“ Endpoint naming: /api/panels/{type}
- βœ“ Authentication middleware
- βœ“ Response format: { success, data, error }

Service Pattern:
- βœ“ Export structure: class vs functions
- βœ“ Data transformation logic
- βœ“ Error propagation

Component Pattern:
- βœ“ Props interface
- βœ“ State management (hooks/class)
- βœ“ Data fetching approach
- βœ“ Loading/error states

Registration Pattern:
- βœ“ Registry file location
- βœ“ Registration format (array/object)
- βœ“ Required metadata fields

Server Dispatch Pattern:
- βœ“ Express app.use() / router.use()  β†’ Express routing
- βœ“ switch/case on url/pathname       β†’ Manual dispatch table
- βœ“ if/else if chain on url           β†’ Manual dispatch chain
- βœ“ handler map object { '/path': fn }β†’ Handler map pattern

3. Plan Your Feature Files

Based on patterns, list the files you need to create and the existing files you need to update:

Typical full-stack panel structure:

  1. Server route handler (e.g., server/routes/system-health-route.ts)
  2. Service layer (e.g., server/services/system-health-service.ts)
  3. UI component (e.g., client/panels/SystemHealthPanel.ts)
  4. Panel registration (e.g., update client/config/panel-registry.ts)
  5. Styling (e.g., client/styles/system-health-panel.css)
  6. Type definitions (if TypeScript, e.g., types/system-health.ts)
  7. ⚠️ Server wiring (update server/index.ts to import and dispatch to the new handler)

3b. Detect Project Framework

Before selecting templates in Step 4, determine the frontend framework in use:

# Check for React
grep -s "react" package.json | head -5

# Check for TypeScript without React (vanilla TS)
ls client/components/*.ts 2>/dev/null | head -3
ls client/panels/*.ts 2>/dev/null | head -3

# Check for a Panel base class (common in vanilla TS dashboards)
grep -r "class.*Panel" client/ --include="*.ts" -l | head -3
grep -r "extends Panel" client/ --include="*.ts" -l | head -3

Decision rule:

  • If react or react-dom is present in package.json β†’ use the React/JSX template (Step 4C-React).
  • If components are .ts files extending a Panel base class β†’ use the Vanilla TS template (Step 4C-Vanilla).
  • When in doubt, read one or two existing component files to conf
Pertanyaan umum

Mengapa titik masuk server dicari dulu?

Skill ini menyatakan langkah wiring bergantung pada cara server mengirim permintaan, sehingga itu harus dicari lebih dulu.

Apakah ini bekerja dengan Express?

Ya. Skill ini mencakup middleware Express maupun pola manual http.createServer dengan switch atau case.

Apakah gaya kodenya sesuai dengan yang ada?

Ya. Skill ini meminta agent membaca contoh yang ada agar kode baru mengikuti pola yang sama.

Detail

Deskripsi asli dari pembuat

Multi-layer workflow for creating complete panel features by analyzing existing patterns and generating coordinated server routes, services, UI components, registration, styling files, AND explicitly wiring new handlers into the server's dispatch table (supports both Express middleware and manual http.createServer switch/case patterns).

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#13041
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa