Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

add-torch-shapes-example

Skill by facebook

Guides a maintainer through adding a PyTorch model as a tested reference port to Pyrefly's shape-tracking example corpus. It is for maintainer work inside the fbsource repository.

  • Score 87
  • 7.3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install add-torch-shapes-example

Built from the published package, never by AI.

git clone --depth 1 https://github.com/facebook/pyrefly /tmp/pyrefly && mkdir -p ~/.claude/skills && cp -r /tmp/pyrefly/.agents/skills/add-torch-shapes-example ~/.claude/skills/add-torch-shapes-example

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install add-torch-shapes-example in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill covers adding a new PyTorch model to the example corpus at tensor-shapes/pyrefly-torch-stubs/examples in the Pyrefly fbsource checkout. It treats each port as a contribution case, so the maintainer records the upstream repository and revision, the files in scope, the configuration and the modes covered. The agent starts from existing examples and upstream shape comments, and verifies each hypothesis with Pyrefly.

The workflow follows the add-shape-types-to-torch-model skill. It places the file, then runs Buck-based Pyrefly checks with the shared tensor-shapes virtual environment and the torch-examples corpus suite. The check must report 0 errors with no leftover reveal_type calls. Genuine stub gaps are fixed in general stubs, and wrong shapes are routed to the modify-shaped-array-dsl skill. It is for maintainers, not for porting models outside the repository.

Written from the project's SKILL.md and checked against it.

What it can do

  • Upstream boundary recordingRecords the upstream repository, revision, files, configuration and modes in scope for the port.
  • Evidence-first startMines existing examples and upstream shape comments before editing the model.
  • Stub gap triageSeparates true stub gaps from Any, gradual returns and third-party boundaries.
  • Buck verificationRuns the Pyrefly check and the torch-examples corpus test suite through Buck.
  • Shape DSL routingSends wrong or missing shapes that stubs cannot express to the modify-shaped-array-dsl skill.

What you need

  • Access to the fbsource fbcode/pyrefly checkout
  • Buck build system
  • Python 3 with the shared tensor-shapes virtual environment
  • Fwdproxy access on hosts that need it

Try asking

  • Port this PyTorch model into the torch shapes example corpus
  • Run the Buck Pyrefly check on my new corpus example
  • Is this missing shape a stub gap or an Any boundary?

Good to know

  • Designed for the fbsource fbcode/pyrefly checkout.
  • Runtime rewrites are proposed, not performed, unless requested.
  • Corpus ports may keep documented gradual boundaries for dynamic or external code.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agents/skills/add-torch-shapes-example/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to add-torch-shapes-example

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

add-torch-shapes-example: common questions

Who is this skill for?

It is for maintainers doing fbsource work on the Pyrefly example corpus. The source says to use the porting skill directly for porting your own model elsewhere.

What must a port pass before it is done?

The Pyrefly check must report 0 errors with no leftover reveal_type calls. The torch-examples corpus suite must also run.

Does the skill change the upstream model at runtime?

No. The source says runtime rewrites are only proposed, and are performed only if the user separately requests it.

How do I install add-torch-shapes-example?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is add-torch-shapes-example free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is add-torch-shapes-example safe to use?

It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to add-torch-shapes-example?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

add-torch-shapes-example Install

Add to stack

Loading.