Skip to content

About

Mainland China-first legal workflow plugins for Claude Code: contract review, litigation support, compliance, corporate, labor & IP, with statute checks and citation gates.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

mcodeforlegal poster

mcodeforlegal

Mainland China-first legal workflow plugins for Claude Code, with framework-level jurisdiction guides for Hong Kong, Macao, Taiwan, and Singapore.

Contract review · litigation support · data compliance · corporate · labor · IP Statute status checks · citation audit · configurable practice playbooks

Quick start · See it work · Capabilities · Plugins · Architecture

mcodeforlegal adapts the plugin-and-playbook architecture of anthropics/claude-for-legal for Chinese legal work. It adds a Mainland China legal baseline, a built-in connector to the official PRC law database, statute status verification, pre-delivery citation gates, and China-specific workflows across six practice areas.

Important

This project is a legal research and workflow aid — it does not constitute legal advice, and all outputs are drafts. Before relying on, signing, filing, or sending any output, have it reviewed by a qualified legal professional in the relevant jurisdiction. Non-lawyer users face an explicit confirmation gate before any legally consequential action, and receive a one-page brief for counsel instead of a green light.

Quick start

Requirements: Python 3.11+ and Claude Code.

/plugin marketplace add Hylouis233/mcodeforlegal
/plugin install legal-core@mcodeforlegal
/plugin install contract-review-cn@mcodeforlegal

Then:

1. cold-start-interview          # one-time interview → your practice profile (playbook)
2. /contract-review-cn:review contract.docx
3. statute-verify 民法典第153条    # current / amended / repealed / not-yet-effective?
4. citation-audit                # pre-send gate: zero unverified [CITE:__] placeholders

See it work

You: "帮我审一下这份保密协议,我们是接收方。"

mcodeforlegal:
 1. loads your practice profile (blocks service if it's still placeholder text)
 2. router confirms: NDA, receiving side → loads nda-review
 3. scope check: is it really an NDA, or a disguised non-compete / exclusivity?
 4. triage against YOUR playbook positions — 🟢🟡🔴 buckets
    (GREEN only from lawyer-reviewed positions, never from defaults)
 5. outputs a memo: header by role + reviewer note (sources / read / flagged /
    currency / before relying) + dual-axis severity
    (legal risk 🔴🟠🟡🟢 × business friction) + next-steps decision tree
 6. every statute reference starts as [CITE:__], filled only after statute-verify
 7. citation-audit must pass before anything is sent

Capabilities & coverage

Capability Default Requires optional source
PRC statute status verification (flk official DB) ✅ —
Citation audit & source attribution ✅ —
Case-number format check ✅ —
Substantive case verification ◐ PKULaw or Jufa token
Mainland China jurisdiction frame ✅ primary —
HK / MO / TW / SG frames ◐ framework baselines Local authoritative source + professional review
Contract review (6 specialties) ✅ —
Batch / due-diligence review ✅ —

Anything not covered is stated as a source gap in the output — never silently skipped.

Why mcodeforlegal

  • Statute currency is checked, not assumed. Every citation goes through statute-verify against the official database: verified_current / amended / repealed / not_yet_effective / not_found / source_unavailable. not_found never means "doesn't exist".
  • Citation discipline. Unverified references stay as [CITE:__] placeholders and are blocked before delivery — drafting with invented citations is treated as a blocking defect.
  • Playbook-driven. Skills ship zero legal positions; your practice profile (a prose playbook built by interview) supplies them. The same skill works for buyer-side and seller-side.
  • Jurisdiction decoupling. LEGAL_FRAMES/ holds one baseline per jurisdiction; skills never hardcode jurisdiction branches. Mainland China is the primary implementation; HK/MO/TW/SG are framework baselines pending local-source verification.
  • Source attribution = provenance, not confidence. [法律法规数据库], [北大法宝], [监管官网], [用户提供] only when the tool actually returned it this session; everything else is [模型知识—待核实].

Plugins

Plugin Install if you need…
legal-core Practice profile, shared guardrails, matter workspace, statute/case/citation verification, tabular review, due diligence, flk connector
contract-review-cn Contract review router + six specialties (NDA / sales / loan / lease / technology / service), clause database, renewal tracking
litigation-cn Matter intake, demand letters (7-item pre-draft gate), complaint outlines, evidence lists
data-compliance-cn PIPL impact assessment, data-export three-track analysis, privacy policy review, breach response
corporate-cn Charter review, shareholder agreements, board resolutions, capital contribution (2023 Company Law)
labor-cn Labor contracts, termination assessment, arbitration prep, handbook democracy procedure
ip-cn Trademark prep, patent disclosure review, IP assignment, software copyright

Recommended starting set: legal-core + contract-review-cn.

How verification works

  1. Identifier first — statute name + article, or case number, matched exactly before any semantic search.
  2. Cross-check signals — title, promulgating body, effective/expiry dates, authority level.
  3. Structured outcome — one of the six states above; failures (rate limit, source down) are reported as source_unavailable, never as a negative finding.
  4. Non-destructive — the draft is never edited silently; verification notes are separate artifacts, and verified items are logged to verification-log.md.

Data sources

Source Type Access
国家法律法规数据库 (flk.npc.gov.cn) Official, free Built-in stdio MCP (flk_server.py), tested against the live 2026 API
北大法宝 (PKULaw) Commercial Opt-in: python plugins/legal-core/scripts/enable_pkulaw.py — the gateway is handshake-verified before anything is enabled; unconfigured or invalid credentials stay disabled
聚法 (Jufa) Commercial User-provided token (see references/connectors.yaml)
CourtListener Open API US-law comparison only

Red line: this project never scrapes wenshu.court.gov.cn and never bypasses logins or captchas. Case-law gaps go through licensed sources or manual retrieval on official sites.

Architecture

The design — canonical guardrails (G1–G12 in legal-core/CLAUDE.md), router + library skills, three-tier red lines (blocks / work-but-ships / FYI), dual-axis severity, matter workspace, and the shared verification engine — is documented in docs/architecture.md. Contribution and release workflow: docs/publishing.md.

Design provenance

Architecture inspired by anthropics/claude-for-legal (Apache-2.0). See THIRD_PARTY_NOTICES.md for design references, data-source integrations, and license attribution.

License

Apache-2.0 — Copyright (c) 2026 Hylouis233 and contributors.

About

Mainland China-first legal workflow plugins for Claude Code: contract review, litigation support, compliance, corporate, labor & IP, with statute checks and citation gates.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages