Agent skill

Text Search Engine

by cjinhuo in cjinhuo/blazwitcher

Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support.

Apache-2.0Auto-check passed

Install Text Search Engine

skills CLI
$ npx skills add cjinhuo/blazwitcher --skill text-search-engine -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cjinhuo/blazwitcher text-search-engine --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cjinhuo/blazwitcher.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/text-search-engine .claude/skills/text-search-engine && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
text-search-engine
GitHub stars
101
Token cost
~1.4k tokens
SKILL.md length
105 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support.

  • Works in 6 steps: search(source, query, options?) - 主搜索函数 → 配置选项 → highlightMatches(source, query) - 快速高亮 → …
  • Wants to add fuzzy search
  • SKILL.md covers 安装, 核心 API, React 组件 and 常见集成模式, plus 2 more sections
  • Calls npm

What it does

Text Search Engine is an agent skill from cjinhuo/blazwitcher. Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support. Invoke when user wants to add fuzzy search, pinyin search, or text matching.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A Chrome Extension to blaze through your tabs, bookmarks, and history — with powerful fuzzy Pinyin search and grouping tags by AI. 一款可以全局搜索标签、书签和历史记录的 Chrome 浏览器扩展,支持拼音模糊搜索和 AI…. The licence is Apache-2.0.

When your agent uses it

  • Wants to add fuzzy search

Example prompts

  • “Use the text-search-engine skill to guide users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support”
  • “/text-search-engine”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. search(source, query, options?) - 主搜索函数
  2. 配置选项
  3. highlightMatches(source, query) - 快速高亮
  4. 带高亮的搜索列表
  5. 复用 BoundaryData 进行多次搜索
  6. Node.js 后端搜索

What it can do on your machine

Read from SKILL.md and the folder at commit 4b062db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • cjinhuo.github.io
    • codesandbox.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Text Search Engine loads about 1.4k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 105 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cjinhuo/blazwitcher at commit 4b062db, republished under its Apache-2.0 licence (© cjinhuo). 105 words, ~1,409 tokens.

Download SKILL.mdSave it as .claude/skills/text-search-engine/SKILL.md (or your agent's skills folder).
name
text-search-engine
description
Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support. Invoke when user wants to add fuzzy search, pinyin search, or text matching.

Text Search Engine 接入指南

此 skill 帮助你将 text-search-engine SDK 集成到项目中。该 SDK 是一个基于动态规划的文本搜索引擎,支持中英文混合模糊搜索,返回权重最高的匹配结果。

安装

bash
npm i text-search-engine

同时支持 Node.js 和 Web 环境。

核心 API

1. search(source, query, options?) - 主搜索函数

返回匹配位置的索引范围数组 [start, end][],无匹配时返回 undefined。

基本用法
javascript
import { search } from 'text-search-engine'

// 纯英文搜索
search('nonode', 'no')    // [[0, 1]] - 匹配 'no'
search('nonode', 'nod')   // [[2, 4]] - 匹配 'nod'
search('nonode', 'noe')   // [[0, 1], [5, 5]] - 匹配 'no' + 'e'

// 纯中文搜索(支持拼音)
search('地表最强前端监控平台', 'jk')        // [[6, 7]] - 匹配 '监控'
search('地表最强前端监控平台', 'qianduapt') // [[4, 5], [8, 9]] - 匹配 '前端' + '平台'

// 中英文混合搜索
search('Node.js 最强监控平台 V9', 'nodejk') // [[0, 3], [10, 11]] - 匹配 'Node' + '监控'
空格分隔搜索

添加空格使每个词独立匹配,从头开始:

javascript
search('Node.js 最强监控平台 V9', 'jknode')    // undefined
search('Node.js 最强监控平台 V9', 'jk node')   // [[10, 11], [0, 3]] - 可以匹配!
2. 配置选项
选项默认值说明
mergeSpacestrue将匹配结果中的空格合并为连续范围
strictnessCoefficientundefined严格系数(0-1),匹配字符数 ≤ ceil(query.length * coefficient) 时返回 undefined
isCharConsecutivefalse要求匹配的字符必须连续
strictCasefalse区分大小写匹配
示例
javascript
// mergeSpaces - 合并空格
search('chrome 应用商店', 'meyinyon', { mergeSpaces: false }) // [[4, 5], [7, 8]]
search('chrome 应用商店', 'meyinyon', { mergeSpaces: true })  // [[4, 8]]

// strictnessCoefficient - 严格系数
search('Node.js 最强监控平台 V8', 'nozjk', { strictnessCoefficient: 0.5 }) // [[0, 1], [8, 8], [10, 11]]
search('Node.js 最强监控平台 V8', 'nozjk', { strictnessCoefficient: 0.4 }) // undefined

// isCharConsecutive - 连续字符
search('Chinese@中国 People-人', 'chie')                              // [[0, 2], [4, 4]]
search('Chinese@中国 People-人', 'chie', { isCharConsecutive: true }) // undefined

// strictCase - 大小写敏感
search('Hello World', 'hello')                        // [[0, 4]]
search('Hello World', 'hello', { strictCase: true })  // undefined
3. highlightMatches(source, query) - 快速高亮

返回 ANSI 转义码,用于控制台输出:

javascript
import { highlightMatches } from 'text-search-engine'

console.log(highlightMatches('Node.js 最强监控平台 V9', 'nodev9'))
// 输出带高亮的文本

React 组件

HighlightWithTarget

自动匹配并高亮:

jsx
import { HighlightWithTarget } from 'text-search-engine/react'

function SearchResult() {
  return <HighlightWithTarget source='Node.js 最强监控平台 V9' target='nodejk' />
}
HighlightWithRanges

手动提供匹配范围:

jsx
import { HighlightWithRanges } from 'text-search-engine/react'
import { search } from 'text-search-engine'

function SearchResult() {
  const ranges = search('Node.js 最强监控平台 V9', 'nodejk')
  return <HighlightWithRanges source='Node.js 最强监控平台 V9' hitRanges={ranges} />
}

常见集成模式

1. 带高亮的搜索列表
jsx
import { search } from 'text-search-engine'
import { HighlightWithRanges } from 'text-search-engine/react'

function SearchList({ items, query }) {
  const results = items
    .map(item => ({ item, ranges: search(item.name, query) }))
    .filter(({ ranges }) => ranges !== undefined)

  return (
    <ul>
      {results.map(({ item, ranges }) => (
        <li key={item.id}>
          <HighlightWithRanges source={item.name} hitRanges={ranges} />
        </li>
      ))}
    </ul>
  )
}
2. 复用 BoundaryData 进行多次搜索

当需要对同一数据源进行多次搜索时,可以预先提取 boundaryData 以提升性能:

javascript
import { 
  extractBoundaryMapping, 
  searchSentenceByBoundaryMapping 
} from 'text-search-engine'

const source = 'Node.js 最强监控平台 V9'

// 预先提取 boundaryData(只需执行一次)
const boundaryData = extractBoundaryMapping(source)

// 多次搜索复用同一个 boundaryData
function searchMultiple(queries) {
  return queries.map(query => {
    const { hitRanges, wordHitRangesMapping } = searchSentenceByBoundaryMapping(boundaryData, query)
    return { query, hitRanges, wordHitRangesMapping }
  }).filter(result => result.hitRanges !== undefined)
}

// 示例:对同一数据源进行多次搜索
const results = searchMultiple(['node', 'jk', 'v9', 'qianduan'])

这种方式特别适合以下场景:

  • 搜索列表中对每个 item 需要匹配多个关键词
  • 实时搜索建议,用户输入变化时复用已处理的数据
  • 批量搜索任务
3. Node.js 后端搜索
javascript
import { search } from 'text-search-engine'

function searchDocuments(documents, query, options = {}) {
  const { limit = 20, strictnessCoefficient = 0.6 } = options
  
  const results = []
  
  for (const doc of documents) {
    const ranges = search(doc.title, query, { strictnessCoefficient })
    if (ranges) {
      results.push({ doc, ranges })
      if (results.length >= limit) break
    }
  }
  
  return results
}

性能

时间复杂度空间复杂度
最优O(M),M = 源字符串长度O(M)
最差O(M × N),N = 查询字符串长度O(M × N)

相关资源

© cjinhuo, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/text-search-engine of cjinhuo/blazwitcher.

Open the folder on GitHubat commit 4b062db

Compare with similar skills

Text Search Engine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Text Search Engine compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Text Search Engine this skillcjinhuo/blazwitcher101—~1.4kAutomated safety check: PassApache-2.0
WxJava Integration Guidebinarywang/WxJava33k—~123Automated safety check: PassApache-2.0
Harness Integration Guideomnigent-ai/omnigent11k—~2.7kAutomated safety check: PassApache-2.0
Integration Testingthedaviddias/Front-End-Checklist74k—~514Automated safety check: PassMIT
Creating Integration DocsNangoHQ/nango13k—~2.7kAutomated safety check: PassCustom licence
Mailtrap Email Integrationaffaan-m/ECC276k1 repos~955Automated safety check: PassMIT

Similar skills

  • WxJava Integration Guide

    binarywang/WxJava

    Plans a WxJava setup for Java, Spring Boot or Solon projects that call WeChat services, from module and BOM choice to config and a minimal working call.

    33k GitHub stars~123 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Harness Integration Guide

    omnigent-ai/omnigent

    Reference guide for building new Omnigent harness integrations — covers SDK/subprocess harnesses and native harnesses as separate tracks, each with their own feature matrix, implementation patterns…

    11k GitHub stars~2.7k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Integration Testing

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing CI coverage, automated checks, or test strategy related to Write integration tests for key workflows.

    74k GitHub stars~514 tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • A skill your agent uses when adding or editing Nango integration documentation - creates and maintains integration pages, setup guides, connect guides, navigation, and provider metadata following…

    13k GitHub stars~2.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Guides agents through integrating transactional email sending via Mailtrap's Email API, including sandbox testing, domain verification, and API authentication.

    276k GitHub starsUsed in 1 repo~955 tokens
    Backend & APIsAuto-check passed
  • API Integration

    sickn33/agentic-awesome-skills

    Designs event-driven architectures, webhook systems, API chaining flows, ETL pipelines, and integration patterns between services.

    47k GitHub starsUsed in 1 repo~1.3k tokens
    Backend & APIsAuto-check passed

More from cjinhuo/blazwitcher

  • Release Publisher

    cjinhuo/blazwitcher

    Handles version bumping and release publishing for blazwitcher extension.

    101 GitHub stars~694 tokensUpdated yesterday
    Auto-check: notes
  • Changeset Generator

    cjinhuo/blazwitcher

    在创建或更新 PR 前,根据当前 pnpm workspace、公开包发布影响、Changesets 历史格式和 changesets-toolkit 提交钩子,生成并校验 Changesets 3 变更记录。用户要求添加或生成 changeset、创建 changeset、准备 PR、判断分支是否需要版本说明,或选择 major、minor、patch 版本类型时使用。

    101 GitHub stars~942 tokensUpdated yesterday
    Auto-check passed
  • Git Auto Commit

    cjinhuo/blazwitcher

    Git 自动提交工具。当用户需要提交代码变更、commit 更改或者完成任务后需要提交时,必须调用此 skill 自动生成符合规范的 commit message 并执行提交,默认推送到远端。

    101 GitHub stars~355 tokensUpdated yesterday
    Auto-check passed

Questions about Text Search Engine

What does Text Search Engine do?

Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support. Text Search Engine is an agent skill from cjinhuo/blazwitcher. Guides users to integrate text-search-engine SDK for Chinese/English fuzzy search with Pinyin support.

When should I use Text Search Engine?

Text Search Engine fits situations like: wants to add fuzzy search.

How do I install Text Search Engine in Claude Code?

Run `npx skills add cjinhuo/blazwitcher --skill text-search-engine -a claude-code`. Or copy the skill folder (.agents/skills/text-search-engine in cjinhuo/blazwitcher) into .claude/skills/text-search-engine in your project. Claude Code loads it when a task matches its description.

How do I install Text Search Engine in Codex?

Run `npx skills add cjinhuo/blazwitcher --skill text-search-engine -a codex`. Or copy the skill folder (.agents/skills/text-search-engine in cjinhuo/blazwitcher) into .agents/skills/text-search-engine in your project. Codex loads it when a task matches its description.

Can I use Text Search Engine in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cjinhuo/blazwitcher --skill text-search-engine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/text-search-engine, .gemini/skills/text-search-engine, .github/skills/text-search-engine and .opencode/skills/text-search-engine in your project.

What does Text Search Engine need to run?

Going by SKILL.md and its folder, Text Search Engine needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Text Search Engine access the network?

SKILL.md names 2 domains. As links in the text: cjinhuo.github.io and codesandbox.io. This is read from the text; nothing was executed.

Is Text Search Engine safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Text Search Engine use?

Text Search Engine is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Text Search Engine use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Text Search Engine?

Skills that share tags, products or a category with Text Search Engine: WxJava Integration Guide (binarywang/WxJava, 33k stars), Harness Integration Guide (omnigent-ai/omnigent, 11k stars), Integration Testing (thedaviddias/Front-End-Checklist, 74k stars) and Creating Integration Docs (NangoHQ/nango, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Text Search Engine?

cjinhuo (a GitHub user) maintains it in cjinhuo/blazwitcher, which has 101 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 9, 2026.

Source: cjinhuo/blazwitcher on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.