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.
npx agentmods add rules/thesethrose/devrules/generate-typesgit clone --depth 1 https://github.com/TheSethRose/DevRulesWhat 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 | $0.00000 | $0.01021 |
| Opus 5 | $0.00000 | $0.00511 |
| Sonnet 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 yesterday.
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.
- yesterday First seen · 80 lines · 0 tokens per session scan A 015cc45e137c
Generate-Types is a cursor rule published in the GitHub repository TheSethRose/DevRules (25 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
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
prpm-json-best-practices
Best practices for structuring prpm.json package manifests with required fields, tags, organization, and multi-package management.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
beanstalk-deploy
Robust deployment patterns for Elastic Beanstalk with GitHub Actions, Pulumi, and edge case handling.
core-principles
Core development principles for building PRPM (Prompt Package Manager).
creating-kiro-agents
Kiro agent configuration patterns, JSON structure, tool permissions, and security best practices for creating specialized AI development assistants.