zuiidea/antd-admin/add-resource
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Add a new CRUD resource in antd-admin-basic (mirror users). Use when scaffolding roles, tenants, or any list+form resource with MSW, routes, menu, and e2e.
Install
npx vskill@latest install zuiidea/antd-admin/add-resourceSKILL.md
Add Resource Recipe
Add a list CRUD flow that mirrors Users (TanStack Router + Query + MSW). No codegen — copy and adapt by hand. References: src/routes/_auth/users/ and matching e2e/*.spec.ts. UI copy is English plain strings (no i18n).
0. Verification commands (after your changes)
Run from the app root (this project directory — where package.json and vite.config.ts live):
1. Zod and types (src/api/<slug>/schemas.ts)
- Define
<Entity>Schema,Create<Entity>RequestSchema,Update<Entity>RequestSchema(Update=Create.partial()). - For list
output, reusePaginatedDataSchema(<Entity>Schema)(unwrappeddata; envelope stays inrequest.ts). - Add list query schema (e.g.
List<Entity>QuerySchema) when the table has filters/pagination. - Export
type <Entity> = z.infer<typeof ...>.
2. Resource API module (src/api/<slug>/index.ts)
- Export path constants if useful for MSW/docs.
- Define APIs with
defineApifrom@/api/request:list/create/update/delete(andqueryKeys). methoddefaults toGET; mutations setPOST/PUT/DELETE.- Use segmented
params/query/body+output; do not call axios from routes.
3. Mock data (src/mocks/data.ts)
- Append a
MOCK_<ENTITIES>array. For admin users,permissionsmust include<slug>:view(and create/edit/delete if you add writes), aligned withGET /api/auth/permissions.
4. MSW (src/mocks/handlers/<slug>.ts + handlers/index.ts)
- Follow
handlers/user.ts: paginatedGET+ optionalkeyword,POST/PUT/DELETE; usesuccessWithSchema/paginatedWithSchema/successWithNullBodyfor success anderrorResponsefor errors. - Register
...<slug>Handlersinhandlers/index.ts.
5. Route page (src/routes/_auth/<slug>/)
createFileRoute("/_auth/<slug>/"), wiringuseResourceCRUDwith resource functions (listX,createX, …) andqueryKeysfrom@/api/<slug>(recommended:optimistic: { update: true, delete: true }), plususeCrudToasts,useUrlSearchState,useTableFitHeight(seeusers/for splitting-Toolbar/-FormModal).- Use English string literals for labels, placeholders, and messages.
6. Menu and permissions (src/utils/appMenu.ts)
- Add a menu entry to
APP_MENU_TREE:path: "/<slug>",permissions: ["<slug>:view"],iconusing a Sidebar-registered key (see existingIconLucide*entries inSidebar). - Keep behavior consistent with
canAccessPath/ 403.
6b. Sidebar labels and icons (src/components/Layout/Sidebar/index.tsx)
- In
MENU_LABELS, add an English label for the menu itemname(must match thenamestring fromappMenu). - In
MENU_ICON_MAP, map the newiconkey to alucide-reacticon and add the matchingimport.
7. E2E (e2e/<slug>.spec.ts)
- Copy structure from
users.spec.ts:loginAsAdmin→goto /<slug>, assert headers / search placeholder, etc.
8. Verification
vp check --no-fmtpnpm run test:e2e(focused spec) or full suite as neededpnpm run buildand watch chunk sizes in the log
Notes
- Before adding or renaming files, confirm nothing already exists at that path so you do not overwrite hand-written code.
- After manual schema edits, treat the diff as source of truth; there is no automatic merge.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapps/basic/.agents/skills/add-resource/SKILL.md
Popularity
- Repository stars
- 9,764
- Repository forks
- 2,468
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zuiidea/antd-admin/add-resource)