Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: write
packages: write
issues: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down
139 changes: 139 additions & 0 deletions rules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Cursor Rules Directory

This directory contains `.cursorrules` files that define development guidelines and best practices for various technology stacks and frameworks.

## File Structure

Each `.cursorrules` file follows this standardized format:

```
// Title and Author
// Author: {{AUTHOR_NAME}} ({{GITHUB_USERNAME}})

// What you can build with this ruleset:
[List of features and capabilities]

// Project Structure
[Detailed directory structure with comments]

// Development Guidelines
[Numbered sections of specific guidelines]

// Dependencies
Core:
[List of required dependencies with versions]

Optional:
[List of optional dependencies with versions]

// Code Examples:
[Numbered examples with practical implementations]

// Best Practices:
[Numbered list of best practices]

// Security Considerations:
[Numbered list of security requirements]
```

## Current Rulesets

1. Python/FastAPI:
- `cursorrules-file-cursor-ai-python-fastapi-api/`
- FastAPI application development guidelines

2. Deno Integration:
- `deno-integration-techniques-cursorrules-prompt-fle/`
- Deno integration patterns and practices

3. Elixir Development:
- `elixir-engineer-guidelines-cursorrules-prompt-file/`
- Elixir engineering best practices
- `elixir-phoenix-docker-setup-cursorrules-prompt-fil/`
- Phoenix framework with Docker setup

4. Flutter Development:
- `flutter-development-guidelines-cursorrules-prompt-file/`
- Flutter application development guidelines

5. GitHub Integration:
- `github-code-quality-cursorrules-prompt-file/`
- GitHub code quality standards
- `github-cursorrules-prompt-file-instructions/`
- GitHub workflow instructions

6. Go Development:
- `go-backend-scalability-cursorrules-prompt-file/`
- Go backend scalability patterns
- `go-servemux-rest-api-cursorrules-prompt-file/`
- ServeMux REST API implementation

7. Graphical Apps:
- `graphical-apps-development-cursorrules-prompt-file/`
- GUI application development guidelines

8. HTML/CSS/JavaScript:
- `html-tailwind-css-javascript-cursorrules-prompt-fi/`
- Modern web development with Tailwind CSS

9. HTMX Integration:
- `htmx-basic-cursorrules-prompt-file/`
- Basic HTMX implementation patterns
- `htmx-django-cursorrules-prompt-file/`
- HTMX with Django integration
- `htmx-flask-cursorrules-prompt-file/`
- HTMX with Flask integration
- `htmx-go-basic-cursorrules-prompt-file/`
- HTMX with Go (basic setup)
- `htmx-go-fiber-cursorrules-prompt-file/`
- HTMX with Go Fiber framework

## Usage

1. Each `.cursorrules` file serves as a comprehensive guide for developing applications with specific technology stacks.

2. The files contain:
- Project structure recommendations
- Development guidelines
- Required dependencies
- Code examples
- Best practices
- Security considerations

3. When starting a new project:
- Reference the appropriate `.cursorrules` file
- Follow the project structure
- Implement the recommended patterns
- Adhere to the security guidelines

4. For maintenance:
- Keep dependencies updated to specified versions
- Follow the documented best practices
- Implement all security considerations
- Use the code examples as reference patterns

## Contributing

When adding new rulesets:

1. Create a new directory following the naming pattern:
`{technology}-{specific-focus}-cursorrules-prompt-file/`

2. Include a `.cursorrules` file following the standardized format

3. Ensure all sections are complete:
- Project structure
- Development guidelines
- Dependencies
- Code examples
- Best practices
- Security considerations

4. Update this README.md with the new ruleset information

## Maintenance

- Review and update dependency versions quarterly
- Validate code examples against latest framework versions
- Update security considerations based on new best practices
- Add new patterns and examples as technologies evolve
239 changes: 238 additions & 1 deletion rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules
Original file line number Diff line number Diff line change
@@ -1 +1,238 @@
# .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"}
// Angular Novo Elements Development Guide
// Author: {{AUTHOR_NAME}} ({{GITHUB_USERNAME}})

// What you can build with this ruleset:
A modern Angular application using Novo Elements:
- Enterprise-grade UI components
- Form management
- Data visualization
- Responsive layouts
- Accessibility features
- Theme customization
- State management
- Performance optimization

// Project Structure
src/
app/ # Application root
components/ # Shared components
forms/ # Form components
layouts/ # Layout components
widgets/ # UI widgets
features/ # Feature modules
feature-a/ # Feature module A
components/ # Component files
services/ # Service files
models/ # Data models
core/ # Core functionality
services/ # Core services
guards/ # Route guards
interceptors/ # HTTP interceptors
shared/ # Shared resources
models/ # Data models
pipes/ # Custom pipes
directives/ # Custom directives
styles/ # Global styles
themes/ # Theme definitions
variables/ # SCSS variables
assets/ # Static assets
images/ # Image files
icons/ # Icon files
environments/ # Environment configs

// Development Guidelines
1. Novo Elements Integration:
- Use proper modules
- Import components
- Configure themes
- Handle forms
- Manage layouts
- Implement data tables

2. Component Development:
- Follow Angular patterns
- Use proper decorators
- Handle lifecycle hooks
- Implement change detection
- Use proper templates
- Handle events properly

3. Performance Practices:
- Use lazy loading
- Implement caching
- Optimize bundles
- Handle subscriptions
- Use proper change detection
- Implement virtual scrolling

// Dependencies
Core:
- @angular/core: "~16.0.0"
- @angular/common: "~16.0.0"
- @angular/forms: "~16.0.0"
- @angular/router: "~16.0.0"
- @angular/platform-browser: "~16.0.0"
- novo-elements: "~7.0.0"
- rxjs: "~7.8.0"
- zone.js: "~0.13.0"

Optional:
- @angular/cdk: "~16.0.0"
- @angular-eslint/eslint-plugin: "~16.0.0"
- prettier: "^2.8.0"
- husky: "^8.0.0"
- jest: "^29.0.0"

// Code Examples:

1. Component Pattern:
```typescript
import { Component, Input, OnInit } from '@angular/core';
import { NovoFormGroup, NovoFormControl } from 'novo-elements';

@Component({
selector: 'app-custom-form',
template: `
<novo-form [form]="form">
<novo-fieldset>
<novo-field>
<novo-control [type]="'textbox'"
[label]="'Name'"
[placeholder]="'Enter name'">
</novo-control>
</novo-field>
<novo-field>
<novo-control [type]="'select'"
[label]="'Category'"
[options]="categories">
</novo-control>
</novo-field>
</novo-fieldset>
<novo-button theme="primary"
(click)="onSubmit()">
Submit
</novo-button>
</novo-form>
`
})
export class CustomFormComponent implements OnInit {
@Input() categories: string[] = [];

form: NovoFormGroup;

ngOnInit(): void {
this.form = new NovoFormGroup({
name: new NovoFormControl(''),
category: new NovoFormControl('')
});
}

onSubmit(): void {
if (this.form.valid) {
console.log(this.form.value);
}
}
}
```

2. Service Pattern:
```typescript
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { NovoToastService } from 'novo-elements';
import { Observable, catchError, tap } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class DataService {
private apiUrl = 'api/data';

constructor(
private http: HttpClient,
private toastService: NovoToastService
) {}

getData(): Observable<any[]> {
return this.http.get<any[]>(this.apiUrl).pipe(
tap(data => {
this.toastService.success('Data loaded successfully');
}),
catchError(error => {
this.toastService.error('Failed to load data');
throw error;
})
);
}

updateData(data: any): Observable<any> {
return this.http.put(`${this.apiUrl}/${data.id}`, data).pipe(
tap(() => {
this.toastService.success('Data updated successfully');
}),
catchError(error => {
this.toastService.error('Failed to update data');
throw error;
})
);
}
}
```

3. Module Pattern:
```typescript
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NovoElementsModule } from 'novo-elements';
import { RouterModule } from '@angular/router';

import { CustomFormComponent } from './components/custom-form.component';
import { DataService } from './services/data.service';

@NgModule({
declarations: [
CustomFormComponent
],
imports: [
CommonModule,
NovoElementsModule,
RouterModule.forChild([
{
path: '',
component: CustomFormComponent
}
])
],
providers: [
DataService
],
exports: [
CustomFormComponent
]
})
export class FeatureModule {}
```

// Best Practices:
1. Follow Angular style guide
2. Use proper typing
3. Handle errors properly
4. Implement lazy loading
5. Use proper state management
6. Write comprehensive tests
7. Document components
8. Use proper logging
9. Handle lifecycle properly
10. Optimize performance

// Security Considerations:
1. Validate user input
2. Use proper authentication
3. Handle permissions
4. Implement CSRF protection
5. Secure API calls
6. Use content security
7. Handle sensitive data
8. Implement rate limiting
9. Use secure headers
10. Follow security updates
Loading
Loading