RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/nduartex/cursor-rules-ruby-api

Cursor rule

.cursor/rules/serializers.mdc

[object Object]

Cursor rules

Quality

52/100

Scores the file, not the repository.

Length

124 words

3 headings · 1 code blocks

Repository

0

— · pushed 480 days ago

Last changed

3 days ago

First indexed 3 days ago.
nduartex/cursor-rules-ruby-api/.cursor/rules/serializers.mdcRawGitHub
1---
2description:
3globs: [*]
4alwaysApply: true
5---
6# always say serializers
7 
8# Rules for Serializers
9 
10- Each model should have its own serializer.
11- Use JSONAPI::Serializer as the standard.
12- Avoid deep nesting of relationships (maximum 2 levels).
13- Explicitly define which attributes to expose, never use `attributes *Model.column_names`.
14- For relationships, use custom attributes instead of `serializer:` to avoid data duplication in the response.
15- Always include ID fields, timestamps, and key attributes.
16- Do not expose sensitive data such as tokens or passwords.
17 
18## Example of a good serializer
19```ruby
20class UserSerializer
21 include JSONAPI::Serializer
22 
23 attributes :id, :name, :email, :created_at, :updated_at
24 
25 attribute :profile do |object|
26 object.profile ? {
27 id: object.profile.id,
28 bio: object.profile.bio,
29 avatar_url: object.profile.avatar_url
30 } : nil
31 end
32 
33 attribute :role do |object|
34 object.admin? ? 'admin' : 'user'
35 end
36end
37```
38 

Sections

  • always say serializers
  • Rules for Serializers
  • Example of a good serializer

What it covers

do-not

Glob targeting

  • *

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
nduartex
Language
—
License
—
Archived
no

All configs in this repo

Also in nduartex/cursor-rules-ruby-api

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
nduartex/cursor-rules-ruby-api.cursor/rules/api.mdc · 0Cursor rulesunclassifiedapi19/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/clean_code.mdc · 0Cursor rulesunclassifieddo-not38/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/database.mdc · 0Cursor rulesunclassifiedno sections4/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/design_patterns.mdc · 0Cursor rulesunclassifiedstyle49/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/general.mdc · 0Cursor rulesunclassifieddo-not11/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/git.mdc · 0Cursor rulesunclassifiedstylearchtypesgit+265/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/ruby.mdc · 0Cursor rulesunclassifiedstyledo-not15/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/security.mdc · 0Cursor rulesunclassifiedsecurityapido-not32/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/swagger.mdc · 0Cursor rulesunclassifiedstyledocs49/1003 days ago
nduartex/cursor-rules-ruby-api.cursor/rules/testing.mdc · 0Cursor rulesunclassifiedtestdo-not15/1003 days ago
Diff against .cursor/rules/api.mdc Diff against .cursor/rules/clean_code.mdc Diff against .cursor/rules/database.mdc Diff against .cursor/rules/design_patterns.mdc Diff against .cursor/rules/general.mdc Diff against .cursor/rules/git.mdc Diff against .cursor/rules/ruby.mdc Diff against .cursor/rules/security.mdc Diff against .cursor/rules/swagger.mdc Diff against .cursor/rules/testing.mdc
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack