full-stack-panel-authoring
Skill này làm gì
Skill này hướng dẫn AI agent qua một quy trình hoàn chỉnh để thêm một panel bảng điều khiển. Nó dành cho nhà phát triển muốn backend, component và đăng ký được làm cùng nhau theo cách nhất quán.
Khi nào nên dùng
- ✓Khi bạn thêm một loại panel mới vào bảng điều khiển TypeScript thuần.
- ✓Khi một tính năng cần route máy chủ, service, component và đăng ký.
- ✓Khi máy chủ dùng hoặc vòng lặp điều phối thủ công hoặc Express.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/full-stack-panel-authoring/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm một panel mới vào bảng điều khiển TypeScript thuần của tôi, từ route máy chủ đến component đã được đăng ký.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent trước hết khám phá cấu trúc dự án và cơ chế điều phối của máy chủ, rồi tạo lần lượt các file route, service, component và đăng ký. Nó nối route mới vào máy chủ và kiểm tra danh sách file với những gì đã xây dựng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Unified Full-Stack Panel Authoring
One guide for the complete workflow: backend route → service → server wiring → Panel component with resilience → registration. Eliminates the need to consult separate skills for what is always a single cohesive task.
When to Use
- Adding a new panel type to a vanilla-TypeScript dashboard
- Creating a feature that spans all layers: server route, service, component, registration
- Ensuring pattern-consistency across the stack
- Projects using a manual
http.createServerdispatch loop or Express
Quick Reference — File Checklist
| # | File | Action |
|---|---|---|
| 1 | server/routes/{feature}-route.ts |
Create |
| 2 | src/services/{feature}.ts |
Create |
| 3 | src/components/{Feature}Panel.ts |
Create |
| 4 | src/components/index.ts |
Update — add export |
| 5 | server/index.ts |
Update — import + dispatch case |
| 6 | src/utils/circuit-breaker.ts |
Create if absent |
| 7 | src/utils/sparkline.ts |
Create if absent |
Step 1 — Explore Project Structure
Run these commands before writing a single line of code. Reading existing patterns prevents style drift and reveals the exact dispatch mechanism.
# Locate server entry point (critical for wiring)
find . -name "index.ts" -o -name "index.js" -o -name "server.ts" -o -name "server.js" \
| grep -v node_modules | head -10
# Find existing route handlers to use as pattern files
find server/routes -name "*.ts" -o -name "*.js" 2>/dev/null | head -10
# Find existing service files
find src/services -name "*.ts" -o -name "*.js" 2>/dev/null | head -10
# Find existing Panel components
find src/components -name "*Panel.ts" 2>/dev/null | head -10
# Find the Panel base class
find src -name "Panel.ts" 2>/dev/null | head -5
# Find component registration index
find src/components -name "index.ts" 2>/dev/null | head -3
# Check for CircuitBreaker utility
find src/utils -name "circuit-breaker.ts" 2>/dev/null
# Check framework (should NOT find React in vanilla TS projects)
grep -s '"react"' package.json | head -3
Read 1-2 examples from each layer before generating any code:
cat server/routes/<existing>-route.ts
cat src/services/<existing>.ts
cat src/components/<existing>Panel.ts
cat src/components/index.ts
cat server/index.ts # most important: reveals dispatch pattern
Step 2 — Detect Server Dispatch Pattern
Read server/index.ts (or server/index.js, src/server.ts) and classify:
# Express signals
grep -n "express\|app\.use\|router\." server/index.ts 2>/dev/null
# Manual http.createServer signals
grep -n "createServer\|switch.*url\|switch.*pathname\|req\.url\|case '/" server/index.ts 2>/dev/null
| Pattern in file | Wiring method (Step 5) |
|---|---|
app.use('/api/x', xRouter) |
5A - Express |
switch(pathname) { case '/api/x': |
5B - Manual switch/case |
if (url.startsWith('/api/x')) |
5C - Manual if/else chain |
const handlers = { '/api/x': fn } |
5D - Handler map |
NOTE: Misidentifying the dispatch pattern is the most common cause of silent 404s. If unsure, read the full server entry point before proceeding.
Step 3 — Create the Server Route Handler
Use the manual dispatch template for http.createServer projects (most common in this codebase). Use the Express template only when Express is confirmed.
Manual dispatch (TypeScript) — preferred template
// server/routes/{feature}-route.ts
import { IncomingMessage, ServerResponse } from 'http';
import { fetch{Feature}Data } from '../../src/services/{feature}';
export async function handle{Feature}Request(
req: IncomingMessage,
res: ServerResponse,
action?: string
): Promise<void> {
try {
const data = await fetch{Feature}Data(action);
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ success: true, data }));
} catch (err) {
res.writeHead(500, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
success: false,
error: err instanceof Error ? err.message : String(err)
}));
}
}
Express template (only when confirmed)
// server/routes/{feature}-route.ts
import { Router } from 'express';
import { fetch{Feature}Data } from '../../src/services/{feature}';
const router = Router();
router.get('/', async (req, res) => {
try {
const data = await fetch{Feature}Data(req.qu
Câu hỏi thường gặp
Nó tạo những file nào?
Danh sách kiểm tra của skill gồm file route, service, component panel, export, mục điều phối trên máy chủ và các tiện ích dùng chung.
Tại sao khám phá dự án trước?
Skill nói đọc các mẫu hiện có giúp tránh lệch phong cách và cho thấy cách điều phối request.
Có bao gồm khả năng phục hồi không?
Có, component dùng circuit breaker và lưu trạng thái panel vào localStorage.
Chi tiết
Mô tả gốc của tác giả
Single cohesive workflow for creating complete dashboard panel features in vanilla TypeScript — covers project-structure exploration, server dispatch pattern detection and wiring (Express or manual http.createServer), Panel base class component authoring with CircuitBreaker resilience and localStorage persistence, panel registration in index.ts, and safe file writing (including emoji workarounds).
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #13055
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.