[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACMM53JTNTWF9YWYYMREQ3":3,"skill-same:01M6ACMM53JTNTWF9YWYYMREQ3":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":6,"updatedAt":47,"install":48,"resources":61},"01M6ACMM53JTNTWF9YWYYMREQ3","devtools",null,"Developer reference for Apache TVM-FFI.","apache\u002Ftvm-ffi","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACMJGMVHDC8T0JAJSC4804",479,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm-ffi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdevtools\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[5,24,25,26,27,9,28,29,30,31,32],"docs","python","cpp","lint","tvm","ffi","developer","reference","for","2026-11-10 10:12:30",false,"---\nname: devtools\ndescription: Developer reference for Apache TVM-FFI.\nargument-hint: \"[lint | cpp | python | docs]\"\n---\n\n# TVM-FFI Developer Guide\n\nCondensed reference from `docs\u002Fdev\u002F`. Use this when working on the TVM-FFI codebase.\n\n## Prerequisites\n\n- **Python**: 3.9+ (managed via `uv`; default virtualenv at `.venv`)\n- **Compiler**: C++20-capable toolchain (GCC\u002FClang on Linux, Apple Clang on macOS, MSVC on Windows)\n- **Build tools**: CMake 3.26+, Ninja\n- **Source**: Always clone with `--recursive`, or run `git submodule update --init --recursive`\n\nAll Python-related commands below use [`uv`](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F). The default virtual environment is `.venv` in the repo root.\n\n---\n\n## 1. Run Linters and clang-tidy\n\n### Pre-commit hooks (primary linting workflow)\n\nInstall and register git hooks:\n\n```bash\nuv tool install pre-commit\npre-commit install          # register git hooks (runs automatically before each commit)\n```\n\nRun hooks manually:\n\n```bash\npre-commit run --all-files          # all hooks on every file\npre-commit run                      # all hooks on staged files only\npre-commit run \u003Chook-id> --all-files  # single hook, e.g. ruff-check, clang-format\n```\n\n**Linters by language:**\n\n| Language | Formatter                       | Linter \u002F Type Checker            |\n|----------|---------------------------------|----------------------------------|\n| Python   | `ruff` (format)                 | `ruff` (lint), `ty` (type check) |\n| C\u002FC++    | `clang-format`                  | `clang-tidy` (see below)         |\n| Cython   | `double-quote-cython-strings`   | `cython-lint`                    |\n| CMake    | `cmake-format`                  | `cmake-lint`                     |\n| Shell    | `shfmt`                         | `shellcheck`                     |\n| YAML     | `yamllint`                      |                                  |\n| TOML     | `taplo-format`                  |                                  |\n| Markdown | `markdownlint-cli2`             |                                  |\n| RST      | `rstcheck`                      |                                  |\n\n**Troubleshooting pre-commit:**\n\n- **Version problems**: Ensure pre-commit 2.18.0+ (`pre-commit --version`).\n- **Stale cache**: Run `pre-commit clean` to clear the hook cache.\n- **Auto-fixed files**: Most formatting hooks fix issues in place. Review changes, stage with `git add -u`, and commit again.\n\n### clang-tidy (separate from pre-commit)\n\n`clang-tidy` is **not** a pre-commit hook. It runs as a separate CI job and only checks changed C++ files. To reproduce locally:\n\n```bash\n# Run on specific files\nuv run --no-project --with \"clang-tidy==21.1.1\" \\\n  python tests\u002Flint\u002Fclang_tidy_precommit.py \\\n    --build-dir=build-pre-commit \\\n    --jobs=$(sysctl -n hw.ncpu) \\\n    include\u002Ftvm\u002Fffi\u002Fc_api.h src\u002Fsome_file.cc\n\n# Run on all C++ sources\nuv run --no-project --with \"clang-tidy==21.1.1\" \\\n  python tests\u002Flint\u002Fclang_tidy_precommit.py \\\n    --build-dir=build-pre-commit \\\n    --jobs=$(sysctl -n hw.ncpu) \\\n    .\u002Fsrc\u002F .\u002Finclude .\u002Ftests\n```\n\n> On macOS, `clang-tidy` is resolved via `xcrun`; the wrapper script handles this automatically.\n> On Linux, replace `$(sysctl -n hw.ncpu)` with `$(nproc)`.\n\n---\n\n## 2. Build and Test the C++ Package\n\n### Build the C++ library (no Python)\n\n```bash\ncmake . -B build_cpp -DCMAKE_BUILD_TYPE=RelWithDebInfo\ncmake --build build_cpp --parallel --config RelWithDebInfo --target tvm_ffi_shared\ncmake --install build_cpp --config RelWithDebInfo --prefix .\u002Fdist\n```\n\nAfter installation:\n- Headers: `dist\u002Finclude\u002F`\n- Libraries: `dist\u002Flib\u002F`\n\n### Build and run C++ tests\n\nSet parallel build level first:\n\n```bash\nexport CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)  # macOS\n# export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)             # Linux\n```\n\nConfigure, build, and run:\n\n```bash\ncmake . -B build_test -DTVM_FFI_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug\ncmake --build build_test --clean-first --config Debug --target tvm_ffi_tests\nctest -V -C Debug --test-dir build_test --output-on-failure\n```\n\n### Key CMake options\n\n| Option                           | Default | Description                                  |\n|----------------------------------|---------|----------------------------------------------|\n| `TVM_FFI_BUILD_TESTS`            | `OFF`   | Enable C++ test targets                      |\n| `TVM_FFI_ATTACH_DEBUG_SYMBOLS`   | `OFF`   | Attach debug symbols in release mode         |\n| `TVM_FFI_USE_LIBBACKTRACE`       | `ON`    | Enable libbacktrace                          |\n| `TVM_FFI_USE_EXTRA_CXX_API`      | `ON`    | Enable extra C++ API in shared lib           |\n| `TVM_FFI_BACKTRACE_ON_SEGFAULT`  | `ON`    | Print backtrace on segfault                  |\n| `CMAKE_EXPORT_COMPILE_COMMANDS`  | `OFF`   | Generate `compile_commands.json` for clangd  |\n\n> On Windows, run from a **Developer Command Prompt for VS** or ensure the MSVC toolchain is on your `PATH`.\n\n---\n\n## 3. Build and Test the Python Package\n\n### Build (editable install)\n\nThe Python build uses `scikit-build-core` which drives CMake to compile the C++ core and Cython extension:\n\n```bash\nuv pip install --force-reinstall --verbose -e .\n```\n\n- `--force-reinstall` forces a full rebuild.\n- `-e` (editable) means pure Python changes are reflected immediately without rebuilding.\n- **C++\u002FCython changes always require re-running this command.**\n\nPass CMake flags via `--config-settings`:\n\n```bash\nuv pip install --force-reinstall --verbose -e . \\\n  --config-settings cmake.define.TVM_FFI_ATTACH_DEBUG_SYMBOLS=ON\n```\n\nVerify the install:\n\n```bash\nuv run python -c \"import tvm_ffi; print(tvm_ffi.__version__)\"\n```\n\n### Update Python stubs\n\nAfter building (or after C++\u002FCython reflection changes), regenerate inline type stubs:\n\n```bash\nuv run tvm-ffi-stubgen python\n```\n\nThis updates inline stub blocks (between `tvm-ffi-stubgen(begin)` \u002F `tvm-ffi-stubgen(end)`\nmarkers) inside `.py` files with type annotations derived from the C++ reflection\nregistry (field types, method signatures, global function schemas).\n\n### Run Python tests\n\nInstall with test dependencies, then run pytest:\n\n```bash\nuv pip install --force-reinstall --verbose --group test -e .\nuv run pytest -vvs tests\u002Fpython\n```\n\n### Run Rust tests\n\nRust tests require the Python package to be installed first (Rust FFI bindings link against the built shared library):\n\n```bash\ncd rust && cargo test\n```\n\n### Troubleshooting\n\n- **Rebuilding after C++\u002FCython changes**: Re-run `uv pip install --force-reinstall -e .`. Editable installs only auto-reflect pure Python changes.\n- **Submodules missing**: Run `git submodule update --init --recursive` from the repo root.\n- **Library not found at import time**: Ensure the dynamic loader can find the shared library. Add the `lib` directory to `LD_LIBRARY_PATH` (Linux), `DYLD_LIBRARY_PATH` (macOS), or `PATH` (Windows).\n\n---\n\n## 4. Build Documentation Website\n\nBuilding documentation requires the Python package to be installed first (see section 3).\n\n### Interactive build (auto-reload)\n\nServes locally at `http:\u002F\u002F127.0.0.1:8000` with live reload:\n\n```bash\nuv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Fcpp\u002Fgenerated\n```\n\n### One-off build\n\n```bash\nuv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### With C++ API reference (requires Doxygen)\n\n```bash\n# Install Doxygen\nbrew install doxygen        # macOS\n# sudo apt install doxygen  # Linux\n\n# Interactive\nBUILD_CPP_DOCS=1 uv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Fcpp\u002Fgenerated --watch include\n\n# One-off\nBUILD_CPP_DOCS=1 uv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### With Rust API reference (requires cargo)\n\n```bash\n# Interactive\nBUILD_RUST_DOCS=1 uv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Frust\u002Fgenerated --watch rust\n\n# One-off\nBUILD_RUST_DOCS=1 uv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### Build all documentation\n\n```bash\nBUILD_CPP_DOCS=1 BUILD_RUST_DOCS=1 uv run --group docs sphinx-build \\\n  -M html docs docs\u002F_build\n```\n\n### Cleanup\n\n```bash\nrm -rf docs\u002F_build\u002F docs\u002Freference\u002Fpython\u002Fgenerated docs\u002Freference\u002Fcpp\u002Fgenerated docs\u002Freference\u002Frust\u002Fgenerated\n```\n","# TVM-FFI Developer Guide\n\nCondensed reference from `docs\u002Fdev\u002F`. Use this when working on the TVM-FFI codebase.\n\n## Prerequisites\n\n- **Python**: 3.9+ (managed via `uv`; default virtualenv at `.venv`)\n- **Compiler**: C++20-capable toolchain (GCC\u002FClang on Linux, Apple Clang on macOS, MSVC on Windows)\n- **Build tools**: CMake 3.26+, Ninja\n- **Source**: Always clone with `--recursive`, or run `git submodule update --init --recursive`\n\nAll Python-related commands below use [`uv`](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F). The default virtual environment is `.venv` in the repo root.\n\n---\n\n## 1. Run Linters and clang-tidy\n\n### Pre-commit hooks (primary linting workflow)\n\nInstall and register git hooks:\n\n```bash\nuv tool install pre-commit\npre-commit install          # register git hooks (runs automatically before each commit)\n```\n\nRun hooks manually:\n\n```bash\npre-commit run --all-files          # all hooks on every file\npre-commit run                      # all hooks on staged files only\npre-commit run \u003Chook-id> --all-files  # single hook, e.g. ruff-check, clang-format\n```\n\n**Linters by language:**\n\n| Language | Formatter                       | Linter \u002F Type Checker            |\n|----------|---------------------------------|----------------------------------|\n| Python   | `ruff` (format)                 | `ruff` (lint), `ty` (type check) |\n| C\u002FC++    | `clang-format`                  | `clang-tidy` (see below)         |\n| Cython   | `double-quote-cython-strings`   | `cython-lint`                    |\n| CMake    | `cmake-format`                  | `cmake-lint`                     |\n| Shell    | `shfmt`                         | `shellcheck`                     |\n| YAML     | `yamllint`                      |                                  |\n| TOML     | `taplo-format`                  |                                  |\n| Markdown | `markdownlint-cli2`             |                                  |\n| RST      | `rstcheck`                      |                                  |\n\n**Troubleshooting pre-commit:**\n\n- **Version problems**: Ensure pre-commit 2.18.0+ (`pre-commit --version`).\n- **Stale cache**: Run `pre-commit clean` to clear the hook cache.\n- **Auto-fixed files**: Most formatting hooks fix issues in place. Review changes, stage with `git add -u`, and commit again.\n\n### clang-tidy (separate from pre-commit)\n\n`clang-tidy` is **not** a pre-commit hook. It runs as a separate CI job and only checks changed C++ files. To reproduce locally:\n\n```bash\n# Run on specific files\nuv run --no-project --with \"clang-tidy==21.1.1\" \\\n  python tests\u002Flint\u002Fclang_tidy_precommit.py \\\n    --build-dir=build-pre-commit \\\n    --jobs=$(sysctl -n hw.ncpu) \\\n    include\u002Ftvm\u002Fffi\u002Fc_api.h src\u002Fsome_file.cc\n\n# Run on all C++ sources\nuv run --no-project --with \"clang-tidy==21.1.1\" \\\n  python tests\u002Flint\u002Fclang_tidy_precommit.py \\\n    --build-dir=build-pre-commit \\\n    --jobs=$(sysctl -n hw.ncpu) \\\n    .\u002Fsrc\u002F .\u002Finclude .\u002Ftests\n```\n\n> On macOS, `clang-tidy` is resolved via `xcrun`; the wrapper script handles this automatically.\n> On Linux, replace `$(sysctl -n hw.ncpu)` with `$(nproc)`.\n\n---\n\n## 2. Build and Test the C++ Package\n\n### Build the C++ library (no Python)\n\n```bash\ncmake . -B build_cpp -DCMAKE_BUILD_TYPE=RelWithDebInfo\ncmake --build build_cpp --parallel --config RelWithDebInfo --target tvm_ffi_shared\ncmake --install build_cpp --config RelWithDebInfo --prefix .\u002Fdist\n```\n\nAfter installation:\n- Headers: `dist\u002Finclude\u002F`\n- Libraries: `dist\u002Flib\u002F`\n\n### Build and run C++ tests\n\nSet parallel build level first:\n\n```bash\nexport CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)  # macOS\n# export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)             # Linux\n```\n\nConfigure, build, and run:\n\n```bash\ncmake . -B build_test -DTVM_FFI_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug\ncmake --build build_test --clean-first --config Debug --target tvm_ffi_tests\nctest -V -C Debug --test-dir build_test --output-on-failure\n```\n\n### Key CMake options\n\n| Option                           | Default | Description                                  |\n|----------------------------------|---------|----------------------------------------------|\n| `TVM_FFI_BUILD_TESTS`            | `OFF`   | Enable C++ test targets                      |\n| `TVM_FFI_ATTACH_DEBUG_SYMBOLS`   | `OFF`   | Attach debug symbols in release mode         |\n| `TVM_FFI_USE_LIBBACKTRACE`       | `ON`    | Enable libbacktrace                          |\n| `TVM_FFI_USE_EXTRA_CXX_API`      | `ON`    | Enable extra C++ API in shared lib           |\n| `TVM_FFI_BACKTRACE_ON_SEGFAULT`  | `ON`    | Print backtrace on segfault                  |\n| `CMAKE_EXPORT_COMPILE_COMMANDS`  | `OFF`   | Generate `compile_commands.json` for clangd  |\n\n> On Windows, run from a **Developer Command Prompt for VS** or ensure the MSVC toolchain is on your `PATH`.\n\n---\n\n## 3. Build and Test the Python Package\n\n### Build (editable install)\n\nThe Python build uses `scikit-build-core` which drives CMake to compile the C++ core and Cython extension:\n\n```bash\nuv pip install --force-reinstall --verbose -e .\n```\n\n- `--force-reinstall` forces a full rebuild.\n- `-e` (editable) means pure Python changes are reflected immediately without rebuilding.\n- **C++\u002FCython changes always require re-running this command.**\n\nPass CMake flags via `--config-settings`:\n\n```bash\nuv pip install --force-reinstall --verbose -e . \\\n  --config-settings cmake.define.TVM_FFI_ATTACH_DEBUG_SYMBOLS=ON\n```\n\nVerify the install:\n\n```bash\nuv run python -c \"import tvm_ffi; print(tvm_ffi.__version__)\"\n```\n\n### Update Python stubs\n\nAfter building (or after C++\u002FCython reflection changes), regenerate inline type stubs:\n\n```bash\nuv run tvm-ffi-stubgen python\n```\n\nThis updates inline stub blocks (between `tvm-ffi-stubgen(begin)` \u002F `tvm-ffi-stubgen(end)`\nmarkers) inside `.py` files with type annotations derived from the C++ reflection\nregistry (field types, method signatures, global function schemas).\n\n### Run Python tests\n\nInstall with test dependencies, then run pytest:\n\n```bash\nuv pip install --force-reinstall --verbose --group test -e .\nuv run pytest -vvs tests\u002Fpython\n```\n\n### Run Rust tests\n\nRust tests require the Python package to be installed first (Rust FFI bindings link against the built shared library):\n\n```bash\ncd rust && cargo test\n```\n\n### Troubleshooting\n\n- **Rebuilding after C++\u002FCython changes**: Re-run `uv pip install --force-reinstall -e .`. Editable installs only auto-reflect pure Python changes.\n- **Submodules missing**: Run `git submodule update --init --recursive` from the repo root.\n- **Library not found at import time**: Ensure the dynamic loader can find the shared library. Add the `lib` directory to `LD_LIBRARY_PATH` (Linux), `DYLD_LIBRARY_PATH` (macOS), or `PATH` (Windows).\n\n---\n\n## 4. Build Documentation Website\n\nBuilding documentation requires the Python package to be installed first (see section 3).\n\n### Interactive build (auto-reload)\n\nServes locally at `http:\u002F\u002F127.0.0.1:8000` with live reload:\n\n```bash\nuv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Fcpp\u002Fgenerated\n```\n\n### One-off build\n\n```bash\nuv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### With C++ API reference (requires Doxygen)\n\n```bash\n# Install Doxygen\nbrew install doxygen        # macOS\n# sudo apt install doxygen  # Linux\n\n# Interactive\nBUILD_CPP_DOCS=1 uv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Fcpp\u002Fgenerated --watch include\n\n# One-off\nBUILD_CPP_DOCS=1 uv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### With Rust API reference (requires cargo)\n\n```bash\n# Interactive\nBUILD_RUST_DOCS=1 uv run --group docs sphinx-autobuild docs docs\u002F_build\u002Fhtml \\\n  --ignore docs\u002Freference\u002Frust\u002Fgenerated --watch rust\n\n# One-off\nBUILD_RUST_DOCS=1 uv run --group docs sphinx-build -M html docs docs\u002F_build\n```\n\n### Build all documentation\n\n```bash\nBUILD_CPP_DOCS=1 BUILD_RUST_DOCS=1 uv run --group docs sphinx-build \\\n  -M html docs docs\u002F_build\n```\n\n### Cleanup\n\n```bash\nrm -rf docs\u002F_build\u002F docs\u002Freference\u002Fpython\u002Fgenerated docs\u002Freference\u002Fcpp\u002Fgenerated docs\u002Freference\u002Frust\u002Fgenerated\n```\n",{"name":5,"description":7,"argument-hint":38},"[lint | cpp | python | docs]","main","a8e370c4818fda2b5f666a879253b55d54c9fe33",".agents\u002Fskills\u002Fdevtools",111,"https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm-ffi","https:\u002F\u002Ftvm.apache.org\u002Fffi","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-14 23:42:50",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add apache\u002Ftvm-ffi --skill devtools",{"tool":54,"command":55},"bunx","bunx skills add apache\u002Ftvm-ffi --skill devtools",{"tool":57,"command":58},"pnpm","pnpm dlx skills add apache\u002Ftvm-ffi --skill devtools","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm-ffi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdevtools\u002FSKILL.md",true,[],[]]