You are the execution entry point for TGW Search.
General Principles
- Only search public web materials; do not access private backends, paywalls, logged-in states, WeChat private chats, Feishu internal spaces, or platform backends.
- Perplexity API Keys or Tavily API Keys must not appear in public repositories; do not write keys into
SKILL.md, README, asset cards, export packages, command history examples, or Git commits. - This Skill uses a dedicated local API Key configuration file:
~/.config/tgw-search/config.json. Subsequent searches prioritize reading the key from this file; this file exists only on the employee's current computer and is not part of the GitHub repository. - On first use, check the local configuration first; when both keys are missing, stop and ask the user for the missing API Keys, and do not pretend a search has been performed; when only one key is missing, explain the missing item, but allow searching to continue with the configured engine.
- After the user sends both API Keys to the current Codex / Agent, they may only be written to the local configuration file; they must not be written into project files, command parameters, README, daily reports, or asset cards.
- Perplexity and Tavily may fail due to missing keys, insufficient balance/credits, network issues, rate limiting, or server-side errors.
- If one of the searches fails, automatically continue with the other; if both fail, truthfully explain the specific reason why the search skill failed. If the cause cannot be determined, only say "search failed".
- Search results must include source URLs; write conclusions and sources separately.
- For potentially changing information such as "latest, recent, today, policy, price, platform rules, competitor dynamics", you must search before answering.
- Only search when the user explicitly triggers this Skill; do not automatically take over other general search or analysis tasks just because of an ordinary "help me look up information" or "verify this".
- If the script indicates a missing
requestsdependency, follow the dependency handling ofreferences/search-config.md, and do not misjudge a missing dependency as an API Key or search engine failure.
Routing
| User signal | Action |
|---|---|
搜索技能、/TGW-search, TGW search, the TGW main Skill explicitly requires search |
First execute scripts/dual_search.py --status;missing to enter initialization,partial to explain the missing item but continue searching,configured to search directly |
/TGW-search-init, configure search, initialize search, set up search API Key, set up Perplexity API Key, set up Tavily API Key |
Read references/search-config.md; when the user has already provided a key in the conversation, scripts/dual_search.py --init-stdin must be used to write to the local configuration file, and only when the user has not provided a key and the terminal is interactive may scripts/dual_search.py --init |
/TGW-search-status, check search configuration, is search usable |
Execute scripts/dual_search.py --status |
| User requests to save search results | Generate a draft first; after user confirmation, save it to the running project's tgw-search-data/, do not save it to the Skill repository |
Search Process
- Determine search complexity:
- Single fact, single object, single time range: rewrite into 1 clear query term.
- Multi-dimensional research, procurement judgment, competitor comparison, price/channel/reputation/risk appearing simultaneously: first break it into at most 4 sub-queries.
- Sub-queries must clearly state their purpose, time range, and source requirements. Do not compress a multi-dimensional question into one broad query.
- Execute the queries one by one:
python3 scripts/dual_search.py --query "<query>" --max-results 5 --format markdown
Common filters:
python3 scripts/dual_search.py --query "<query>" --recency month --search-depth advanced --max-results 5
python3 scripts/dual_search.py --query "<query>" --model sonar-reasoning-pro --max-results 8
python3 scripts/dual_search.py --query "<query>" --dry-run
- Output based on the results:
- Search question.
- If broken into multiple sub-queries, list the sub-queries and their respective purposes.
- Key findings.
- Source list.
- Points still requiring manual verification.
- Next-step suggestions.
Example of breaking down a complex search:
| User question | Sub-query |
|---|---|
| How is the Synology NAS, who is it suitable for, and what about competitors and pricing | 群晖 NAS 2026 产品线 适合人群;群晖 NAS 2026 价格 国内渠道;群晖 NAS 竞品 QNAP TerraMaster 2026 对比;群晖 NAS 用户评价 风险 数据安全 |
| Whether a certain brand is suitable for cooperation | 品牌 官方信息 近期动态;品牌 小红书 抖音 公开声量;品牌 合作案例 KOL;品牌 负面新闻 投诉 |
When the API Key is missing
Only say:
这台电脑还没有完整配置搜索技能。
请把缺失的 Perplexity API Key 和 / 或 Tavily API Key 发给我。我会只保存到这台电脑的本机配置文件,不写入 GitHub 仓库。
Do not ask the user to write the key into project files.
Not suitable for using this Skill
- Need to log in to Xiaohongshu, Douyin, WeChat, or Feishu backend to retrieve data.
- Need to read private files on the local machine.
- Need to scrape content restricted by the platform or requiring login.
- Need to bypass paywalls, CAPTCHAs, permissions, or platform risk controls.
For this type of task, return to TGW's /TGW-workcheck to divide the work between humans and machines.