pigdoc

Original🇨🇳 Chinese
Translated

Search PIG official documentation and summarize answers. It is triggered when users ask technical questions, configuration methods, function descriptions related to PIG CLOUD, PIG AI, pigx, or explicitly say "check documentation", "search", "how to configure", "how to implement". When encountering specific problems related to the PIG framework, you should actively search the documentation before answering, and do not rely on potentially outdated information in the training data.

9installs
Added on

NPX Install

npx skill4agent add lltx/skills pigdoc

SKILL.md Content (Chinese)

View Translation Comparison →

PIG Documentation Search Skill

The PIG official documentation library (
pig
index) contains the latest user guides, configuration instructions and best practices. Summarizing after searching can provide accurate official answers.

Search Steps

1. Extract Keywords

Extract 1-3 core keywords from the user's question. Chinese is preferred (the documentation is mainly in Chinese).
Examples:
  • "How to configure multiple data sources" →
    多数据源
  • "OAuth2 login failure" →
    OAuth2 登录
  • "Gateway routing 404 error" →
    网关路由

2. Call the Search API

bash
curl -s -X POST "https://search.pig4cloud.com/indexes/pig/search" \
  -H "Content-Type: application/json" \
  -d '{"q": "关键词", "limit": 3}'

3. Response Field Description

FieldMeaning
hits[].lvl0
Document title
hits[].content
Document body (Markdown format)
hits[].url
Document path (e.g.
/doc/pigx/use/xxx
)
hits[].lvl2
Document update time

4. Summarize and Answer

Output in the following format based on search results:

According to PIG official documentation, regarding "[user question]":
Solution: [Synthesize the content of the documentation, extract core steps or descriptions, and list them in clear points. Retain key content such as code snippets and configuration examples]
Reference Documentation:
  • Document Title — A one-sentence description of the purpose of this document

Summarization Principles:
  • Retain code blocks, XML/YAML configurations, and key precautions in the documentation
  • Merge content when multiple documents describe the same issue, avoid duplication
  • If the relevance of search results to the question is low, explain it first and then supplement the answer based on known knowledge
  • If
    hits
    is empty, inform the user that there is no relevant content in the documentation for now

When Search Results Are Unsatisfactory

When the first search returns fewer than 2 hits or the content is obviously irrelevant, search again with another keyword, and summarize the combined results of the two searches.