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/yu-iskw/llmops-demo-tsWrote 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/yu-iskw/llmops-demo-ts/google-genai-typescript)<a href="https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/google-genai-typescript"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/google-genai-typescript/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/yu-iskw/llmops-demo-ts/google-genai-typescript"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/google-genai-typescript.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.01945 | $0.01945 |
| Opus 5 | $0.00972 | $0.00972 |
| Sonnet 5 | $0.00389 | $0.00389 |
| Haiku 4.5 | $0.00194 | $0.00194 |
Grade A, and why
google-genai-typescript 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 4d 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 — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Utilizing @google/genai in TypeScript
This guide provides comprehensive instructions and best practices for integrating the Google Gen AI SDK (@google/genai) into your TypeScript applications. This SDK allows you to build powerful applications leveraging Gemini models, supporting both the Gemini Developer API and Vertex AI.
1. Introduction to @google/genai
The @google/genai SDK is Google DeepMind’s primary SDK for its generative AI offerings, designed for TypeScript and JavaScript developers to build applications powered by Gemini. It is where new AI features are added.
2. Prerequisites
- Node.js: Version 20 or later.
For Vertex AI Users (excluding Vertex AI Studio)
- Google Cloud Project: Select or create one.
- Billing: Enable billing for your project.
- Vertex AI API: Enable the Vertex AI API.
- Authentication:
- Install the
gcloudCLI. - Initialize the
gcloudCLI. - Create local authentication credentials:
gcloud auth application-default login
- Install the
3. Installation
To install the SDK, use pnpm:
pnpm add @google/genai
4. Initialization
The SDK supports initialization for both Google AI Studio (API Key) and Vertex AI implementations.
4.1. Gemini Developer API (Using an API Key)
For server-side applications, obtain an API key from Google AI Studio and initialize the client:
import { GoogleGenAI } from '@google/genai';
const GEMINI_API_KEY = process.env.GEMINI_API_KEY; // It is recommended to use environment variables for API keys.
const ai = new GoogleGenAI({ apiKey: GEMINI_API_KEY });
Caution: Avoid exposing API keys in client-side code. Use server-side implementations in production.
4.2. Vertex AI
Initialize the client for Vertex AI by specifying your Google Cloud project and location:
import { GoogleGenAI } from '@google/genai';
const PROJECT_ID = process.env.GOOGLE_CLOUD_PROJECT_ID || "your-gcp-project-id";
const LOCATION = process.env.GOOGLE_CLOUD_LOCATION || "us-central1"; // e.g., "us-central1"
const ai = new GoogleGenAI({
vertexai: true,
project: PROJECT_ID,
location: LOCATION,
});
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.
- 4d ago First seen · 212 lines · 1,945 tokens per session scan A 455ad2cafdca
google-genai-typescript is a cursor rule published in the GitHub repository yu-iskw/llmops-demo-ts (6 stars, last pushed 7d ago), licensed Apache-2.0. It adds 1,945 tokens to every session, about $0.0097 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.
Other cursor rules, from other repositories
typescript-javascript-rules
description: Defines specific coding style and structure for TypeScript and JavaScript files, including function usage, type preferences, and file organization. globs: /.{ts,tsx,js,jsx}.
page_layer_rules
Page layer rules for Next.js App Router pages and layouts.
update-ai-sdk
Update ai-sdk(ai, @ai/) to latest.
gateway
The gateway core module is the central orchestrator that handles AI provider requests, manages caching, queuing, and provides unified interfaces for chat completion, embeddings, and tool responses.
llamaindex-js
Definitive guidelines for writing robust, performant, and maintainable llamaindex-js applications using modern TypeScript best practices.
design
All tasks related to updating frontend components, CSS, and general styling.