Files
cursor__plugins/plugins/boilerplate/rules/example-rule.mdc
ericzakariasson 5e55a3a3f1 Initial commit: Cursor plugin specification and boilerplate
- Add plugin specification README with complete schema documentation
- Include boilerplate plugin demonstrating all components:
  - Rules (.mdc files with frontmatter)
  - Agents (specialized subagent definitions)
  - Skills (self-contained capabilities with SKILL.md)
  - Hooks (pre/post event automation)
  - MCP servers (external tool integrations)
  - Extensions directory structure

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-22 17:54:49 -08:00

37 lines
872 B
Plaintext

---
description: Example rule demonstrating Cursor rule structure
globs:
- "**/*.ts"
- "**/*.tsx"
alwaysApply: false
---
# Example Coding Standards
When working with TypeScript files, follow these conventions:
1. **Use explicit types** - Avoid `any` unless absolutely necessary
2. **Prefer `const` over `let`** - Use immutable bindings when possible
3. **Use async/await** - Prefer async/await over raw Promises
4. **Handle errors explicitly** - Always catch and handle errors appropriately
## Example
```typescript
// ✅ Good
const fetchData = async (id: string): Promise<Data> => {
try {
const response = await api.get(`/data/${id}`);
return response.data;
} catch (error) {
console.error('Failed to fetch data:', error);
throw error;
}
};
// ❌ Bad
const fetchData = (id) => {
return api.get('/data/' + id).then(r => r.data);
};
```