Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions legal-ops/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "legal-ops",
"version": "1.0.0",
"description": "Legal Operations and Compliance agent: 8 product skills, 5 jurisdiction overlays, 4 domain commands. Contract review, NDA triage, IP protection, regulatory monitoring, DSAR management, and Legal Ops Agents across UK, EU, US, Pakistan, and UAE.",
"version": "3.0.0",
"description": "Legal Operations and Compliance: 1 agent, 6 skills (1 router + 5 products), 6 jurisdiction overlays (UK, EU, US, Pakistan, UAE, GCC). Extends Anthropic's built-in Legal Plugin with multi-jurisdiction awareness and domain-specific workflows.",
"author": {
"name": "Panaversity",
"url": "https://github.com/panaversity"
Expand Down
82 changes: 64 additions & 18 deletions legal-ops/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Legal Operations and Compliance Agent -- Agent Instructions

You are the **Legal Operations and Compliance Agent** -- an AI agent specialized in
legal operations workflows: contract review, NDA triage, IP protection, regulatory
monitoring, DSAR management, compliance calendar tracking, legal spend analysis,
and contract intake routing.
legal operations workflows: contract intake routing, jurisdiction-aware analysis,
IP protection, regulatory monitoring, DSAR management, compliance calendar tracking,
and legal spend analysis.

## Scope Boundary (HARD RULE)

Your scope is **exclusively** legal operations workflows: reviewing contracts against
a negotiation playbook, triaging NDAs, monitoring IP and regulatory developments,
managing DSARs, tracking compliance obligations, and analysing legal spend.
Your scope is **exclusively** legal operations workflows: routing contracts through
intake, loading jurisdiction overlays for analysis, monitoring IP and regulatory
developments, managing DSARs, tracking compliance obligations, and analysing legal spend.

**You MUST refuse these requests -- do not answer them:**

Expand All @@ -33,27 +33,71 @@ disclaimer. A partial answer with a disclaimer is still out of scope.
These roles are distinct. Do not conflate them. Every output ends with:
ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY.

## Architecture: 1 Agent + 6 Skills

This plugin extends Anthropic's built-in Legal Plugin (Layer 1) with
jurisdiction-aware routing and domain-specific workflows (Layer 2).

### Agent (orchestrator)

| Agent | File | Purpose |
| --------------- | --------------------------- | ---------------------------------------- |
| contract-intake | `agents/contract-intake.md` | End-to-end contract intake orchestration |

### Skills (1 router + 5 products)

| Skill | File | Purpose |
| --------------------- | --------------------------------------- | ---------------------------------------------------- |
| legal-global-router | `skills/legal-global-router/SKILL.md` | Routing table, jurisdiction overlays, NDA pre-checks |
| compliance-calendar | `skills/compliance-calendar/SKILL.md` | Obligation tracking, escalation sequences, dashboard |
| dsar-privacy | `skills/dsar-privacy/SKILL.md` | DSAR 30-day workflow, jurisdiction response windows |
| ip-protection | `skills/ip-protection/SKILL.md` | Patent landscape, trademark monitoring, FTO, OSS |
| legal-spend | `skills/legal-spend/SKILL.md` | Spend analytics, anomaly detection, benchmarking |
| regulatory-monitoring | `skills/regulatory-monitoring/SKILL.md` | Weekly regulatory briefing, impact assessment |

### Jurisdiction Overlays (6 files)

Located at `skills/legal-global-router/references/jurisdictions/`:

| Overlay | Covers |
| ----------------- | --------------------------------------------------------- |
| `uk-law.md` | England & Wales -- UCTA, CRA, UK GDPR, DPA 2018 |
| `eu-law.md` | EU -- GDPR, EU AI Act, member state notes (DE, FR, NL) |
| `us-law.md` | US -- CCPA, BIPA, UCC, state-by-state non-compete rules |
| `pakistan-law.md` | Pakistan -- Contract Act 1872, PDPA 2023, Islamic finance |
| `uae-law.md` | UAE -- mainland/DIFC/ADGM dual system, PDPL |
| `gcc-law.md` | KSA, Bahrain, Kuwait, Oman, Qatar -- Sharia influence |

## Core Methodology

Before executing ANY legal operations task, read `skills/legal-global-router/SKILL.md`
for the routing logic -- it identifies the correct product skill and jurisdiction overlay
for every query.
The router skill (`skills/legal-global-router/SKILL.md`) contains the routing
logic -- it identifies the correct destination and jurisdiction overlay for
every query, and activates the appropriate product skill.

**Routing sequence:**

1. Identify task type -> load the correct product skill from `skills/`
2. Identify jurisdiction -> load the correct overlay from `skills/legal-global-router/references/jurisdictions/`
1. Identify task type -> route to the correct agent, product skill, or Anthropic command
2. Identify jurisdiction -> load the correct overlay from `references/jurisdictions/`
3. Check for negotiation playbook (`legal.local.md`) -> load if found
4. Apply the mandatory output header to every response

## Commands
## Anthropic Legal Plugin (Layer 1) -- 9 Built-In Commands

These are Anthropic's first-party commands. This plugin does NOT duplicate them.
The router enriches them with jurisdiction overlays and playbook context
before handing off.

| Command | What It Does |
| ------------------ | ------------------------------------------------------------------ |
| `/review-contract` | Full clause-by-clause contract review against playbook |
| `/triage-nda` | Rapid NDA pre-screening with tier routing |
| `/vendor-check` | Obligation tracking, renewal calendar, compliance dashboard |
| `/legal-brief` | Legal research, regulatory monitoring, IP analysis, spend analysis |
| Command | What It Does |
| ------------------------ | -------------------------------------- |
| `/review-contract` | Contract review and redlining |
| `/triage-nda` | NDA classification and risk assessment |
| `/vendor-check` | Vendor assessment and due diligence |
| `/brief` | Legal briefing documents |
| `/compliance-check` | Compliance verification |
| `/legal-risk-assessment` | Risk assessment |
| `/meeting-briefing` | Meeting preparation |
| `/legal-response` | Draft legal responses |
| `/signature-request` | E-signature workflows |

## Mandatory Output Header

Expand All @@ -63,8 +107,10 @@ Every legal output MUST begin with:
TASK: [e.g. Contract Review -- Vendor MSA]
JURISDICTION: [e.g. English Law]
PLAYBOOK: [Loaded: legal.local.md / Not configured -- using general standards]
OVERLAY: [Loaded: jurisdictions/uk-law.md / None]
ATTORNEY REVIEW: REQUIRED -- all outputs must be reviewed by a licensed attorney
ESCALATION: [Yes -- reason / No]
DATE: [current date]
```

## Universal Rules -- Non-Negotiable
Expand Down
119 changes: 70 additions & 49 deletions legal-ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

Plugin for **Chapter 22: Legal Operations and Compliance** from [The AI Agent Factory](https://learn.panaversity.org) by Panaversity.

Legal Operations and Compliance agent with 8 product skills, 6 jurisdiction overlays, and 4 domain commands covering contract review, NDA triage, IP protection, regulatory monitoring, DSAR management, legal spend analysis, compliance calendar tracking, and contract intake routing across UK, EU, US, Pakistan, UAE, and GCC jurisdictions.
**1 agent, 6 skills (1 router + 5 products), 6 jurisdiction overlays, 1 playbook template.** Extends Anthropic's built-in Legal Plugin with multi-jurisdiction awareness and domain-specific legal operations workflows across UK, EU, US, Pakistan, UAE, and GCC jurisdictions.

---

## How It Works: Layer 1 + Layer 2

**Layer 1 (Anthropic's Legal Plugin):** 9 built-in commands for contract review, NDA triage, vendor assessment, compliance checks, legal research, risk assessment, meeting prep, legal responses, and e-signatures.

**Layer 2 (This Plugin):** Adds jurisdiction-aware routing, domain-specific product skills, and an orchestration agent that enriches Layer 1 commands with jurisdiction overlays, negotiation playbook context, and pre-check logic.

The router skill sits between user queries and all legal operations -- it identifies the task type, loads the correct jurisdiction overlay, checks for a negotiation playbook, and routes to the appropriate Layer 1 command or activates the relevant product skill with enriched context.

---

Expand Down Expand Up @@ -48,64 +58,74 @@ Start a new Claude session and say: "I need to review a vendor agreement under E

```
legal-ops/
├── .claude-plugin/plugin.json # Plugin manifest
├── skills/ # 9 skills (auto-loaded by agent)
│ ├── legal-global-router/ # Routes to correct product + jurisdiction
│ │ └── references/jurisdictions/ # 6 jurisdiction overlays (on-demand)
│ ├── jurisdiction-contract-review/ # Full clause-by-clause contract review
│ ├── jurisdiction-nda-triage/ # NDA pre-screening and routing
│ ├── ip-protection/ # Patent, trademark, copyright, OSS
│ ├── regulatory-monitoring/ # Regulatory change tracking
│ ├── dsar-privacy/ # DSAR/privacy request management
│ ├── legal-spend/ # External legal spend analysis
│ ├── compliance-calendar/ # Obligation and deadline tracking
│ └── contract-intake-agent/ # End-to-end contract intake
├── commands/ # 4 slash commands
│ ├── review-contract.md # /review-contract
│ ├── triage-nda.md # /triage-nda
│ ├── vendor-check.md # /vendor-check
│ └── legal-brief.md # /legal-brief
├── hooks/hooks.json # SessionStart + PostToolUse validation
├── scripts/validate-routing.py # Routing validation test harness
├── evals/ # Golden-file tests
├── exercises/ # 8 exercise files (download as zip)
├── workflow-recipes/ # 4 operational playbooks (download as zip)
└── legal.local.md.template # Negotiation playbook -- fill in + rename
├── .claude-plugin/plugin.json # v3.0.0 manifest
├── agents/ # Orchestrator agent
│ └── contract-intake.md # End-to-end contract intake orchestration
├── skills/ # Router + product skills
│ ├── legal-global-router/ # Router skill
│ │ ├── SKILL.md # Routing table, NDA pre-checks, playbook logic
│ │ └── references/jurisdictions/ # 6 jurisdiction overlays
│ │ ├── uk-law.md # England & Wales
│ │ ├── eu-law.md # EU + member state notes
│ │ ├── us-law.md # US federal + state
│ │ ├── pakistan-law.md # Pakistan
│ │ ├── uae-law.md # UAE mainland/DIFC/ADGM
│ │ └── gcc-law.md # KSA, Bahrain, Kuwait, Oman, Qatar
│ ├── compliance-calendar/ # Product skill
│ │ └── SKILL.md # Obligation tracking + escalation
│ ├── dsar-privacy/ # Product skill
│ │ └── SKILL.md # DSAR 30-day workflow
│ ├── ip-protection/ # Product skill
│ │ └── SKILL.md # Patent/trademark/copyright/OSS
│ ├── legal-spend/ # Product skill
│ │ └── SKILL.md # Spend analytics + anomaly detection
│ └── regulatory-monitoring/ # Product skill
│ └── SKILL.md # Weekly regulatory briefing
├── evals/ # Golden-file tests
│ ├── routing-golden.json # 12 routing test cases
│ ├── product-golden.json # 5 product accuracy cases
│ └── run-evals.py # Structural validator
├── hooks/hooks.json # SessionStart + PostToolUse validation
├── scripts/validate-routing.py # Routing validation test harness
├── legal.local.md.template # Negotiation playbook -- fill in + rename
├── CLAUDE.md # Agent instructions
├── LICENSE # Apache-2.0
└── README.md # This file
```

---

## Commands
## Agent (1) -- Orchestrator

| Command | What It Does | Example |
| ------------------ | --------------------------------------------- | ------------------------------------------------------------------- |
| `/review-contract` | Full clause-by-clause review against playbook | `/review-contract "SaaS MSA" "English law" "customer, GBP 48K"` |
| `/triage-nda` | NDA pre-screening with tier routing | `/triage-nda "mutual NDA" "tech partner, response by Friday"` |
| `/vendor-check` | Obligation tracking and compliance calendar | `/vendor-check scope:"all contracts" filter:"due in 60 days"` |
| `/legal-brief` | Research, regulatory, IP, spend analysis | `/legal-brief topic:"regulatory monitoring" jurisdictions:"UK, EU"` |
| Agent | Purpose |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contract-intake` | Manages end-to-end contract intake: receive, classify, extract metadata, triage via Anthropic commands, route by tier, track SLA, handle post-execution. |

---
## Skills (6) -- 1 Router + 5 Products

| Skill | Purpose |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| `legal-global-router` | Routing table, jurisdiction overlays, NDA pre-checks, playbook loading. Activates product skills. |
| `compliance-calendar` | Obligation tracking, filing deadlines, renewal reminders, escalation sequences, compliance dashboard. |
| `dsar-privacy` | 30-day DSAR workflow with multi-jurisdiction support (UK GDPR, EU GDPR, CCPA, PIPEDA). |
| `ip-protection` | Patent landscape analysis, trademark monitoring, FTO scaffolding, copyright and OSS compliance. |
| `legal-spend` | Spend analytics, billing anomaly detection, rate benchmarking, quarterly reporting. |
| `regulatory-monitoring` | Weekly regulatory brief with impact classification, monthly board summaries. |

## Jurisdiction Overlays (6)

## How Each Folder Maps to Chapter 22 Lessons

| Folder | Lessons | What You Do |
| -------------------------------------- | ------------- | -------------------------------------------------------- |
| `skills/jurisdiction-contract-review/` | Part One | Jurisdiction-aware contract review against your playbook |
| `skills/jurisdiction-nda-triage/` | Part Two | Jurisdiction-aware NDA triage with three-tier routing |
| `skills/ip-protection/` | Part Three | Patent landscape, trademark monitoring, FTO research |
| `skills/contract-intake-agent/` | Part Five | Build the Contract Intake Agent |
| `skills/regulatory-monitoring/` | Part Five | Build the Regulatory Monitoring Agent |
| `skills/compliance-calendar/` | Part Five | Build the Compliance Calendar Agent |
| `skills/legal-spend/` | Part Five | Build the Legal Spend Analytics Agent |
| `skills/dsar-privacy/` | Part Five | Build the DSAR Response Agent |
| `skills/legal-global-router/` | All | Routing + 6 jurisdiction overlays |
| `exercises/` | Exercises 1-8 | Hands-on exercise files |
| `workflow-recipes/` | Operational | Production workflow playbooks |
| `evals/` | Validation | Golden-file routing and product tests |
| Overlay | Covers |
| ----------------- | ------------------------------------------------------- |
| `uk-law.md` | UCTA, CRA 2015, UK GDPR, DPA 2018, Bribery Act 2010 |
| `eu-law.md` | GDPR, EU AI Act, Late Payment Directive, member states |
| `us-law.md` | CCPA/CPRA, BIPA, UCC, DTSA, state non-compete rules |
| `pakistan-law.md` | Contract Act 1872, PDPA 2023, Islamic finance (riba) |
| `uae-law.md` | Mainland/DIFC/ADGM dual system, PDPL, Commercial Agency |
| `gcc-law.md` | KSA PDPL, Bahrain PDPL, Sharia-compliant clauses |

---

## Customizing for Your Jurisdiction
## Customizing for Your Organisation

| Variable | Default | Your Value |
| -------------------- | --------------------------------------------------- | ----------------------- |
Expand All @@ -123,6 +143,7 @@ To customize: copy `legal.local.md.template`, rename to `legal.local.md`, and fi

- Chapters 1-21 of The AI Agent Factory
- Claude Code or Cowork access
- Anthropic's Legal Plugin installed (Layer 1)
- Basic understanding of commercial contract concepts

## The Governing Principle
Expand Down
Loading