Skip to content
Prompt

wisemapping-frontend — Cursor Rules

by wisemapping

AI Summary

Cursor Rules for WiseMapping frontend that enforces copyright headers, Material-UI tree-shakeable imports, and code standards to maintain bundle size and legal compliance across the project.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "wisemapping-frontend — Cursor Rules" prompt rules to my project.
Repository: https://github.com/wisemapping/wisemapping-frontend

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Cursor Rules for wisemapping-frontend

1. Copyright Header (MANDATORY)

ALL .ts, .tsx, .js, .jsx files MUST start with this header BEFORE any imports: ` /* • Copyright [2007-2025] [wisemapping] • * Licensed under WiseMapping Public License, Version 1.0 (the "License"). • It is basically the Apache License, Version 2.0 (the "License") plus the • "powered by wisemapping" text requirement on every single page; • you may not use this file except in compliance with the License. • You may obtain a copy of the license at • * https://github.com/wisemapping/wisemapping-open-source/blob/main/LICENSE.md • * Unless required by applicable law or agreed to in writing, software • distributed under the License is distributed on an "AS IS" BASIS, • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. • See the License for the specific language governing permissions and • limitations under the License. */ ` Exceptions: package.json, tsconfig.json, .md, .txt, test data files, assets

2. Material UI Imports (CRITICAL - 500KB+ Bundle Impact)

⚠️ Pre-push hook will REJECT incorrect imports

✅ CORRECT (Tree-shakeable):

`typescript // Components - one per line import Button from '@mui/material/Button'; import Box from '@mui/material/Box'; // Icons - one per line import SearchIcon from '@mui/icons-material/Search'; import EditIcon from '@mui/icons-material/Edit'; // Hooks from /styles import { useTheme, styled } from '@mui/material/styles'; // Types use 'import type' import type { PaletteMode } from '@mui/material'; import type { SvgIconProps } from '@mui/material/SvgIcon'; `

❌ WRONG (Bloats bundle):

`typescript import { Button, Box } from '@mui/material'; // NO! import { Search, Edit } from '@mui/icons-material'; // NO! import { PaletteMode } from '@mui/material'; // NO! Use 'import type' ` Common Components Quick Reference: `typescript // Layout: Box, Container, Grid, Stack // Inputs: Button, TextField, Select, MenuItem, Checkbox, Switch // Feedback: Alert, Dialog, Snackbar, CircularProgress // Data: Table, TableBody, TableCell, TableHead, TableRow, Chip, Tooltip // Navigation: Tabs, Tab, Drawer // Utils: IconButton, Divider, Paper, Typography ` Validation: Run ./scripts/check-mui-imports.sh or yarn build:analyze

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
16 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars16
Forks17
Issues5
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more