Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add shuiyuan1223/skillfix_xuetang --skill "add-page"
Install specific skill from multi-skill repository
# Description
Use when adding a new page/view to the PHA web UI. Covers A2UI page generation, routing, sidebar nav, and i18n.
# SKILL.md
name: add-page
description: Use when adding a new page/view to the PHA web UI. Covers A2UI page generation, routing, sidebar nav, and i18n.
Add New Page to PHA
Checklist
Follow these steps in order. Do NOT skip any step.
1. i18n Types & Translations
- [ ]
src/locales/types.tsโ Addnav.xxxto nav section, add new section if needed - [ ]
src/locales/zh-CN.tsโ Add Chinese translations - [ ]
src/locales/en.tsโ Add English translations
2. Page Generator
- [ ]
src/gateway/pages.tsโ CreategenerateXxxPage(data)function - [ ] Use
A2UIGeneratorto build component tree - [ ] Use
t("xxx.yyy")for all user-facing text (NO hardcoded strings) - [ ] Use icon NAMES (e.g.
"heart","brain"), NEVER emoji foriconproperties - [ ] Available icons listed in CLAUDE.md. Need new icon? Add SVG to
ui/src/lib/icons.tsxICONS object - [ ] Complex pages can have their own file (e.g.
src/gateway/evolution-lab.ts) instead of adding topages.ts
3. Sidebar Navigation
- [ ]
src/gateway/pages.tsโ IngenerateSidebar(), add nav item:
typescript { id: "xxx", label: t("nav.xxx"), icon: "icon-name" } - [ ] Main pages go in first
ui.nav(), settings pages go in secondui.nav()
4. Route Handler
- [ ]
src/gateway/server.tsโ InhandleNavigate(), addcase "xxx":beforedefault: - [ ] Fetch data, call
generateXxxPage(data), assign tomainPage - [ ] Add import for
generateXxxPageat top of file
5. Action Handlers (if page has interactive elements)
- [ ]
src/gateway/server.tsโ InhandleAction(), add handlers for buttons/forms - [ ] Add any session state fields to
GatewaySessionclass - [ ] Pattern:
else if (action === "xxx_action" && payload?.field) { ... }
6. Verify
bun run check # Types pass
bun test # Tests pass
bun run build # Build succeeds
Architecture Rules
- Frontend is a pure renderer โ All UI generated server-side via A2UI
- No frontend changes needed if existing A2UI components suffice
- Available components:
text,card,column,row,grid,chart,stat_card,data_table,table,button,form,form_input,badge,progress,collapsible,code_editor,tabs,score_gauge,modal,git_timeline,step_indicator,file_tree - Complex pages can have their own file (e.g.
evolution-lab.ts) instead of adding topages.ts - New A2UI component types require renderers in both
A2UIRenderer.tsx(Web) andtui-renderer.ts(TUI)
Navigation View IDs
All registered view IDs in handleNavigate():
Main Views:
chat โ ่ๅคฉ้กต้ข (default)
system-agent โ ็ณป็ป Agent ่ๅคฉ
dashboard โ ๅฅๅบทไปช่กจ็ (aliases: health, sleep, activity)
memory โ ่ฎฐๅฟ็ณป็ป
evolution โ ่ฟๅๅฎ้ชๅฎค
Settings Views:
settings/prompts โ ๆ็คบ่ฏ็ฎก็
settings/skills โ ๆ่ฝ็ฎก็
settings/integrations โ ๆฐๆฎๆบ้ๆ
settings/logs โ ๆฅๅฟๆฅ็
settings/general โ ้็จ่ฎพ็ฝฎ
settings/system-agent โ (redirects โ settings/prompts)
settings/evolution โ (redirects โ evolution)
settings/evolution-legacy โ (redirects โ evolution)
Navigation Structure
Main Nav (top-level):
chat, dashboard, memory, evolution, system-agent
Settings Nav (below divider):
settings/prompts, settings/skills, settings/integrations, settings/logs, settings/general
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.