diff --git a/.github/workflows/legal-ops-evals.yml b/.github/workflows/legal-ops-evals.yml index 4d99bfa..6e7db81 100644 --- a/.github/workflows/legal-ops-evals.yml +++ b/.github/workflows/legal-ops-evals.yml @@ -28,39 +28,7 @@ jobs: echo "OK: ${skill_name}" done - - name: Validate routing golden file + - name: Run eval harness (validates all golden files) run: | cd legal-ops - python3 -c " - import json - with open('evals/routing-golden.json') as f: - cases = json.load(f) - assert isinstance(cases, list), f'Expected list, got {type(cases)}' - assert len(cases) >= 5, f'Expected 5+ routing cases, got {len(cases)}' - for c in cases: - assert 'query' in c, f'Case missing query: {c}' - assert 'expected_product_skill' in c, f'Case missing expected_product_skill: {c}' - assert 'expected_jurisdiction' in c, f'Case missing expected_jurisdiction: {c}' - print(f'Routing golden: {len(cases)} cases valid.') - " - - - name: Validate product golden file - run: | - cd legal-ops - python3 -c " - import json - with open('evals/product-golden.json') as f: - cases = json.load(f) - assert isinstance(cases, list), f'Expected list, got {type(cases)}' - assert len(cases) >= 5, f'Expected 5+ product cases, got {len(cases)}' - for c in cases: - assert 'product' in c, f'Case missing product: {c}' - assert 'scenario' in c, f'Case missing scenario: {c}' - assert 'expected_contains' in c, f'Case missing expected_contains: {c}' - print(f'Product golden: {len(cases)} cases valid.') - " - - - name: Dry-run eval harness - run: | - cd legal-ops - uv run evals/run-evals.py --dry-run + uv run evals/run-evals.py diff --git a/legal-ops/.claude-plugin/plugin.json b/legal-ops/.claude-plugin/plugin.json index d8366a7..9a9120a 100644 --- a/legal-ops/.claude-plugin/plugin.json +++ b/legal-ops/.claude-plugin/plugin.json @@ -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": "2.0.0", + "description": "Legal Operations extension: 6 product skills, 1 router, 6 jurisdiction overlays, 3 domain commands. IP protection, regulatory monitoring, DSAR management, legal spend analytics, compliance calendar, and contract intake across UK, EU, US, Pakistan, UAE, and GCC jurisdictions. Extends Anthropic's Legal Plugin (Layer 1) with jurisdiction-aware orchestration.", "author": { "name": "Panaversity", "url": "https://github.com/panaversity" @@ -11,8 +11,7 @@ "license": "Apache-2.0", "keywords": [ "legal-ops", - "contract-review", - "nda", + "contract-intake", "ip-protection", "regulatory", "compliance", diff --git a/legal-ops/CLAUDE.md b/legal-ops/CLAUDE.md index 43f3ed6..c0ed89d 100644 --- a/legal-ops/CLAUDE.md +++ b/legal-ops/CLAUDE.md @@ -48,12 +48,11 @@ for every query. ## Commands -| 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 | +| ---------------------- | ---------------------------------------------------------------------------------------------------------- | +| `/contract-intake` | Orchestrated contract intake: classify, route via Anthropic Layer 1, apply jurisdiction overlay, track SLA | +| `/compliance-calendar` | Obligation tracking, renewal calendar, deadline management, compliance dashboard | +| `/legal-brief` | Legal research, regulatory monitoring, IP analysis, spend analysis | ## Mandatory Output Header diff --git a/legal-ops/README.md b/legal-ops/README.md index 0aea895..0de6562 100644 --- a/legal-ops/README.md +++ b/legal-ops/README.md @@ -2,7 +2,7 @@ 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. +Legal Operations extension with 6 product skills, 1 router, 6 jurisdiction overlays, and 3 domain commands covering 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. --- @@ -49,21 +49,18 @@ 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) +├── skills/ # 7 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 +├── commands/ # 3 slash commands +│ ├── contract-intake.md # /contract-intake +│ ├── compliance-calendar.md # /compliance-calendar │ └── legal-brief.md # /legal-brief ├── hooks/hooks.json # SessionStart + PostToolUse validation ├── scripts/validate-routing.py # Routing validation test harness @@ -77,31 +74,28 @@ legal-ops/ ## Commands -| 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"` | +| Command | What It Does | Example | +| ---------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `/contract-intake` | Orchestrated contract intake with jurisdiction routing | `/contract-intake "SaaS MSA from UK vendor" "English law" "customer, GBP 48K"` | +| `/compliance-calendar` | Obligation tracking and compliance dashboard | `/compliance-calendar scope:"all contracts" filter:"due in 60 days"` | +| `/legal-brief` | Research, regulatory, IP, spend analysis | `/legal-brief topic:"regulatory monitoring" jurisdictions:"UK, EU"` | --- ## 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 | +| Folder | Lessons | What You Do | +| ------------------------------- | ------------- | ---------------------------------------------------- | +| `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 | --- @@ -132,6 +126,22 @@ To customize: copy `legal.local.md.template`, rename to `legal.local.md`, and fi Every file in this plugin enforces this distinction. Every output ends with: **ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY.** +## Relationship to Anthropic's Legal Plugin + +This plugin is a **Layer 2 extension** that builds on top of Anthropic's official Legal Plugin (Layer 1). It does NOT duplicate Layer 1 capabilities. + +| Capability | Owner | Command/Skill | +| ---------------------------------------------------- | --------------------- | ---------------------- | +| Contract review (clause-by-clause analysis) | Anthropic (Layer 1) | `/review-contract` | +| NDA triage (three-tier classification) | Anthropic (Layer 1) | `/triage-nda` | +| Vendor status lookup | Anthropic (Layer 1) | `/vendor-check` | +| Daily/topic/incident briefings | Anthropic (Layer 1) | `/brief` | +| Contract intake orchestration + jurisdiction routing | Panaversity (Layer 2) | `/contract-intake` | +| Obligation tracking + compliance dashboard | Panaversity (Layer 2) | `/compliance-calendar` | +| IP, regulatory, spend, DSAR research | Panaversity (Layer 2) | `/legal-brief` | + +**`/brief` vs `/legal-brief`:** These are different commands with different preferred entrypoints and owners. `/brief` (Anthropic) is the general briefing tool — daily briefings, topic briefings, incident briefs. `/legal-brief` (Panaversity) is a specialized legal-ops research wrapper that routes through the jurisdiction-aware router before invoking ip-protection, regulatory-monitoring, legal-spend, or dsar-privacy skills. Both can handle IP and regulatory topics; `/legal-brief` adds jurisdiction overlay loading and domain-specific output formats. + ## License Apache-2.0 -- see [LICENSE](./LICENSE). diff --git a/legal-ops/TESTING.md b/legal-ops/TESTING.md new file mode 100644 index 0000000..4ab046f --- /dev/null +++ b/legal-ops/TESTING.md @@ -0,0 +1,109 @@ +# Pre-Merge Smoke Test Protocol + +## Context + +This plugin (v2.0.0) deleted duplicate skills (`jurisdiction-contract-review`, `jurisdiction-nda-triage`) and colliding commands (`/review-contract`, `/triage-nda`, `/vendor-check`). Contract review and NDA triage are now handled by Anthropic's Layer 1 plugin. Panaversity provides jurisdiction overlays and orchestration wrappers. + +**These tests MUST pass before merging.** + +--- + +## Test 1: Anthropic Layer 1 — Jurisdiction Overlay Fires + +Install both plugins in Cowork (Anthropic legal + Panaversity legal-ops). + +``` +Use /review-contract to review this SaaS vendor agreement under English law. +The vendor limits liability to 3 months' fees. We are the customer. +``` + +**Pass criteria:** + +- Output references UCTA (Unfair Contract Terms Act 1977) +- Output references `uk-law.md` overlay or UK-specific statutory framework +- Output includes mandatory header block (TASK, JURISDICTION, ATTORNEY REVIEW) + +``` +Use /triage-nda for this mutual NDA with a German company under German law. +Standard mutual form, 3-year term, no residuals clause. +``` + +**Pass criteria:** + +- Output references `eu-law.md` overlay or EU-specific framework +- Output produces Tier classification +- Output includes attorney review disclaimer + +**If overlays do NOT fire:** Do not merge. The router needs adjustment to ensure overlays load even when Anthropic handles the core review/triage. + +--- + +## Test 2: `/contract-intake` Wrapper Handoff + +``` +/contract-intake "SaaS vendor agreement from UK company" "English law" "We are the customer, GBP 48K annual" +``` + +**Pass criteria:** + +- Assigns reference ID +- Classifies as vendor agreement → routes to Anthropic's `/review-contract` +- Jurisdiction overlay (uk-law.md) is loaded before handoff +- Triage tier is assigned after review +- Communication template is suggested + +``` +/contract-intake "incoming NDA from German technology partner" "German law" "Mutual NDA, need response by Friday" +``` + +**Pass criteria:** + +- Classifies as NDA → routes to Anthropic's `/triage-nda` +- EU overlay loads +- Tier classification produced + +--- + +## Test 3: `/compliance-calendar` Standalone + +``` +/compliance-calendar scope:"all active contracts" filter:"obligations due within 60 days" +``` + +**Pass criteria:** + +- Produces RED/YELLOW/GREEN dashboard format +- Escalation timeline referenced +- Attorney review disclaimer present + +--- + +## Test 4: `/legal-brief` Domain Routing + +``` +/legal-brief topic:"patent landscape analysis" subject:"AI document analysis" jurisdictions:"US, EU, UK" +``` + +**Pass criteria:** + +- Routes to `ip-protection` skill +- Jurisdiction overlays load +- Output is IP research brief format (not general briefing) + +--- + +## Structural Verification (automated) + +```bash +# No Panaversity command files for Anthropic-owned names +ls commands/ # Should list: compliance-calendar.md, contract-intake.md, legal-brief.md + +# No plugin-commands declarations in any SKILL.md +grep -r 'plugin-commands' skills/ # Should return 0 results + +# No stale skill directories +ls skills/ # Should NOT contain jurisdiction-contract-review or jurisdiction-nda-triage + +# Evals pass +uv run evals/run-evals.py # Should print PASSED +``` diff --git a/legal-ops/commands/compliance-calendar.md b/legal-ops/commands/compliance-calendar.md new file mode 100644 index 0000000..1b2d3cb --- /dev/null +++ b/legal-ops/commands/compliance-calendar.md @@ -0,0 +1,45 @@ +# /compliance-calendar + +Obligation tracking, renewal calendar, deadline management, and compliance dashboard with jurisdiction-aware escalation. + +## Usage + +/compliance-calendar [scope] [filter] [output-format] + +## Examples + +/compliance-calendar "all active contracts" "obligations due within 60 days" +/compliance-calendar scope:"vendor agreements" filter:"renewal dates in 90 days" output:"dashboard" +/compliance-calendar "Acme Corp" "all obligations" "summary" + +## Workflow + +1. Route to compliance-calendar skill via legal-global-router +2. Load jurisdiction overlay for regulatory deadline context +3. Query connected contract repository (Google Drive / SharePoint MCP) +4. Extract obligation data: deliverables, payments, notices, renewals, regulatory filings +5. Apply escalation timeline: + - 60 days: add to dashboard + - 30 days: notify obligation owner + - 14 days: notify owner + manager + - 7 days: notify General Counsel; add to weekly brief + - 1 day: emergency alert (CFO for financial, GC for legal/regulatory) + - Missed: log compliance incident; initiate remediation +6. Produce compliance calendar dashboard with RED/YELLOW/GREEN categorisation + +## Coverage + +- **Contract obligations**: deliverables, payments, notice periods, audit windows, SLA reviews +- **Regulatory filings**: annual returns, licence renewals, data protection registrations +- **Internal reviews**: DPIA, privacy policy, HR policy, infosec policy, vendor risk +- **Auto-renewal alerts**: flag contracts approaching auto-renewal that should be renegotiated + +## Output + +- Compliance Calendar with RED (overdue) / YELLOW (due 14 days) / GREEN (due 15-60 days) +- Obligations summary by owner and deadline +- Renewal calendar with notice period deadlines (last date to give non-renewal notice) +- Overdue items requiring immediate action +- Total open obligations count + +ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/commands/contract-intake.md b/legal-ops/commands/contract-intake.md new file mode 100644 index 0000000..db50f63 --- /dev/null +++ b/legal-ops/commands/contract-intake.md @@ -0,0 +1,45 @@ +# /contract-intake + +Orchestrated contract intake workflow: receives incoming contracts, classifies document type, routes through Anthropic's `/review-contract` or `/triage-nda` with jurisdiction overlay, and tracks through tier-based SLA. + +## Usage + +/contract-intake [contract-description] [jurisdiction] [context] + +## Examples + +/contract-intake "SaaS vendor agreement received from UK company" "English law" "We are the customer, GBP 48K annual" +/contract-intake "incoming NDA from German technology partner" "German law" "Mutual NDA, need response by Friday" +/contract-intake "new consulting agreement for Dubai advisory project" "DIFC" "6-month term, AED 180K" + +## Workflow + +1. Receive contract and assign reference ID [YYYY-MM-DD-XXXX] +2. Run legal-global-router to identify jurisdiction and load overlay +3. Classify document type (NDA → Anthropic's `/triage-nda`; vendor/MSA/SaaS → Anthropic's `/review-contract`; employment → HR Legal queue; M&A → GC immediately) +4. Extract metadata: counterparty, contract type, business unit, urgency, value, governing law +5. Execute the appropriate Anthropic command with jurisdiction overlay applied +6. Assign triage tier based on output (Tier 1: standard approval / Tier 2: counsel review / Tier 3: full review + GC) +7. Route using communication templates (Template A/B/C per tier) +8. Set SLA reminders and track progress +9. On execution: log to repository, set renewal/obligation reminders + +## Layer Architecture + +This command is a **Layer 2 orchestration wrapper**. It does NOT duplicate Anthropic's contract review or NDA triage logic. Instead, it: + +- Adds jurisdiction-aware routing via the legal-global-router +- Applies jurisdiction overlays before handing off to Anthropic's Layer 1 commands +- Adds tier-based SLA tracking and escalation +- Provides communication templates for each tier +- Manages post-execution obligation tracking + +## Output + +- Intake receipt with reference ID and metadata +- Document classification and routing decision +- Triage tier assignment with SLA timeline +- Communication template for the assigned tier +- Post-execution: obligation tracking entries and calendar reminders + +ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/commands/review-contract.md b/legal-ops/commands/review-contract.md deleted file mode 100644 index a21dc9d..0000000 --- a/legal-ops/commands/review-contract.md +++ /dev/null @@ -1,34 +0,0 @@ -# /review-contract - -Full clause-by-clause contract review against your organisation's negotiation playbook. - -## Usage - -/review-contract [contract-type] [jurisdiction] [context] - -## Examples - -/review-contract "SaaS vendor agreement" "English law" "We are the customer, annual value GBP 48,000" -/review-contract "MSA" "New York law" "Consulting engagement, 6-month term, USD 95,000" -/review-contract "partnership agreement" "UAE/DIFC" "Co-marketing referral arrangement, no cash exchange" - -## Workflow - -1. Route to contract-review skill via legal-global-router -2. Load the jurisdiction overlay from router references -3. Load the negotiation playbook (legal.local.md) if configured -4. Gather context: party role, contract type, deadline, value, concerns -5. Read the entire contract before flagging any issues -6. Analyse clause-by-clause against playbook or general standards -7. Classify deviations: GREEN (acceptable) / YELLOW (negotiate) / RED (escalate) -8. Generate specific redline text for each YELLOW and RED item -9. Produce holistic risk summary with negotiation priority order - -## Output - -- Mandatory header block (task, jurisdiction, playbook, attorney review, escalation) -- Clause-by-clause analysis with three-tier classification -- Specific redline language ready to insert for each flagged item -- Holistic risk summary: GREEN/YELLOW/RED counts, material risk, recommendation - -ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/commands/triage-nda.md b/legal-ops/commands/triage-nda.md deleted file mode 100644 index a4d5dd0..0000000 --- a/legal-ops/commands/triage-nda.md +++ /dev/null @@ -1,35 +0,0 @@ -# /triage-nda - -Rapid NDA pre-screening and three-tier routing recommendation. - -## Usage - -/triage-nda [nda-type] [counterparty-context] - -## Examples - -/triage-nda "mutual NDA" "prospective technology partner, need response by Friday" -/triage-nda "unilateral NDA" "large enterprise vendor, M&A due diligence" -/triage-nda "incoming NDA" "new SaaS vendor, routine evaluation" - -## Workflow - -1. Route to nda-triage skill via legal-global-router -2. Load NDA configuration from playbook (legal.local.md) if available -3. Gather context: mutual/unilateral, purpose, counterparty type, urgency -4. Compare incoming NDA against standard form or general commercial standards -5. Classify deviations and assign tier: - - Tier 1: Standard Approval (no attorney review) -- target 60-70% - - Tier 2: Counsel Review (attorney review, no negotiation expected) -- target 20-30% - - Tier 3: Full Review (attorney review + likely negotiation) -- target 10-15% -6. Check for automatic RED flags (residuals clause, no public info carve-out, etc.) -7. Produce triage report with routing recommendation - -## Output - -- NDA Triage Report with tier classification -- Estimated attorney time: 0 / ~15 min / ~45 min -- Deviation summary: GREEN/YELLOW/RED counts -- Routing recommendation with specific deviations listed - -ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/commands/vendor-check.md b/legal-ops/commands/vendor-check.md deleted file mode 100644 index bb401cc..0000000 --- a/legal-ops/commands/vendor-check.md +++ /dev/null @@ -1,36 +0,0 @@ -# /vendor-check - -Obligation tracking, vendor status check, renewal calendar, and compliance dashboard. - -## Usage - -/vendor-check [scope] [filter] [output-format] - -## Examples - -/vendor-check "Acme Corp" "all obligations" "summary" -/vendor-check scope:"all active contracts" filter:"obligations due within 60 days" -/vendor-check scope:"vendor agreements" filter:"renewal dates in 90 days" output:"compliance calendar" - -## Workflow - -1. Route to compliance-calendar skill via legal-global-router -2. Query connected contract repository (Google Drive / SharePoint MCP) -3. Extract obligation data: deliverables, payments, notices, renewals -4. Apply escalation timeline: - - 60 days: add to dashboard - - 30 days: notify obligation owner - - 14 days: notify owner + manager - - 7 days: notify General Counsel - - 1 day: emergency alert (CFO for financial, GC for legal/regulatory) - - Missed: log compliance incident; initiate remediation -5. Produce compliance calendar dashboard - -## Output - -- Compliance Calendar with RED/YELLOW/GREEN categorisation -- Obligations summary by owner and deadline -- Renewal calendar with notice period deadlines -- Overdue items requiring immediate action - -ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/evals/product-golden.json b/legal-ops/evals/product-golden.json index 1dfed51..858fcc2 100644 --- a/legal-ops/evals/product-golden.json +++ b/legal-ops/evals/product-golden.json @@ -1,33 +1,4 @@ [ - { - "product": "contract-review", - "jurisdiction": "UK", - "scenario": "SaaS vendor agreement with 3-month liability cap, no DPA, vendor-side termination only", - "expected_contains": [ - "RED", - "limitation of liability", - "UCTA", - "DPA", - "termination", - "attorney review", - "redline" - ], - "must_not_contain": ["approved for execution", "legal advice", "GREEN"] - }, - { - "product": "nda-triage", - "jurisdiction": "UK", - "scenario": "Mutual NDA with residuals clause, no public info carve-out, perpetual obligations", - "expected_contains": [ - "Tier 3", - "RED", - "residuals", - "perpetual", - "senior counsel", - "attorney review" - ], - "must_not_contain": ["Tier 1", "Standard Approval", "approved for signing"] - }, { "product": "dsar-privacy", "jurisdiction": "UK", @@ -42,20 +13,6 @@ ], "must_not_contain": ["confirm data holdings", "redact opinions"] }, - { - "product": "contract-review", - "jurisdiction": "US", - "scenario": "California consulting agreement with broad non-compete and no CISG exclusion", - "expected_contains": [ - "RED", - "non-compete", - "California", - "VOID", - "CISG", - "exclusion" - ], - "must_not_contain": ["enforceable non-compete", "approved"] - }, { "product": "regulatory-monitoring", "jurisdiction": "EU", diff --git a/legal-ops/evals/product-integration-golden.json b/legal-ops/evals/product-integration-golden.json new file mode 100644 index 0000000..b0a811d --- /dev/null +++ b/legal-ops/evals/product-integration-golden.json @@ -0,0 +1,51 @@ +[ + { + "owner": "anthropic", + "note": "Tests that Anthropic's review-contract skill produces expected output when invoked with Panaversity jurisdiction overlay.", + "product": "review-contract", + "jurisdiction": "UK", + "scenario": "SaaS vendor agreement with 3-month liability cap, no DPA, vendor-side termination only", + "expected_contains": [ + "RED", + "limitation of liability", + "UCTA", + "DPA", + "termination", + "attorney review", + "redline" + ], + "must_not_contain": ["approved for execution", "legal advice", "GREEN"] + }, + { + "owner": "anthropic", + "note": "Tests that Anthropic's triage-nda skill produces expected output when invoked with Panaversity jurisdiction overlay.", + "product": "triage-nda", + "jurisdiction": "UK", + "scenario": "Mutual NDA with residuals clause, no public info carve-out, perpetual obligations", + "expected_contains": [ + "Tier 3", + "RED", + "residuals", + "perpetual", + "senior counsel", + "attorney review" + ], + "must_not_contain": ["Tier 1", "Standard Approval", "approved for signing"] + }, + { + "owner": "anthropic", + "note": "Tests that Anthropic's review-contract skill produces expected output for US jurisdiction.", + "product": "review-contract", + "jurisdiction": "US", + "scenario": "California consulting agreement with broad non-compete and no CISG exclusion", + "expected_contains": [ + "RED", + "non-compete", + "California", + "VOID", + "CISG", + "exclusion" + ], + "must_not_contain": ["enforceable non-compete", "approved"] + } +] diff --git a/legal-ops/evals/routing-golden.json b/legal-ops/evals/routing-golden.json index 24ece34..e9834f0 100644 --- a/legal-ops/evals/routing-golden.json +++ b/legal-ops/evals/routing-golden.json @@ -1,20 +1,4 @@ [ - { - "query": "Review this vendor MSA for our SaaS procurement under English law", - "expected_product_skill": "contract-review", - "expected_jurisdiction": "UK", - "expected_overlay": "uk-law.md", - "expected_contains": ["UCTA", "limitation of liability", "attorney review"], - "must_not_contain": ["legal advice", "approved for execution"] - }, - { - "query": "We received an NDA from a prospective technology partner based in Delaware", - "expected_product_skill": "nda-triage", - "expected_jurisdiction": "US", - "expected_overlay": "us-law.md", - "expected_contains": ["Tier", "triage", "standard form"], - "must_not_contain": ["approved for signing"] - }, { "query": "Run a patent landscape analysis for AI document extraction technology in the EU", "expected_product_skill": "ip-protection", @@ -63,14 +47,6 @@ "expected_contains": ["metadata", "classification", "Tier", "routing"], "must_not_contain": ["approved for execution"] }, - { - "query": "Review this consulting agreement governed by UAE/DIFC law for our Dubai subsidiary", - "expected_product_skill": "contract-review", - "expected_jurisdiction": "UAE", - "expected_overlay": "uae-law.md", - "expected_contains": ["DIFC", "mainland", "legal zone"], - "must_not_contain": ["legal advice"] - }, { "query": "We need trademark monitoring for our brand across EU member states", "expected_product_skill": "ip-protection", @@ -79,14 +55,6 @@ "expected_contains": ["EUTM", "EUIPO", "similarity", "monitoring"], "must_not_contain": ["FTO opinion"] }, - { - "query": "Triage this incoming NDA from a German company proposing German law as governing law", - "expected_product_skill": "nda-triage", - "expected_jurisdiction": "EU", - "expected_overlay": "eu-law.md", - "expected_contains": ["Tier", "governing law", "German"], - "must_not_contain": ["Tier 1"] - }, { "query": "A California resident has filed a CCPA data deletion request", "expected_product_skill": "dsar-privacy", diff --git a/legal-ops/evals/routing-integration-golden.json b/legal-ops/evals/routing-integration-golden.json new file mode 100644 index 0000000..fd4623f --- /dev/null +++ b/legal-ops/evals/routing-integration-golden.json @@ -0,0 +1,42 @@ +[ + { + "owner": "anthropic", + "note": "Router identifies this as contract review and hands off to Anthropic Layer 1. Panaversity provides the jurisdiction overlay only.", + "query": "Review this vendor MSA for our SaaS procurement under English law", + "expected_handoff": "review-contract", + "expected_jurisdiction": "UK", + "expected_overlay": "uk-law.md", + "expected_contains": ["UCTA", "limitation of liability", "attorney review"], + "must_not_contain": ["legal advice", "approved for execution"] + }, + { + "owner": "anthropic", + "note": "Router identifies this as NDA triage and hands off to Anthropic Layer 1. Panaversity provides the jurisdiction overlay only.", + "query": "We received an NDA from a prospective technology partner based in Delaware", + "expected_handoff": "triage-nda", + "expected_jurisdiction": "US", + "expected_overlay": "us-law.md", + "expected_contains": ["Tier", "triage", "standard form"], + "must_not_contain": ["approved for signing"] + }, + { + "owner": "anthropic", + "note": "Router identifies this as contract review and hands off to Anthropic Layer 1. Panaversity provides the jurisdiction overlay only.", + "query": "Review this consulting agreement governed by UAE/DIFC law for our Dubai subsidiary", + "expected_handoff": "review-contract", + "expected_jurisdiction": "UAE", + "expected_overlay": "uae-law.md", + "expected_contains": ["DIFC", "mainland", "legal zone"], + "must_not_contain": ["legal advice"] + }, + { + "owner": "anthropic", + "note": "Router identifies this as NDA triage and hands off to Anthropic Layer 1. Panaversity provides the jurisdiction overlay only.", + "query": "Triage this incoming NDA from a German company proposing German law as governing law", + "expected_handoff": "triage-nda", + "expected_jurisdiction": "EU", + "expected_overlay": "eu-law.md", + "expected_contains": ["Tier", "governing law", "German"], + "must_not_contain": ["Tier 1"] + } +] diff --git a/legal-ops/evals/run-evals.py b/legal-ops/evals/run-evals.py index 1788521..345caf5 100644 --- a/legal-ops/evals/run-evals.py +++ b/legal-ops/evals/run-evals.py @@ -7,6 +7,10 @@ Validates that golden files exist and have expected structure. Does NOT run actual LLM inference -- that requires the plugin installed. + +Two eval buckets: + 1. Panaversity-local: tests routing/behavior for skills THIS plugin owns + 2. Integration: tests handoff to Anthropic Layer 1 + overlay application """ import json @@ -14,11 +18,25 @@ from pathlib import Path +# Skills owned by this plugin (Panaversity Layer 2) +PANAVERSITY_SKILLS = { + "ip-protection", + "regulatory-monitoring", + "dsar-privacy", + "legal-spend", + "compliance-calendar", + "contract-intake-agent", +} + +EXPECTED_JURISDICTIONS = {"UK", "EU", "US", "Pakistan", "UAE"} + + def validate_routing_golden(path: Path) -> list[str]: + """Validate Panaversity-local routing cases.""" errors = [] cases = json.loads(path.read_text()) - if len(cases) < 10: - errors.append(f"routing-golden.json: expected 10+ cases, got {len(cases)}") + if len(cases) < 6: + errors.append(f"routing-golden.json: expected 6+ cases (one per Panaversity skill), got {len(cases)}") required_fields = [ "query", "expected_product_skill", @@ -31,35 +49,49 @@ def validate_routing_golden(path: Path) -> list[str]: for f in required_fields: if f not in c: errors.append(f"routing-golden.json case {i}: missing field '{f}'") - # Verify all 8 product skills are covered + # Every case in this file must route to a Panaversity-owned skill + skill = c.get("expected_product_skill", "") + if skill and skill not in PANAVERSITY_SKILLS: + errors.append( + f"routing-golden.json case {i}: skill '{skill}' is not Panaversity-owned. " + f"Move to routing-integration-golden.json." + ) + # Verify all 6 Panaversity skills are covered skills = {c["expected_product_skill"] for c in cases} - expected_skills = { - "contract-review", - "nda-triage", - "ip-protection", - "regulatory-monitoring", - "dsar-privacy", - "legal-spend", - "compliance-calendar", - "contract-intake-agent", - } - missing_skills = expected_skills - skills + missing_skills = PANAVERSITY_SKILLS - skills if missing_skills: - errors.append(f"routing-golden.json: missing product skills: {missing_skills}") - # Verify all 5 jurisdictions are covered - jurisdictions = {c["expected_jurisdiction"] for c in cases} - expected_jurisdictions = {"UK", "EU", "US", "Pakistan", "UAE"} - missing_jurisdictions = expected_jurisdictions - jurisdictions - if missing_jurisdictions: - errors.append(f"routing-golden.json: missing jurisdictions: {missing_jurisdictions}") + errors.append(f"routing-golden.json: missing Panaversity skills: {missing_skills}") + return errors + + +def validate_routing_integration(path: Path) -> list[str]: + """Validate cross-plugin routing cases (handoff to Anthropic Layer 1).""" + errors = [] + cases = json.loads(path.read_text()) + required_fields = [ + "query", + "expected_handoff", + "expected_jurisdiction", + "expected_overlay", + "expected_contains", + "must_not_contain", + ] + for i, c in enumerate(cases): + for f in required_fields: + if f not in c: + errors.append(f"routing-integration-golden.json case {i}: missing field '{f}'") + # Every case must have owner: anthropic + if c.get("owner") != "anthropic": + errors.append(f"routing-integration-golden.json case {i}: missing or wrong 'owner' (expected 'anthropic')") return errors def validate_product_golden(path: Path) -> list[str]: + """Validate Panaversity-local product behavior cases.""" errors = [] cases = json.loads(path.read_text()) - if len(cases) < 5: - errors.append(f"product-golden.json: expected 5+ cases, got {len(cases)}") + if len(cases) < 2: + errors.append(f"product-golden.json: expected 2+ Panaversity product cases, got {len(cases)}") required_fields = [ "product", "jurisdiction", @@ -71,6 +103,33 @@ def validate_product_golden(path: Path) -> list[str]: for f in required_fields: if f not in c: errors.append(f"product-golden.json case {i}: missing field '{f}'") + # Every case must test a Panaversity-owned skill + product = c.get("product", "") + if product and product not in PANAVERSITY_SKILLS: + errors.append( + f"product-golden.json case {i}: product '{product}' is not Panaversity-owned. " + f"Move to product-integration-golden.json." + ) + return errors + + +def validate_product_integration(path: Path) -> list[str]: + """Validate cross-plugin product behavior cases (Anthropic Layer 1 output).""" + errors = [] + cases = json.loads(path.read_text()) + required_fields = [ + "product", + "jurisdiction", + "scenario", + "expected_contains", + "must_not_contain", + ] + for i, c in enumerate(cases): + for f in required_fields: + if f not in c: + errors.append(f"product-integration-golden.json case {i}: missing field '{f}'") + if c.get("owner") != "anthropic": + errors.append(f"product-integration-golden.json case {i}: missing or wrong 'owner' (expected 'anthropic')") return errors @@ -78,27 +137,53 @@ def main(): eval_dir = Path(__file__).parent all_errors = [] + print("=" * 60) + print("PANAVERSITY-LOCAL EVALS (skills owned by this plugin)") + print("=" * 60) + routing = eval_dir / "routing-golden.json" if routing.exists(): all_errors.extend(validate_routing_golden(routing)) - print(f"routing-golden.json: {len(json.loads(routing.read_text()))} cases") + cases = json.loads(routing.read_text()) + skills = {c["expected_product_skill"] for c in cases} + print(f" routing-golden.json: {len(cases)} cases covering {len(skills)} Panaversity skills") else: all_errors.append("routing-golden.json not found") product = eval_dir / "product-golden.json" if product.exists(): all_errors.extend(validate_product_golden(product)) - print(f"product-golden.json: {len(json.loads(product.read_text()))} cases") + print(f" product-golden.json: {len(json.loads(product.read_text()))} cases") else: all_errors.append("product-golden.json not found") + print() + print("=" * 60) + print("INTEGRATION EVALS (handoff to Anthropic Layer 1)") + print("=" * 60) + + routing_int = eval_dir / "routing-integration-golden.json" + if routing_int.exists(): + all_errors.extend(validate_routing_integration(routing_int)) + print(f" routing-integration-golden.json: {len(json.loads(routing_int.read_text()))} cases") + else: + print(" routing-integration-golden.json: not found (optional)") + + product_int = eval_dir / "product-integration-golden.json" + if product_int.exists(): + all_errors.extend(validate_product_integration(product_int)) + print(f" product-integration-golden.json: {len(json.loads(product_int.read_text()))} cases") + else: + print(" product-integration-golden.json: not found (optional)") + + print() if all_errors: - print(f"\nFAILED: {len(all_errors)} errors:") + print(f"FAILED: {len(all_errors)} errors:") for e in all_errors: print(f" - {e}") sys.exit(1) else: - print("\nPASSED: All golden files valid.") + print("PASSED: All golden files valid.") if __name__ == "__main__": diff --git a/legal-ops/exercises/ex01-negotiation-playbook.md b/legal-ops/exercises/ex01-negotiation-playbook.md index 0450100..137a8e3 100644 --- a/legal-ops/exercises/ex01-negotiation-playbook.md +++ b/legal-ops/exercises/ex01-negotiation-playbook.md @@ -6,7 +6,7 @@ | ------------------- | ---------------------------------------------------------------------- | | **Type** | SKILL.md Configuration | | **Time** | 60-90 minutes | -| **Skills Required** | `contract-review`, `legal-global-router`, `legal.local.md.template` | +| **Skills Required** | Anthropic's `review-contract` (Layer 1), `legal-global-router`, `legal.local.md.template` | | **Prerequisite** | Legal Ops plugin installed; access to 3 recently negotiated agreements | | **Chapter** | Chapter 22 -- Legal Operations and Compliance | diff --git a/legal-ops/exercises/ex02-contract-review-sprint.md b/legal-ops/exercises/ex02-contract-review-sprint.md index 3bb3889..ef96bcd 100644 --- a/legal-ops/exercises/ex02-contract-review-sprint.md +++ b/legal-ops/exercises/ex02-contract-review-sprint.md @@ -6,8 +6,8 @@ | ------------------- | --------------------------------------------- | | **Type** | Applied Practice | | **Time** | 60 minutes (20 minutes per contract) | -| **Skills Required** | `contract-review`, `legal-global-router` | -| **Plugin Command** | `/review-contract` | +| **Skills Required** | Anthropic's `review-contract` (Layer 1), `legal-global-router` | +| **Plugin Command** | Anthropic's `/review-contract` (Layer 1) | | **Chapter** | Chapter 22 -- Legal Operations and Compliance | --- diff --git a/legal-ops/exercises/ex03-nda-triage-system.md b/legal-ops/exercises/ex03-nda-triage-system.md index 5c2cae9..b22bbf0 100644 --- a/legal-ops/exercises/ex03-nda-triage-system.md +++ b/legal-ops/exercises/ex03-nda-triage-system.md @@ -2,13 +2,13 @@ ## Scenario Profile -| Field | Value | -| ------------------- | --------------------------------------------- | -| **Type** | Workflow Configuration | -| **Time** | 45 minutes | -| **Skills Required** | `nda-triage`, `legal-global-router` | -| **Plugin Command** | `/triage-nda` | -| **Chapter** | Chapter 22 -- Legal Operations and Compliance | +| Field | Value | +| ------------------- | --------------------------------------------------------- | +| **Type** | Workflow Configuration | +| **Time** | 45 minutes | +| **Skills Required** | Anthropic's `triage-nda` (Layer 1), `legal-global-router` | +| **Plugin Command** | Anthropic's `/triage-nda` (Layer 1) | +| **Chapter** | Chapter 22 -- Legal Operations and Compliance | --- diff --git a/legal-ops/exercises/ex05-contract-intake-agent.md b/legal-ops/exercises/ex05-contract-intake-agent.md index 6948d9a..37d187c 100644 --- a/legal-ops/exercises/ex05-contract-intake-agent.md +++ b/legal-ops/exercises/ex05-contract-intake-agent.md @@ -2,13 +2,13 @@ ## Scenario Profile -| Field | Value | -| ------------------- | -------------------------------------------------- | -| **Type** | Agent Configuration and Testing | -| **Time** | 90 minutes | -| **Skills Required** | All product skills + `contract-intake-agent` | -| **Plugin Commands** | `/review-contract`, `/triage-nda`, `/vendor-check` | -| **Chapter** | Chapter 22 -- Legal Operations and Compliance | +| Field | Value | +| ------------------- | ------------------------------------------------------- | +| **Type** | Agent Configuration and Testing | +| **Time** | 90 minutes | +| **Skills Required** | All product skills + `contract-intake-agent` | +| **Plugin Commands** | `/contract-intake` (wraps Anthropic's Layer 1 commands) | +| **Chapter** | Chapter 22 -- Legal Operations and Compliance | --- diff --git a/legal-ops/exercises/ex08-legal-ops-dashboard.md b/legal-ops/exercises/ex08-legal-ops-dashboard.md index 270b723..ee5b263 100644 --- a/legal-ops/exercises/ex08-legal-ops-dashboard.md +++ b/legal-ops/exercises/ex08-legal-ops-dashboard.md @@ -7,7 +7,7 @@ | **Type** | Integration and Measurement | | **Time** | 60 minutes | | **Skills Required** | All product skills | -| **Plugin Commands** | `/vendor-check`, `/legal-brief` | +| **Plugin Commands** | `/compliance-calendar`, `/legal-brief` | | **Chapter** | Chapter 22 -- Legal Operations and Compliance | --- diff --git a/legal-ops/hooks/hooks.json b/legal-ops/hooks/hooks.json index 249082a..425b067 100644 --- a/legal-ops/hooks/hooks.json +++ b/legal-ops/hooks/hooks.json @@ -5,7 +5,7 @@ "hooks": [ { "type": "prompt", - "prompt": "The Legal Operations and Compliance plugin (v1.0.0) is active. Capabilities: 8 product skills (contract review, NDA triage, IP protection, regulatory monitoring, DSAR privacy, legal spend, compliance calendar, contract intake), 5 jurisdiction overlays (UK, EU, US, Pakistan, UAE), 4 domain commands. Commands available: /review-contract (full contract review), /triage-nda (NDA pre-screening), /vendor-check (obligation and compliance tracking), /legal-brief (research, regulatory monitoring, IP analysis). The router auto-activates on any legal operations query. ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY. $ARGUMENTS" + "prompt": "The Legal Operations and Compliance plugin (v2.0.0) is active. Capabilities: 6 product skills (IP protection, regulatory monitoring, DSAR privacy, legal spend, compliance calendar, contract intake) plus 1 router, 6 jurisdiction overlays (UK, EU, US, Pakistan, UAE, GCC), 3 domain commands. Commands available: /contract-intake (orchestrated contract intake with jurisdiction routing and tier-based SLA tracking), /compliance-calendar (obligation tracking, renewal calendar, deadline management), /legal-brief (research, regulatory monitoring, IP analysis). The router auto-activates on any legal operations query. ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY. $ARGUMENTS" } ] } diff --git a/legal-ops/skills/compliance-calendar/SKILL.md b/legal-ops/skills/compliance-calendar/SKILL.md index 04fe443..3722410 100644 --- a/legal-ops/skills/compliance-calendar/SKILL.md +++ b/legal-ops/skills/compliance-calendar/SKILL.md @@ -1,6 +1,5 @@ --- name: compliance-calendar -version: 1.0 description: > Activate for: contract renewal, renewal deadline, notice period, renewal reminder, compliance deadline, obligation due, filing deadline, @@ -9,8 +8,9 @@ description: > obligation tracking, contract obligation, missed deadline, overdue, 60-day calendar, compliance obligations. NOT for: contract review, NDA triage, IP research, DSAR processing, setting compliance policy (compliance officer required). -plugin-commands: /vendor-check -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + chapter: "22 -- Legal Operations and Compliance" --- ## CALENDAR CATEGORIES diff --git a/legal-ops/skills/contract-intake-agent/SKILL.md b/legal-ops/skills/contract-intake-agent/SKILL.md index fb39f48..f399f41 100644 --- a/legal-ops/skills/contract-intake-agent/SKILL.md +++ b/legal-ops/skills/contract-intake-agent/SKILL.md @@ -1,15 +1,15 @@ --- name: contract-intake-agent -version: 1.0 description: > Activate for: incoming contract, contract received, new contract, contract routing, contract intake, NDA received, vendor agreement received, contract submitted for review, legal intake, contract queue, contract management, contract tracking, new agreement, contract pipeline, contract submitted. NOT for: IP research, regulatory monitoring, DSAR processing, contract execution (authorised signatory required), legal advice. -plugin-commands: /review-contract, /triage-nda, /vendor-check -mcp-integrations: Google Drive, SharePoint, Gmail, Outlook, Google Sheets, Notion -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + mcp-integrations: Google Drive, SharePoint, Gmail, Outlook, Google Sheets, Notion + chapter: "22 -- Legal Operations and Compliance" --- ## INTAKE SEQUENCE -- EXECUTE IN ORDER diff --git a/legal-ops/skills/dsar-privacy/SKILL.md b/legal-ops/skills/dsar-privacy/SKILL.md index 3aa8e77..df948d1 100644 --- a/legal-ops/skills/dsar-privacy/SKILL.md +++ b/legal-ops/skills/dsar-privacy/SKILL.md @@ -1,6 +1,5 @@ --- name: dsar-privacy -version: 1.0 description: > Activate for: DSAR, data subject access request, subject access request, SAR, right of access, Article 15, GDPR request, CCPA request, privacy @@ -9,8 +8,9 @@ description: > processing, Article 18, objection to processing, Article 21, data subject rights, privacy inquiry, ICO complaint, privacy response. NOT for: contract review, NDA triage, IP matters, regulatory monitoring, legal advice on data protection interpretation, erasure execution. -plugin-commands: /legal-brief -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + chapter: "22 -- Legal Operations and Compliance" --- ## JURISDICTION RESPONSE WINDOWS diff --git a/legal-ops/skills/ip-protection/SKILL.md b/legal-ops/skills/ip-protection/SKILL.md index 2486baf..b4a8ff0 100644 --- a/legal-ops/skills/ip-protection/SKILL.md +++ b/legal-ops/skills/ip-protection/SKILL.md @@ -1,6 +1,5 @@ --- name: ip-protection -version: 1.0 description: > Activate for: patent, patent search, patent landscape, freedom to operate, FTO, prior art, trademark, trade mark, brand protection, trademark watch, @@ -9,8 +8,9 @@ description: > patent infringement, trademark infringement, copyright infringement, IP portfolio, IP monitoring, competitor patent, patent filing. NOT for: contract review, NDA triage, regulatory monitoring, DSAR processing, patent filing (attorney required), trademark registration. -plugin-commands: /legal-brief -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + chapter: "22 -- Legal Operations and Compliance" --- ## IP TASK CLASSIFICATION diff --git a/legal-ops/skills/jurisdiction-contract-review/SKILL.md b/legal-ops/skills/jurisdiction-contract-review/SKILL.md deleted file mode 100644 index a44301c..0000000 --- a/legal-ops/skills/jurisdiction-contract-review/SKILL.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -name: jurisdiction-contract-review -version: 1.0 -description: > - Activate for: contract review, clause analysis, redline, vendor agreement, - MSA, master services agreement, SOW, statement of work, SaaS agreement, - software licence, professional services agreement, partnership agreement, - supply agreement, distribution agreement, review contract, full NDA review - (use jurisdiction-nda-triage for quick triage only). - NOT for: NDA-only triage (use jurisdiction-nda-triage), IP research, regulatory monitoring, DSAR processing, general legal advice, litigation strategy. -plugin-commands: /review-contract -chapter: 22 -- Legal Operations and Compliance ---- - -## REVIEW WORKFLOW -- EXECUTE IN ORDER - -### Phase 1: Context Gathering (before reading the contract) - -Ask the user: - -1. Which party are you? (Customer / Vendor / Licensor / Licensee / Partner / Other) -2. What is the contract type? (SaaS / Professional Services / Licence / Partnership / Other) -3. When does this need to be finalised? -4. Approximate contract value? -5. Any specific clauses of concern? -6. Relevant business context (new vs. strategic vs. commodity vendor)? - -### Phase 2: Playbook Loading - -CHECK for playbook in user's local settings (legal.local.md or configured file). - -IF playbook FOUND: - -- Load all clause positions, acceptable ranges, and escalation triggers -- Label output: "Reviewed against [Organisation] Negotiation Playbook v[X]" - -IF playbook NOT FOUND: - -- Inform user: "No playbook configured. Reviewing against general commercial standards." -- Offer to help create a playbook (see legal.local.md.template) -- Label all output: "Reviewed against general commercial standards" - -### Phase 3: Full Contract Read - -READ THE ENTIRE CONTRACT before flagging any issues. -Reason: Clauses interact. An uncapped indemnity may be partially offset by a broad -limitation of liability. Review holistically, not clause-by-clause in isolation. - -Identify: - -- Contract type (confirm or update from context phase) -- User's side (confirm from context) -- Governing law and jurisdiction -- Material clauses present / absent -- Unusual structure or atypical provisions - -### Phase 4: Clause-by-Clause Analysis - -ANALYSE each material clause against playbook (or general standards). - -PRIORITY CLAUSES (always analyse): - -1. Limitation of liability -- cap amount, mutual/asymmetric, carve-outs -2. Intellectual property -- ownership, work product, licence-back -3. Indemnification -- scope, triggers, caps, mutual/one-sided -4. Data protection -- DPA requirement, transfer mechanisms, breach notification -5. Termination -- for convenience, for cause, notice periods, consequences -6. Governing law and jurisdiction -- choice of law, dispute resolution -7. Confidentiality -- scope, duration, carve-outs -8. Payment and pricing -- fixed/variable, invoicing, late payment -9. Warranties and representations -- scope, disclaimers -10. Force majeure -- scope, notification, relief - -SECONDARY CLAUSES (analyse if present): - -- Non-compete / non-solicitation -- Audit rights -- Assignment and change of control -- Insurance requirements -- SLA and service credits -- Auto-renewal provisions - -### Phase 5: Three-Tier Flag Classification - -Classify every deviation from playbook (or general standard): - -GREEN -- ACCEPTABLE -Within standard position or acceptable range. -No action required. Note for completeness. - -YELLOW -- NEGOTIATE -Outside standard position but within acceptable range. -Action: Provide primary redline + fallback position. - -RED -- ESCALATE -Outside acceptable range. Potential material risk. -Action: Flag for attorney review. Do not proceed without legal sign-off. - -### Phase 6: Redline Generation Format - -For each YELLOW and RED item: - -CLAUSE: [Clause name and section number] -STATUS: [YELLOW / RED] -CURRENT: "[Exact current contract text]" -ISSUE: [Specific problem and why it matters] -REDLINE: "[Exact proposed replacement text -- ready to insert]" -FALLBACK: [If YELLOW: fallback position if primary ask is rejected] -RATIONALE: "[Professional rationale suitable for sharing with counterparty's counsel]" -PRIORITY: [Must-have / Nice-to-have] - -### Phase 7: Holistic Risk Summary - -Conclude with: - -- Total: [N] GREEN | [N] YELLOW | [N] RED -- Single most material risk in this contract -- Overall recommendation: Approve / Negotiate / Escalate to counsel / Decline -- Suggested negotiation priority order (most important first) - -## OUTPUT FORMAT - -### Redline Output (per YELLOW / RED clause) - -``` -CLAUSE: [Clause name and section number] -STATUS: [YELLOW / RED] -CURRENT: "[Exact current contract text]" -ISSUE: [Specific problem and why it matters] -REDLINE: "[Exact proposed replacement text -- ready to insert]" -FALLBACK: [If YELLOW: fallback position if primary ask is rejected] -RATIONALE: "[Professional rationale suitable for sharing with counterparty's counsel]" -PRIORITY: [Must-have / Nice-to-have] -``` - -### Holistic Risk Summary Output - -``` -CONTRACT REVIEW SUMMARY -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Contract: [Type -- Counterparty] -Governing Law: [jurisdiction] -Playbook: [Loaded / General standards] -Reviewed by: Legal Ops Agent - -CLAUSE ANALYSIS: [N] GREEN | [N] YELLOW | [N] RED - -MOST MATERIAL RISK: -[description of the single most significant risk] - -RECOMMENDATION: [Approve / Negotiate / Escalate to counsel / Decline] - -NEGOTIATION PRIORITY ORDER: -1. [highest priority item] -2. [next priority] -3. [...] - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY -``` - -## NEVER DO THESE - -- NEVER approve a contract for execution -- route for authorised signatory -- NEVER skip Phase 1 context gathering -- user's position changes the entire analysis -- NEVER flag an issue without a specific proposed remedy -- NEVER read clauses in isolation without considering the full contract -- NEVER send redlines to counterparty -- attorney review required first -- NEVER classify a liability carve-out for death/personal injury from negligence - as GREEN -- void under English law (UCTA s.2(1)); RED regardless of playbook - -## ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/skills/jurisdiction-nda-triage/SKILL.md b/legal-ops/skills/jurisdiction-nda-triage/SKILL.md deleted file mode 100644 index f3ae3af..0000000 --- a/legal-ops/skills/jurisdiction-nda-triage/SKILL.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -name: jurisdiction-nda-triage -version: 1.0 -description: > - Activate for: NDA, non-disclosure agreement, confidentiality agreement, - mutual NDA, unilateral NDA, mutual CA, MCA, CDA, triage NDA, review NDA, - incoming NDA, NDA received, sign NDA, NDA approval, quick NDA check. - NOT for: full contract review (use jurisdiction-contract-review), IP matters, regulatory monitoring, DSAR processing, employment agreements. -plugin-commands: /triage-nda -chapter: 22 -- Legal Operations and Compliance ---- - -## TRIAGE WORKFLOW - -### Phase 1: Context - -Ask before reviewing: - -1. Mutual (both parties disclose) or unilateral (one party discloses)? - If unilateral: which party is the discloser? -2. Purpose: vendor evaluation / partnership / M&A / employment / other? -3. Counterparty type: new vendor / strategic partner / large enterprise / individual? -4. Urgency / deadline? -5. Any known concerns? - -### Phase 2: Standard Form Loading - -CHECK for NDA configuration in legal.local.md. - -IF NDA configuration FOUND: - -- Load standard form reference; Tier 1/2/3 criteria -- Compare incoming NDA against standard form directly - -IF NOT FOUND: - -- Apply general commercial NDA standards -- Label: "Reviewed against general commercial NDA standards" - -### Phase 3: Three-Tier Routing Classification - -TIER 1 -- STANDARD APPROVAL (no attorney review required) -Criteria: NDA substantially identical to standard form, OR deviations -fall within pre-approved acceptable ranges (defined in playbook). -Action: Notify business unit -- proceed to authorised signatory. -Target: 60-70% of incoming NDAs. - -TIER 2 -- COUNSEL REVIEW (attorney review; no negotiation expected) -Criteria: Deviations within acceptable range requiring attorney confirmation. -Action: Route to reviewing attorney with triage summary attached. -Target: 20-30%. - -TIER 3 -- FULL REVIEW (attorney review + likely negotiation) -Criteria: RED deviations present. Unusual structure. High-risk provisions. -Action: Route to senior counsel / GC with full risk summary. -Target: 10-15%. - -### Phase 4: Triage Report Format - -NDA TRIAGE REPORT - ---- - -Counterparty: [Name] -Date: [Date] -Playbook: [Loaded / Not configured] - -TRIAGE TIER: [1 / 2 / 3] -- [Label] -Attorney time: [0 / ~15 min / ~45 min] - -SUMMARY: [N] GREEN | [N] YELLOW | [N] RED -RECOMMENDATION: [Route to / Approve for execution] - -DEVIATIONS FROM STANDARD: -GREEN [Clause]: [deviation] -- [classification and reason] -YELLOW [Clause]: [deviation] -- [flag and proposed position] -RED [Clause]: [deviation] -- [RED reason and escalation note] - ---- - -ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY - -## AUTOMATIC RED FLAGS (always Tier 3 regardless of playbook) - -- Residuals clause: allows use of information "retained in unaided memory" -- No carve-out for publicly available information -- Non-compete provisions of any scope -- Perpetual confidentiality obligations (no sunset clause) -- Governing law: jurisdiction with no established commercial law framework -- No definition of Confidential Information (unacceptably broad) -- Unilateral NDA where mutual expected, without documented business justification -- Injunctive relief provisions asymmetric in favour of counterparty -- Disclosure to affiliates without "need to know" qualification - -## NEVER DO THESE - -- NEVER route a Tier 3 NDA to Tier 1 regardless of business urgency -- NEVER approve execution without an authorised signatory -- NEVER omit the residuals clause check -- most commonly missed high-risk provision -- NEVER classify an NDA as Tier 1 if governing law differs from standard - without attorney confirmation - -## ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY diff --git a/legal-ops/skills/legal-global-router/SKILL.md b/legal-ops/skills/legal-global-router/SKILL.md index f1b8f9e..3a69df0 100644 --- a/legal-ops/skills/legal-global-router/SKILL.md +++ b/legal-ops/skills/legal-global-router/SKILL.md @@ -1,6 +1,5 @@ --- name: legal-global-router -version: 1.0 description: > TOP-LEVEL ROUTER. Activate when ANY of these terms appear: contract review, NDA, non-disclosure, confidentiality agreement, @@ -12,23 +11,27 @@ description: > vendor agreement, CLM, contract lifecycle, playbook, clause analysis, negotiation, legal ops, legal operations, contract triage. NOT for: direct legal advice, court filings, litigation strategy, attorney-client privileged communications, contract execution. -author: Panaversity -- The AI Agent Factory -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + author: Panaversity -- The AI Agent Factory + chapter: "22 -- Legal Operations and Compliance" --- ## STEP 1 -- IDENTIFY TASK TYPE AND LOAD PRODUCT FILE -| Query Pattern | Load Product Skill | -| -------------------------------------------------- | -------------------------------------------- | -| Contract review, clause analysis, redlines | skills/jurisdiction-contract-review/SKILL.md | -| NDA, non-disclosure, confidentiality agreement | skills/jurisdiction-nda-triage/SKILL.md | -| Patent, trademark, copyright, trade secret, IP | skills/ip-protection/SKILL.md | -| Regulatory update, compliance monitoring | skills/regulatory-monitoring/SKILL.md | -| DSAR, data subject, GDPR request, privacy request | skills/dsar-privacy/SKILL.md | -| Legal spend, invoice, firm performance | skills/legal-spend/SKILL.md | -| Renewal, obligation, deadline, compliance calendar | skills/compliance-calendar/SKILL.md | -| Contract intake, incoming contract, routing | skills/contract-intake-agent/SKILL.md | -| Legal briefing, research, topic summary | use /legal-brief command directly | +| Query Pattern | Load Product Skill / Action | +| -------------------------------------------------- | ---------------------------------------------- | +| Contract review, clause analysis, redlines | Anthropic Layer 1 handles via /review-contract | +| NDA, non-disclosure, confidentiality agreement | Anthropic Layer 1 handles via /triage-nda | +| Contract intake, incoming contract, routing | skills/contract-intake-agent/SKILL.md | +| Patent, trademark, copyright, trade secret, IP | skills/ip-protection/SKILL.md | +| Regulatory update, compliance monitoring | skills/regulatory-monitoring/SKILL.md | +| DSAR, data subject, GDPR request, privacy request | skills/dsar-privacy/SKILL.md | +| Legal spend, invoice, firm performance | skills/legal-spend/SKILL.md | +| Renewal, obligation, deadline, compliance calendar | skills/compliance-calendar/SKILL.md | +| Legal briefing, research, topic summary | use /legal-brief command directly | + +For contract review and NDA triage, this router provides the jurisdiction overlay. The core review/triage logic comes from Anthropic's Layer 1 plugin. ## STEP 2 -- IDENTIFY JURISDICTION AND LOAD OVERLAY @@ -70,7 +73,7 @@ Do not produce any substantive legal output without this header. - NEVER skip the playbook check -- if no playbook found, state explicitly - NEVER apply a jurisdiction overlay without confirming the user's jurisdiction - NEVER provide legal advice directly -- route to the correct product skill which will produce analysis for attorney review -- NEVER route employment disputes to jurisdiction-contract-review -- these require specialist employment law advice +- NEVER route employment disputes to Anthropic's /review-contract -- these require specialist employment law advice ## UNIVERSAL RULES -- NON-NEGOTIABLE diff --git a/legal-ops/skills/legal-spend/SKILL.md b/legal-ops/skills/legal-spend/SKILL.md index b3a717d..271aa34 100644 --- a/legal-ops/skills/legal-spend/SKILL.md +++ b/legal-ops/skills/legal-spend/SKILL.md @@ -1,6 +1,5 @@ --- name: legal-spend -version: 1.0 description: > Activate for: legal spend, legal invoice, law firm invoice, legal budget, matter budget, legal costs, external counsel, billing rates, hourly rates, @@ -8,8 +7,9 @@ description: > legal ROI, panel firms, outside counsel, legal department budget, matter management, legal benchmarking. NOT for: contract review, NDA triage, IP research, regulatory monitoring, DSAR processing, budget approval (CFO required). -plugin-commands: /legal-brief -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + chapter: "22 -- Legal Operations and Compliance" --- ## DATA SOURCES (connect via MCP) diff --git a/legal-ops/skills/regulatory-monitoring/SKILL.md b/legal-ops/skills/regulatory-monitoring/SKILL.md index a187b1b..1f4a52c 100644 --- a/legal-ops/skills/regulatory-monitoring/SKILL.md +++ b/legal-ops/skills/regulatory-monitoring/SKILL.md @@ -1,6 +1,5 @@ --- name: regulatory-monitoring -version: 1.0 description: > Activate for: regulatory update, regulation change, new law, compliance monitoring, regulatory briefing, regulatory calendar, law change, legal @@ -8,8 +7,9 @@ description: > EU AI Act, employment law change, company law update, sector regulation, regulatory horizon, compliance alert, policy review, board briefing. NOT for: contract review, NDA triage, IP research, DSAR processing, legal advice on regulatory interpretation. -plugin-commands: /legal-brief -chapter: 22 -- Legal Operations and Compliance +metadata: + version: "1.0" + chapter: "22 -- Legal Operations and Compliance" --- ## CONFIGURATION PARAMETERS (load from settings or ask user) diff --git a/legal-ops/workflow-recipes/contract-intake-workflow.md b/legal-ops/workflow-recipes/contract-intake-workflow.md index f19148d..53c9219 100644 --- a/legal-ops/workflow-recipes/contract-intake-workflow.md +++ b/legal-ops/workflow-recipes/contract-intake-workflow.md @@ -52,8 +52,8 @@ Unknown -> Extract key terms; route to GC queue ``` Execute the appropriate product skill: - - nda-triage: produces Tier 1/2/3 classification - - contract-review: produces GREEN/YELLOW/RED analysis + - Anthropic's triage-nda: produces Tier 1/2/3 classification + - Anthropic's review-contract: produces GREEN/YELLOW/RED analysis Output: Triage tier + deviation summary + routing recommendation ``` @@ -105,13 +105,13 @@ On confirmed signing: ## Required Skill Files -| Skill File | Purpose | -| ----------------------- | --------------------------------------- | -| `contract-intake-agent` | Intake sequence, routing, and templates | -| `contract-review` | Full contract review (Tier 2/3) | -| `nda-triage` | NDA triage (Tier 1/2/3) | -| `compliance-calendar` | Post-execution obligation tracking | -| `legal-global-router` | Routing and jurisdiction identification | +| Skill File | Purpose | +| ---------------------------------- | --------------------------------------- | +| `contract-intake-agent` | Intake sequence, routing, and templates | +| Anthropic's `review-contract` (L1) | Full contract review (Tier 2/3) | +| Anthropic's `triage-nda` (L1) | NDA triage (Tier 1/2/3) | +| `compliance-calendar` | Post-execution obligation tracking | +| `legal-global-router` | Routing and jurisdiction identification | --- diff --git a/legal-ops/workflow-recipes/nda-triage-workflow.md b/legal-ops/workflow-recipes/nda-triage-workflow.md index 3a5569f..d49b9cf 100644 --- a/legal-ops/workflow-recipes/nda-triage-workflow.md +++ b/legal-ops/workflow-recipes/nda-triage-workflow.md @@ -113,10 +113,10 @@ Tier 3: Send to GC with full summary; SLA: 5 days ## Required Skill Files -| Skill File | Purpose | -| --------------------- | --------------------------------------- | -| `nda-triage` | Three-tier classification and RED flags | -| `legal-global-router` | Jurisdiction identification | -| Jurisdiction overlays | Governing law considerations | +| Skill File | Purpose | +| ----------------------------- | --------------------------------------- | +| Anthropic's `triage-nda` (L1) | Three-tier classification and RED flags | +| `legal-global-router` | Jurisdiction identification | +| Jurisdiction overlays | Governing law considerations | ALL OUTPUTS REQUIRE REVIEW BY LICENSED ATTORNEY