Xpersona
S

self-improving-legal

CLAWHUB · Unverified

Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement. Use when: (1) An unfavorable clause is accepted or slips through review, (2) A compliance deadline is missed or approaching, (3) A new regulation impacts the organization, (4) A contract remains unsigned past SLA, (5) An IP infringement notice is received, (6) New case law changes interpretation in a relevant jurisdiction, (7) A data subject access request reveals process gaps. Skill: self-improving-legal Owner: jose-compu Summary: Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement. Use when: (1) An unfavorable clause is accepted or slips through review, (2) A compliance deadline is missed or approaching, (3) A new regulation impacts the organization, (4) A contract rema

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-legal
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-legal/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,017 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: self-improving-legal
description: "Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement. Use when: (1) An unfavorable clause is accepted or slips through review, (2) A compliance deadline is missed or approaching, (3) A new regulation impacts the organization, (4) A contract remains unsigned past SLA, (5) An IP infringement notice is received, (6) New case law changes interpretation in a relevant jurisdiction, (7) A data subject access request reveals process gaps."
---

# Self-Improving Legal Skill

Log legal learnings, compliance findings, contract issues, and regulatory changes to markdown files for continuous improvement. Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure. Important learnings get promoted to clause libraries, compliance checklists, regulatory trackers, contract playbooks, or risk registers.

## CRITICAL: Privilege & Confidentiality Protection

**NEVER log privileged attorney-client communications, specific case strategy, confidential settlement terms, or litigation work product in any learning or issue entry.** Always abstract findings to process-level lessons. Use generalized descriptions:

| Protected Information | Acceptable Abstraction |
|----------------------|----------------------|
| Attorney-client advice on specific matter | "Outside counsel recommended clause revision for indemnity cap" |
| Settlement amount or terms | "Settlement reached; update playbook to flag similar exposure earlier" |
| Litigation strategy details | "Discovery phase revealed need for better document retention process" |
| Privileged legal memoranda | "Internal review identified gap in force majeure clause coverage" |
| Specific opposing party positions | "Counterparty negotiation pattern: late-stage payment term changes" |
| Confidential deal terms | "Deal structure required non-standard IP assignment clause" |

When in doubt, omit the specific detail and log only the process improvement lesson. Privilege waiver through careless documentation is irreversible.

**Cross-session sharing**: do not forward legal findings to another session unless the user explicitly consents to that specific send. A trusted environment is not a substitute for consent.

## First-Use Initialisation

Before logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:

```bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Legal Learnings\n\nClause risks, compliance gaps, precedent shifts, regulatory changes, and legal operations insights.\n\n**Categories**: clause_risk | compliance_gap | precedent_shift | contract_deviation | regulatory_change | litigation_exposure\n**Areas**: contracts | compliance | litigation | intellectual_property | privacy | regulatory | corporate_governanc

_meta.json

{
  "ownerId": "kn78jat5kd20evgyxzp9dmryax84qap0",
  "slug": "self-improving-legal",
  "version": "1.1.2",
  "publishedAt": 1790688409560
}

references/examples.md

# Legal Entry Examples

Concrete examples of well-formatted legal entries with all fields.

## Learning: Clause Risk (Unlimited Liability)

```markdown
## [LRN-20260412-001] clause_risk

**Logged**: 2026-04-12T09:30:00Z
**Priority**: high
**Status**: pending
**Area**: contracts

### Summary
Unlimited liability clause slipped through standard review in SaaS vendor renewal agreement

### Details
During quarterly contract audit, discovered that a SaaS vendor renewal contained an
unlimited liability clause that bypassed the standard review checklist. The clause
was buried in a supplemental terms addendum that was not flagged during the initial
redline cycle. The vendor had changed the liability section from the original MSA
which capped liability at 12 months of fees.

This is the third instance in the past quarter where a vendor modified liability
terms during renewal without explicit flagging. The current review process does
not include a mandatory diff against the original MSA terms.

### Recommended Action
1. Add mandatory MSA-to-renewal diff check to contract review checklist
2. Flag any liability section changes as "must review" in CLM workflow
3. Update clause library with standard fallback: cap at 2x annual contract value
4. Require VP Legal sign-off for any liability cap above fallback position

### Metadata
- Source: contract_review
- Jurisdiction: US-Federal
- Related Files: contracts/vendor-renewals/2026-Q1/
- Tags: liability, unlimited-liability, saas, vendor, renewal
- Regulation: N/A
- See Also: LRN-20260215-003, LRN-20260118-001
- Pattern-Key: clause.unlimited_liability
- Recurrence-Count: 3
- First-Seen: 2026-01-18
- Last-Seen: 2026-04-12

---
```

## Learning: Compliance Gap (CCPA Backup Deletion)

```markdown
## [LRN-20260412-002] compliance_gap

**Logged**: 2026-04-12T11:00:00Z
**Priority**: high
**Status**: in_progress
**Area**: privacy

### Summary
CCPA data deletion process not covering backup systems, leaving personal information in backups beyond the 45-day response window

### Details
A data subject access request (DSAR) audit revealed that while primary database
records are deleted within the 45-day CCPA response window, backup systems retain
personal information for up to 180 days due to the standard backup retention
policy. Engineering was unaware that CCPA deletion obligations extend to backup
systems and that a reasonable timeline for backup purging must be communicated
to the data subject.

The gap affects all California residents whose data has been subject to deletion
requests since the backup retention policy was last updated (January 2025).

### Recommended Action
1. Update backup retention policy to include CCPA deletion carve-out
2. Implement backup deletion queue that triggers within 90 days of primary deletion
3. Update DSAR response template to disclose backup retention timeline
4. Train engineering team on backup obligations under CCPA
5. Add quarterly audit of backup deletion compliance

### Metadata
- Sourc

references/hooks-setup.md

# Legal Hook Setup Guide

Configure automatic legal self-improvement triggers for AI coding agents.

## Overview

Hooks enable proactive legal finding capture by injecting reminders at key moments:
- **UserPromptSubmit**: Reminder after matching prompts to evaluate legal findings
- **PostToolUse (Bash)**: Detection when legal-relevant patterns appear in command output

## Claude Code Setup

### Option 1: Project-Level Configuration

Create `.claude/settings.json` in your project root:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "contract|compliance|regulation|litigation|GDPR|CCPA|clause|indemnity|liability",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-legal/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Option 2: User-Level Configuration (discouraged)

Do **not** install this hook globally. User-level hooks persist across all repositories and sessions. Keep hooks project-scoped. The example below is shown only so you can recognize and remove it:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "contract|compliance|regulation|litigation|GDPR|CCPA|clause|indemnity|liability",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/skills/self-improving-legal/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Minimal Setup (Activator Only)

For lower overhead, use only the UserPromptSubmit hook:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "contract|compliance|regulation|litigation|GDPR|CCPA|clause|indemnity|liability",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-legal/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## Codex CLI Setup

Codex uses the same hook system. Create `.codex/settings.json`:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "contract|compliance|regulation|litigation|GDPR|CCPA|clause|indemnity|liability",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-legal/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## GitHub Copilot Setup

Copilot doesn't support hooks directly. Add guidance to `.github/copilot-instructions.md`:

```markdown
## Legal Self-Improvement

After completing tasks that involved:
- Reviewing or drafting contract language
- Working with compliance requirements or regulatory filings
- Handling privacy-related code (consent, data deletion, DSAR)
- Addressing intellectual property concerns
- Processing litigation-related documents

Consider logging the finding to `.learnings/` using the legal self-improvement skill format.

CRITICAL: NEVER include privileged attorney-client communications, specific case
strategy, or confidential settlement terms in learning entries.
Always abstra

references/openclaw-integration.md

# OpenClaw Legal Integration

Complete setup and usage guide for integrating the legal self-improvement skill with OpenClaw.

## Overview

OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Legal context is injected from workspace files at session start, and hooks trigger on lifecycle events to remind the agent about legal finding capture.

## Workspace Structure

```
~/.openclaw/
├── workspace/                   # Working directory
│   ├── AGENTS.md               # Legal workflows, contract review delegation
│   ├── SOUL.md                 # Legal principles, privilege protection
│   ├── TOOLS.md                # Legal tool configs, CLM integration
│   ├── CLAUSE_LIBRARY.md       # Standard clauses with positions and fallbacks
│   ├── COMPLIANCE.md           # Regulatory requirements and audit checklists
│   ├── PLAYBOOKS.md            # Contract negotiation and compliance playbooks
│   ├── RISK_REGISTER.md        # Recurring risk categories and mitigation plans
│   ├── MEMORY.md               # Long-term memory (main session only)
│   └── .learnings/             # Legal finding logs
│       ├── LEARNINGS.md
│       ├── LEGAL_ISSUES.md
│       └── FEATURE_REQUESTS.md
├── skills/                      # Installed skills
│   └── self-improving-legal/
│       └── SKILL.md
└── hooks/                       # Custom hooks
    └── self-improving-legal/
        ├── HOOK.md
        └── handler.ts
```

## Quick Setup

### 1. Install the Skill

```bash
clawdhub install self-improving-legal
```

Or copy manually:

```bash
cp -r self-improving-legal ~/.openclaw/skills/
```

### 2. Install the Hook (Optional)

Copy the hook to OpenClaw's hooks directory:

```bash
mkdir -p .openclaw/hooks
cp -r hooks/openclaw .openclaw/hooks/self-improving-legal
```


### 3. Create Learning Files

```bash
mkdir -p ~/.openclaw/workspace/.learnings
```

Or copy from `assets/`:

```bash
cp assets/LEARNINGS.md ~/.openclaw/workspace/.learnings/
cp assets/ERRORS.md ~/.openclaw/workspace/.learnings/LEGAL_ISSUES.md
cp assets/FEATURE_REQUESTS.md ~/.openclaw/workspace/.learnings/
```

## Injected Prompt Files

### AGENTS.md (Legal Workflows)

Purpose: Legal operations workflows and matter routing patterns.

```markdown
# Legal Agent Coordination

## Contract Review Workflow
1. Receive: Contract or amendment for review
2. Classify: Standard vs non-standard terms
3. Compare: Diff against original MSA or template
4. Flag: Deviations from clause library positions
5. Escalate: Red-line items to senior counsel
6. Document: Log clause risks to .learnings/

## Delegation Rules
- Do not spawn sub-agents or read other sessions from this skill
- Log a redacted note in this workspace only
- Do not send cross-session messages
```

### SOUL.md (Legal Principles)

Purpose: Legal operations mindset and privilege protection.

```markdown
# Legal Principles

## Core Mindset
- Protect privilege: never document attorney-client communications
- Abstract to process: capture lesso

Sponsored

Ads related to self-improving-legal and adjacent AI workflows.