npx agentspec-cli install 1ec6756d-97c6-4cd6-a517-bdd8e8d1db6e --file-type cursor-rules→ .cursor/rules/
---
description: This rule enforces the use of specific library versions and their features as defined in package.json. It ensures code consistency and optimal usage of library capabilities while maintaining version compatibility. This rule should be applied when: (1) Implementing new features, (2) Modifying existing code, (3) Importing libraries, or (4) Using library-specific features.
globs: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"]
alwaysApply: true
---
# Library Version and Feature Constraints
## Required Node Version
- Node.js version must be >= 22.14.0 as specified in package.json
## Core Dependencies
Use these specific versions and their features:
### CLI and Utility Libraries
- `commander` (^11.0.0)
- Use for command-line interface implementation
- Prefer declarative command definitions
- Utilize built-in option validation
- `chalk` (^5.3.0)
- Use for terminal text styling
- Prefer template literals with chalk
- Use consistent color schemes for different message types
- `inquirer` (^9.2.12)
- Use for interactive command-line prompts
- Prefer async/await syntax with prompts
- Utilize built-in validation features
- `ora` (^8.0.1)
- Use for loading spinners
- Implement with async operations
- Use consistent spinner styles
### File System Operations
- `fs-extra` (^11.2.0)
- Prefer fs-extra methods over native fs
- Use promise-based API
- Utilize built-in error handling
### Development Tools
- `eslint` (^8.56.0)
- Follow project's ESLint configuration
- Address all ESLint warnings and errors
- `prettier` (^3.2.5)
- Maintain consistent code formatting
- Use project's Prettier configuration
## Best Practices
1. Always use the latest features available in the specified versions
2. Prefer built-in functionality over custom implementations
3. Use TypeScript types when available
4. Handle version-specific features gracefully
## Version Upgrade Guidelines
1. Document any version-specific changes
2. Test compatibility when upgrading dependencies
3. Update related code when library versions change
4. Maintain backward compatibility where possible
## Code Examples
### Command Line Interface (commander)
```ts
// Preferred
program
.name('cursor-rules-deploy')
.description('Deploy Cursor AI rules and templates')
.version('1.0.0');
// Avoid
if (process.argv.includes('--version')) {
console.log('1.0.0');
}
```
### Logging (chalk)
```ts
// Preferred - Always use Logger class with chalk
Logger.info(chalk.blue('Processing'), chalk.green(filename));
Logger.error(chalk.red('Error:'), chalk.yellow(errorMessage));
Logger.warn(chalk.yellow('Warning:'), chalk.dim(warningMessage));
Logger.debug(chalk.gray('Debug:'), chalk.dim(debugInfo));
// Avoid
console.log('Processing', filename);
console.error('Error:', errorMessage);
console.warn('Warning:', warningMessage);
console.debug('Debug:', debugInfo);
```
### File Operations (fs-extra)
```ts
// Preferred
await fs.copy(sourcePath, targetPath, { overwrite: true });
// Avoid
fs.copyFileSync(sourcePath, targetPath);
```General AI Behavior
description: "Base rules for AI interactions across the project"
by AgentHub Crawler
TypeScript Coding Rules for LLML Project
The TypeScript implementation is a minimalist, functional, and robust library with zero production dependencies besides `dedent`. It prioritizes predictable output and developer experience through a simple API and strict typing, while gracefully handling varied and unpredictable input data.
by AgentHub Crawler
Novel Reader Configuration
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
=====================
Sign in to leave a comment.
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler