TVM FFI Development

VerifiedCaution

This skill assists in developing and verifying Foreign Function Interface (FFI) changes in TVM. It can take a GitHub issue URL or a text description, then fetches details, writes a minimal Python reproducer, and follows a development loop with building and testing. It enforces project-specific code style and best practices for C++ and Python.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#tvm#ffi#development#verification#cpp-python

Recommended for

Automated summary

This skill helps develop and verify TVM Foreign Function Interface (FFI) changes.

Strengths

  • Provides a complete workflow: understanding, implementation, build, and test.
  • Enforces strict code style guidelines for C++ and Python, improving code quality.
  • Automates reproducibility by writing and running repro scripts.
  • Simplifies GitHub issue handling via a dedicated command.

Limitations

  • Requires prior knowledge of TVM and its FFI internals.
  • Depends on the TVM build and test environment (/tvm-ffi-build, /tvm-ffi-test).
  • May not cover all edge cases not described in the instructions.
When to use it

Use this skill when implementing or fixing TVM FFI functionality, from bug reproduction to validation.

When not to use it

Avoid this skill for generic TVM development tasks not involving FFI, or if you are unfamiliar with the specified coding conventions.

Security analysis

Caution
Quality score85/100

The skill involves executing Python scripts and build/test commands, which could potentially run malicious code if given untrusted issue descriptions. The operations are legitimate for development but are powerful, warranting caution.

Findings
  • •Runs Python repro scripts and build/test commands, which could execute arbitrary code. This is typical for a development workflow but requires caution.
How this analysis is made

Examples

Fix a TVM FFI bug from GitHub issue
/tvm-ffi-dev https://github.com/apache/tvm/issues/12345
Implement a new FFI feature
/tvm-ffi-dev Add a new FFI function to access tensor data via std::expected
Continue current FFI work
/tvm-ffi-dev

name: tvm-ffi-dev description: Develop and verify TVM FFI changes.

TVM FFI Dev

Usage

/tvm-ffi-dev                  # auto-run: pick next item or continue current work
/tvm-ffi-dev <GitHub issue URL>
/tvm-ffi-dev <text description>

Instructions

  1. Understand the task:

    • If given a GitHub issue URL, fetch with gh issue view <URL>
    • Write a minimal Python repro script and run it to confirm the error. If it can't be reproduced, stop and report.
    • If given text, use that as the requirement
  2. Follow /dev-autodev loop with these project-specific details:

    • If fixing an issue: Re-run the repro script to verify it passes, then delete it.
    • Verify: Use /tvm-ffi-build, then /tvm-ffi-test.

Code style

  • C++: prefer std::string_view, static_cast, STL algorithms over manual loops
  • C++: add move-qualified overloads (&&) for accessors returning owned values
  • C++: align new APIs with C++ std equivalents (e.g. std::expected, std::unexpected), list deviations explicitly
  • C++: use std::move on optionals (*std::move(val)), avoid double checking
  • C++: fast path first (value before error), minimize branches
  • C++: ban implicit conversions for error types, use explicit constructors (e.g. Unexpected(Error(...)))
  • Python: reuse stdlib types (e.g. dataclasses.KW_ONLY) instead of redefining
  • Tests: call actual registered FFI functions, not reimplement logic
  • Tests: use ASSERT_TRUE for null checks before dereferencing
  • Tests: no duplicate assertions, remove redundant checks
  • Extract duplicated logic into helpers
  • New user-facing APIs need documentation with usage examples
  • Preserve original error info on rethrow, not generic messages

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/tvm-ffi-development-mmlj2oq7' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/tvm-ffi-development-mmlj2oq7/download' --output '.skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md.part' && mv '.skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md.part' '.skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md' && test -s '.skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/tvm-ffi-dev' && cp -R '.skill-downloads/tvm-ffi-development-mmlj2oq7' '.claude/skills/tvm-ffi-dev'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/tvm-ffi-development-mmlj2oq7'

openskills read 'tvm-ffi-development-mmlj2oq7'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/tvm-ffi-development-mmlj2oq7/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills