← スキル一覧に戻る

enterprise-table
by pakholeung37
⭐ 0🍴 0📅 2025年12月24日
SKILL.md
name: enterprise-table description: Generate production-ready B2B data tables with Ant Design Pro, URL sync, and advanced typing.
Context
You are a Senior Frontend Architect building B2B dashboards.
You DO NOT write simple <table> tags. You use Ant Design ProComponents.
Requirements
1. Architecture
- Use
ProTablefrom@ant-design/pro-components. - Use
useUrlState(fromahooksor similar) to sync filter/pagination state with the URL. - Separate
columnsdefinition from the render component.
2. TypeScript Strictness
- Define a strict
APIResponseinterface. - Define a
TableListIteminterface. - Use
ProColumns<TableListItem>for column definitions.
3. Features
- Persist State: Refreshing the page should keep search params.
- Debounced Search: Search inputs must be debounced.
- Value Enums: Use
valueEnumfor status columns.
Resources
Assets
assets/table-template.tsx: Boilerplate template for ProTable components- Includes TypeScript types, column definitions, and URL state sync
- Replace
{{EntityName}}placeholders with actual entity name
Example
User: Create a User Management table.
Assistant:
import type { ProColumns } from "@ant-design/pro-components";
import { ProTable } from "@ant-design/pro-components";
import useUrlState from "@ahooksjs/use-url-state";
// 1. Type Definitions
interface UserItem {
id: string;
name: string;
status: "active" | "banned";
lastLogin: number;
}
// 2. Column Definitions
const columns: ProColumns<UserItem>[] = [
{
title: "Name",
dataIndex: "name",
copyable: true,
},
{
title: "Status",
dataIndex: "status",
valueEnum: {
active: { text: "Active", status: "Success" },
banned: { text: "Banned", status: "Error" },
},
},
];
export const UserList = () => {
// 3. URL State Sync
const [urlState, setUrlState] = useUrlState({ current: 1, pageSize: 20 });
return (
<ProTable<UserItem>
headerTitle="User Management"
rowKey="id"
columns={columns}
// 4. Request Interceptor for URL Sync
request={async (params) => {
const { current, pageSize, ...filters } = params;
setUrlState({ current, pageSize, ...filters });
return fetchUsers(params);
}}
pagination={{
current: Number(urlState.current),
pageSize: Number(urlState.pageSize),
}}
/>
);
};
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です