齐夫特

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

1.语义/混合(默认)

使用自然语言通过“含义”或“意图”查找代码。 最适合:高级架构问题,寻找不熟悉的逻辑。

2. 精确匹配(-e, --exact)

执行文字、字节完美的子字符串搜索。 最适合:查找特定变量名称、错误字符串或样板文件。

3.正则表达式搜索(-r,--regex)

使用 Rust 支持的正则表达式进行模式匹配。 最适合:查找模式的所有实例(例如,所有公共函数)。

索引

在搜索之前,您必须为项目建立索引。 zift 使用增量索引,并会在查询时自动刷新过时的文件,但建议使用完整的初始索引:

过滤

使用 -l 或 --local 标志将结果限制为当前工作目录(在 monorepos 中很有用)。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@diegosouzapw · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# zift Skill

`zift` is a high-performance, local-first code search tool that combines semantic (vector) and lexical (FTS5) search.

## Core Search Modes

### 1. Semantic / Hybrid (Default)
Uses natural language to find code by "meaning" or "intent".
```bash
zift "how do I handle database connections" .
```
*Best for: High-level architectural questions, finding unfamiliar logic.*

### 2. Exact Match (`-e`, `--exact`)
Performs a literal, byte-perfect substring search.
```bash
zift -e "SearchResult { file_path" .
```
*Best for: Finding specific variable names, error strings, or boilerplate.*

### 3. Regex Search (`-r`, `--regex`)
Uses Rust-powered regular expressions for pattern matching.
```bash
zift -r "pub (async )?fn" .
```
*Best for: Finding all instances of a pattern (e.g., all public functions).*

## Workflow

### Indexing
Before searching, you must index the project. `zift` uses incremental indexing and will auto-refresh stale files on query, but a full initial index is recommended:
```bash
zift add .
```

### Filtering
Use the `-l` or `--local` flag to restrict results to the current working directory (useful in monorepos).
```bash
zift "auth logic" . --local
```

## Architecture & Performance
- **Local-first**: All embeddings and indices stay on your machine (`~/.cache/zift`).
- **GPU Accelerated**: Uses Metal/GPU for embedding generation via `llama-cpp-2`.
- **Hybrid RRF**: Fuses semantic and lexical results using Reciprocal Rank Fusion (k=60) with Power-Law scaling (γ=2.5) for intuitive percentages.
- **Speed**: Exact and Regex searches skip the embedding phase and are near-instant (<50ms).

## Troubleshooting
- **Stale Index**: If results seem old, run `zift add .` again or `zift forget .` to reset.
- **Model Issues**: `zift` defaults to `nomic-embed-text-v1.5`. Ensure the model is downloaded to the cache directory.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。