Skip to content
Closed
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
7 changes: 4 additions & 3 deletions .cursor/rules/accessibility-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: *.vue, *.jsx, *.tsx, *.html, *.php

Ensures WCAG compliance and accessibility best practices.

<rule>
```yaml
name: accessibility_standards
description: Enforce accessibility standards and WCAG compliance
filters:
Expand All @@ -18,7 +18,7 @@ actions:
conditions:
- pattern: "<img[^>]+(?!alt=)[^>]*>"
message: "Images must have alt attributes for screen readers."

- pattern: "aria-[a-z]+=\"\""
message: "ARIA attributes should not be empty; provide meaningful values."

Expand Down Expand Up @@ -53,4 +53,5 @@ actions:
metadata:
priority: high
version: 1.1
</rule>
```

9 changes: 5 additions & 4 deletions .cursor/rules/api-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: *.php, *.js, *.ts

Ensures consistent API design, documentation, and implementation best practices across PHP, JavaScript, and TypeScript files.

<rule>
```yaml
name: enhanced_api_standards
description: Enforce enhanced API design, implementation, and documentation standards
filters:
Expand Down Expand Up @@ -35,14 +35,14 @@ actions:
- **HTTP Methods:** Use proper HTTP methods for operations (GET for retrieval, POST for creation, etc.).
- **Status Codes:** Use appropriate HTTP status codes to communicate the result of the request.
- **Versioning:** Implement API versioning to manage changes without breaking existing integrations.
- **Documentation:**
- **Documentation:**
- **Swagger/OpenAPI:** Use tools like Swagger for comprehensive API documentation.
- **Endpoint Descriptions:** Clearly document all endpoints including path, methods, parameters, and possible responses.
- **Authentication & Security:**
- Implement OAuth, JWT, or similar secure authentication methods.
- Use HTTPS for all API communications.
- **Rate Limiting:** Implement rate limiting to prevent abuse and ensure fair usage.
- **Error Handling:**
- **Error Handling:**
- Provide clear, human-readable error messages with corresponding status codes.
- Implement error logging for debugging purposes.
- **Pagination:** For list endpoints, implement pagination to manage large datasets.
Expand All @@ -53,4 +53,5 @@ actions:
metadata:
priority: high
version: 1.1
</rule>
```

24 changes: 12 additions & 12 deletions .cursor/rules/behat-ai-guide.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class FeatureContext extends DrupalContext {
use PathTrait;
use ResponseTrait;
use WaitTrait;

// Drupal-specific traits
use BlockTrait;
use ContentTrait;
Expand All @@ -82,7 +82,7 @@ class FeatureContext extends DrupalContext {
use MediaTrait;
use TaxonomyTrait;
use UserTrait;

// Only add custom methods when drevops/behat-steps doesn't provide the functionality
}
```
Expand Down Expand Up @@ -212,9 +212,9 @@ The following is the complete reference from [drevops/behat-steps STEPS.md](http
[Source](vendor/drevops/behat-steps/src/DateTrait.php)

> Convert relative date expressions into timestamps or formatted dates.
>
>
> Supports values and tables.
>
>
> Possible formats:
> - `[relative:OFFSET]`
> - `[relative:OFFSET#FORMAT]`
Expand Down Expand Up @@ -298,7 +298,7 @@ The following is the complete reference from [drevops/behat-steps STEPS.md](http
>
> Skip processing with tags: `@behat-steps-skip:fileDownloadBeforeScenario` or
> `@behat-steps-skip:fileDownloadAfterScenario`
>
>
> Special tags:
> - `@download` - enable download handling

Expand Down Expand Up @@ -418,9 +418,9 @@ The following is the complete reference from [drevops/behat-steps STEPS.md](http
[Source](vendor/drevops/behat-steps/src/Drupal/BigPipeTrait.php)

> Bypass Drupal BigPipe when rendering pages.
>
>
> Activated by adding `@big_pipe` tag to the scenario.
>
>
> Skip processing with tags: `@behat-steps-skip:bigPipeBeforeScenario` or
> `@behat-steps-skip:bigPipeBeforeStep`.

Expand Down Expand Up @@ -547,7 +547,7 @@ The following is the complete reference from [drevops/behat-steps STEPS.md](http
>
> Skip processing with tags: `@behat-steps-skip:emailBeforeScenario` or
> `@behat-steps-skip:emailAfterScenario`
>
>
> Special tags:
> - `@email` - enable email tracking using a default handler
> - `@email:{type}` - enable email tracking using a `{type}` handler
Expand Down Expand Up @@ -756,10 +756,10 @@ Use `FileTrait` and `MediaTrait` from drevops/behat-steps along with built-in Dr
[Source](vendor/drevops/behat-steps/src/Drupal/TestmodeTrait.php)

> Configure Drupal Testmode module for controlled testing scenarios.
>
>
> Skip processing with tags: `@behat-steps-skip:testmodeBeforeScenario` and
> `@behat-steps-skip:testmodeAfterScenario`.
>
>
> Special tags:
> - `@testmode` - enable for scenario

Expand Down Expand Up @@ -810,7 +810,7 @@ Use `FileTrait` and `MediaTrait` from drevops/behat-steps along with built-in Dr
>
> Skip processing with tags: `@behat-steps-skip:watchdogSetScenario` or
> `@behat-steps-skip:watchdogAfterScenario`
>
>
> Special tags:
> - `@watchdog:{type}` - limit watchdog messages to specific types.
> - `@error` - add to scenarios that are expected to trigger an error.
Expand All @@ -828,7 +828,7 @@ class FeatureContext extends DrupalContext {
use ContentTrait; // For content management
use UserTrait; // For user operations
use EmailTrait; // For email testing

// Custom methods only when absolutely necessary
}
```
Expand Down
7 changes: 4 additions & 3 deletions .cursor/rules/build-optimization.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: webpack.config.js, vite.config.js, *.config.js

Ensures optimal build configuration and process for better performance and maintainability.

<rule>
```yaml
name: enhanced_build_optimization
description: Enforce standards for optimizing build processes
filters:
Expand Down Expand Up @@ -43,7 +43,7 @@ actions:
- **Caching:**
- Configure proper caching strategies (e.g., HTTP headers, service workers for PWA).
- Use long-term caching for static assets with content hashing in filenames.
- **Modern JavaScript:**
- **Modern JavaScript:**
- Use ES6+ features but ensure polyfills for older browsers if needed.
- Consider using features like module/nomodule for graceful degradation.
- **Minification & Compression:** Ensure all JavaScript and CSS are minified and consider enabling gzip compression on the server.
Expand All @@ -54,4 +54,5 @@ actions:
metadata:
priority: high
version: 1.1
</rule>
```

21 changes: 11 additions & 10 deletions .cursor/rules/code-generation-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: *.php, *.js, *.ts, *.vue, *.jsx, *.tsx, *.py

Ensures high-quality, executable code generation adhering to best practices across multiple programming languages.

<rule>
```yaml
name: enhanced_code_generation_standards
description: Enforce standards for code generation ensuring high quality and integration readiness
filters:
Expand Down Expand Up @@ -37,34 +37,35 @@ actions:
message: |
**Code Generation Best Practices:**
- **Executable Solutions:** Generate fully functional code, not just skeletons or stubs.
- **Readability:**
- **Readability:**
- Prioritize code readability, with clear naming conventions and logical structure.
- Use whitespace effectively to enhance code clarity.
- **Error Handling:**
- **Error Handling:**
- Implement comprehensive error handling with appropriate exceptions or error codes.
- Consider edge cases and provide meaningful error messages.
- **Imports/Dependencies:**
- **Imports/Dependencies:**
- Include all necessary imports or require statements at the beginning of the file.
- Manage dependencies to ensure the code is self-contained or clearly documented for setup.
- **Integration:**
- **Integration:**
- Code should be immediately usable within the project's existing framework or technology stack.
- Ensure compatibility with existing patterns or libraries used in the project.
- **Formatting:**
- **Formatting:**
- Adhere to the project's coding style guide (e.g., Prettier, Black for Python, etc.).
- Use linters and formatters to maintain consistent code style.
- **Testing:**
- **Testing:**
- Include unit or integration tests where applicable to validate generated code.
- Encourage test-driven development if part of the project's culture.
- **Documentation:**
- **Documentation:**
- Provide inline comments for complex logic or algorithms.
- Write docstrings or JSDoc for functions, classes, and modules to describe usage, parameters, and return values.
- Consider generating external documentation if the project uses tools like Swagger for APIs or Sphinx for Python.
- **Security:**
- **Security:**
- Avoid hardcoded credentials or sensitive information.
- Follow security best practices for the language (e.g., SQL injection prevention in PHP, XSS in JavaScript).
- **Performance:** While readability takes precedence, be mindful of performance implications of the generated code.

metadata:
priority: critical
version: 1.1
</rule>
```

13 changes: 8 additions & 5 deletions .cursor/rules/cursor-rules.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: *.mdc

Standards for placing and organizing Cursor rule files in the repository, ensuring rules are always up-to-date and follow best practices.

<rule>
```yaml
name: cursor_rules_location_and_maintenance
description: Standards for placing and maintaining Cursor rule files in the correct directory
filters:
Expand All @@ -15,7 +15,10 @@ filters:
pattern: "\\.mdc$"
# Match files that look like Cursor rules
- type: content
pattern: "(?s)<rule>.*?</rule>"
pattern: "(?s)<rule>.*?
```

"
# Match file creation or modification events
- type: event
pattern: "file_create|file_modify"
Expand Down Expand Up @@ -63,13 +66,13 @@ actions:
filters:
- type: file_extension
pattern: "pattern_to_match"

actions:
- type: enforce|suggest|validate
conditions:
- pattern: "regex_pattern"
message: "Clear message explaining the issue"

metadata:
priority: high|medium|low
version: 1.0
Expand Down Expand Up @@ -111,7 +114,7 @@ examples:
# Good: Rule file in correct location
.cursor/rules/my-rule.mdc
output: "Correctly placed Cursor rule file"

- input: |
# Bad: Poorly structured rule
<rule>
Expand Down
6 changes: 4 additions & 2 deletions .cursor/rules/debugging-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ globs: *.php, *.js, *.ts, *.vue, *.jsx, *.tsx, *.py

Ensures proper debugging practices and error handling.

<rule>
```yaml
name: debugging_standards
description: Enforce standards for debugging and error handling
filters:
Expand Down Expand Up @@ -36,4 +36,6 @@ actions:
metadata:
priority: high
version: 1.0
</rule>
```


8 changes: 5 additions & 3 deletions .cursor/rules/docker-compose-standards.mdc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
description: Docker Compose standards Rule
globs:
globs:
alwaysApply: false
---
<rule>

```yaml
name: docker_compose_best_practices
description: Enforces best practices in docker-compose files to ensure maintainability, security, and consistency
filters:
Expand Down Expand Up @@ -136,4 +137,5 @@ examples:
metadata:
priority: high
version: 1.0
</rule>
```

Loading