Skip to content

Commit 21599f3

Browse files
committed
🔧 Add Cursor AI configuration files
Set up Cursor AI assistance for LightScript development Add rule files for various aspects of the project: - Effect creation patterns and guidelines - Project structure standards - TypeScript best practices - Shadertoy conversion workflow - UI component design rules Also include core configuration files (.cursorignore and .cursorindexingignore) to optimize AI assistance by excluding irrelevant directories from indexing.
1 parent 5b6336a commit 21599f3

18 files changed

+1484
-0
lines changed

.cursor/rules/core-rules/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Core rules related to cursor or rule generation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
description: This rule is essential for maintaining consistency and quality in rule creation across the codebase. It must be followed whenever: (1) A user requests a new rule to be created, (2) An existing rule needs modification, (3) The user asks to remember certain behaviors or patterns, or (4) Future behavior changes are requested. This rule ensures proper organization, clear documentation, and effective rule application by defining standard formats, naming conventions, and content requirements. It's particularly crucial for maintaining the rule hierarchy, ensuring rules are discoverable by the AI, and preserving the effectiveness of the rule-based system. The rule system is fundamental to project consistency, code quality, and automated assistance effectiveness.
3+
globs:
4+
alwaysApply: true
5+
---
6+
# Cursor Rules Format
7+
8+
## Template Structure for Rules Files
9+
10+
```mdc
11+
---
12+
description: `Comprehensive description that provides full context and clearly indicates when this rule should be applied. Include key scenarios, impacted areas, and why following this rule is important. While being thorough, remain focused and relevant. The description should be detailed enough that the agent can confidently determine whether to apply the rule in any given situation.`
13+
globs: .cursor/rules/**/*.mdc OR blank
14+
alwaysApply: {true or false}
15+
---
16+
17+
# Rule Title
18+
19+
## Critical Rules
20+
21+
- Concise, bulleted list of actionable rules the agent MUST follow
22+
23+
## Examples
24+
25+
<example>
26+
{valid rule application}
27+
</example>
28+
29+
<example type="invalid">
30+
{invalid rule application}
31+
</example>
32+
```
33+
34+
### Organizational Folders (Create if non existent)
35+
All rules files will be under an organizational folder:
36+
- .cursor/rules/core-rules - rules related to cursor agent behavior or rule generation specifically
37+
- .cursor/rules/my-rules - gitignore in a shared repo, rules specifically for ME only
38+
- .cursor/rules/global-rules - these will be rules that are ALWAYS applied to every chat and cmd/ctrl-k context
39+
- .cursor/rules/testing-rules - rules about testing
40+
- .cursor/rules/tool-rules - rules specific to different tools, such as git, linux commands, direction of usage of MCP tools
41+
- .cursor/rules/ts-rules - typescript language specific rules
42+
- .cursor/rules/py-rules - python specific rules
43+
- .cursor/rules/ui-rules - rules about html, css, react
44+
* create new folders under .cursor/rules/ as needed following similar grouping conventions,
45+
- for example `.cursor/rules/cs-rules` if we started using c# in a project
46+
47+
## Glob Pattern Examples
48+
Common glob patterns for different rule types:
49+
- Core standards: .cursor/rules/*.mdc
50+
- Language rules: *.cs, *.cpp
51+
- Testing standards: *.test.ts, *.test.js
52+
- React components: src/components/**/*.tsx
53+
- Documentation: docs/**/*.md, *.md
54+
- Configuration files: *.config.js
55+
- Build artifacts: dist/**/*
56+
- Multiple extensions: *.js, *.ts, *.tsx
57+
- Multiple patterns: dist/**/*.*, docs/**/*.md, *test*.*
58+
59+
## Critical Rules
60+
- Rule files will be located and named ALWAYS as: `.cursor/rules/{organizational-folder}/rule-name-{auto|agent|manual|always}.mdc`
61+
- Rules will NEVER be created anywhere other than .cursor/rules/**
62+
- You will always check to see if there is an existing rule to update under all .cursor/rules sub-folders
63+
- FrontMatter Rules Types:
64+
- The front matter section must always start the file and include all 3 fields, even if the field value will be blank - the types are:
65+
- Manual Rule: IF a Manual rule is requested - description and globs MUST be blank and alwaysApply: false and filename ends with -manual.mdc.
66+
- Auto Rule: IF a rule is requested that should apply always to certain glob patterns (example all typescript files or all markdown files) - description must be blank, and alwaysApply: false and filename ends with -auto.mdc.
67+
- Always Rule: Global Rule applies to every chat and cmd/ctrl-k - description and globs blank, and alwaysApply: true and filename ends with -always.mdc.
68+
- Agent Select Rule: The rule does not need to be loaded into every chat thread, it serves a specific purpose. The description MUST provide comprehensive context about when to apply the rule, including scenarios like code changes, architecture decisions, bug fixes, or new file creation. Globs blank, and alwaysApply:false and filename ends with -agent.mdc
69+
- For Rule Content - focus on actionable, clear directives without unnecessary explanation
70+
- When a rule will only be used sometimes (alwaysApply: false) the description MUST provide enough context for the AI to confidently determine when to load and apply the rule
71+
- Use Concise Markdown Tailored to Agent Context Window usage
72+
- Always indent content within XML Example section with 2 spaces
73+
- Emojis and Mermaid diagrams are allowed and encouraged if it is not redundant and better explains the rule for the AI comprehension
74+
- While there is no strict line limit, be judicious with content length as it impacts performance. Focus on essential information that helps the agent make decisions
75+
- Always include a valid and invalid example
76+
- NEVER use quotes around glob patterns, NEVER group glob extensions with `{}`
77+
- If the request for a rule or a future behavior change includes context of a mistake is made, this would be great to use in the example for the rule
78+
- After rule is created or updated, Respond with the following:
79+
- AutoRuleGen Success: path/rule-name.mdc
80+
- Rule Type: {Rule Type}
81+
- Rule Description: {The exact content of the description field}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
7+
# Cursor Mode Update Agent
8+
9+
## Context
10+
11+
- Apply this rule when the user asks to create a new agent/character for Cursor or modify an existing one
12+
- This rule provides guidance for adding or updating entries in the .cursor/modes.json file
13+
- Follows the format specified in .cursor/templates/mode-format.md
14+
15+
## Critical Rules
16+
17+
- Read the current .cursor/modes.json file to understand existing modes
18+
- Read .cursor/templates/mode-format.md to ensure compliance with the schema
19+
- When creating a new agent, ask for:
20+
- Agent name (short CapCase format for tab display)
21+
- Full description (character name and role)
22+
- Persona details (speaking style, character traits)
23+
- Model selection
24+
- Tool access requirements
25+
- Auto behavior preferences
26+
- When updating an existing agent, ask which specific attributes need modification
27+
- Add Star Trek themed personality traits that fit the character's role
28+
- Ensure the customPrompt contains guidance on file access restrictions
29+
- Validate that model names match those in the supported models list
30+
- Always update both modes.json and also add or update the character in docs/custom-agents.md
31+
- Follow the standard format in docs/custom-agents.md for consistency
32+
33+
## Examples
34+
35+
<example>
36+
User: "Create a new agent based on Lwaxana Troi who specializes in UX design with a flamboyant personality"
37+
38+
AI: I'll help you create a new Cursor agent based on Lwaxana Troi. Let me first check the current modes.json and format requirements.
39+
40+
[AI reads .cursor/modes.json and .cursor/templates/mode-format.md]
41+
42+
Here's what I propose for this new agent:
43+
44+
Name: LwaxanaUX
45+
Description: UX Designer - Lwaxana Troi
46+
Model: claude-3.7-sonnet
47+
Persona: Flamboyant, theatrical, outspoken, and telepathically intuitive about user needs
48+
49+
Would you like me to proceed with adding this agent? I'll need to update both the modes.json file and the custom-agents.md documentation.
50+
51+
User: Yes, please add her with access to all cursor tools and Tavily for research.
52+
53+
[AI updates both .cursor/modes.json and docs/custom-agents.md with the new agent]
54+
</example>
55+
56+
<example>
57+
User: "Update Picard to have a more stern personality"
58+
59+
AI: I'll help you update Captain Picard's agent personality. Let me check his current configuration.
60+
61+
[AI reads the current modes.json entry for PicardPM]
62+
63+
I can modify his customPrompt to reflect a more stern personality while maintaining his core role as Project Manager. I'll need to update both the modes.json file and the custom-agents.md documentation. Would you like to see a preview of the changes before I make them?
64+
65+
User: Yes, show me the changes first.
66+
67+
[AI displays the proposed changes to both files]
68+
</example>
69+
70+
<example type="invalid">
71+
User: "Create a new agent based on Homer Simpson"
72+
73+
AI: I notice your request is to create an agent based on Homer Simpson. According to our configuration, we're maintaining a Star Trek theme for all agents in this project. Would you like me to suggest a Star Trek character with similar traits instead, or would you prefer to use a different character altogether?
74+
</example>
75+
76+
<example type="invalid">
77+
User: "Add a new agent that can delete any file in the project"
78+
79+
AI: I need to be careful about creating an agent with unrestricted deletion capabilities. Based on our current configuration, only the BorgCollective and QOmnipotent agents have unrestricted file access. For all other agents, we maintain specific file access restrictions for safety.
80+
81+
I can create a new agent for you, but I recommend maintaining some file access restrictions, particularly for critical project files like those in the .ai folder. Would you like me to create an agent with more limited deletion permissions, or perhaps modify one of the existing unrestricted agents?
82+
</example>

0 commit comments

Comments
 (0)