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 skills add yaniv-golan/affinity-sdk --skill affinity-python-sdkgit clone --depth 1 https://github.com/yaniv-golan/affinity-sdkWrote 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/skills/yaniv-golan/affinity-sdk/affinity-python-sdk)<a href="https://agentmods.dev/skills/yaniv-golan/affinity-sdk/affinity-python-sdk"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/affinity-python-sdk/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/skills/yaniv-golan/affinity-sdk/affinity-python-sdk"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/affinity-python-sdk.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.00020 | $0.04842 |
| Opus 5.5 | $0.00008 | $0.01937 |
| Sonnet 5.5 | $0.00004 | $0.00968 |
| Haiku 4.5 | $0.00002 | $0.00484 |
Grade A, and why
affinity-python-sdk 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.
How it starts
The opening of the file, as written. The whole thing — 506 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Affinity Python SDK
IMPORTANT: Write Operations Require Explicit User Request
Always use read-only mode by default. Only allow writes when the user explicitly requests data modification.
from affinity.policies import Policies, WritePolicy
# DEFAULT: Read-only mode (prevents accidental data modification)
with Affinity.from_env(policies=Policies(write=WritePolicy.DENY)) as client:
... # Write operations will raise WriteNotAllowedError
# ONLY when user explicitly approves writes:
with Affinity.from_env() as client:
...
Installation
# SDK only (Python API wrapper)
pip install affinity-sdk
# SDK with .env file support
pip install "affinity-sdk[dotenv]"
Client Initialization
from affinity import Affinity, AsyncAffinity
from affinity.policies import Policies, WritePolicy
# RECOMMENDED: Read-only with .env file
with Affinity.from_env(load_dotenv=True, policies=Policies(write=WritePolicy.DENY)) as client:
me = client.whoami()
companies = client.companies.all()
# Async client
async with AsyncAffinity.from_env(policies=Policies(write=WritePolicy.DENY)) as client:
companies = await client.companies.all()
API versions
Affinity versions its V2 API by date (2024-01-01, 2026-07-15, 2026-09-17, or current).
Unpinned, each request uses the API key's default version, and calls that need a newer one
(relationships, company/person field writes, notes per company) send it themselves. Pin when you
need consistent response shapes:
client = Affinity.from_env(affinity_api_version="2026-09-17")
client.affinity_api_versions_seen # versions that answered, e.g. frozenset({"2026-09-17"})
A pin older than a call needs raises ApiVersionTooOldError; a version Affinity rejects raises
UnsupportedApiVersionError (both from affinity.exceptions). There is no silent fallback.
Multi-Source Tasks: Output Only the Summary
When a task combines data from multiple Affinity sources (e.g., person + interactions + list entries), fetch everything in one script and print only the relevant summary. Never dump raw model_dump_json() — it floods the conversation with hundreds of lines the agent must parse just to extract a few facts.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3d ago Changed · +43 lines 0489c3f80101
- 5d ago Changed 2ad1f1459ed3
- 6d ago Changed · +42 lines 08c9410fcf70
- 9d ago Changed · +8 lines 2e4ab83f805f
- 1mo ago First seen · 413 lines · 20 tokens per session scan A 46ca719ee1b3
affinity-python-sdk is a skill published in the GitHub repository yaniv-golan/affinity-sdk (0 stars, last pushed 3d ago), licensed MIT. It adds 20 tokens to every session and 4,842 once invoked, about $0.0001 per session on Opus 5.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 skills, from other repositories
fastapi
Use when building, reviewing, testing, securing or shipping a FastAPI / async Python service — routers, Pydantic v2 schemas, dependency injection, async SQLAlchemy 2.0, OAuth2/JWT, ASGITransport tests, production wiring. NOT language-level Python or packaging (that is python), NOT engine-level SQL (that is…
pytdbot
Write Telegram bots and userbots with Pytdbot (async TDLib wrapper with high-level helpers; not the Telegram Bot API). Use when the user works with Pytdbot, TDLib, or pytdbot.Client.
cloudflare-workers-multi-lang
Multi-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrating WASM modules for performance-critical code.
functions-development
Build serverless Go or Python functions for Falcon Foundry apps. TRIGGER when user asks to "create a function", "write a serverless function", "build backend logic", runs foundry functions create, or needs help with FDK handler patterns, function testing, or collection integration from functions. Also TRIGGER when…
fastapi-expert
Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.
python-services
Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).