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/altaidevorg/rules-for-ai/content___partgit clone --depth 1 https://github.com/altaidevorg/rules-for-aiWhat 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.00026 | $0.03162 |
| Opus 5 | $0.00013 | $0.01581 |
| Sonnet 5 | $0.00005 | $0.00632 |
| Haiku 4.5 | $0.00003 | $0.00316 |
Grade A, and why
content___part 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 2d 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 — 276 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Chapter 2: Content / Part
In Chapter 1: Client, we learned how to configure the Client to connect to Google's Generative AI APIs. Now that we have a connection, we need to understand how to structure the data we send and receive. This chapter introduces the fundamental data structures for communication: Content and Part.
Motivation and Use Case
Generative models, especially multi-modal ones like Gemini, process information in structured turns. A conversation isn't just a flat string; it involves roles (who is speaking?), different types of data (text, images, function calls/results), and potentially multiple pieces of data within a single turn.
The Content and Part objects provide this necessary structure. Content represents a single message or turn in the conversation, while Part represents individual pieces of data within that turn. This allows for rich interactions beyond simple text prompts.
Central Use Case: Imagine you want to ask a Gemini model to describe an image you provide. You can't just pass a raw image; you need to structure the request clearly indicating the text prompt ("What is in this image?") and the image data itself, both belonging to the 'user' role in a single turn.
# Assuming 'client' is configured as shown in Chapter 1
from google.genai import types
import PIL.Image
# Load an image (replace with your image loading logic)
try:
img = PIL.Image.open('path/to/your/image.jpg')
except FileNotFoundError:
print("Please replace 'path/to/your/image.jpg' with an actual image file.")
exit() # Or handle appropriately
# Explicitly construct Content and Part objects
image_part = types.Part.from_image(img) # Helper to create image part
text_part = types.Part.from_text("Describe this image.")
# Create a Content object for the user's turn
user_content = types.Content(
role='user',
parts=[text_part, image_part] # Multi-modal input
)
# Send the structured content to the model
response = client.models.generate_content(
model='gemini-1.5-flash', # Use an appropriate multi-modal model
contents=[user_content] # Pass a list of Content objects
)
print(response.text)
This example shows how Content (with role='user') groups multiple Part objects (text_part, image_part) to form a single, multi-modal message turn.
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.
- 2d ago First seen · 276 lines · 26 tokens per session scan A b6471dd48041
content___part is a cursor rule published in the GitHub repository altaidevorg/rules-for-ai (2 stars, last pushed 1y ago), licensed MIT. It adds 26 tokens to every session and 3,162 once invoked, about $0.0001 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-08-31.
Other cursor rules, from other repositories
baml
A set of rules for setting up BAML and help with syntax guidance.
json-prompt-design
Protects MOTO prompt wording and defines cross-cutting JSON response invariants.
token-efficiency
Token efficiency rules - eliminate waste in AI output, enforce read-before-write, prevent iteration cycles.
langchain
LangChain: chains, agents, memory, tools.
prompt-routing
Route tasks to the correct Universal AI Engineering Prompt.
llm-zod-jsonschema
Best Practice for LLM Output Parsing with Zod and JSON Schema.