Tw Legal RAG
aa0101181514/tw-legal-rag
Retrieve real Taiwan court judgments with verifiable citations before answering any question about Taiwan law or case law.
NLP techniques for legal text analysis, case law mining, and contracts
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wentorai/research-plugins legal-nlp-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .claude/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.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/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .claude/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wentorai/research-plugins legal-nlp-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .agents/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .agents/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wentorai/research-plugins legal-nlp-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .cursor/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .cursor/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wentorai/research-plugins.git --path skills/domains/law/legal-nlp-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wentorai/research-plugins legal-nlp-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .gemini/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .gemini/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wentorai/research-plugins legal-nlp-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .github/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .github/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill legal-nlp-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wentorai/research-plugins legal-nlp-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/domains/law/legal-nlp-guide .opencode/skills/legal-nlp-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "legal-nlp-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/legal-nlp-guide into .opencode/skills/legal-nlp-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "legal-nlp-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
legal-nlp-guideNLP techniques for legal text analysis, case law mining, and contracts
Legal NLP Guide is an agent skill from wentorai/research-plugins. NLP techniques for legal text analysis, case law mining, and contracts
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Legal & Compliance, covering Natural language processing and Legal research. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.
Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Legal NLP Guide loads about 2.1k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 283 words of instructions outside code blocks.
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.
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.
The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 283 words, ~2,124 tokens.
.claude/skills/legal-nlp-guide/SKILL.md (or your agent's skills folder).A skill for applying natural language processing techniques to legal texts. Covers legal document classification, named entity recognition for legal entities, contract clause extraction, case law similarity search, and court opinion summarization using modern NLP tools.
Legal language presents unique NLP challenges:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Legal-BERT: domain-adapted BERT for legal text
model_name = "nlpaueb/legal-bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name, num_labels=5
)
# Legal document categories
labels = ["contract", "court_opinion", "statute", "regulation", "brief"]
def classify_legal_document(text: str, max_length: int = 512) -> dict:
"""
Classify a legal document into predefined categories.
For long documents, use the first 512 tokens (typically the
preamble/introduction which contains strong classification signals).
"""
inputs = tokenizer(
text, return_tensors="pt",
max_length=max_length, truncation=True, padding=True
)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1).squeeze()
predicted = labels[probs.argmax().item()]
return {
"predicted_class": predicted,
"confidence": probs.max().item(),
"all_scores": {l: p.item() for l, p in zip(labels, probs)},
}Common topic taxonomies for legal research:
| Category | Examples |
|---|---|
| Constitutional Law | Due process, equal protection, First Amendment |
| Criminal Law | Sentencing, evidence, plea bargaining |
| Contract Law | Breach, formation, damages |
| Tort Law | Negligence, product liability, defamation |
| Property Law | Real property, intellectual property, zoning |
| Administrative Law | Agency rulemaking, judicial review |
Legal NER extends standard NER with domain-specific entity types:
import spacy
# Load a legal NER model (e.g., trained on the LegalNERo dataset)
# or fine-tune spaCy on legal annotations
nlp = spacy.load("en_legal_ner")
legal_entity_types = {
"COURT": "Court or tribunal name",
"JUDGE": "Judge or justice name",
"PARTY": "Plaintiff, defendant, petitioner, respondent",
"STATUTE": "Statute or regulation citation",
"CASE_CITATION": "Case name and reporter citation",
"DATE": "Dates of decisions, filings, events",
"JURISDICTION": "Geographic or subject matter jurisdiction",
"PROVISION": "Specific section or clause reference",
}
def extract_legal_entities(text: str) -> list[dict]:
"""Extract legal named entities from text."""
doc = nlp(text)
entities = []
for ent in doc.ents:
entities.append({
"text": ent.text,
"label": ent.label_,
"start": ent.start_char,
"end": ent.end_char,
"description": legal_entity_types.get(ent.label_, ""),
})
return entitiesimport re
# US case citation patterns (simplified)
CASE_CITE_PATTERN = re.compile(
r"(?P<volume>\d+)\s+"
r"(?P<reporter>U\.S\.|S\.\s?Ct\.|F\.\s?\d[dthsr]+|"
r"F\.\s?Supp\.\s?\d*[dthsr]*)\s+"
r"(?P<page>\d+)"
r"(?:\s*,\s*(?P<pinpoint>\d+))?"
r"(?:\s*\((?P<year>\d{4})\))?"
)
def parse_citations(text: str) -> list[dict]:
"""Extract and parse legal citations from text."""
citations = []
for match in CASE_CITE_PATTERN.finditer(text):
citations.append({
"full_match": match.group(),
"volume": match.group("volume"),
"reporter": match.group("reporter"),
"page": match.group("page"),
"pinpoint": match.group("pinpoint"),
"year": match.group("year"),
})
return citationsdef segment_contract_clauses(text: str) -> list[dict]:
"""
Segment a contract into numbered clauses and classify them.
Uses section numbering patterns as primary segmentation cues.
"""
# Split on section/article numbering patterns
section_pattern = re.compile(
r"\n\s*(?:Section|Article|Clause|\d+\.)\s+\d+[\.\d]*\s*[:\.\-]?\s*",
re.IGNORECASE,
)
sections = section_pattern.split(text)
headers = section_pattern.findall(text)
clause_types = {
"indemnification": ["indemnif", "hold harmless", "defend and indemnify"],
"termination": ["terminat", "cancel", "expir"],
"confidentiality": ["confidential", "non-disclosure", "proprietary"],
"limitation_of_liability": ["limit of liabilit", "limitation of liabilit",
"aggregate liability", "consequential damages"],
"governing_law": ["governing law", "governed by", "jurisdiction"],
"force_majeure": ["force majeure", "act of god", "beyond reasonable control"],
"assignment": ["assign", "transfer", "delegate"],
}
clauses = []
for i, section in enumerate(sections[1:], 1):
detected_type = "general"
section_lower = section.lower()
for ctype, keywords in clause_types.items():
if any(kw in section_lower for kw in keywords):
detected_type = ctype
break
clauses.append({
"index": i,
"header": headers[i - 1].strip() if i <= len(headers) else "",
"type": detected_type,
"text": section.strip()[:500],
})
return clausesfrom sentence_transformers import SentenceTransformer
import numpy as np
# Legal domain sentence embeddings
encoder = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
def build_case_index(case_summaries: list[str]) -> np.ndarray:
"""Encode case summaries into dense vector representations."""
embeddings = encoder.encode(case_summaries, show_progress_bar=True)
# L2 normalize for cosine similarity via dot product
norms = np.linalg.norm(embeddings, axis=1, keepdims=True)
return embeddings / norms
def search_similar_cases(query: str, index: np.ndarray,
case_ids: list[str], top_k: int = 10) -> list:
"""Find the most similar cases to a query."""
query_vec = encoder.encode([query])
query_vec = query_vec / np.linalg.norm(query_vec)
scores = (index @ query_vec.T).squeeze()
top_indices = np.argsort(scores)[::-1][:top_k]
return [(case_ids[i], scores[i]) for i in top_indices]© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/domains/law/legal-nlp-guide of wentorai/research-plugins.
Open the folder on GitHubat commit bf44b3c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.
Legal NLP Guide 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Legal NLP Guide this skillwentorai/research-plugins | 298 | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Tw Legal RAGaa0101181514/tw-legal-rag | 328 | — | ~580 | Automated safety check: Pass | Custom licence | |
| Recallentireio/skills | 223 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Pseudonymization Riskmukul975/Privacy-Data-Protection-Skills | 301 | — | ~3.2k | Automated safety check: Pass | Apache-2.0 | |
| Legal AI Model Router Stephane Boghossianlawve-ai/awesome-legal-skills | 847 | — | ~1.5k | Automated safety check: Pass | AGPL-3.0-or-later | |
| Design Award SearchSeanJ1ang/design-judge-skills | 712 | — | ~3k | Automated safety check: Pass | Apache-2.0 |
aa0101181514/tw-legal-rag
Retrieve real Taiwan court judgments with verifiable citations before answering any question about Taiwan law or case law.
entireio/skills
A skill your agent uses when the user describes a task and wants to know whether something similar has been done before, then turn the closest prior session into a task playbook.
mukul975/Privacy-Data-Protection-Skills
Assessment of pseudonymization techniques and re-identification risk.
lawve-ai/awesome-legal-skills
Routes any legal task to the right LLM, like OpenRouter but for legal work and grounded in benchmarks instead of brand loyalty.
SeanJ1ang/design-judge-skills
Find and verify award-winning designs in the same or adjacent functional category through eight explicit relevance dimensions: problem and user, core function, sensing technology, intervention…
CSlawyer1985/china-lawyer-analyst
通过中国法律视角分析事件,运用成文法解释、指导案例参照、请求权基础分析等方法, 理解权利义务、评估责任风险、识别法律依据并推荐合规策略。
wentorai/research-plugins
Craft structured research abstracts that maximize clarity and journal acceptance
wentorai/research-plugins
Manage academic citations across BibTeX, APA, MLA, and Chicago formats
wentorai/research-plugins
Summarize academic papers with structured extraction of key elements
wentorai/research-plugins
Evidence-based study techniques for academic learning and retention
wentorai/research-plugins
Adjust writing tone and register for academic audiences and venues
wentorai/research-plugins
Academic translation, post-editing, and Chinglish correction guide
Categories
NLP techniques for legal text analysis, case law mining, and contracts. Legal NLP Guide is an agent skill from wentorai/research-plugins.
Legal NLP Guide fits situations like: tasks that involve Natural language processing; tasks that involve Legal research.
Run `npx skills add wentorai/research-plugins --skill legal-nlp-guide -a claude-code`. Or copy the skill folder (skills/domains/law/legal-nlp-guide in wentorai/research-plugins) into .claude/skills/legal-nlp-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wentorai/research-plugins --skill legal-nlp-guide -a codex`. Or copy the skill folder (skills/domains/law/legal-nlp-guide in wentorai/research-plugins) into .agents/skills/legal-nlp-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill legal-nlp-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/legal-nlp-guide, .gemini/skills/legal-nlp-guide, .github/skills/legal-nlp-guide and .opencode/skills/legal-nlp-guide in your project.
SKILL.md names no scripts, command-line tools or credentials: Legal NLP Guide is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Legal NLP Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Legal NLP Guide: Tw Legal RAG (aa0101181514/tw-legal-rag, 328 stars), Recall (entireio/skills, 223 stars), Pseudonymization Risk (mukul975/Privacy-Data-Protection-Skills, 301 stars) and Legal AI Model Router Stephane Boghossian (lawve-ai/awesome-legal-skills, 847 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.
Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.