typescript-conventions

typescript-conventions is a cursor rule for Cursor from superagent-ai/grok-cli. It costs 0 tokens per session (517 once invoked), scanned A, original, MIT.

TypeScript coding rules for an ESM project, where modules use import and export statements, including file layout, types, naming, and compiler settings.

In plain words
What is it for?
Use it when writing or reviewing TypeScript files, imports, interfaces, shared types, names, and compiled source locations.
Why use it?
It keeps new code consistent with the project's module system and existing TypeScript structure.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when writing or reviewing TypeScript files, imports, interfaces, shared types, names, and compiled source locations.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/superagent-ai/grok-cli/typescript-conventions
About the project

grok-cli is an open-source terminal coding agent that uses the Grok API to work on software projects. Developers use it for interactive or headless coding tasks, with features including web and X search, sub-agents, a terminal interface, and remote control through Telegram.

superagent-ai/grok-cli · 3,496 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/superagent-ai/grok-cli

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for typescript-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/superagent-ai/grok-cli/typescript-conventions/github.svg)](https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions)
Your own site
<a href="https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions"><img src="https://agentmods.dev/badge/rules/superagent-ai/grok-cli/typescript-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for typescript-conventions

Your own site · 80×15
<a href="https://agentmods.dev/rules/superagent-ai/grok-cli/typescript-conventions"><img src="https://agentmods.dev/badge/rules/superagent-ai/grok-cli/typescript-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 517 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00517
Opus 5.5 $0.00000 $0.00207
Sonnet 5.5 $0.00000 $0.00103
Haiku 4.5 $0.00000 $0.00052

Measured 1mo ago against content hash 534ba35cddb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/typescript-conventions.mdc · 55 lines

What it actually says

TypeScript Conventions

Module System

  • This is an ESM project ("type": "module" in package.json).
  • Always use ES module import/export syntax — never require().
  • When importing local modules, include the .js extension (TypeScript compiles .ts → .js):
    import { GrokAgent } from "./agent/grok-agent.js";
    

TypeScript Configuration

  • Target: ES2022, Module: ESNext, JSX: react
  • strict: false and noImplicitAny: false — the codebase does not enforce strict mode.
  • moduleResolution: "Bundler" is used.
  • Source files live in src/, compiled output goes to dist/.

Type Practices

  • Prefer explicit interfaces for public API boundaries (e.g. ChatEntry, ToolResult, GrokToolCall).
  • Use type imports when importing only types:
    import type { ChatCompletionMessageParam } from "openai/resources/chat";
    
  • any is acceptable where strict typing would add friction, but prefer narrower types when practical.
  • Shared types belong in src/types/index.ts.

Naming Conventions

  • Files: kebab-case (grok-agent.ts, chat-interface.tsx, settings-manager.ts).
  • Classes: PascalCase (GrokAgent, TextEditorTool, BashTool).
  • Interfaces/Types: PascalCase (ChatEntry, ToolResult, StreamingChunk).
  • Functions/variables: camelCase (processUserMessage, loadApiKey).
  • Constants: camelCase or UPPER_SNAKE_CASE for true constants (GROK_TOOLS).

Error Handling

  • Catch errors as error: any and access .message for display.
  • Tool execution methods return ToolResult objects ({ success, output?, error? }) rather than throwing.
  • Use process.exit(1) for fatal CLI errors.

ESLint Rules

  • @typescript-eslint/no-unused-vars: error
  • @typescript-eslint/no-explicit-any: warn

Run bun run lint to check and bun run typecheck to verify types.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 55 lines · 0 tokens per session scan A 534ba35cddb4

Subscribe to this mod's changes

typescript-conventions is a cursor rule published in the GitHub repository superagent-ai/grok-cli (3,496 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 517 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.