agentleFS
chihebnabilchihebnabil/lovable-boilerplate/.cursor/rules/quality.mdc

lovable-boilerplate / rules

Cursor rule65 starsChanged 16 months agoMITView on GitHub

Code quality checklist and anti-patterns to avoid before shipping

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
  1. Very specific:

    Run npm run dev to start development

    line 51
  2. Distinctive:

    Follow component size limits (300 lines max)

    line 52
  3. Distinctive:

    Test responsive design on mobile/desktop

    line 54
  4. Distinctive:

    Verify accessibility contrast ratios

    line 55
  5. Very specific:

    Run npm run lint and fix all issues

    line 56
  6. Distinctive:

    Ensure no console errors before shipping

    line 57

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
quality.mdc
---
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()
}
```

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.