full-stack-panel-authoring
它能做什么
这项技能指导智能体完成一个完整的仪表板面板添加流程。适合希望后端、组件和注册能以一致的方式一起完成的开发者。
适用场景
- ✓当你要为原生 TypeScript 仪表板添加新的面板类型的时候。
- ✓当一个功能需要服务器路由、服务、组件和注册的时候。
- ✓当服务器使用手动分发循环或 Express 的时候。
技能链接
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/full-stack-panel-authoring/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的原生 TypeScript 仪表板添加一个新面板,从服务器路由一直到注册好的组件。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体先探索项目结构和服务器分发模式,然后依次创建路由、服务、组件和注册文件。它将新路由接入服务器,并将已构建的文件与清单进行核对。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
常见问题
它会创建哪些文件?
技能的清单包括路由文件、服务、面板组件、导出、服务器分发条目和共享工具。
为什么要先探索项目?
技能指出,阅读现有模式可以防止风格偏离,并展示请求如何被分发。
它涵盖容错吗?
涵盖,组件使用熔断器,并将面板状态保存到 localStorage。
详情
作者的原始描述
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
热度
- GitHub 星标
- 7.8k
- 排名
- #13055
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
agentpilot
7.8k帮你的智能体准备任务并运行 AgentPilot 循环,逐步改进项目:循环会提出修改、测试修改并为其打分。
openspace
7.8k帮你的智能体设置 OpenSpace,这是一个用于存储和获取智能体技能的工具,并通过 MCP 将其连接到你的 AI 应用。
rsi-arena
7.8k帮你的智能体设置并运行标准 AI 基准测试,例如 AIME 和 Terminal-Bench,用来比较不同的改进方法。
experiment-guide
7.8k帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。