一键导入
tensor-grep
Use tensor-grep for repository code search, symbol lookup, blast-radius analysis, and edit planning when solving codebase tasks or preparing patches.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use tensor-grep for repository code search, symbol lookup, blast-radius analysis, and edit planning when solving codebase tasks or preparing patches.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when searching code, logs, or repositories with tensor-grep; validating rg or AST parity; using tg MCP tools; checking GPU/search routing; or producing agent-friendly context, source, refs, or blast-radius output.
Use when you need the domain theory behind tensor-grep's search/retrieval behavior, not just the command syntax — ripgrep exit codes (including the exit-2-but-kept partial-results contract)/PCRE2/binary-NUL-detection/-uuu/-- sentinels, ast-grep + tree-sitter routing, BM25 vs the flat no-IDF capsule scorer, PageRank vs in-degree centrality, the trigram index, PyO3 + the GIL, MCP argv surface, LSP 3.17 framing, and Model2Vec/potion-code (SHIPPED as `tg search --semantic`). Load before explaining WHY tg behaves a certain way, reasoning about the protocol/algorithm THEORY underneath a backend/router change (exit-code semantics, scoring math, wire framing), or writing docs that touch these subsystems — for the invariants a backend/router change must not break, use `tensor-grep-architecture-contract` instead (or in addition). Not a how-to-run or how-to-debug guide — see the sibling table below for those.
Use when you need the load-bearing design of tensor-grep and WHY it holds before touching cli/bootstrap.py, rust_core/src/main.rs, backends/, core/result.py, cli/main.py's native-delegation gate, routing, the agent capsule, or before reviewing/planning any change to the front door, command/flag registration, or backend contract. Explains the bootstrap intercept-before-Typer front door, native-vs-Python routing, the 4 command + 2 flag registration sites, the Backend Fail-Closed Contract, the native-delegation forward-or-refuse contract (`_can_delegate_to_native_tg_search` + its field-coverage ratchet), the partial-results `result_incomplete`/`incomplete_reason` envelope, `MatchLine`'s frozen-but-hashable dataclass contract, the ASCII-only CLI output rule, the agent-context moat, the invariants that must hold, and the known-weak points (flat no-IDF scorer, GPU not viable, rg parity gap, FFI not the dir-scan speed path). Read this to build the right mental model; use sibling skills for the how-to of changing, de
Use when asked to deep-dive, audit, fix, or drain tensor-grep backlog — OR investigate/rank next work and produce SPEC/TDD plans (docs/plans/requirements|design|tasks-*.md) without implementing. Triggers: "work the backlog", "what next", "investigate and plan", backlog-completion campaign. META-ORCHESTRATOR — 20-skill library. Semantic-search flagship: tensor-grep-semantic-search-campaign. Scale/hang campaign: tensor-grep-large-repo-scale-campaign. Load tensor-grep-change-control before edit.
Use when about to claim, review, or dispute a speedup/regression in tensor-grep (tg vs rg, hot-cache, AST, agent-workflow, or GPU changes) — which benchmark script to run, how to read check_regression.py, the noise-floor/absolute-jitter rule for sub-10ms rows, the fair-baseline rule (never compare tg against a strawman comparator), and the launcher-attribution rules (tg_launcher_mode, tg_launcher_command_kind, stale-binary refusal) that make a benchmark artifact claim-quality instead of noise.
Use when setting up the tensor-grep dev environment from a fresh clone, rebuilding the Rust/PyO3 extension or standalone `tg` binary after touching `rust_core/`, or debugging a build/toolchain problem — uv install, `maturin develop`, `cargo build`, the pinned 1.96.0 Rust toolchain, Python >=3.11 floor, a "hanging" cargo build, cargo/rustc missing from PATH, ruff CRLF false-alarms, or a dependency upper-cap silently downgrading tensor-grep on a newer Python. Gives exact copy-paste setup commands and the traps that have each cost a real cycle.
| name | tensor-grep |
| description | Use tensor-grep for repository code search, symbol lookup, blast-radius analysis, and edit planning when solving codebase tasks or preparing patches. |
Use this skill when you need to locate code precisely, understand likely edit impact, or prepare a minimal patch in a real repository. Treat tg as an agentic code-intelligence layer over a validated rg-compatible subset, not as a blanket faster-grep, full ast-grep, GPU, or LSP claim.
tg --versiontg search --format rg "PATTERN" REPO_PATHtg search --format rg --sort path "PATTERN" REPO_PATHtg "PATTERN" REPO_PATH, tg -t js "PATTERN" REPO_PATH, and tg --count-matches "PATTERN" REPO_PATH.tg agent REPO_PATH --query "change invoice tax" --jsontg edit-plan REPO_PATH --query "change invoice tax" --jsontg context-render REPO_PATH --query "invoice flow" --jsontg defs REPO_PATH SYMBOL --jsontg source REPO_PATH SYMBOL --jsontg refs REPO_PATH SYMBOL --jsontg callers REPO_PATH SYMBOL --jsontg blast-radius REPO_PATH SYMBOL --jsontg blast-radius-plan REPO_PATH SYMBOL --jsontg session open REPO_PATH --jsontg session edit-plan SESSION_ID REPO_PATH --query "change behavior" --jsontg session edit-plan SESSION_ID REPO_PATH --query "change behavior" --daemon --jsontg identifies the likely file/span, make the change directly instead of stopping at analysis.git-style unified diff only.tg over repeated manual grep loops when working inside a real repository.--format rg for automation that expects ripgrep-shaped text output.tg PATTERN PATH, tg -t js PATTERN PATH, and tg --count-matches PATTERN PATH are treated as tg search ....tg ranks highest.ambiguity before editing; tie_requires_confirmation is a stop sign for autonomous edits.tg already identified the primary file and span.lsp_proof=true.NativeGpuBackend, sidecar_used=false, 1GB/5GB correctness, and speed wins over both rg and tg_cpu.--glob, --type, or --max-depth; unbounded generated-root scans can be refused unless explicitly opted in.nativetg defs REPO_PATH SYMBOL --provider lsp --jsontg blast-radius REPO_PATH SYMBOL --provider hybrid --jsonUse lsp or hybrid only if native lookup seems ambiguous or incomplete. Provider availability is not semantic proof; check health_status, lsp_proof, and fallback fields.
$NAME or escape $.cmd.exe, quote or caret-escape metacharacters such as | and &.tg.exe path reported by tg doctor --json over a .ps1 shim.git-style unified diff with diff --git headers and enough context lines to apply cleanly.See REFERENCE.md for current command patterns and examples.