mypy — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mypy (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A bulleted imperative like {match} tells the agent to never reveal, disclose, or mention something to the user. Used adversarially it can instruct the agent to hide its tool calls or lie about what it did — stripping the transparency a user relies on to trust the agent.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Mypy is a static type checker for Python that finds bugs without running code. This skill provides comprehensive guidance for professional mypy integration and usage.
# Install mypy
python3 -m pip install mypy
# Check a file
mypy program.py
# Check with strict mode
mypy --strict program.pydef greeting(name: str) -> str:
return 'Hello ' + name
# Type checking catches errors
greeting(3) # Error: Argument has incompatible type "int"; expected "str"Mypy supports multiple configuration formats (discovery order):
mypy.ini.mypy.inipyproject.toml (with [tool.mypy] section)setup.cfg (with [mypy] section)# mypy.ini
[mypy]
python_version = 3.11
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = True
# Per-module configuration
[mypy-module_name.*]
ignore_missing_imports = TrueSee references/config_file.md for complete configuration reference.
--check-untyped-defs for gradual typing# type: ignore comments sparingly for temporary exceptionsSee references/existing_code.md for migration strategies.
When mypy reports errors:
[attr-defined])references/error_code_list.md - Default errorsreferences/error_code_list2.md - Optional checksreveal_type() for debugging type inferenceSee references/common_issues.md for troubleshooting.
Generics: references/generics.md
Protocols: references/protocols.md
TypedDict: references/typed_dict.md
Literal Types: references/literal_types.md
See references/kinds_of_types.md for type system overview.
# Strict mode (recommended for new projects)
mypy --strict module.py
# Check specific paths
mypy src/ tests/
# Generate HTML coverage report
mypy --html-report ./mypy-report src/
# Use mypy daemon for faster checking
dmypy run -- src/
# Generate stubs from existing code
stubgen -p mypackage -o stubs/See references/command_line.md for all CLI options.
- name: Type check with mypy
run: |
pip install mypy
mypy --install-types --non-interactive
mypy src/# .pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies: [types-all]The references/ directory contains complete mypy 1.19.1 documentation:
getting_started.md - Installation, basic conceptscheat_sheet_py3.md - Quick reference guidebuiltin_types.md - Python built-in typestype_inference_and_annotations.md - Annotations guidekinds_of_types.md - Type system overviewclass_basics.md - Class typing fundamentalsprotocols.md - Structural subtypinggenerics.md - Generic types and TypeVarstyped_dict.md - TypedDict patternsliteral_types.md - Literal types and Enumsfinal_attrs.md - Final declarationsmore_types.md - Additional type patternstype_narrowing.md - Type narrowing techniquesduck_type_compatibility.md - Duck typing rulesconfig_file.md - Complete configuration referencecommand_line.md - CLI options and flagsrunning_mypy.md - Running mypy guideinline_config.md - Inline type commentsmypy_daemon.md - Daemon mode for speedinstalled_packages.md - Package type stubsstubs.md - Stub files guidestubgen.md - Automatic stub generationstubtest.md - Stub testing toolextending_mypy.md - Plugins and extensionsmetaclasses.md - Metaclass typingruntime_troubles.md - Runtime annotation issuesdynamic_typing.md - Dynamic typing patternserror_codes.md - Error code systemerror_code_list.md - Default error codeserror_code_list2.md - Optional error codescommon_issues.md - Solutions to common issuesfaq.md - Frequently asked questionsadditional_features.md - Advanced featuressupported_python_features.md - Python version supportexisting_code.md - Migration strategieschangelog.md - Version historyThe scripts/ directory contains tools to refresh documentation from mypy.readthedocs.io:
# Discover all documentation pages
python scripts/discover_pages.py > mypy_pages.txt
# Bulk scrape and clean documentation
python scripts/scrape_docs.py
# Clean individual markdown files
python scripts/clean_markdown.py input.md output.mdThese scripts use cloudscraper for Cloudflare bypass and automatically clean navigation/footer content.
--check-untyped-defs initially# type: ignore[code] instead of blanket ignoresfrom typing import Optional
def find_user(id: int) -> Optional[User]:
# May return None
return user_db.get(id)from typing import Union
def process(value: Union[int, str]) -> str:
if isinstance(value, int):
return str(value)
return valuefrom typing import TypeVar, Sequence
T = TypeVar('T')
def first(seq: Sequence[T]) -> T:
return seq[0]from typing import Protocol
class Drawable(Protocol):
def draw(self) -> None: ...
def render(obj: Drawable) -> None:
obj.draw() # Any object with draw() worksThis skill is based on mypy 1.19.1 (stable) documentation. Use the scraping scripts to update to newer versions as they are released.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.