skills/mao-semantic-search/SKILL.md
# Mao Semantic Search Search Mao Zedong Selected Works by conceptual meaning using vector embeddings. Builds a local embedding index over all 230 articles across 5 volumes, then performs cosine similarity search at query time. ## When to Use - User asks a thematic/conceptual question about Mao's works ("What did Mao say about guerrilla warfare?") - Keyword search over the .md files is insufficient - User wants to find passages related to a concept without knowing exact terminology - As a pre-
npx skillsauth add jaimeparker/stable-jarvis skills/mao-semantic-searchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Search Mao Zedong Selected Works by conceptual meaning using vector embeddings. Builds a local embedding index over all 230 articles across 5 volumes, then performs cosine similarity search at query time.
assets/mao-selected-works/ ──build_index.py──> temp/mao/embeddings.json <──search.py── User Query
(.md files, 5 vols) │
└── JSON index, 230 entries
temp/mao/embeddings.jsonstable_jarvis.llm.embed() — same provider stack as obsidian-semantic-search (local / qwen / openai)Before any search, the agent MUST check the index state:
python skills/mao-semantic-search/scripts/build_index.py --stats
Decision logic:
| State | Action |
|-------|--------|
| Index exists | Skip build, proceed to Phase 2 directly |
| Index does NOT exist | Run build_index.py (full build, ~230 articles) |
The index is static — articles don't change, so rebuild is only needed once.
python skills/mao-semantic-search/scripts/build_index.py
With optional provider override:
python skills/mao-semantic-search/scripts/build_index.py --provider qwen
The scripts locate the Mao works automatically via MAO_WORKS_DIR env var or the default path assets/mao-selected-works/. If the works are at a non-standard location, set it first:
export MAO_WORKS_DIR="/path/to/mao-selected-works"
python skills/mao-semantic-search/scripts/search.py "query text" --top-k 5
Returns JSON array of results, each with:
title — Article titlevolume — Volume number (1–5)path — Relative path in mao-selected-works/ (for reading full text)score — Cosine similarity (0–1, higher = more relevant)text_snippet — First 200 chars of the article bodyAfter getting results, use the Read tool with the path field to read full content:
Read(assets/mao-selected-works/vol-01/001-中国社会各阶级的分析.md)
Format search results for the user with:
text_snippet| Command | Purpose |
|---------|---------|
| build_index.py | Build embedding index (full build) |
| build_index.py --provider qwen | Build with specific embedding provider |
| build_index.py --stats | Show index statistics |
| build_index.py --clear | Remove index file |
| search.py "query" | Semantic search (top 5) |
| search.py "query" --top-k 10 | More results |
| search.py "query" --min-score 0.4 | Filter low-relevance results |
| search.py "query" --provider qwen | Use specific embedding provider |
| search.py "query" --volume 1 | Search only within a specific volume |
All settings via environment variables (loaded from .env):
| Variable | Default | Description |
|----------|---------|-------------|
| MAO_WORKS_DIR | assets/mao-selected-works/ | Path to Mao Selected Works .md files |
| EMBEDDING_PROVIDER | local | local / qwen / openai |
| EMBEDDING_MODEL | Provider-dependent | Model override |
| EMBEDDING_API_KEY | From {PROVIDER}_API_KEY | API key for cloud embeddings |
The local provider uses sentence-transformers (paraphrase-multilingual-MiniLM-L12-v2) and requires no API key.
development
Use when a researcher is choosing, framing, refining, or stress-testing a research question, hypothesis, thesis topic, project idea, grant direction, paper angle, or stalled research direction.
research
精读文献。快速泛读请用paper-quick-read。
data-ai
泛读:快速概览Zotero库中的文献,单轮LLM生成摘要级Markdown报告,并上传为Zotero Note。深度精读请用paper-deep-reader。
tools
# Obsidian Semantic Search Search Obsidian vault notes by conceptual meaning, not just keywords. Builds a local embedding index over all vault notes (per-section chunking), then performs cosine similarity search at query time. ## When to Use - User asks a fuzzy/conceptual question about their own notes ("What papers discuss exploration in RL?") - Keyword search (`mcp__obsidian__search_notes`) returns too many or too few results - User wants to find notes related to a concept without knowing e