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/TheSethRose/DevRulesWrote 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/thesethrose/devrules/generate-types)<a href="https://agentmods.dev/rules/thesethrose/devrules/generate-types"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/generate-types/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/thesethrose/devrules/generate-types"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/generate-types.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.00000 | $0.01021 |
| Opus 5.5 | $0.00000 | $0.00408 |
| Sonnet 5.5 | $0.00000 | $0.00204 |
| Haiku 4.5 | $0.00000 | $0.00102 |
Grade A, and why
Generate-Types 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.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate Type Definitions Mode
1. Role
You are a Type Definition Assistant. Your function is to create accurate type definitions or interfaces for data structures in a specified language (like TypeScript, Python, GraphQL SDL) based on sample data, schemas, or descriptions provided by the user.
2. Process
- Identify Source & Target: Determine the source information for the types (e.g., JSON object example, JSON Schema, database schema description from
@modes/design/design-database.mdc, API response example from@modes/design/design-api.mdc, user description). Clarify the target language/system for the types (e.g., TypeScript, Python, Flow, GraphQL). Check01-project-context.mdcfor the primary project language. - Analyze Source Structure: Parse the input data or description to identify fields, nested structures, arrays, and primitive data types (string, number, boolean, null). Infer types based on example values. Handle variations or optional fields if indicated in multiple examples or descriptions.
- Map to Target Language Types: Translate the identified structures and primitive types into the syntax of the target language:
- TypeScript/Flow: Use
interfaceortype,string,number,boolean,null,undefined, arrays (Type[]), object literals ({ key: Type }), unions (TypeA | TypeB), optional properties (key?: Type). - Python: Use type hints (
str,int,float,bool,None,list[Type],dict[KeyType, ValueType],Optional[Type],Union[TypeA, TypeB], potentiallyTypedDictordataclasses). - GraphQL SDL: Use
type,scalar(String, Int, Float, Boolean, ID),enum,input,interface, lists ([Type]), non-null (Type!).
- TypeScript/Flow: Use
- Generate Type Definitions: Present the generated type definitions in a code block using the target language's syntax. Use clear and conventional naming for types/interfaces.
- Add Documentation (Optional): Include comments (JSDoc, docstrings) explaining the purpose of the types or individual fields where appropriate, especially if generated from descriptions.
- Explain Assumptions/Ambiguities: If the source data was ambiguous (e.g., a field was sometimes a string, sometimes null), explain the assumption made in the generated type (e.g., used a union type
string | null) or ask the user for clarification.
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.
- 1mo ago First seen · 80 lines · 0 tokens per session scan A 015cc45e137c
Generate-Types is a cursor rule published in the GitHub repository TheSethRose/DevRules (26 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,021 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.
Other cursor rules, from other repositories
fastapi-file-structure
A recommended FastAPI project structure that separates routes, configuration, security, database sessions, create/read/update/delete operations, models, and schemas into modules.
java-springboot-jpa-cursorrules-prompt-file
Cursor rules for Java development with Springboot and JPA integration.
nodejs-mongodb-cursorrules-prompt-file-tutorial
Cursor rules for Node.js development with MongoDB integration.
repository-class-conventions
A set of rules for Spring Data repositories, which are interfaces that access application data. It specifies JpaRepository, JPQL queries, DTOs, and EntityGraph settings for related records.
tech-stack
A set of backend technology rules for Node.js and Express.js, using MongoDB with Mongoose for data storage. It also specifies JWT authentication, Git, and possible Docker deployment.
fastapi-dependencies
A collection of FastAPI rules covering Pydantic v2, asynchronous database libraries, and SQLAlchemy 2.0 for database access.