This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 4efd660fdd [AGENT] Migrate agent instructions to vendor-neutral layout 
(#19783)
4efd660fdd is described below

commit 4efd660fdd5caa90ad74fa48e93e0ce904e060a1
Author: Tianqi Chen <[email protected]>
AuthorDate: Mon Jun 15 18:50:14 2026 -0400

    [AGENT] Migrate agent instructions to vendor-neutral layout (#19783)
    
    This PR migrates repository agent instructions away from Claude-specific
    paths and into a vendor-neutral layout.
    
    Changes:
    - Add root `AGENTS.md`
    - Move existing command guidance from `.claude/commands` to
    `.agents/skills/*/SKILL.md` using git renames.
    - Move the GPU monitor helper from `.claude/scripts` to
    `.agents/scripts`.
    - Update the TIR test skill to reference
    `.agents/scripts/monitor_gpu.sh`.
    - Replace the ASF header skip entry for `.claude/*` with `.agents/*`.
    
    Validation:
    - `bash -n .agents/scripts/monitor_gpu.sh`
    - `.agents/scripts/monitor_gpu.sh --help`
    - `pre-commit run --files AGENTS.md .agents/skills/tir-build/SKILL.md
    .agents/skills/tir-test/SKILL.md .agents/skills/tir-bench/SKILL.md
    .agents/scripts/monitor_gpu.sh tests/lint/check_asf_header.py`
---
 {.claude => .agents}/scripts/monitor_gpu.sh        | 13 ++-
 .../skills/tir-bench/SKILL.md                      |  0
 .../skills/tir-build/SKILL.md                      |  6 +-
 .../skills/tir-test/SKILL.md                       |  4 +-
 AGENTS.md                                          | 99 ++++++++++++++++++++++
 tests/lint/check_asf_header.py                     |  2 +-
 6 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/.claude/scripts/monitor_gpu.sh b/.agents/scripts/monitor_gpu.sh
similarity index 86%
rename from .claude/scripts/monitor_gpu.sh
rename to .agents/scripts/monitor_gpu.sh
index 85963da930..e1d91ae3b4 100755
--- a/.claude/scripts/monitor_gpu.sh
+++ b/.agents/scripts/monitor_gpu.sh
@@ -23,7 +23,18 @@ while [[ $# -gt 0 ]]; do
     --interval) INTERVAL="$2"; shift 2 ;;
     --log) LOG="$2"; shift 2 ;;
     -h|--help)
-      sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'
+      cat <<'EOF'
+Watch a single GPU for foreign processes (anyone other than the current
+user) appearing during a long-running test. Intended companion to
+`/tir-test`: leave this running in a side terminal while pytest runs, and
+it will alert if someone else lands on the same GPU.
+
+Usage:
+  monitor_gpu.sh                       # uses $CUDA_VISIBLE_DEVICES, defaults 
to 0
+  monitor_gpu.sh --gpu 3               # watch GPU 3
+  monitor_gpu.sh --gpu 3 --interval 2  # poll every 2 seconds
+  monitor_gpu.sh --log /tmp/gpu.log    # also tee to a log file
+EOF
       exit 0 ;;
     *) echo "unknown arg: $1" >&2; exit 2 ;;
   esac
diff --git a/.claude/commands/tir-bench.md b/.agents/skills/tir-bench/SKILL.md
similarity index 100%
rename from .claude/commands/tir-bench.md
rename to .agents/skills/tir-bench/SKILL.md
diff --git a/.claude/commands/tir-build.md b/.agents/skills/tir-build/SKILL.md
similarity index 69%
rename from .claude/commands/tir-build.md
rename to .agents/skills/tir-build/SKILL.md
index 21aadbe685..ee43dfa84b 100644
--- a/.claude/commands/tir-build.md
+++ b/.agents/skills/tir-build/SKILL.md
@@ -4,12 +4,14 @@ Build TVM from the current worktree.
 
 1. Check that `build/` directory exists. If not, run initial setup:
    ```bash
-   mkdir -p build && cd build && cmake .. && make -j$(nproc)
+   mkdir -p build
+   cmake -S . -B build
+   cmake --build build --parallel
    ```
 
 2. If `build/` already exists, run incremental build:
    ```bash
-   cmake --build build -j$(nproc)
+   cmake --build build --parallel
    ```
 
 3. Report success/failure and build time.
diff --git a/.claude/commands/tir-test.md b/.agents/skills/tir-test/SKILL.md
similarity index 95%
rename from .claude/commands/tir-test.md
rename to .agents/skills/tir-test/SKILL.md
index f6cd25236b..b4c4506916 100644
--- a/.claude/commands/tir-test.md
+++ b/.agents/skills/tir-test/SKILL.md
@@ -10,14 +10,14 @@ Run the full TIRX test suite.
 2. Start the GPU monitor in the background so we can detect if anyone else 
lands on the same GPU mid-run:
    ```bash
    GPU_LOG="/tmp/tir_test_gpu_${CUDA_VISIBLE_DEVICES}.log"
-   bash .claude/scripts/monitor_gpu.sh --gpu "$CUDA_VISIBLE_DEVICES" 
--interval 5 --log "$GPU_LOG" &
+   bash .agents/scripts/monitor_gpu.sh --gpu "$CUDA_VISIBLE_DEVICES" 
--interval 5 --log "$GPU_LOG" &
    MON_PID=$!
    trap 'kill $MON_PID 2>/dev/null' EXIT
    ```
 
 3. Run the full test suite with xdist parallelism:
    ```bash
-   pytest tests/python/tirx/ -n 16
+   pytest tests/python/tirx/ -n auto
    ```
 
 4. Stop the monitor and check for foreign GPU usage during the run:
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000000..4d70e7c79c
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,99 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# AGENTS.md
+
+This file provides vendor-neutral guidance for agentic coding tools working
+with Apache TVM.
+
+## Repository Overview
+
+Apache TVM is an open-source machine learning compiler stack. The repository
+contains the C++ compiler/runtime, Python bindings, TIR/Relax IRs, scheduling
+and lowering passes, target code generators, runtime integrations, tests,
+documentation, and application examples.
+
+## Repository Structure
+
+- `include/tvm/` - public C++ headers
+- `src/` - C++ implementation
+- `python/tvm/` - Python package
+- `tests/` - C++, Python, integration, and lint tests
+- `cmake/` - CMake modules and default configuration
+- `3rdparty/` - vendored dependencies and submodules
+- `docs/` - documentation source
+- `apps/` - application examples
+- `.agents/skills/` - reusable agent workflows for this repository
+
+## Build
+
+Use an existing `build/` directory when present:
+
+```bash
+cmake --build build --parallel
+```
+
+For a fresh checkout, initialize submodules and configure CMake first:
+
+```bash
+git submodule update --init --recursive
+mkdir -p build
+cp cmake/config.cmake build/config.cmake
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
+cmake --build build --parallel
+```
+
+Development should use `PYTHONPATH`, not editable installs:
+
+```bash
+export PYTHONPATH="$(pwd)/python:$(pwd)/.local/python"
+```
+
+Do not use `pip install -e` for TVM or `tvm-ffi`; editable installs can make
+one worktree silently import another worktree's code.
+
+## Test And Lint
+
+Run the smallest relevant test first, then broaden as needed. Common examples:
+
+```bash
+python -m pytest tests/python/all-platform-minimal-test/ -xvs
+python -m pytest tests/python/tir-base/test_tir_base.py -xvs
+./build/cpptest
+```
+
+For lint validation on a pull request, run pre-commit on the files changed by
+the branch instead of the whole repository:
+
+```bash
+pre-commit run --files <changed-file>...
+```
+
+Use `.agents/skills/tir-build`, `.agents/skills/tir-test`, and
+`.agents/skills/tir-bench` when their workflows apply.
+
+## Coding Conventions
+
+- Follow the surrounding style before introducing new abstractions.
+- Keep changes scoped to the task and avoid unrelated cleanups.
+- Prefer explicit tests that show the IR or behavior being changed.
+- Use Apache TVM commit tags such as `[REFACTOR][IR]`, `[FIX][TIR]`, or
+  `[DOCS]` as appropriate.
+- Preserve Apache license headers in new source, script, and documentation
+  files when the surrounding tree uses them.
diff --git a/tests/lint/check_asf_header.py b/tests/lint/check_asf_header.py
index 8ba73524f7..d6237c600a 100644
--- a/tests/lint/check_asf_header.py
+++ b/tests/lint/check_asf_header.py
@@ -186,7 +186,7 @@ SKIP_LIST: list[str] = [
     "ffi/3rdparty/*",
     ".github/*",
     ".txdev/*",
-    ".claude/*",
+    ".agents/*",
     "*.json",
     "*.txt",
     "*.svg",

Reply via email to