agentsclimarketplace

Umi max enterprise

Skill mik284/umi-max-enterprise

Conventions and patterns for building enterprise apps with Umi Max (@umijs/max), Ant Design Pro, RBAC, ProTable, ProForm, all ProComponents, antd components, Ant Design Charts, GraphQL, and the built-in REST request layer. Use this whenever the user is working in an Umi Max project — mentions "umi", "@umijs/max", "umi max", "Ant Design Pro", ProTable, ProForm, ModalForm, DrawerForm, StepsForm, ProCard, ProDescriptions, ProList, ProLayout, "@ant-design/charts", or files like config/config.ts, src/app.tsx, src/access.ts, src/models, or src/services in a project using the `max` CLI. Covers convention-based routing, the Model data-flow system (useModel), the built-in request layer (axios + ahooks useRequest), the access/permissions plugin (useAccess, <Access>), RBAC with dynamic server-driven menus, ProTable for data-heavy list pages, all ProComponents (ProForm/ModalForm/DrawerForm/StepsForm/ProCard/ProDescriptions/ProList), key antd components and enterprise patterns, Ant Design Charts for dashboards, GraphQL integration via Apollo Client or urql, and the ProLayout-based layout & menu system.From its SKILL.md

Install
npx -y skills add mik284/umi-max-enterprise

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.4 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Umi Max — Enterprise Patterns

Umi Max (@umijs/max) is a curated bundle of plugins on top of UmiJS: convention-based routing, a hooks-based global data store ("Model"), a unified request layer, role-based access control, and a ProLayout-based shell — all wired together so an enterprise admin app needs almost no boilerplate. The defaults are opinionated. The biggest mistake an agent can make here is reaching for generic React patterns (Redux, raw fetch, hand-rolled route guards, custom admin shells, plain antd Table) when Umi Max and ProComponents already have a convention-based answer.

Before writing code in an Umi Max project, identify which system the task touches, and read the matching reference file:

Task involves...Read
Global state, shared data between components, useModel, @@initialStatereferences/data-flow.md
Calling a REST backend, useRequest, error handling, interceptors, request configreferences/request.md
Permissions, roles, "can this user see/do X", route guards, <Access>references/access.md
Page shell, sidebar menu, route config, page title/icon, hiding nav itemsreferences/layout-routing.md
Data tables, search forms, CRUD list pages, column actions, toolbarreferences/pro-table.md
ProForm, ModalForm, DrawerForm, StepsForm, ProCard, ProDescriptions, ProList, ProSkeletonreferences/pro-components.md
antd Form, Upload, Modal, Drawer, Notification, ConfigProvider, Statisticreferences/antd-components.md
Dynamic server-driven menus, multi-tenant roles, fine-grained permissionsreferences/rbac.md
GraphQL queries, mutations, subscriptions, Apollo/urql setupreferences/graphql.md
Dashboard charts, Line, Bar, Pie, DualAxes, Gauge, Tiny sparklines, org chartsreferences/charts.md

If a task touches more than one (e.g. "add a dashboard page with charts that only managers can see"), read all relevant files — they're short and meant to be combined.

Mental model

Umi Max + ProComponents + antd replace almost everything you'd normally hand-roll:

  • Redux / Zustand / ContextModel (src/models/*.ts) + useModel()
  • axios/fetch wrapper → built-in request / useRequest from @umijs/max
  • Manual <PrivateRoute> guards → route access: key + src/access.ts
  • Hand-built admin shelllayout plugin renders ProLayout from route config
  • Custom table + search formProTable from @ant-design/pro-components
  • antd Form boilerplateProForm, ModalForm, DrawerForm, StepsForm
  • antd Card layoutsProCard with split, colSpan, tabs
  • Record detail viewsProDescriptions
  • Chart.js / Recharts@ant-design/charts (Line, Column, Pie, Gauge, etc.)
  • Custom GraphQL wiring → Apollo Client or urql via rootContainer in src/app.tsx

Project conventions an agent must respect

  1. Use the max CLI, not umi. Scaffolding commands are npx max g ....
  2. Respect directory conventions:
    • Models: src/models/*.ts or co-located src/pages/xxx/models/
    • Services (API calls): src/services/*.ts
    • Access rules: src/access.ts (single file, default export)
    • Route config: config/config.ts or config/routes.ts — check which exists
    • Runtime config (interceptors, layout, GraphQL provider): src/app.ts / src/app.tsx
    • GraphQL: src/graphql/client.ts, src/graphql/queries/, src/graphql/generated/
  3. Import from @umijs/max, not from react-redux, axios, react-router-dom for things Umi Max provides.
  4. Import ProComponents from @ant-design/pro-components, not from antd.
  5. Import charts from @ant-design/charts, not from recharts, chart.js, or echarts.
  6. TypeScript types: RequestConfig and RunTimeLayoutConfig are exported from @umijs/max.
  7. Backend is the source of truth for permissions. Client-side RBAC is UX polish only.
  8. Wrap the app in <App> from antd and use App.useApp() for message/modal/notification — never call them as static module imports.
  9. Do not override antd styles with .ant-* CSS selectors — use ConfigProvider design tokens.

Quick examples

Model + useModel:

// src/models/userModel.ts
import { useState, useCallback } from 'react';
import { getUser } from '@/services/user';
export default function useUserModel() {
  const [user, setUser] = useState<any>(null);
  const fetchUser = useCallback(async () => setUser(await getUser()), []);
  return { user, fetchUser };
}
// In a component:
const { user } = useModel('userModel');

REST request:

const { data, loading } = useRequest(() => getUserList({ page: 1 }));

Access:

// src/access.ts
export default function access(initialState: any) {
  const perms = new Set<string>(initialState?.currentUser?.permissions ?? []);
  return { canAdmin: initialState?.currentUser?.role === 'admin', canWriteUsers: perms.has('user:write') };
}
// Route:
{ path: '/admin', component: 'Admin', access: 'canAdmin' }

ProTable:

<ProTable rowKey="id" request={async (params) => {
  const res = await getUserList(params);
  return { data: res.data, success: true, total: res.total };
}} columns={columns} />

ModalForm:

<ModalForm title="Create User" trigger={<Button type="primary">+ New</Button>}
  modalProps={{ destroyOnClose: true }}
  onFinish={async (values) => { await createUser(values); return true; }}>
  <ProFormText name="name" label="Name" rules={[{ required: true }]} />
</ModalForm>

Dashboard chart:

import { Line } from '@ant-design/charts';
<div style={{ height: 280 }}>
  <Line data={data} xField="month" yField="revenue" smooth />
</div>

GraphQL provider (src/app.tsx):

import { ApolloProvider } from '@apollo/client';
import { apolloClient } from './graphql/client';
export function rootContainer(container: React.ReactNode) {
  return <ApolloProvider client={apolloClient}>{container}</ApolloProvider>;
}

RBAC dynamic menu:

export const layout: RunTimeLayoutConfig = ({ initialState }) => ({
  menu: { request: async () => fetchMenuByRole(initialState?.currentUser?.role) },
});

Read the relevant reference file before writing real code — each one covers configuration options, gotchas, and patterns that are not safe to guess.

What ships with it: 12 files

81.5 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,149. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.