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 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/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/ai-riksarkivet/ra-mcp/python-type-safety"><img src="https://agentmods.dev/badge/skills/ai-riksarkivet/ra-mcp/python-type-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00104 | $0.05111 |
| Opus 5.5 | $0.00042 | $0.02044 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (27 stars, last pushed 2d ago), licensed Apache-2.0. It adds 104 tokens to every session and 5,111 once invoked, about $0.0004 per session on Opus 5.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
python-package-management
Guide for managing packages in the Agent Framework Python monorepo, including creating new connector packages, versioning, and the lazy-loading pattern. Use this when adding, modifying, or releasing packages.
python-feature-lifecycle
Guidance for package and feature lifecycle in the Agent Framework Python codebase, including stage meanings, feature-stage decorators, feature enums, and how to move APIs from one stage to the next.
python-code-quality
Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.
python-development
Coding standards, conventions, and patterns for developing Python code in the Agent Framework repository. Use this when writing or modifying Python source files in the python/ directory.
effect-v4
Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all pinned exactly to [email protected] — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing…
adk-agent-builder
Builds ADK (Agent Development Kit) Python agents: LLM agents with tools, graph workflows of function and agent nodes, conditional routing, fan-out and join, schema-validated delegation between agents, human-in-the-loop pauses, and pytest coverage for all of it. Use when asked to create an agent or a workflow, add a…