一键导入
add-ui-screen
Step-by-step workflow for adding a new screen/page to pulse-ui. Use when creating a new UI screen, page, dashboard view, or route in pulse-ui/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Step-by-step workflow for adding a new screen/page to pulse-ui. Use when creating a new UI screen, page, dashboard view, or route in pulse-ui/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Step-by-step workflow for adding a new sub-agent or tool to the Pulse AI system. Use when creating a new ADK agent, tool, or extending the AI pipeline in pulse_ai/.
Cross-cutting workflow for adding a new alert metric spanning DB, backend, cron, frontend, and AI agent. Only invoke explicitly when adding a new metric type.
Step-by-step workflow for adding a new REST API endpoint to pulse-server. Use when creating a new backend endpoint, route, resource, or API in backend/server/.
Step-by-step workflow for adding a new reusable component to pulse-ui. Use when creating a shared component in pulse-ui/src/components/ (not a full screen/page).
Workflow for ClickHouse schema changes — adding columns, tables, or modifying the OTEL analytics schema. Use when making changes to ClickHouse tables in the otel database.
Workflow for building and deploying Pulse services locally via Docker. Use when building Docker images, starting/stopping services, or managing the local development environment.
| name | add-ui-screen |
| description | Step-by-step workflow for adding a new screen/page to pulse-ui. Use when creating a new UI screen, page, dashboard view, or route in pulse-ui/. |
- [ ] Step 1: Create screen folder structure
- [ ] Step 2: Define types/interfaces
- [ ] Step 3: Create React Query hook
- [ ] Step 4: Build the screen component
- [ ] Step 5: Add styles
- [ ] Step 6: Register route
- [ ] Step 7: Add navbar entry (if top-level)
- [ ] Step 8: Verify build
pulse-ui/src/screens/MyScreen/
├── MyScreen.tsx
├── MyScreen.interface.ts
├── MyScreen.module.css
├── MyScreen.constants.ts
├── index.ts
└── components/ (if needed)
index.ts:
export { MyScreen } from "./MyScreen";
MyScreen.interface.ts:
export interface MyScreenProps {
// props if any
}
export interface MyDataItem {
id: string;
name: string;
// ...
}
Create a folder-based hook at pulse-ui/src/hooks/useGetMyData/:
hooks/useGetMyData/
├── index.ts # Barrel export
├── useGetMyData.ts # Hook implementation
└── useGetMyData.interface.ts # Types for this hook
useGetMyData.interface.ts:
export interface MyDataResponse {
items: MyDataItem[];
}
useGetMyData.ts:
import { useQuery } from "@tanstack/react-query";
import { makeRequest } from "../../helpers/makeRequest/makeRequest";
import { API_BASE_URL } from "../../constants/Constants";
import { MyDataResponse } from "./useGetMyData.interface";
export function useGetMyData(enabled: boolean) {
return useQuery({
queryKey: ["myData"],
queryFn: () => makeRequest<MyDataResponse>({
url: `${API_BASE_URL}/v1/my-endpoint`,
init: { method: "GET" },
}),
enabled,
refetchOnWindowFocus: false,
});
}
index.ts:
export { useGetMyData } from "./useGetMyData";
Use Mantine components, handle loading/error states:
import { Container, Title, Loader, Alert } from "@mantine/core";
import classes from "./MyScreen.module.css";
import { useGetMyData } from "../../hooks/useGetMyData";
export function MyScreen() {
const { data, isLoading, error } = useGetMyData(true);
if (isLoading) return <Loader />;
if (error) return <Alert color="red">Failed to load data</Alert>;
return (
<Container className={classes.container}>
<Title order={2}>My Screen</Title>
{/* content */}
</Container>
);
}
MyScreen.module.css using Mantine CSS variables:
.container {
padding: var(--mantine-spacing-md);
}
In Constants.ts, add to ROUTES:
MY_SCREEN: { basePath: "/my-screen", ... }
In App.tsx, add <Route>:
<Route path={ROUTES.MY_SCREEN.basePath} element={<MyScreen />} />
Add entry in NAVBAR_ITEMS in Constants.ts with a Tabler icon.
cd pulse-ui && yarn build