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.
git clone --depth 1 https://github.com/andr-ca/agentharnessWrote 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.
[](https://agentmods.dev/rules/andr-ca/agentharness/typescript-conventions)<a href="https://agentmods.dev/rules/andr-ca/agentharness/typescript-conventions"><img src="https://agentmods.dev/badge/rules/andr-ca/agentharness/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.
<a href="https://agentmods.dev/rules/andr-ca/agentharness/typescript-conventions"><img src="https://agentmods.dev/badge/rules/andr-ca/agentharness/typescript-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.00860 |
| Opus 5.5 | $0.00016 | $0.00344 |
| Sonnet 5.5 | $0.00008 | $0.00172 |
| Haiku 4.5 | $0.00004 | $0.00086 |
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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Conventions
This file is self-contained for day-to-day use. Deeper reference (needs
the full harness checkout): languages/typescript/CONVENTIONS.md (full
examples including generics and import grouping) and
frameworks/react/CONVENTIONS.md (React/JSX-specific additions).
Naming
camelCase— functions, variables, method names.PascalCase— classes, interfaces, type aliases, enum names.UPPER_SNAKE_CASE— module-level constants.- Enum members:
PascalCase. - Generic type params:
T/Ufor simple one-liners; descriptive names (TEntity,TResponse) for complex or nested generics.
Imports & module structure
Group: external packages → internal modules → type-only imports.
Separate each group with a blank line. Prefer import type for
type-only imports (helps tools that strip types without full parsing).
import fs from 'fs';
import express from 'express';
import { UserRepository } from './repositories/UserRepository';
import type { User } from './types';
Private members: # over _prefix
Prefer native # private fields (ES2022+/TS 3.8+) in new code — real
runtime privacy, not a convention that's still readable via ["_name"].
Don't rewrite working _prefix code on sight; it's not deprecated.
class TokenStore {
#tokens: Map<string, string> = new Map(); // true runtime privacy
#rotate(): void { /* ... */ }
}
Null vs. Undefined
Pick based on what absence means, then apply it consistently:
undefined(via?) — "not provided / not yet set."null— an explicit "no value" the code sets deliberately (nullable column, "user cleared this field").- Do not mix both for the same kind of absence in one module.
Pitfalls to catch in review
// WRONG: async function catches error, logs it, then resolves — hides failure
async function save(data: Data): Promise<void> {
try {
await db.write(data);
} catch (err) {
logger.error('save failed', err);
// caller sees a successful promise despite the failure
}
}
// RIGHT: rethrow after logging so the caller can handle the failure
async function save(data: Data): Promise<void> {
try {
await db.write(data);
} catch (err) {
logger.error('save failed', err);
throw err; // caller knows this failed
}
}
// Type-cast escape hatch silences the compiler, not the bug
const result = someValue as SomeType; // risky without a runtime check
// Prefer a type guard:
function isSomeType(v: unknown): v is SomeType { /* ... */ }
// Non-null assertion hides null/undefined bugs
const name = user!.profile!.name; // crashes at runtime if null
// RIGHT: optional chaining + fallback
const name = user?.profile?.name ?? 'Unknown';
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.
- 2mo ago First seen · 105 lines · 39 tokens per session scan A 813d18769cf9
typescript-conventions is a cursor rule published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 9d ago), licensed MIT. It adds 39 tokens to every session and 860 once invoked, about $0.0002 per session on Opus 5.5. 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-09-03.
typescript-conventions compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| typescript-conventionsandr-ca/agentharness | Cursor rule | 1 | 9d ago | MIT | A | 39 | Cursor |
| vue-typescript-patternssoaring-xiongkulu/easyaiot | Cursor rule | 767 | yesterday | MIT | A | 381 | Cursor |
| nextjs-typescript-app-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 66 | Cursor |
| tsun-pany/v3-admin-vite | Cursor rule | 7.1k | 4mo ago | MIT | A | 287 | Cursor |
| typescript-securityfmflurry/settings-opencode | Cursor rule | 170 | 26d ago | MIT | A | 0 | Cursor |
| naming-conventions-ruleholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 64 | Cursor |
| platform-pattern-2-filesystem-operationsPaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 885 | Cursor |