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 skills/ai-riksarkivet/ra-mcp/python-type-safetynpx skills add AI-Riksarkivet/ra-mcp --skill python-type-safetygit clone --depth 1 https://github.com/AI-Riksarkivet/ra-mcpWrote 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/ai-riksarkivet/ra-mcp/python-type-safety)<a href="https://agentmods.dev/skills/ai-riksarkivet/ra-mcp/python-type-safety"><img src="https://agentmods.dev/badge/skills/ai-riksarkivet/ra-mcp/python-type-safety.svg" alt="Measured on agentmods" 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 | $0.00104 | $0.05111 |
| Opus 5 | $0.00052 | $0.02556 |
| Sonnet 5 | $0.00021 | $0.01022 |
| Haiku 4.5 | $0.00010 | $0.00511 |
Grade A, and why
python-type-safety scanned grade A with 1 finding 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
def fetch(url: str, *, as_json: Literal[True]) -> dict: ... How it starts
The opening of the file, as written. The whole thing — 745 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Type Safety (3.13+ / 3.14+)
Modern Python type safety using the Astral toolchain: ty for type checking and language server, ruff for linting (including annotation enforcement), and uv for package management. All examples target Python 3.13+ with 3.14 deferred annotations as the default.
Toolchain
| Tool | Role | Install |
|---|---|---|
| ty | Type checker + LSP (10-100x faster than mypy) | uv tool install ty@latest |
| ruff | Linter + formatter (replaces flake8, black, isort) | uv tool install ruff |
| uv | Package manager + env management | astral.sh/uv |
ty is the type checker from Astral (the creators of ruff and uv). It is written in Rust, provides a full language server (LSP) with code navigation, completions, and inlay hints, and supports advanced features like intersection types, reachability analysis, and gradual typing guarantees.
Key Python Version Features
Python 3.12
- PEP 695 — Type parameter syntax:
def first[T](items: list[T]) -> T: - PEP 695 —
typestatement for aliases:type Point = tuple[float, float]
Python 3.13
- PEP 696 — TypeVar/ParamSpec/TypeVarTuple defaults:
class Box[T = int]: - PEP 742 —
TypeIsfor proper bidirectional type narrowing - PEP 705 —
ReadOnlyfor TypedDict items - PEP 702 —
warnings.deprecated()decorator with type system support
Python 3.14
- PEP 649/749 — Deferred evaluation of annotations (no more
from __future__ import annotations, no more forward reference strings) - PEP 758 —
exceptandexcept*expressions may omit brackets
Fundamental Patterns
Pattern 1: Annotate All Public Signatures
Every public function, method, and class should have type annotations. Use native generics everywhere (no typing.List, typing.Dict, etc. — those are ancient history).
from pydantic import BaseModel
class User(BaseModel):
id: str
name: str
email: str | None = None
class UserRepository:
def __init__(self, db: Database) -> None:
self._db = db
async def find_by_id(self, user_id: str) -> User | None:
...
async def find_by_email(self, email: str) -> User | None:
...
async def save(self, user: User) -> User:
...
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 · 745 lines · 104 tokens per session scan A 208adbf1332e
python-type-safety is a skill published in the GitHub repository AI-Riksarkivet/ra-mcp (21 stars, last pushed yesterday), licensed Apache-2.0. It adds 104 tokens to every session and 5,111 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
n8n-subworkflows
Build reusable, composable n8n sub-workflows. Use when extracting shared logic, building anything multi-step or reused across workflows, or any workflow over 10 nodes — and whenever the user mentions sub-workflows, Execute Workflow, reuse, shared/common logic, modular workflows, "Define Below" inputs…
n8n-code-tool
Write JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) — the AI-agent-callable tool, NOT the workflow Code node. Use when building a Code Tool attached to an AI Agent, writing code that an LLM will invoke, parsing the query input, returning a string result, defining an input schema…
blockrun
Pay-per-call access to AI models, real-time data, media generation and multi-chain RPC over x402 micropayments (USDC on Base or Solana). No API keys, no accounts, no subscriptions. Start here when you have the BlockRun MCP installed and need to know WHICH tool answers a question, how the wallet works, or how to make a…
crypto-data
Use for any crypto data question — token/coin prices, FX, commodities, stocks, OHLC history, DEX pairs and liquidity, DeFi TVL, yield/APY pools, on-chain SQL, wallet labels and net worth, social mindshare, news, or raw JSON-RPC against a chain. Routes across five tools that overlap heavily, so it also says which one…
orchestrator-contract
MUST activate when you ARE an orchestrator — you are the top-level agent, you spawn subagents, you delegate work, you coordinate parallel or sequential execution. Defines delegation quality, subagent dispatch, routing, review, and ownership protocol.
implement-direct
Implement a small, well-defined issue directly — no planning phase, no task tracker.