lovable-boilerplate / rules
Cursor rule65 starsChanged 16 months agoMITView on GitHub
Code quality checklist and anti-patterns to avoid before shipping
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/components.mdcCursor rule
- .cursor/rules/core.mdcCursor rule
- .cursor/rules/design.mdcCursor rule
- .cursor/rules/forms.mdcCursor rule
- .cursor/rules/hooks.mdcCursor rule
- .cursor/rules/services.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
The file
We split this quality.mdc into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Run npm run dev to start development
- Distinctive: line 52
Follow component size limits (300 lines max)
- Distinctive: line 54
Test responsive design on mobile/desktop
- Distinctive: line 55
Verify accessibility contrast ratios
- Very specific: line 56
Run npm run lint and fix all issues
- Distinctive: line 57
Ensure no console errors before shipping
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Code quality checklist and anti-patterns to avoid before shipping
globs: []
alwaysApply: false
---
# Quality Checklist Rules
## Pre-Ship Quality Gates
### Code Architecture Quality
- [ ] **No monolithic components** - Each component under 300 lines with single responsibility
- [ ] **Logic extraction** - Reusable logic moved to custom hooks, not duplicated
- [ ] **Type safety** - Shared interfaces defined in `lib/types.ts` and reused
- [ ] **Service layer** - API calls abstracted to service functions, not inline
- [ ] **Proper imports** - Using path aliases (@/) and organized import groups
- [ ] **Validation schemas** - Zod schemas shared and reused across components
- [ ] **Component composition** - Complex UI built from smaller, focused components
### Design Quality
- [ ] Uses intentional color palette that serves the design purpose
- [ ] Has proper visual hierarchy with varied typography scales
- [ ] Includes subtle animations and micro-interactions
- [ ] Features generous whitespace and purposeful spacing
- [ ] All interactive elements have clear hover/active states
- [ ] **Accessibility standards are met (proper contrast, focus states)**
- [ ] Mobile experience is thoughtfully designed
- [ ] Maintains cohesive visual story throughout
- [ ] Design feels custom-crafted, not template-like
- [ ] Visual identity matches target industry and audience
- [ ] Color choices enhance user experience and brand message
### Essential Commands Check
```bash
npm run lint # MUST pass before shipping
npm run build # MUST succeed without errors
```
### NEVER Ship Code That:
- Contains components over 300 lines mixing multiple concerns
- Has duplicated logic that could be extracted to hooks
- Uses inline API calls instead of service layer
- Lacks proper TypeScript interfaces
- Has accessibility contrast violations
- Contains copy-pasted code blocks
- Mixes business logic with presentation layer
- Has console errors or warnings
- Fails ESLint checks
### Development Workflow
1. Run `npm run dev` to start development
2. Follow component size limits (300 lines max)
3. Extract reusable logic to hooks
4. Test responsive design on mobile/desktop
5. Verify accessibility contrast ratios
6. Run `npm run lint` and fix all issues
7. Ensure no console errors before shipping
## Common Anti-Patterns to Avoid
### Component Anti-Patterns
```tsx
// DON'T: Monolithic component
const BadDashboard = () => {
// 400+ lines of mixed concerns
const [users, setUsers] = useState([])
const [products, setProducts] = useState([])
// ... massive component
}
// DO: Composition pattern
const GoodDashboard = () => (
<PageLayout>
<DashboardHeader />
<DashboardMetrics />
<DashboardCharts />
</PageLayout>
)
```
### Data Fetching Anti-Patterns
```tsx
// DON'T: Inline API calls
const BadComponent = () => {
useEffect(() => {
fetch('/api/users').then(res => res.json()).then(setUsers)
}, [])
}
// DO: Service layer + custom hooks
const GoodComponent = () => {
const { data: users } = useUsers()
}
```
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

