Legal Intelligent Retrieval Skill: Standard RAG Strategies, Processes, and Output Specifications

Preface

When conducting regulatory queries, contract reviews, or risk analyses within an Agent, common issues include single-source retrieval, arbitrary response structures, and a lack of unified conventions for tool calling with external legal databases like PKULaw (北大法宝). Below is an introduction to the community Skill on SkillHub: “Legal Intelligent Search - Strategy & Process & Tool Mapping & Output Specification” (Coordinates @user_c715c6d2/liuye-legal-intelligent-search, current version v1.5.2). It organizes legal transaction processing into a reusable RAG strategy and workflow, and defines an output structure to facilitate consistent implementation in Skill-supported environments such as Cursor, Claude Code, and Codex.

What is this

This Skill targets “Legal Affairs + Retrieval-Augmented Generation (RAG)” scenarios: it utilizes parallel retrieval (PKULaw and IMA Knowledge Base), a fixed processing pipeline, and PKULaw MCP tool mapping to guide the Agent in completing analysis and outputting results in a unified format. It is published by SkillHub user user_c715c6d2, sourced from the community, and categorized as professional. The SkillHub page is tagged with requires_api_key=true; relevant API keys must be configured before use (specific fields should refer to the SKILL.md within the Skill package).

Core Features

The following capabilities are derived from the official description and the SkillHub page; implementation details not individually verified are not expanded upon here.

Parallel Retrieval Strategy

Initiates retrieval simultaneously for both PKULaw and the IMA Knowledge Base. This reduces missed detections caused by relying on a single knowledge source and is suitable for Q&A that combines regulatory provisions, cases, and internal knowledge bases.

Standard Processing Flow

The officially described pipeline consists of four steps:

  1. Question Identification: Clarify the user’s legal诉求 (demands/intent) and constraints.
  2. RAG Retrieval: Fetch regulations, cases, or knowledge base fragments according to the strategy.
  3. Legal Skill Analysis: Perform legal reasoning and induction based on the retrieval results.
  4. Output: Generate the final draft following the formatting specifications described below.

PKULaw MCP Tool Mapping

The Skill provides a complete mapping of PKULaw MCP tools, facilitating the Agent’s invocation of corresponding retrieval or query capabilities within the workflow, rather than improvising tool names and parameters.

Output Format Specification

Responses must cover five parts: Legal Basis, Analysis, Risk Assessment, Recommendations, and Disclaimer. This is suitable for deliverables requiring auditability and alignment with practical habits, rather than an unstructured, chat-style reply.

Applicable Task Types

Scenarios listed officially include: Regulatory queries, Case analysis, Contract review, and Legal risk analysis.

Installation and Activation

Installation follows the official SkillHub guidelines: first, prepare the skillhub CLI according to SkillHub Installation & Priority Source Configuration. Then, install this Skill into the current Agent’s skills directory (the --dir flag must be used; otherwise, it defaults to ./skills/ and may not be recognized).

Check the CLI:

command -v skillhub && skillhub --version

If not installed, execute the full installation (recommended by documentation):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this Skill (replace <skills directory> with the current environment path):

skillhub install @user_c715c6d2/liuye-legal-intelligent-search --dir <skills directory>

Common Agent skills directories (excerpted from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Alternatively, provide the following prompt to an AI that supports Skill installation to complete the configuration according to the installation documentation:

Please install @user_c715c6d2/liuye-legal-intelligent-search based on https://skillhub.cn/install/skillhub.md.

After installation, refresh or restart the Agent as required by the client, and complete configurations such as API Keys in the Skill instructions (requires_api_key=true).

Typical Usage

The official source does not provide an independent, copyable one-click example script. Actual usage involves proposing legal tasks within a conversation where the Skill is enabled. The Agent should execute according to “Question Identification → RAG Retrieval → Legal Skill Analysis → Output,” utilize PKULaw and the IMA Knowledge Base in parallel as much as possible, and invoke PKULaw MCP tools via mapping when necessary.

Reproducible question directions (consistent with official applicable scenarios):

  1. Regulatory Query: e.g., “Which article of which law applies to a certain behavior?” — Expected output includes legal basis and disclaimer.
  2. Case Analysis: Provide key points of a case and request an analysis section and risk assessment against retrieved cases or provisions.
  3. Contract Review: Paste clauses and request identification of risk points, suggested modifications, and legal basis.
  4. Legal Risk Analysis: Describe a commercial or compliance scenario and request structured risks and recommendations.

Following the steps above, if a response lacks any of the “Legal Basis / Analysis / Risk Assessment / Recommendations / Disclaimer” sections, you can explicitly request completion according to the Skill’s output specifications.

Applicable Scenarios & Notes

Who it is for: Teams or individuals who need to perform legal RAG within Agent workflows and already possess or plan to integrate PKULaw (and MCP), IMA Knowledge Base, and API keys.

Community & Version Information (SkillHub scraped data, 2026-10-19): Rating 100000, 9883 downloads; The API coordinate page and display page are consistent at v1.5.2.

Limitations & Notes:

  • Tag requires_api_key=true: Retrieval and tool calls may fail if keys are not configured; refer to the instructions within the Skill package.
  • The output is AI-assisted analysis. The disclaimer section is part of the process requirement and cannot replace the opinion of a practicing lawyer or a formal legal opinion letter.
  • Parallel retrieval depends on the availability and quota of external services; the scope of the IMA Knowledge Base content depends on the data you have actually integrated.
  • Cursor / Codex / Claude Code differ only in their skills directory; the Skill itself is consistent. Whether each platform automatically loads skills depends on their respective documentation.

Conclusion

“Legal Intelligent Search - Strategy & Process & Tool Mapping & Output Specification” encapsulates legal RAG retrieval strategies, processing order, PKULaw MCP mapping, and a five-part output into a single Skill. It is suitable for transforming regulatory queries, case, and contract tasks from “temporary prompts” into repeatable workflows. Official Entrances:

  • SkillHub Display Page: https://www.skillhub.cn/skills/user_c715c6d2/liuye-legal-intelligent-search
  • API Coordinate Page: https://api.skillhub.cn/user_c715c6d2/liuye-legal-intelligent-search
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye