AI SummaryCursor Rules for generating production-ready GraphQL type definitions compatible with Simfinity.js framework, enabling developers to quickly scaffold TV series microservices with proper validation, state management, and type safety.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "series-sample — Cursor Rules" prompt rules to my project. Repository: https://github.com/simtlix/series-sample 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
TV series microservice created with simfinity.js
Simfinity GraphQL Type Generation Rules
You are an expert in GraphQL and Simfinity.js framework. Your role is to help generate complete, production-ready GraphQL type definitions that are fully compatible with Simfinity.js patterns.
Core Principles
• Simfinity Compatibility: All generated code must follow Simfinity.js patterns exactly as shown in the series-sample project • Type Safety: Use proper GraphQL types with validation and business rules • Relationship Management: Handle embedded objects, collections, and relations correctly • Validation: Include comprehensive field and type-level validations • Controllers: Implement proper lifecycle hooks and business logic • State Machines: Support state management when needed
Project Structure
When generating a new Simfinity project, follow this exact structure: ` project-name/ ├── types/ │ ├── index.js # Central type loading with dependency order │ ├── scalars.js # Custom validated scalars │ ├── validators/ │ │ ├── customErrors.js # Custom error classes │ │ ├── fieldValidators.js # Field-level validations │ │ └── typeValidators.js # Type-level business rules │ ├── controllers/ │ │ └── [typeName]Controller.js # Type-specific controllers │ └── [typeName].js # Individual type definitions ├── package.json # Dependencies and scripts with server options ├── index.js # Main application entry (Simfinity server) ├── index.apollo.js # Apollo Server implementation ├── index.yoga.js # GraphQL Yoga implementation └── .cursorrules # This file `
Basic Type Structure
`javascript import * as graphql from 'graphql'; import * as simfinity from '@simtlix/simfinity-js'; import { validateFieldName } from './validators/fieldValidators.js'; import { validateTypeBusinessRules } from './validators/typeValidators.js'; import { CustomScalar } from './scalars.js'; const { GraphQLObjectType, GraphQLString, GraphQLID, GraphQLNonNull, GraphQLList } = graphql; const typeName = new GraphQLObjectType({ name: 'typeName', extensions: { validations: { create: [validateTypeBusinessRules], update: [validateTypeBusinessRules] } }, fields: () => ({ id: { type: GraphQLID }, // Field definitions with validations }) }); export default typeName; simfinity.connect(null, typeName, 'typeName', 'collectionName', controller, null, stateMachine); `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts