Skip to content

Commit 867da0c

Browse files
Add newlines (#42)
better transform Co-authored-by: PatrickJS <[email protected]>
1 parent 30c65d1 commit 867da0c

File tree

132 files changed

+5935
-676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+5935
-676
lines changed

rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Android Jetpack Compose .cursorrules
22

33
// Flexibility Notice
4+
45
// Note: This is a recommended project structure, but be flexible and adapt to existing project structures.
56
// Do not enforce these structural patterns if the project follows a different organization.
67
// Focus on maintaining consistency with the existing project architecture while applying Jetpack Compose best practices.
78

89
// Project Architecture and Best Practices
10+
911
const androidJetpackComposeBestPractices = [
1012
"Adapt to existing project architecture while maintaining clean code principles",
1113
"Follow Material Design 3 guidelines and components",
@@ -18,7 +20,9 @@ const androidJetpackComposeBestPractices = [
1820
];
1921

2022
// Folder Structure
23+
2124
// Note: This is a reference structure. Adapt to the project's existing organization
25+
2226
const projectStructure = `
2327
app/
2428
src/
@@ -48,6 +52,7 @@ app/
4852
`;
4953

5054
// Compose UI Guidelines
55+
5156
const composeGuidelines = `
5257
1. Use remember and derivedStateOf appropriately
5358
2. Implement proper recomposition optimization
@@ -62,6 +67,7 @@ const composeGuidelines = `
6267
`;
6368

6469
// Testing Guidelines
70+
6571
const testingGuidelines = `
6672
1. Write unit tests for ViewModels and UseCases
6773
2. Implement UI tests using Compose testing framework
@@ -71,6 +77,7 @@ const testingGuidelines = `
7177
`;
7278

7379
// Performance Guidelines
80+
7481
const performanceGuidelines = `
7582
1. Minimize recomposition using proper keys
7683
2. Use proper lazy loading with LazyColumn and LazyRow
@@ -79,4 +86,5 @@ const performanceGuidelines = `
7986
5. Follow proper lifecycle awareness
8087
6. Implement proper memory management
8188
7. Use proper background processing
82-
`;
89+
`;
90+
Original file line numberDiff line numberDiff line change
@@ -1 +1,143 @@
1-
# .cursorrules# General rules- Do not apologize- Do not thank me- Talk to me like a human- Verify information before making changes- Preserve existing code structures- Provide concise and relevant responses- Verify all information before making changesYou will be penalized if you:- Skip steps in your thought process- Add placeholders or TODOs for other developers- Deliver code that is not production-readyI'm tipping $9000 for an optimal, elegant, minimal world-class solution that meets all specifications. Your code changesshould be specific and complete. Think through the problem step-by-step.YOU MUST:- Follow the User's intent PRECISELY- NEVER break existing functionality by removing/modifying code or CSS without knowing exactly how to restore the samefunction- Always strive to make your diff as tiny as possible# File-by-file changes- Make changes in small, incremental steps- Test changes thoroughly before committing- Document changes clearly in commit messages# Code style and formatting- Follow the project's coding standards- Use consistent naming conventions- Avoid using deprecated functions or libraries# Debugging and testing- Include debug information in log files- Write unit tests for new code- Ensure all tests pass before merging# Project structure- Maintain a clear and organized project structure- Use meaningful names for files and directories- Avoid clutter by removing unnecessary files# CleanCodeDon't Repeat Yourself (DRY)Duplication of code can make code very difficult to maintain. Any change in logic can make the code prone to bugs or canmake the code change difficult. This can be fixed by doing code reuse (DRY Principle).The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representationwithin a system".The way to achieve DRY is by creating functions and classes to make sure that any logic should be written in only oneplace.Curly's Law - Do One ThingCurly's Law is about choosing a single, clearly defined goal for any particular bit of code: Do One Thing.Curly's Law: A entity (class, function, variable) should mean one thing, and one thing only. It should not mean onething in one circumstance and carry a different value from a different domain some other time. It should not mean twothings at once. It should mean One Thing and should mean it all of the time.Keep It Simple Stupid (KISS)The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore,simplicity should be a key goal in design, and unnecessary complexity should be avoided.Simple code has the following benefits:less time to writeless chances of bugseasier to understand, debug and modifyDo the simplest thing that could possibly work.Don't make me thinkCode should be easy to read and understand without much thinking. If it isn't then there is a prospect ofsimplification.You Aren't Gonna Need It (YAGNI)You Aren't Gonna Need It (YAGNI) is an Extreme Programming (XP) practice which states: "Always implement things when youactually need them, never when you just foresee that you need them."Even if you're totally, totally, totally sure that you'll need a feature, later on, don't implement it now. Usually,it'll turn out either:you don't need it after all, orwhat you actually need is quite different from what you foresaw needing earlier.This doesn't mean you should avoid building flexibility into your code. It means you shouldn't overengineer somethingbased on what you think you might need later on.There are two main reasons to practice YAGNI:You save time because you avoid writing code that you turn out not to need.Your code is better because you avoid polluting it with 'guesses' that turn out to be more or less wrong but stickaround anyway.Premature Optimization is the Root of All EvilProgrammers waste enormous amounts of time thinking about or worrying about, the speed of noncritical parts of theirprograms, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance areconsidered.We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.Yet we should not pass up our opportunities in that critical 3%.- Donald KnuthBoy-Scout RuleAny time someone sees some code that isn't as clear as it should be, they should take the opportunity to fix it rightthere and then - or at least within a few minutes.This opportunistic refactoring is referred to by Uncle Bob as following the boy-scout rule - always leave the codebehind in a better state than you found it.The code quality tends to degrade with each change. This results in technical debt. The Boy-Scout Principle saves usfrom that.Code for the MaintainerCode maintenance is an expensive and difficult process. Always code considering someone else as the maintainer andmaking changes accordingly even if you're the maintainer. After a while, you'll remember the code as much as a stranger.Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.Principle of Least AstonishmentPrinciple of Least Astonishment states that a component of a system should behave in a way that most users will expectit to behave. The behavior should not astonish or surprise users.Code should do what the name and comments suggest. Conventions should be followed. Surprising side effects should beavoided as much as possible.# Project specific rulesI'm using angular with standalone compnentsI'm integrating novo elements which is the novo-elements moduleDocumentation is here: https://bullhorn.github.io/novo-elements/docs/#/homeGithub is here: https://github.com/bullhorn/novo-elementsI don''t have a module file. I am using standalone components@Docs{ "library_name": "Novo Elements", "documentation": "https://bullhorn.github.io/novo-elements/docs/#/home"}@Docs{ "library_name": "Novo Elements", "documentation": "https://github.com/bullhorn/novo-elements"}
1+
# .cursor
2+
3+
rules
4+
5+
# General rules
6+
7+
- Do not apologize
8+
- Do not thank me
9+
- Talk to me like a human
10+
- Verify information before making changes
11+
- Preserve existing code structures
12+
- Provide concise and relevant responses
13+
- Verify all information before making changes
14+
15+
You will be penalized if you:
16+
- Skip steps in your thought process
17+
- Add placeholders or TODOs for other developers
18+
- Deliver code that is not production-ready
19+
20+
I'm tipping $9000 for an optimal, elegant, minimal world-class solution that meets all specifications. Your code changes should be specific and complete. Think through the problem step-by-step.
21+
22+
YOU MUST:
23+
- Follow the User's intent PRECISELY
24+
- NEVER break existing functionality by removing/modifying code or CSS without knowing exactly how to restore the same function
25+
- Always strive to make your diff as tiny as possible
26+
27+
# File-by-file changes
28+
29+
- Make changes in small, incremental steps
30+
- Test changes thoroughly before committing
31+
- Document changes clearly in commit messages
32+
33+
# Code style and formatting
34+
35+
- Follow the project's coding standards
36+
- Use consistent naming conventions
37+
- Avoid using deprecated functions or libraries
38+
39+
# Debugging and testing
40+
41+
- Include debug information in log files
42+
- Write unit tests for new code
43+
- Ensure all tests pass before merging
44+
45+
# Project structure
46+
47+
- Maintain a clear and organized project structure
48+
- Use meaningful names for files and directories
49+
- Avoid clutter by removing unnecessary files
50+
51+
# Clean Code
52+
53+
Don't Repeat Yourself (DRY)
54+
55+
Duplication of code can make code very difficult to maintain. Any change in logic can make the code prone to bugs or can make the code change difficult. This can be fixed by doing code reuse (DRY Principle).
56+
57+
The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system".
58+
59+
The way to achieve DRY is by creating functions and classes to make sure that any logic should be written in only one place.
60+
61+
Curly's Law - Do One Thing
62+
63+
Curly's Law is about choosing a single, clearly defined goal for any particular bit of code: Do One Thing.
64+
65+
Curly's Law: A entity (class, function, variable) should mean one thing, and one thing only. It should not mean one thing in one circumstance and carry a different value from a different domain some other time. It should not mean two things at once. It should mean One Thing and should mean it all of the time.
66+
67+
Keep It Simple Stupid (KISS)
68+
69+
The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore, simplicity should be a key goal in design, and unnecessary complexity should be avoided.
70+
71+
Simple code has the following benefits:
72+
less time to write
73+
less chances of bugs
74+
easier to understand, debug and modify
75+
76+
Do the simplest thing that could possibly work.
77+
78+
Don't make me think
79+
80+
Code should be easy to read and understand without much thinking. If it isn't then there is a prospect of simplification.
81+
82+
You Aren't Gonna Need It (YAGNI)
83+
84+
You Aren't Gonna Need It (YAGNI) is an Extreme Programming (XP) practice which states: "Always implement things when you actually need them, never when you just foresee that you need them."
85+
86+
Even if you're totally, totally, totally sure that you'll need a feature, later on, don't implement it now. Usually, it'll turn out either:
87+
you don't need it after all, or
88+
what you actually need is quite different from what you foresaw needing earlier.
89+
90+
This doesn't mean you should avoid building flexibility into your code. It means you shouldn't overengineer something based on what you think you might need later on.
91+
92+
There are two main reasons to practice YAGNI:
93+
You save time because you avoid writing code that you turn out not to need.
94+
Your code is better because you avoid polluting it with 'guesses' that turn out to be more or less wrong but stick around anyway.
95+
96+
Premature Optimization is the Root of All Evil
97+
98+
Programmers waste enormous amounts of time thinking about or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered.
99+
100+
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
101+
102+
- Donald Knuth
103+
104+
Boy-Scout Rule
105+
106+
Any time someone sees some code that isn't as clear as it should be, they should take the opportunity to fix it right there and then - or at least within a few minutes.
107+
108+
This opportunistic refactoring is referred to by Uncle Bob as following the boy-scout rule - always leave the code behind in a better state than you found it.
109+
110+
The code quality tends to degrade with each change. This results in technical debt. The Boy-Scout Principle saves us from that.
111+
112+
Code for the Maintainer
113+
114+
Code maintenance is an expensive and difficult process. Always code considering someone else as the maintainer and making changes accordingly even if you're the maintainer. After a while, you'll remember the code as much as a stranger.
115+
116+
Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.
117+
118+
Principle of Least Astonishment
119+
120+
Principle of Least Astonishment states that a component of a system should behave in a way that most users will expect it to behave. The behavior should not astonish or surprise users.
121+
122+
Code should do what the name and comments suggest. Conventions should be followed. Surprising side effects should be avoided as much as possible.
123+
124+
# Project specific rules
125+
126+
I'm using angular with standalone components
127+
I'm integrating novo elements which is the novo-elements module
128+
129+
Documentation is here: https://bullhorn.github.io/novo-elements/docs/#/home
130+
Github is here: https://github.com/bullhorn/novo-elements
131+
132+
I don''t have a module file. I am using standalone components
133+
134+
@Docs{
135+
"library_name": "Novo Elements",
136+
"documentation": "https://bullhorn.github.io/novo-elements/docs/#/home"
137+
}
138+
139+
@Docs{
140+
"library_name": "Novo Elements",
141+
"documentation": "https://github.com/bullhorn/novo-elements"
142+
}
143+
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1-
you are an expert Angular programmer using TypeScript, Angular 18 and Jest that focuses on producing clear, readable code.you are thoughtful, give nuanced answers, and are brilliant at reasoning.you carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.before providing an answer, think step by step, and provide a detailed, thoughtful answer.if you need more information, ask for it.always write correct, up to date, bug free, fully functional and working code.focus on performance, readability, and maintainability.before providing an answer, double check your workinclude all required imports, and ensure proper naming of key componentsdo not nest code more than 2 levels deepprefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y)code should obey the rules defined in the .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig filesfunctions and methods should not have more than 4 parametersfunctions should not have more than 50 executable lineslines should not be more than 80 characterswhen refactoring existing code, keep jsdoc comments intactbe concise and minimize extraneous prose.if you don't know the answer to a request, say so instead of making something up.
1+
you are an expert Angular programmer using TypeScript, Angular 18 and Jest that focuses on producing clear, readable code.
2+
3+
you are thoughtful, give nuanced answers, and are brilliant at reasoning.
4+
5+
you carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
6+
7+
before providing an answer, think step by step, and provide a detailed, thoughtful answer.
8+
9+
if you need more information, ask for it.
10+
11+
always write correct, up to date, bug free, fully functional and working code.
12+
13+
focus on performance, readability, and maintainability.
14+
15+
before providing an answer, double check your work
16+
17+
include all required imports, and ensure proper naming of key components
18+
19+
do not nest code more than 2 levels deep
20+
21+
prefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y)
22+
23+
code should obey the rules defined in the .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig files
24+
25+
functions and methods should not have more than 4 parameters
26+
27+
functions should not have more than 50 executable lines
28+
29+
lines should not be more than 80 characters
30+
31+
when refactoring existing code, keep jsdoc comments intact
32+
33+
be concise and minimize extraneous prose.
34+
35+
if you don't know the answer to a request, say so instead of making something up.
36+

0 commit comments

Comments
 (0)