tsoa-rules

tsoa-rules is a cursor rule for Cursor from yu-iskw/llmops-demo-ts. It costs 2,345 tokens per session, scanned A, original, Apache-2.0.

A set of development rules for tsoa, a TypeScript framework that generates API routes and OpenAPI descriptions from typed controllers. OpenAPI is a standard format for documenting web APIs.

In plain words
What is it for?
It is for building Node.js APIs with TypeScript controllers, models, generated routes, and OpenAPI documentation.
Why use it?
It helps keep server code, runtime validation, and API documentation aligned through TypeScript types and annotations.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { User } from "../models/User";.

Good fit It is for building Node.js APIs with TypeScript controllers, models, generated routes, and OpenAPI documentation.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/yu-iskw/llmops-demo-ts
agentmods
npx agentmods add rules/yu-iskw/llmops-demo-ts/tsoa-rules

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 tsoa-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/tsoa-rules.svg)](https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/tsoa-rules)
Your own site
<a href="https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/tsoa-rules"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/tsoa-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,345 This file is loaded in full into every session.
When invoked 2,345 The same file — it is already loaded in full.
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.02345 $0.02345
Opus 5 $0.01172 $0.01172
Sonnet 5 $0.00469 $0.00469
Haiku 4.5 $0.00234 $0.00234

Measured 3d ago against content hash d295e0a93459, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tsoa-rules 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 3d 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/tsoa-rules.mdc · 291 lines

How it starts

The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TSOA Development Best Practices

This document outlines comprehensive guidelines and best practices for developing Node.js server-side applications with tsoa, focusing on TypeScript for type safety and OpenAPI specification generation.

1. Introduction to tsoa

  • tsoa is a framework that integrates an OpenAPI compiler to build type-safe Node.js applications using TypeScript.
  • It generates OpenAPI (Swagger) specifications and routes from your TypeScript controllers and models, ensuring type-safe by default and seamless runtime validation.
  • Philosophy:
    • Rely on TypeScript type annotations for API metadata.
    • Use decorators for metadata not expressible via type annotations.
    • Utilize JSDoc for pure text metadata (e.g., endpoint descriptions).
    • Minimize boilerplate code.
    • Models should primarily be interfaces (pure data structures), but classes are also supported.

2. Project Setup and Configuration

tsoa.json Configuration

  • Configure entryFile to point to your application's entry point (e.g., src/app.ts or src/index.ts).
  • Use controllerPathGlobs to specify where tsoa should look for controllers (e.g., "src/**/*Controller.ts").
  • Set noImplicitAdditionalProperties to "throw-on-extras" for strict validation, rejecting undeclared properties in incoming requests. Other options are "ignore" or "silently-remove-extras".
  • Define spec.outputDirectory and routes.routesDir for generated OpenAPI specifications and route files.
  • Set spec.specVersion to 3 for OpenAPI v3 specifications.
// tsoa.json
{
  "entryFile": "src/app.ts",
  "noImplicitAdditionalProperties": "throw-on-extras",
  "controllerPathGlobs": ["src/**/*Controller.ts"],
  "spec": {
    "outputDirectory": "build",
    "specVersion": 3
  },
  "routes": {
    "routesDir": "build"
  }
}

tsconfig.json Recommendations

  • Ensure experimentalDecorators is true.
  • Use strict type-checking options like strict, noImplicitAny, strictNullChecks, noUnusedLocals, and noUnusedParameters.

Read the full file on GitHub · 291 lines

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. 3d ago First seen · 291 lines · 2,345 tokens per session scan A d295e0a93459

Subscribe to this mod's changes

tsoa-rules is a cursor rule published in the GitHub repository yu-iskw/llmops-demo-ts (6 stars, last pushed 6d ago), licensed Apache-2.0. It adds 2,345 tokens to every session, about $0.0117 per session on Opus 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-04.