Shadmin Feature Development
Purpose
When the user asks to add/modify a feature in this repo, follow Shadmin’s established architecture and conventions, and land code in the correct layers with minimal, verifiable changes.
Mandatory rules
- Always follow: AI_RULES.md
- Use the existing layering:
- Backend:
api (controller/route) → usecase → repository → ent/schema - Frontend:
web/src/services → web/src/features/<feature> → web/src/routes
- Backend:
- Permissions must be consistent:
- Protected APIs must use JWT + Casbin
CheckAPIPermission()for/api/v1/system/*routes.
- Protected APIs must use JWT + Casbin
- Response format must be consistent:
- Use
domain.RespSuccess(...)/domain.RespError(...).
- Use
- Finish with verification:
- Backend:
go test ./... - If frontend changed:
cd web && (npm|pnpm) run lint && (npm|pnpm) run format:check
- Backend:
Workflow (apply every time)
- Clarify scope (what to do / not do) + list APIs, data model, permissions, and UI impact.
- List touched files first (grouped by backend/frontend layers) before editing.
- Implement changes layer-by-layer:
domain/(DTOs + interfaces + errors)ent/schema/(if data model changes)repository/usecase/(timeouts, validation, orchestration)api/controller/(HTTP only + swagger comments)api/route/+api/route/factory.go(wiring)web/src/types+web/src/services+web/src/features+web/src/routes
- Output at the end:
- Change summary
- File list
- How to verify
References (optional)
- Prompt template: AI提示词模板.md
- Repo guidelines: AGENTS.md
Examples (triggers)
- “新增项目管理模块(Project CRUD)”
- “给字典增加一个字段并在前端表格显示”
- “新增 /api/v1/system/xxx 接口并接入菜单权限”
Converted and distributed by TomeVault — claim your Tome and manage your conversions.