solidjs-basic-cursorrules-prompt-file — Cursor rule: setup and use
Enforces Solid.js conventions in Cursor, including reactive primitives, folder layout, and component rendering patterns.
.cursor/rules/solidjs-basic-cursorrules-prompt-file.mdcWhat solidjs-basic-cursorrules-prompt-file does
This rule guides Cursor when generating Solid.js code by enforcing functional JSX components and core reactivity primitives. It directs the assistant to handle state with createSignal() and createStore(), derive values with createMemo(), and manage side effects via createEffect(). Conditional rendering and collections must use <Show> and <For> components rather than ternaries or map() calls.
The configuration outlines a baseline directory layout: src/components, src/pages, and src/utils alongside App.jsx and index.jsx. It also instructs the agent to configure data fetching through createResource(), apply lazy loading, implement Solid Router when routing is needed, and handle failures with error boundaries.
Because alwaysApply is set to false, Cursor will not inject these instructions into every prompt unless relevant project files match the glob pattern.
What it helps with
- enforce createSignal and createStore for reactive state
- replace map methods and ternaries with For and Show components
- scaffold a standard Solid.js project structure with pages and components
- handle async data fetching using createResource
Example prompts for the agent
- Build a user list component in Solid.js with dynamic filtering and a loading state
- Set up page routing using Solid Router with code splitting
- Convert this React component into a functional Solid.js component using signals
How to install solidjs-basic-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/solidjs-basic-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/solidjs-basic-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/solidjs-basic-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/solidjs-basic-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/solidjs-basic-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about solidjs-basic-cursorrules-prompt-file
How do I install solidjs-basic-cursorrules-prompt-file in Cursor?
Save the rule content to .cursor/rules/solidjs-basic-cursorrules-prompt-file.mdc in your project root.
What reactive primitives does this rule enforce?
It instructs the assistant to use createSignal() for local state, createStore() for complex state, and createMemo() for derived values.
Does the rule run on every query automatically?
No, the frontmatter specifies alwaysApply: false, so Cursor applies it conditionally rather than globally injecting it into every chat.
Source text
solidjs-basic-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Solid.js development with basic setup." globs: **/* alwaysApply: false --- // Solid.js Basic Setup .cursorrules // Prefer functional components const preferFunctionalComponents = true; // Solid.js best practices const solidjsBestPractices = [ "Use createSignal() for reactive state", "Utilize createEffect() for side effects", "Implement createMemo() for derived values", "Use createResource() for data fetching", "Implement Show and For components for conditional and list rendering", "Utilize createStore() for complex state management", ]; // Folder structure const folderStructure = ` src/ components/ pages/ utils/ App.jsx index.jsx public/ index.html `; // Additional instructions const additionalInstructions = ` 1. Use JSX for component templates 2. Implement proper error boundaries 3. Utilize Solid Router for routing when applicable 4. Use Solid's built-in optimization features 5. Implement lazy-loading for improved performance 6. Follow Solid.js naming conventions and best practices 7. Use server-side rendering (SSR) when needed `;
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules