Pyrefly Type Coverage

🏢Official
by pytorch · vlatest · Repository

Pyrefly Type Coverage analyzes your code to identify all used types and their dependencies, boosting understanding & debugging efficiency.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add pyrefly-type-coverage npx -- -y @trustedskills/pyrefly-type-coverage
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "pyrefly-type-coverage": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/pyrefly-type-coverage"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill helps you improve type coverage in your Python code using Pyrefly, Meta's type checker. It guides you through a structured process of removing error suppression directives, configuring stricter type checking within your pyrefly.toml file, running the type checker to identify missing annotations, and then adding those annotations. The goal is to systematically resolve all identified type errors in your Python files or directories.

When to use it

  • When you want to improve the robustness and maintainability of your Python code through better type hinting.
  • During refactoring efforts where increased type safety is desired.
  • To address specific type checking errors flagged by Pyrefly.
  • For projects already using a pyrefly.toml configuration file.

Key capabilities

  • Provides step-by-step instructions for improving type coverage with Pyrefly.
  • Guides users on removing error suppression directives (pyre-ignore-all-errors).
  • Explains how to configure stricter type checking within pyrefly.toml.
  • Instructs users on running the Pyrefly type checker and interpreting its output.
  • Offers examples of common annotation patterns for function signatures, class attributes, and complex types.

Example prompts

  • "Guide me through improving type coverage in my Python file."
  • "How do I configure stricter type checking using pyrefly?"
  • "What are some common annotation patterns I can use with Pyrefly?"

Tips & gotchas

  • Prerequisites: This skill requires that your project already has a pyrefly.toml configuration file.
  • The skill focuses on resolving errors; suppressing them with # pyrefly: ignore[...] should be a last resort after attempting to fix the underlying issue.
  • Type annotations may require Python 3.10 or later syntax for complex types.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
pytorch
Installs
56

🏢 Official

Published by the company or team that built the technology.