devtools
Skill477 starsChanged 8 days agoApache-2.0View on GitHub
Developer reference for Apache TVM-FFI.
- Deletes or force-pushes
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- vercel-labs/json-rendertheir own version, first seen Oct 29, 2026
- OHOKAYYEAH/claude-skillstheir own version, first seen Oct 13, 2026
- sukirman1901/frontend-experttheir own version, first seen Sep 10, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- vercel-labs/json-render★ 19ksame name
- sukirman1901/frontend-expert★ 9same name
- OHOKAYYEAH/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Source: Always clone with --recursive, or run git submodule update --init --recursive
- Very specific: line 18
All Python-related commands below use uv.
- Very specific: line 57
Version problems: Ensure pre-commit 2.18.0+ (pre-commit --version).
- Very specific: line 58
Stale cache: Run pre-commit clean to clear the hook cache.
- Distinctive: line 161
After building (or after C++/Cython reflection changes), regenerate inline type stubs:
- Distinctive: line 191
Submodules missing: Run git submodule update --init --recursive from the repo root.
- Very specific: line 192
Library not found at import time: Ensure the dynamic loader can find the shared library.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TVM-FFI Developer Guide
Condensed reference from docs/dev/. Use this when working on the TVM-FFI codebase.
Prerequisites
- Python: 3.9+ (managed via
uv; default virtualenv at.venv) - Compiler: C++20-capable toolchain (GCC/Clang on Linux, Apple Clang on macOS, MSVC on Windows)
- Build tools: CMake 3.26+, Ninja
- Source: Always clone with
--recursive, or rungit submodule update --init --recursive
All Python-related commands below use uv. The default virtual environment is .venv in the repo root.
1. Run Linters and clang-tidy
Pre-commit hooks (primary linting workflow)
Install and register git hooks:
uv tool install pre-commit
pre-commit install # register git hooks (runs automatically before each commit)Run hooks manually:
pre-commit run --all-files # all hooks on every file
pre-commit run # all hooks on staged files only
pre-commit run <hook-id> --all-files # single hook, e.g. ruff-check, clang-formatLinters by language:
| Language | Formatter | Linter / Type Checker |
| Python | ruff (format) | ruff (lint), ty (type check) |
| C/C++ | clang-format | clang-tidy (see below) |
| Cython | double-quote-cython-strings | cython-lint |
| CMake | cmake-format | cmake-lint |
| Shell | shfmt | shellcheck |
| YAML | yamllint | |
| TOML | taplo-format | |
| Markdown | markdownlint-cli2 | |
| RST | rstcheck |
Troubleshooting pre-commit:
- Version problems: Ensure pre-commit 2.18.0+ (
pre-commit --version). - Stale cache: Run
pre-commit cleanto clear the hook cache. - Auto-fixed files: Most formatting hooks fix issues in place. Review changes, stage with
git add -u, and commit again.
clang-tidy (separate from pre-commit)
clang-tidy is not a pre-commit hook. It runs as a separate CI job and only checks changed C++ files. To reproduce locally:
# Run on specific files
uv run --no-project --with "clang-tidy==21.1.1" \
python tests/lint/clang_tidy_precommit.py \
--build-dir=build-pre-commit \
--jobs=$(sysctl -n hw.ncpu) \
include/tvm/ffi/c_api.h src/some_file.cc
# Run on all C++ sources
uv run --no-project --with "clang-tidy==21.1.1" \
python tests/lint/clang_tidy_precommit.py \
--build-dir=build-pre-commit \
--jobs=$(sysctl -n hw.ncpu) \
./src/ ./include ./testsOn macOS,
clang-tidyis resolved viaxcrun; the wrapper script handles this automatically. On Linux, replace$(sysctl -n hw.ncpu)with$(nproc).
2. Build and Test the C++ Package
Build the C++ library (no Python)
cmake . -B build_cpp -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build_cpp --parallel --config RelWithDebInfo --target tvm_ffi_shared
cmake --install build_cpp --config RelWithDebInfo --prefix ./distAfter installation:
- Headers:
dist/include/ - Libraries:
dist/lib/
Build and run C++ tests
Set parallel build level first:
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu) # macOS
# export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) # LinuxConfigure, build, and run:
cmake . -B build_test -DTVM_FFI_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build_test --clean-first --config Debug --target tvm_ffi_tests
ctest -V -C Debug --test-dir build_test --output-on-failureKey CMake options
| Option | Default | Description |
TVM_FFI_BUILD_TESTS | OFF | Enable C++ test targets |
TVM_FFI_ATTACH_DEBUG_SYMBOLS | OFF | Attach debug symbols in release mode |
TVM_FFI_USE_LIBBACKTRACE | ON | Enable libbacktrace |
TVM_FFI_USE_EXTRA_CXX_API | ON | Enable extra C++ API in shared lib |
TVM_FFI_BACKTRACE_ON_SEGFAULT | ON | Print backtrace on segfault |
CMAKE_EXPORT_COMPILE_COMMANDS | OFF | Generate compile_commands.json for clangd |
On Windows, run from a Developer Command Prompt for VS or ensure the MSVC toolchain is on your
PATH.
3. Build and Test the Python Package
Build (editable install)
The Python build uses scikit-build-core which drives CMake to compile the C++ core and Cython extension:
uv pip install --force-reinstall --verbose -e .--force-reinstallforces a full rebuild.-e(editable) means pure Python changes are reflected immediately without rebuilding.- C++/Cython changes always require re-running this command.
Pass CMake flags via --config-settings:
uv pip install --force-reinstall --verbose -e . \
--config-settings cmake.define.TVM_FFI_ATTACH_DEBUG_SYMBOLS=ONVerify the install:
uv run python -c "import tvm_ffi; print(tvm_ffi.__version__)"Update Python stubs
After building (or after C++/Cython reflection changes), regenerate inline type stubs:
uv run tvm-ffi-stubgen pythonThis updates inline stub blocks (between tvm-ffi-stubgen(begin) / tvm-ffi-stubgen(end)
markers) inside .py files with type annotations derived from the C++ reflection
registry (field types, method signatures, global function schemas).
Run Python tests
Install with test dependencies, then run pytest:
uv pip install --force-reinstall --verbose --group test -e .
uv run pytest -vvs tests/pythonRun Rust tests
Rust tests require the Python package to be installed first (Rust FFI bindings link against the built shared library):
cd rust && cargo testTroubleshooting
- Rebuilding after C++/Cython changes: Re-run
uv pip install --force-reinstall -e .. Editable installs only auto-reflect pure Python changes. - Submodules missing: Run
git submodule update --init --recursivefrom the repo root. - Library not found at import time: Ensure the dynamic loader can find the shared library. Add the
libdirectory toLD_LIBRARY_PATH(Linux),DYLD_LIBRARY_PATH(macOS), orPATH(Windows).
4. Build Documentation Website
Building documentation requires the Python package to be installed first (see section 3).
Interactive build (auto-reload)
Serves locally at http://127.0.0.1:8000 with live reload:
uv run --group docs sphinx-autobuild docs docs/_build/html \
--ignore docs/reference/cpp/generatedOne-off build
uv run --group docs sphinx-build -M html docs docs/_buildWith C++ API reference (requires Doxygen)
# Install Doxygen
brew install doxygen # macOS
# sudo apt install doxygen # Linux
# Interactive
BUILD_CPP_DOCS=1 uv run --group docs sphinx-autobuild docs docs/_build/html \
--ignore docs/reference/cpp/generated --watch include
# One-off
BUILD_CPP_DOCS=1 uv run --group docs sphinx-build -M html docs docs/_buildWith Rust API reference (requires cargo)
# Interactive
BUILD_RUST_DOCS=1 uv run --group docs sphinx-autobuild docs docs/_build/html \
--ignore docs/reference/rust/generated --watch rust
# One-off
BUILD_RUST_DOCS=1 uv run --group docs sphinx-build -M html docs docs/_buildBuild all documentation
BUILD_CPP_DOCS=1 BUILD_RUST_DOCS=1 uv run --group docs sphinx-build \
-M html docs docs/_buildCleanup
rm -rf docs/_build/ docs/reference/python/generated docs/reference/cpp/generated docs/reference/rust/generatedDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

