facebook/pyre-check/architecture
Claude Code and agent skill by facebook/pyre-check
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Use when you need to understand the Pyre or Pysa codebase architecture, find where specific functionality is implemented, or navigate the source directory structure. Use when working on OCaml code, debugging type checking or taint analysis issues, or exploring the codebase.
Install
npx vskill@latest install facebook/pyre-check/architectureSKILL.md
The same SKILL.md was published earlier as facebook/pyre-check/architecture.
Pyre Architecture
Type Checking Pipeline
- Python CLI (
client/): Reads.pyre_configuration, determines flags, shells out topyre.bin - Command dispatch (
source/main.ml): Routes toCheck,Analyze(Pysa),Infer,Server,CodeNavigation, orNoDaemonQuery - Parsing (
source/menhir_parser/,source/cpython_parser/): Python source -> AST (source/ast/) - Environment building (
source/analysis/): Populates global type environment in parallel. All sources added at once (not recursively following imports). Builds a layered environment chain:UnannotatedGlobalEnvironment->ClassHierarchyEnvironment->TypeAliasEnvironment->AnnotatedGlobalEnvironment->FunctionDefinitionEnvironment->ErrorsEnvironment->TypeEnvironment - Type checking (
source/analysis/typeCheck.ml): Each function checked in parallel via control flow graph. Propagates parameter types through function body, checks compatibility at each operation. Never goes beyond function call boundaries. - Error reporting: Results collected and returned to CLI
Pysa (Taint Analysis) Pipeline
- Analysis orchestrator (
source/interprocedural_analyses/taint/taintAnalysis.ml): Main entrypoint of the analysis, runs the different analysis steps - PyrePysaApi (
source/interprocedural/pyrePysaApi.ml): Provides an API to query a type checker (pyre or pyrefly) - Class Hierarchy Graph (
source/interprocedural/classHierarchyGraph.ml): Builds a class hierarchy graph - Callables Shared Memory (
source/interprocedural/callablesSharedMemory.ml): Builds a mapping from callables (functions and methods) to their AST and signature - Call Graph (
source/interprocedural/callGraph.ml): Defines call graph data structures - Call Graph Builder (
source/interprocedural/callGraphBuilder.ml): Builds call graphs for all callables - Model parsing (
source/interprocedural_analyses/taint/modelParser.ml): Parses.pysamodel files - Forward analysis (
source/interprocedural_analyses/taint/forwardAnalysis.ml): Tracks taint from sources - Backward analysis (
source/interprocedural_analyses/taint/backwardAnalysis.ml): Tracks taint to sinks - Configuration (
source/interprocedural_analyses/taint/taintConfiguration.ml): Defines rules connecting sources to sinks - Global Fixpoint (
source/interprocedural/fixpointAnalysis.ml): Implements a global fixpoint over callables - Model (
source/interprocedural_analyses/taint/model.ml): Defines a summary of the taint behavior of a function, inferred during analysis
Key Source Directories
source/ast/: Python AST representation (Expression, Statement, Source, Location, Reference)source/analysis/: Core type checker: type representation (type.ml), CFG, fixpoint, preprocessing, environments, type order, class hierarchysource/interprocedural/: Interprocedural framework: call graph, dependency graph, override graph, fixpointsource/interprocedural_analyses/taint/: Pysa taint analysis: sources, sinks, domains, models, rules, reportingsource/interprocedural_analyses/type_inference/: Interprocedural type inferencesource/server/: Pyre daemon for incremental analysissource/code_navigation_server/: IDE code navigation serversource/command/: OCaml CLI command implementationssource/buck_command/: Buck-specific commandssource/buck_integration/: Buck build system integrationsource/service/: Shared memory management, schedulingsource/domains/: Abstract domain library (lattices for interprocedural analyses)source/hack_parallel/: Shared memory and multi-worker infrastructure (forked from Hack)source/saved_state/: Serialization for incremental analysisclient/: Python CLI (pyrecommand)client/commands/: All user-facing commands (check, analyze, start, stop, infer, query, etc.)client/configuration/:.pyre_configurationfile parsingclient/language_server/: LSP protocol implementationapi/: Programmatic Python API for Pyre serverpyre_extensions/: Runtime Python helpers (none_throws,safe_cast, etc.)tools/generate_taint_models/: Auto-generation of Pysa taint modelstools/typeshed_patcher/: Applies patches to bundled typeshed stubsstubs/: Bundled typeshed with patching mechanismfacebook/: Meta-internal code (not open-sourced)
OCaml Conventions
- Most types derive
show,eq,compare,to_yojsonvia PPX derivers. For a typeModule.t,Module.showgives a debug string. - Debug with
Log.dump "format %s" valueand run withpyre --noninteractive check - In Python test files, use
pyre_dump(),pyre_dump_cfg(),pyre_dump_locations(), andreveal_type(x)to inspect Pyre's state
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.llms/skills/architecture/SKILL.md
Popularity
- Repository stars
- 7,165
- Repository forks
- 452
- 7-day trend score
- 44
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/facebook/pyre-check/architecture)