PromucFlow_constructor/.cursor/rules/index.mdc
vivek-appsmith d176e40726
refactor: restructure .cursor directory for improved organization and clarity (#40196)
# refactor: restructure .cursor directory for improved organization and
clarity

## Description

This PR refactors the `.cursor` directory to enhance organization,
clarity, and maintainability.

### Problem

The existing `.cursor` directory lacked clear organization, making it
difficult to find specific files, understand their purpose, and add new
components consistently.

### Solution

A comprehensive restructuring:

#### New Directory Structure

```
.cursor/
├── settings.json                  # Main configuration file
├── docs/                          # Documentation
│   ├── guides/                    # In-depth guides
│   ├── references/                # Quick references
│   └── practices/                 # Best practices
├── rules/                         # Rule definitions
│   ├── commit/                    # Commit-related rules
│   ├── quality/                   # Code quality rules
│   ├── testing/                   # Testing rules
│   └── verification/              # Verification rules
└── hooks/                         # Git hooks and scripts
```

#### Key Changes

1. **Logical Categorization**: Organized files into clear categories
based on purpose
2. **Improved Documentation**: Added comprehensive README files for each
directory
3. **Standardized Naming**: Implemented consistent kebab-case naming
convention
4. **Reference Updates**: Updated all internal references to point to
new file locations

### Benefits

- **Easier Navigation**: Clear categorization makes finding files
intuitive
- **Improved Understanding**: Comprehensive documentation explains
purpose and usage
- **Simplified Maintenance**: Logical structure makes updates and
additions easier
- **Better Onboarding**: New team members can quickly understand the
system

This refactoring sets a solid foundation for all Cursor AI-related
configurations and rules, making it easier for the team to leverage
Cursor's capabilities.
2025-04-11 12:04:33 +05:30

136 lines
4.1 KiB
Plaintext

---
description:
globs:
alwaysApply: true
---
# Appsmith Cursor Rules
```yaml
name: Appsmith Cursor Rules
description: A comprehensive set of rules for Cursor AI to enhance development for Appsmith
author: Cursor AI
version: 1.0.0
tags:
- appsmith
- development
- quality
- verification
activation:
always: true
event:
- pull_request
- file_change
- command
triggers:
- pull_request.created
- pull_request.updated
- file.created
- file.modified
- command: "cursor_help"
```
## Overview
This is the main entry point for Cursor AI rules for the Appsmith codebase. These rules help enforce consistent coding standards, verify bug fixes and features, generate appropriate tests, and optimize performance.
## Available Rules
### 1. [Semantic PR Validator](mdc:semantic_pr_validator.mdc)
Ensures pull request titles follow the Conventional Commits specification.
```javascript
// Example usage
const semanticPR = require('./semantic_pr_validator');
const validation = semanticPR.onPRTitleChange('feat(widgets): add new table component');
console.log(validation.status); // 'success'
```
### 2. [Bug Fix Verifier](mdc:bug_fix_verifier.mdc)
Guides developers through the proper steps to fix bugs and verifies that fixes meet quality standards.
```javascript
// Example usage
const bugFixVerifier = require('./bug_fix_verifier');
const verification = bugFixVerifier.verifyBugFix(changedFiles, testFiles, issueDetails);
console.log(verification.score); // The verification score
```
### 3. [Test Generator](mdc:test_generator.mdc)
Analyzes code changes and generates appropriate test cases to ensure proper test coverage.
```javascript
// Example usage
const testGenerator = require('./test_generator');
const testPlan = testGenerator.generateTests(changedFiles, codebase);
console.log(testPlan.summary); // 'Generated X test plans'
```
### 4. [Performance Optimizer](mdc:performance_optimizer.mdc)
Identifies performance bottlenecks in code and suggests optimizations to improve efficiency.
```javascript
// Example usage
const performanceOptimizer = require('./performance_optimizer');
const analysis = performanceOptimizer.analyzePerformance(changedFiles, codebase);
console.log(analysis.score); // The performance score
```
### 5. [Feature Implementation Validator](mdc:feature_implementation_validator.mdc)
Ensures new feature implementations meet all requirements, follow best practices, and include appropriate tests.
```javascript
// Example usage
const featureValidator = require('./feature_implementation_validator');
const validation = featureValidator.validateFeature(
implementationFiles,
codebase,
pullRequest
);
console.log(validation.score); // The feature implementation score
```
## Integration
These rules are automatically integrated into Cursor AI when working with the Appsmith codebase. They will be triggered based on context and can also be manually invoked through commands.
## Command Examples
- `validate_pr_title` - Check if a PR title follows conventional commits format
- `verify_bug_fix --pullRequest=123` - Verify a bug fix implementation
- `generate_tests --file=src/utils/helpers.js` - Generate tests for a specific file
- `optimize_performance --file=src/components/Table.tsx` - Analyze and optimize performance
- `validate_feature --pullRequest=123` - Validate a feature implementation
## Configuration
The behavior of these rules can be customized in the `.cursor/settings.json` file. For example:
```json
{
"development": {
"gitWorkflow": {
"semanticPR": {
"enabled": true,
"titleFormat": "type(scope): description",
"validTypes": [
"feat", "fix", "docs", "style", "refactor",
"perf", "test", "build", "ci", "chore", "revert"
]
}
}
}
}
```
## Documentation
For more detailed information about each rule and how to use it effectively, please refer to the individual rule files linked above.
## Activation
To activate all rules, run `cursor_help` in the command palette. This will display available commands and provide guidance on using the rules for your specific task.