agentleFS
donvitodonvito/ai-backends/.cursor/rules/folder-guidelines.mdc

ai-backends / rules

Cursor rule146 starsChanged 14 months agoApache-2.0View on GitHub

This document provides guidelines for organizing code in the AI Backends project.

  • 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 4,157 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 repository2 other files it gives its agents.

The file

We split this folder-guidelines.mdc into the rules it gives an agent

12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Call appropriate services to process business logic

    line 20
  2. Distinctive:

    Keep controllers thin, move business logic to services

    line 22
  3. Distinctive:

    Create reusable middleware functions

    line 26
  4. Distinctive:

    Keep middleware focused on a single responsibility

    line 28
  5. Distinctive:

    Create interfaces for database entities if applicable

    line 33
  6. Distinctive:

    Use descriptive names that reflect the resource being accessed

    line 41
  7. Distinctive:

    Create reusable utility functions

    line 52
  8. Distinctive:

    Keep functions pure when possible

    line 53
  9. Distinctive:

    Create reusable schema components

    line 59
  10. Distinctive:

    Keep schemas aligned with OpenAPI documentation

    line 60
  11. Distinctive:

    Create comprehensive test coverage

    line 64
  12. Distinctive:

    Use fixtures for test data

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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
folder-guidelines.mdc
---
description: 
globs: 
alwaysApply: true
---
# Folder Organization Guidelines

This document provides guidelines for organizing code in the AI Backends project.

## src/config/

- Store environment variables, app settings, and configuration values
- Export constants for API keys, server settings, etc.
- Configuration should be loaded from environment variables when possible

## src/controllers/

- Controllers should handle HTTP request/response cycle
- Extract request data and validate it
- Call appropriate services to process business logic
- Format and return responses
- Keep controllers thin, move business logic to services

## src/middlewares/

- Create reusable middleware functions
- Handle cross-cutting concerns like authentication, logging, error handling
- Keep middleware focused on a single responsibility

## src/models/

- Define data structures and types
- Create interfaces for database entities if applicable
- Define schemas for data validation

## src/routes/

- Define API routes and endpoints
- Connect routes to controllers
- Group related routes in separate files
- Use descriptive names that reflect the resource being accessed

## src/services/

- Implement core business logic
- Handle external API calls
- Maintain separation of concerns
- Services should be testable in isolation

## src/utils/

- Create reusable utility functions
- Keep functions pure when possible
- Group related utilities in separate files

## src/schemas/

- Define validation schemas using Zod
- Create reusable schema components
- Keep schemas aligned with OpenAPI documentation

## tests/

- Create comprehensive test coverage
- Unit tests should focus on individual functions
- Integration tests should test API endpoints
- Use fixtures for test data

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.