agentleFS
DXHeroesDXHeroes/mcp-devtools/.cursor/rules/typescript-style.mdc

mcp-devtools / rules

Cursor rule13 starsChanged 21 months agoMITArchived repositoryView on GitHub

TypeScript Coding Standards

The file

Show its rules and text

We split this typescript-style.mdc into the rules it gives an agent

18 rules. About 0 are common, 12 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these standards when writing TypeScript code for MCP DevTools:

    line 9
  2. Very specific:

    Files: Use camelCase for filenames

    line 17
  3. Very specific:

    Interfaces: Use PascalCase prefixed with I (e.g., IToolParams)

    line 18
  4. Very specific:

    Types: Use PascalCase (e.g., ToolResponse)

    line 19
  5. Very specific:

    Functions: Use camelCase (e.g., executeQuery)

    line 20
  6. Very specific:

    Constants: Use UPPER_SNAKE_CASE for truly constant values

    line 21
  7. Distinctive:

    Keep files under 300 lines when possible

    line 30
  8. Very specific:

    Use explicit typing over any

    line 34
  9. Distinctive:

    Prefer interfaces for object shapes

    line 35
  10. Distinctive:

    Use type guards for runtime type checking

    line 36
  11. Distinctive:

    Use readonly for immutable properties

    line 38
  12. Distinctive:

    Always specify return types for functions

    line 39
  13. Distinctive:

    Use null coalescing and optional chaining

    line 40
  14. Distinctive:

    Use typed error classes

    line 44
  15. Distinctive:

    Use JSDoc for public APIs

    line 51
  16. Distinctive:

    Keep comments up to date with code changes

    line 54
  17. Distinctive:

    Use named exports for multiple items

    line 58
  18. Distinctive:

    Use default export for primary component of a file

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
typescript-style.mdc
---
description: TypeScript Coding Standards
globs: packages/*/src/**/*.ts
alwaysApply: true
---

# TypeScript Coding Standards

Follow these standards when writing TypeScript code for MCP DevTools:

@file packages/jira/src/tools/getTicket.ts
@file tsconfig.json
@file .cursor/rules/testing-standards.mdc

## Naming Conventions

- **Files**: Use `camelCase` for filenames
- **Interfaces**: Use `PascalCase` prefixed with `I` (e.g., `IToolParams`)
- **Types**: Use `PascalCase` (e.g., `ToolResponse`)
- **Functions**: Use `camelCase` (e.g., `executeQuery`)
- **Constants**: Use `UPPER_SNAKE_CASE` for truly constant values
- **Variables**: Use `camelCase`
- **Private/Protected Members**: Prefix with underscore (e.g., `_privateMethod`)

## Code Organization

- One class/interface per file when possible
- Group related functions in logical files
- Export public API from index.ts files
- Keep files under 300 lines when possible

## TypeScript Best Practices

- Use explicit typing over `any`
- Prefer interfaces for object shapes
- Use type guards for runtime type checking
- Utilize generics for reusable components
- Use readonly for immutable properties
- Always specify return types for functions
- Use null coalescing and optional chaining

## Error Handling

- Use typed error classes
- Handle async errors with try/catch
- Provide meaningful error messages
- Return structured error responses

## Comments

- Use JSDoc for public APIs
- Comment complex algorithms
- Explain "why" not "what"
- Keep comments up to date with code changes

## Imports/Exports

- Use named exports for multiple items
- Use default export for primary component of a file
- Group imports by external/internal/types
- Avoid circular dependencies

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.