Agent skill

Self Improving Legal

by aAAaqwq in aAAaqwq/AGI-Super-Team

Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement.

MITAuto-check passedLegal & Compliance

Install Self Improving Legal

skills CLI
$ npx skills add aAAaqwq/AGI-Super-Team --skill self-improving-legal -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aAAaqwq/AGI-Super-Team self-improving-legal --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aAAaqwq/AGI-Super-Team.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/self-improving-legal .claude/skills/self-improving-legal && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
self-improving-legal
GitHub stars
105
Token cost
~6.7k tokens
SKILL.md length
2,234 words
Files
16 (incl. scripts, references, assets)
Skills in repo
167
Repo updated
First seen
Licence
MIT

At a glance

Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement.

  • Works in 3 steps: Log to .learnings/LEGAL_ISSUES.md,… → NEVER log privileged communications,… → Review and promote broadly applicable…
  • An unfavorable clause is accepted
  • SKILL.md covers CRITICAL: Privilege &…, First-Use Initialisation, Quick Reference and OpenClaw Setup (Recommended), plus 10 more sections
  • Runs Shell, JavaScript and TypeScript scripts from its folder; calls git; reaches github.com

What it does

Self Improving Legal is an agent skill from aAAaqwq/AGI-Super-Team. 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…

Its SKILL.md is about 6.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts, reference files and assets (for example `.clawhub/origin.json`, `_meta.json` and `assets/ERRORS.md`).

It sits in Legal & Compliance, covering Legal research. The repository describes itself as: An installable, cross-framework AI organization: C-suite agents, expert subagents, curated skills, independent review, and one-command setup across 18 AI client/runtime adapters. The licence is MIT.

When your agent uses it

  • An unfavorable clause is accepted
  • Slips through review
  • A compliance deadline is missed
  • A new regulation impacts the organization

Example prompts

  • “Use the self-improving-legal skill to capture clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and…”
  • “/self-improving-legal”

Requirements

  • Node.js
  • A Bash shell

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Log to .learnings/LEGAL_ISSUES.md, LEARNINGS.md, or FEATURE_REQUESTS.md
  2. NEVER log privileged communications, case strategy, or settlement terms
  3. Review and promote broadly applicable findings to

What it can do on your machine

Read from SKILL.md and the folder at commit 7cefd81. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell, JavaScript and TypeScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Self Improving Legal loads about 6.7k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 144 tokens; SKILL.md has 2,234 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~144
When it runs · the whole SKILL.md, loaded when a task matches
~6.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aAAaqwq/AGI-Super-Team at commit 7cefd81, republished under its MIT licence (© aAAaqwq). 2,234 words, ~6,708 tokens.

Download SKILL.mdSave it as .claude/skills/self-improving-legal/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
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.

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 InformationAcceptable 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.

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_governance\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/LEGAL_ISSUES.md ] || printf "# Legal Issues Log\n\nContract disputes, compliance failures, regulatory impacts, and litigation matters.\n\n---\n" > .learnings/LEGAL_ISSUES.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Legal Operations Feature Requests\n\nLegal technology, automation, and process improvement requests.\n\n---\n" > .learnings/FEATURE_REQUESTS.md

Never overwrite existing files. This is a no-op if .learnings/ is already initialised.

Do not log privileged communications, specific case strategy, or confidential settlement terms. Abstract all entries to process-level lessons.

If you want automatic reminders, use the opt-in hook workflow described in Hook Integration.

Quick Reference

SituationAction
Unfavorable clause accepted in contractLog to .learnings/LEARNINGS.md with category clause_risk
Compliance deadline missed or approachingLog to .learnings/LEGAL_ISSUES.md with category compliance_gap
New regulation impacts the organizationLog to .learnings/LEARNINGS.md with category regulatory_change
Contract unsigned past SLALog to .learnings/LEGAL_ISSUES.md with category contract_deviation
IP infringement notice receivedLog to .learnings/LEGAL_ISSUES.md with category litigation_exposure
New case law in relevant jurisdictionLog to .learnings/LEARNINGS.md with category precedent_shift
Data subject access request reveals gapsLog to .learnings/LEARNINGS.md with category compliance_gap
Vendor changed terms without flaggingLog to .learnings/LEGAL_ISSUES.md with category contract_deviation
Regulatory filing deadline within 30 daysLog to .learnings/LEGAL_ISSUES.md with priority high
Contract redline rejected 3+ timesLog to .learnings/LEARNINGS.md with category clause_risk
Similar to existing entryLink with **See Also**, consider priority bump
Broadly applicable legal patternPromote to clause library, compliance checklist, or playbook
Proven compliance workflowPromote to AGENTS.md (OpenClaw workspace)
Legal tool configurationPromote to TOOLS.md (OpenClaw workspace)
Legal operations principlesPromote to SOUL.md (OpenClaw workspace)

OpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.

Installation

Via ClawdHub (recommended):

bash
clawdhub install self-improving-legal

Manual:

bash
git clone https://github.com/jose-compu/self-improving-legal.git ~/.openclaw/skills/self-improving-legal
Workspace Structure

OpenClaw injects these files into every session:

~/.openclaw/workspace/
├── AGENTS.md          # Legal workflows, contract review delegation
├── SOUL.md            # Legal principles, privilege protection, confidentiality
├── TOOLS.md           # Legal tool capabilities, CLM configs, e-discovery
├── MEMORY.md          # Long-term memory (main session only)
├── memory/            # Daily memory files
│   └── YYYY-MM-DD.md
└── .learnings/        # This skill's log files
    ├── LEARNINGS.md
    ├── LEGAL_ISSUES.md
    └── FEATURE_REQUESTS.md
Create Learning Files
bash
mkdir -p ~/.openclaw/workspace/.learnings

Then create the log files (or copy from assets/):

  • LEARNINGS.md — clause risks, compliance gaps, regulatory changes, precedent shifts
  • LEGAL_ISSUES.md — contract disputes, compliance failures, litigation matters
  • FEATURE_REQUESTS.md — legal technology and automation requests
Promotion Targets

When legal learnings prove broadly applicable, promote them:

Learning TypePromote ToExample
Clause patternsClause library"Always cap indemnity at 2x annual contract value"
Compliance requirementsCompliance checklist"CCPA deletion must cover backup systems within 90 days"
Regulatory trackingRegulatory tracker"EU AI Act model documentation deadline Q1 2026"
Contract negotiation patternsContract playbook"Vendor payment term changes require VP approval"
Risk patternsRisk register"Unlimited liability clauses in SaaS agreements"
Legal operations workflowsAGENTS.md"Route IP matters to patent counsel within 48 hours"
Optional: Enable Hook

For automatic reminders at session start:

bash
cp -r hooks/openclaw ~/.openclaw/hooks/self-improving-legal
openclaw hooks enable self-improving-legal

See references/openclaw-integration.md for complete details.


Generic Setup (Other Agents)

For Claude Code, Codex, Copilot, or other agents, create .learnings/ in the project or workspace root:

bash
mkdir -p .learnings

Create the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.

Add reference to agent files

Add to AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md:

When legal issues or findings occur:

  1. Log to .learnings/LEGAL_ISSUES.md, LEARNINGS.md, or FEATURE_REQUESTS.md
  2. NEVER log privileged communications, case strategy, or settlement terms
  3. Review and promote broadly applicable findings to:
    • Clause libraries — reusable clause language and fallback positions
    • Compliance checklists — regulatory requirement tracking
    • Contract playbooks — negotiation patterns and escalation guides
    • Risk registers — recurring risk categories and mitigation plans

Logging Format

Learning Entry [LRN-YYYYMMDD-XXX]

Append to .learnings/LEARNINGS.md:

markdown
## [LRN-YYYYMMDD-XXX] category

**Logged**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: contracts | compliance | litigation | intellectual_property | privacy | regulatory | corporate_governance

### Summary
One-line description of the legal insight or finding

### Details
Full context: what clause, regulation, or precedent was involved, why it matters,
what the correct approach or fallback position is. NEVER include privileged
attorney-client communications or confidential settlement terms.

### Recommended Action
Specific clause revision, compliance step, filing, or process change

### Metadata
- Source: contract_review | regulatory_update | case_law | audit | negotiation | litigation
- Jurisdiction: US-Federal | US-CA | EU | UK | other
- Related Files: path/to/contract.docx, path/to/policy.md
- Tags: tag1, tag2
- Regulation: GDPR | CCPA | SOX | HIPAA | EU-AI-Act (if applicable)
- See Also: LRN-20260110-001 (if related to existing entry)
- Pattern-Key: clause.indemnity_cap | comply.ccpa_deletion (optional)
- Recurrence-Count: 1 (optional)
- First-Seen: 2026-01-15 (optional)
- Last-Seen: 2026-01-15 (optional)

---

Categories for learnings:

CategoryUse When
clause_riskUnfavorable or missing clause identified in contract review
compliance_gapRegulatory requirement not met or process gap discovered
precedent_shiftNew case law changes interpretation of existing obligations
contract_deviationContract terms deviate from standard playbook without approval
regulatory_changeNew regulation or amendment requires operational adjustment
litigation_exposurePattern or practice that increases litigation risk
Legal Issue Entry [LEG-YYYYMMDD-XXX]

Append to .learnings/LEGAL_ISSUES.md:

markdown
## [LEG-YYYYMMDD-XXX] issue_type

**Logged**: ISO-8601 timestamp
**Priority**: critical | high | medium | low
**Status**: pending
**Area**: contracts | compliance | litigation | intellectual_property | privacy | regulatory | corporate_governance
**Severity**: critical | high | medium | low

### Summary
Brief description of the legal issue

### Issue Details
Context of the legal issue: what happened, what contract or regulation is involved,
what the exposure or risk is. Abstract to process-level lessons — do NOT include
privileged communications, specific case strategy, or confidential terms.

### Impact Assessment
- Affected contracts/matters
- Financial exposure estimate (range, not exact if confidential)
- Regulatory risk (enforcement action, fine range, reputational)
- Deadline or statute of limitations implications

### Recommended Action
- Immediate steps to mitigate
- Escalation path (in-house counsel, outside counsel, board)
- Long-term process improvement

### Timeline
- **Identified**: ISO-8601
- **Escalated**: ISO-8601 (if applicable)
- **Resolved**: ISO-8601 (if applicable)

### Metadata
- Trigger: contract_redline | regulatory_filing | case_law | audit_finding | infringement_notice | dsar
- Jurisdiction: US-Federal | US-CA | EU | UK | other
- Counterparty: [generalized role, e.g., "SaaS vendor", "enterprise customer"]
- Related Files: path/to/document
- See Also: LEG-20260110-001 (if related)

---
Feature Request Entry [FEAT-YYYYMMDD-XXX]

Append to .learnings/FEATURE_REQUESTS.md:

markdown
## [FEAT-YYYYMMDD-XXX] capability_name

**Logged**: ISO-8601 timestamp
**Priority**: medium
**Status**: pending
**Area**: contracts | compliance | litigation | intellectual_property | privacy | regulatory | corporate_governance

### Requested Capability
What legal operations tool, automation, or capability is needed

### Business Justification
Why it's needed — what risk it mitigates, what workflow it improves, what compliance
requirement it satisfies

### Complexity Estimate
simple | medium | complex

### Suggested Implementation
How this could be built: CLM integration, regulatory API, compliance dashboard, clause library

### Metadata
- Frequency: first_time | recurring
- Related Features: existing_tool_or_feature
- Compliance: GDPR | CCPA | SOX | HIPAA (if applicable)

---

ID Generation

Format: TYPE-YYYYMMDD-XXX

  • TYPE: LRN (learning), LEG (legal issue), FEAT (feature request)
  • YYYYMMDD: Current date
  • XXX: Sequential number or random 3 chars (e.g., 001, A7B)

Examples: LRN-20260412-001, LEG-20260412-A3F, FEAT-20260412-002

Resolving Entries

When an issue is resolved, update the entry:

  1. Change **Status**: pending → **Status**: resolved
  2. Add resolution block after Metadata:
markdown
### Resolution
- **Resolved**: 2026-01-16T09:00:00Z
- **Action Taken**: Brief description of resolution (abstracted, no privileged details)
- **Clause/Policy Updated**: Reference to updated clause library or compliance checklist
- **Verified By**: legal review | compliance audit | outside counsel

Other status values:

  • in_progress — Actively being negotiated, reviewed, or remediated
  • wont_fix — Risk accepted with documented justification and approver
  • promoted — Elevated to clause library, compliance checklist, or contract playbook
  • promoted_to_skill — Extracted as a reusable skill

Detection Triggers

Automatically log when you encounter:

Contract Review Signals (→ learning or legal issue):

  • Contract redline rejected 3+ times on the same clause
  • Unlimited liability or uncapped indemnity accepted
  • Non-standard payment terms without VP approval
  • Auto-renewal clause without termination notice window
  • Assignment clause missing change-of-control protections
  • Most-favored-nation clause absent from strategic vendor agreement

Regulatory Signals (→ learning or legal issue):

  • New regulation published affecting the organization's industry
  • Regulatory filing deadline within 30 days
  • Amendment to existing regulation (GDPR, CCPA, SOX, HIPAA)
  • Enforcement action against peer company in same sector
  • Cross-border data transfer mechanism invalidated

Litigation Signals (→ legal issue):

  • IP infringement notice or cease-and-desist received
  • Data subject access request (DSAR) received
  • Subpoena or litigation hold notice
  • Non-compete or non-solicitation dispute
  • Breach of contract claim or demand letter

Compliance Signals (→ learning):

  • GDPR/CCPA audit finding
  • SOX control deficiency
  • Internal audit exception
  • Third-party vendor compliance gap
  • Data retention policy violation
  • Missing consent mechanism for data processing

Precedent Signals (→ learning):

  • Court ruling changes interpretation of standard clause
  • Regulatory guidance document issued
  • Industry association publishes new model terms
  • Arbitration award sets new benchmark in relevant area

Priority Guidelines

PriorityWhen to UseLegal Examples
criticalActive litigation, regulatory enforcement, material breachInjunction filed, regulatory investigation opened, data breach notification deadline
highCompliance deadline approaching, material contract risk, IP claimFiling due in 30 days, unlimited liability accepted, patent infringement notice
mediumProcess improvement, clause optimization, template updateClause library gap, negotiation playbook outdated, compliance checklist incomplete
lowDocumentation, minor template revision, informationalPrecedent noted for future reference, template formatting, policy language cleanup

Area Tags

Use to filter learnings by legal domain:

AreaScope
contractsContract drafting, review, negotiation, CLM, clause libraries
complianceRegulatory compliance, audits, certifications, internal controls
litigationDisputes, claims, discovery, settlement, litigation holds
intellectual_propertyPatents, trademarks, copyrights, trade secrets, licensing
privacyData protection, GDPR, CCPA, DSAR, consent management
regulatoryRegulatory filings, government relations, enforcement actions
corporate_governanceBoard matters, corporate records, entity management, fiduciary duties

When a learning is broadly applicable (not a one-off matter), promote it to permanent legal operations standards.

When to Promote
  • Clause risk recurs across multiple contract negotiations
  • Compliance gap applies to the entire regulatory program
  • Precedent shift affects standard contract positions
  • Contract negotiation pattern should be institutionalized
  • Regulatory change requires ongoing monitoring
Promotion Targets
TargetWhat Belongs There
Clause libraryStandard clauses, fallback positions, red/yellow/green markups
Compliance checklistRegulatory requirements, audit preparation, filing deadlines
Regulatory trackerNew regulations, amendments, enforcement trends
Contract playbookNegotiation positions, escalation triggers, approval thresholds
Risk registerRecurring risk categories, exposure estimates, mitigation plans
CLAUDE.mdLegal operations conventions for AI agents
AGENTS.mdLegal workflows, matter routing, delegation patterns
How to Promote
  1. Distill the learning into a concise clause, checklist item, or playbook entry
  2. Add to appropriate target (clause library, compliance checklist, playbook)
  3. Update original entry:
    • Change **Status**: pending → **Status**: promoted
    • Add **Promoted**: clause_library (or compliance_checklist, contract_playbook, risk_register)
Show full SKILL.md (900 more words)Show less
Promotion Examples

Learning → Clause library entry:

Unlimited liability in SaaS renewal (3 instances in quarter) → Standard clause: "Cap at 12 months fees, fallback 2x annual value, VP Legal approval for exceptions."

Learning → Compliance checklist item:

CCPA deletion not covering backups → Checklist: "Primary DB 30 days, backups 90 days, confirmation within 45-day window, quarterly audit."

Recurring Pattern Detection

If logging something similar to an existing entry:

  1. Search first: grep -r "keyword" .learnings/
  2. Link entries: Add **See Also**: LEG-20260110-001 in Metadata
  3. Bump priority if issue keeps recurring
  4. Consider systemic fix: Recurring legal issues often indicate:
    • Missing clause library entry (→ add standard clause with fallback)
    • Missing compliance control (→ add to compliance checklist)
    • Outdated contract playbook (→ update negotiation positions)
    • Training gap (→ schedule legal operations training)

Periodic Review

Review .learnings/ at natural breakpoints:

When to Review
  • Before major contract negotiations
  • Before compliance audit deadlines
  • After regulatory changes affecting the organization
  • After litigation matters are resolved
  • Quarterly during active legal operations
  • Before board meetings or governance reviews
Quick Status Check
bash
grep -h "Status\*\*: pending" .learnings/*.md | wc -l
grep -B5 "Priority\*\*: critical\|Priority\*\*: high" .learnings/*.md | grep "^## \["
grep -l "Area\*\*: contracts" .learnings/*.md
grep -h "Regulation:" .learnings/*.md | sort -u
Review Actions
  • Resolve closed legal matters and promote recurring clause risks
  • Update compliance checklists for new regulations
  • Link related entries and archive resolved litigation matters

Hook Integration

Enable automatic reminders through agent hooks. This is opt-in.

Quick Setup (Claude Code / Codex)

Create .claude/settings.json in your project:

json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improving-legal/scripts/activator.sh"
      }]
    }]
  }
}

This injects a legal-focused learning evaluation reminder after each prompt (~80-120 tokens overhead).

json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improving-legal/scripts/activator.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improving-legal/scripts/error-detector.sh"
      }]
    }]
  }
}

Enable PostToolUse only if you want the hook to inspect command output for legal-relevant patterns such as breach, violation, non-compliance, litigation, and regulatory keywords.

Available Hook Scripts
ScriptHook TypePurpose
scripts/activator.shUserPromptSubmitReminds to evaluate legal findings after tasks
scripts/error-detector.shPostToolUse (Bash)Triggers on legal-relevant patterns in output

See references/hooks-setup.md for detailed configuration and troubleshooting.

Automatic Skill Extraction

When a legal learning is valuable enough to become a reusable skill, extract it.

Skill Extraction Criteria
CriterionDescription
RecurringSame clause risk or compliance gap in 2+ contract types or regulatory areas
VerifiedStatus is resolved with confirmed process improvement
Non-obviousRequired legal analysis or cross-jurisdictional research
Broadly applicableNot matter-specific; useful across contract types or regulatory programs
User-flaggedUser says "save this as a legal skill" or similar
Extraction Workflow
  1. Identify candidate: Learning meets extraction criteria
  2. Run helper (or create manually):
    bash
    ./skills/self-improving-legal/scripts/extract-skill.sh skill-name --dry-run
    ./skills/self-improving-legal/scripts/extract-skill.sh skill-name
  3. Customize SKILL.md: Fill in template with legal-specific content
  4. Update learning: Set status to promoted_to_skill, add Skill-Path
  5. Verify: Ensure NO privileged communications, case strategy, or confidential terms leaked into the skill
Extraction Detection Triggers

In conversation:

  • "This clause keeps causing problems"
  • "Save this compliance process as a skill"
  • "We see this regulatory issue every quarter"
  • "Add this to our contract playbook"

In entries:

  • Multiple See Also links (recurring clause risk pattern)
  • High priority + resolved status
  • Category: compliance_gap with reusable remediation process
  • Regulatory change with broad organizational impact

Multi-Agent Support

AgentActivationDetection
Claude CodeHooks (UserPromptSubmit, PostToolUse)Automatic via hook scripts
Codex CLIHooks (same pattern)Automatic via hook scripts
GitHub CopilotManual (.github/copilot-instructions.md)Manual review
OpenClawWorkspace injection + inter-agent messagingVia session tools

Regardless of agent, apply legal self-improvement when you:

  1. Review a contract — identify clause risks, deviations, missing protections
  2. Encounter a compliance gap — regulatory requirement not met, audit finding
  3. Track a regulatory change — new law, amendment, or enforcement action
  4. Handle litigation matters — claims, disputes, discovery, holds
  5. Process IP issues — infringement notices, licensing gaps, trade secret exposure
  6. Manage privacy requests — DSARs, consent gaps, cross-border transfer issues
  1. Protect privilege — never log attorney-client communications or work product
  2. Abstract to process — capture the lesson, not the confidential details
  3. Track deadlines — regulatory filings, statutes of limitations, response windows
  4. Version clause libraries — track which clause version was used in which agreement
  5. Audit compliance quarterly — systematic review of regulatory obligations
  6. Maintain jurisdiction tags — legal obligations vary by jurisdiction
  7. Link related matters — contract issues may relate to compliance or litigation
  8. Escalate promptly — critical items require immediate counsel notification
  9. Document approval chains — record who approved exceptions to standard terms
  10. Review before negotiations — check .learnings/ for past issues with similar clauses or counterparties

Gitignore Options

Keep learnings local (recommended for legal):

gitignore
.learnings/

Legal findings may contain sensitive context even when abstracted. Default to local-only. Track in repo only if all entries are confirmed free of privileged information and confidential terms.

Hybrid (track templates, ignore entries): add .learnings/*.md and !.learnings/.gitkeep to .gitignore.

Stackability Contract (Standalone + Multi-Skill)

This skill is standalone-compatible and stackable with other self-improving skills.

  • Namespace for this skill: .learnings/legal/
  • Keep current standalone behavior if you prefer flat files.
  • Optional shared index for all skills: .learnings/INDEX.md
Required Metadata

Every new entry must include:

markdown
**Skill**: legal
Hook Arbitration (when 2+ skills are enabled)
  • Use one dispatcher hook as the single entrypoint.
  • Dispatcher responsibilities: route by matcher, dedupe repeated events, and rate-limit reminders.
  • Suggested defaults: dedupe key = event + matcher + file + 5m_window; max 1 reminder per skill every 5 minutes.

Only trigger this skill automatically for legal signals such as:

  • contract clause|liability|indemnity|compliance obligation
  • jurisdiction|regulatory update|legal risk|counsel escalation
  • explicit legal intent in user prompt
Cross-Skill Precedence

When guidance conflicts, apply:

  1. security
  2. engineering
  3. coding
  4. ai
  5. user-explicit domain skill
  6. meta as tie-breaker
Ownership Rules
  • This skill writes only to .learnings/legal/ in stackable mode.
  • It may read other skill folders for cross-linking, but should not rewrite their entries.

© aAAaqwq, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 15 other files (scripts, references, assets) in skills/self-improving-legal of aAAaqwq/AGI-Super-Team.

  • SKILL.md
  • .clawhub/origin.json
  • _meta.json
  • assets/ERRORS.md
  • assets/FEATURE_REQUESTS.md
  • assets/LEARNINGS.md
  • assets/SKILL-TEMPLATE.md
  • hooks/openclaw/HOOK.md
  • hooks/openclaw/handler.js
  • hooks/openclaw/handler.ts
  • references/examples.md
  • references/hooks-setup.md
  • references/openclaw-integration.md
  • scripts/activator.sh
  • scripts/error-detector.sh
  • … and 1 more

Open the folder on GitHubat commit 7cefd81

Compare with similar skills

Self Improving Legal next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Self Improving Legal compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Self Improving Legal this skillaAAaqwq/AGI-Super-Team105—~6.7kAutomated safety check: PassMIT
Tw Legal RAGaa0101181514/tw-legal-rag328—~580Automated safety check: PassCustom licence
Design Award SearchSeanJ1ang/design-judge-skills712—~3kAutomated safety check: PassApache-2.0
China Lawyer AnalystCSlawyer1985/china-lawyer-analyst196—~3.3kAutomated safety check: PassNone
Billing And Litigation BudgetTHUYRan/Legal-Skills-Chinese874—~5kAutomated safety check: PassNone
Legal Issue ResearchGolden2002/legal-research-skill156—~6.8kAutomated safety check: PassMIT

Similar skills

  • Tw Legal RAG

    aa0101181514/tw-legal-rag

    Retrieve real Taiwan court judgments with verifiable citations before answering any question about Taiwan law or case law.

    328 GitHub stars~580 tokensUpdated today
    Legal & ComplianceAuto-check passed
  • Design Award Search

    SeanJ1ang/design-judge-skills

    Find and verify award-winning designs in the same or adjacent functional category through eight explicit relevance dimensions: problem and user, core function, sensing technology, intervention…

    712 GitHub stars~3k tokensUpdated 1 mo ago
    Legal & ComplianceAuto-check passed
  • China Lawyer Analyst

    CSlawyer1985/china-lawyer-analyst

    通过中国法律视角分析事件,运用成文法解释、指导案例参照、请求权基础分析等方法, 理解权利义务、评估责任风险、识别法律依据并推荐合规策略。

    196 GitHub stars~3.3k tokensUpdated 8 mo ago
    Legal & ComplianceAuto-check passed
  • Billing And Litigation Budget

    THUYRan/Legal-Skills-Chinese

    A skill your agent uses when the user needs to track or manage attorney hours, expert fees, and investigation costs; control litigation spend; or prepare timesheets or expense statements for clients.

    874 GitHub stars~5k tokensUpdated 1 mo ago
    Legal & ComplianceAuto-check passed
  • Legal Issue Research

    Golden2002/legal-research-skill

    中国法律全领域系统性检索专家. An agent skill from Golden2002/legal-research-skill.

    156 GitHub stars~6.8k tokensUpdated 1 mo ago
    Legal & ComplianceAuto-check passed
  • Tax Law Research

    Serein-81/financial_rag

    Searches current Chinese tax laws, rates and policy changes with Tavily web search, prioritizing government sources and flagging outdated or conflicting results.

    148 GitHub stars~997 tokensUpdated 4 mo ago
    Legal & ComplianceAuto-check: notes

More from aAAaqwq/AGI-Super-Team

All 167 skills in this repo
  • Content Creator

    aAAaqwq/AGI-Super-Team

    Create SEO-optimized marketing content with consistent brand voice.

    105 GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • Financial Calculator

    aAAaqwq/AGI-Super-Team

    Advanced financial calculator with future value tables, present value, discount calculations, markup pricing, and compound interest.

    105 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Bankr Signals

    aAAaqwq/AGI-Super-Team

    Transaction-verified trading signals on Base blockchain. An agent skill from aAAaqwq/AGI-Super-Team.

    105 GitHub starsUsed in 2 repos~3.3k tokens
    Auto-check passed
  • Erc 8004

    aAAaqwq/AGI-Super-Team

    Register AI agents on Ethereum mainnet using ERC-8004 (Trustless Agents).

    105 GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Frontend Design Ultimate

    aAAaqwq/AGI-Super-Team

    Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed.

    105 GitHub starsUsed in 2 repos~2.7k tokens
    Auto-check passed
  • Zsxq Smart Publish

    aAAaqwq/AGI-Super-Team

    Publish and manage content on 知识星球 (zsxq.com). An agent skill from aAAaqwq/AGI-Super-Team.

    105 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed

Questions about Self Improving Legal

What does Self Improving Legal do?

Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement. Self Improving Legal is an agent skill from aAAaqwq/AGI-Super-Team. Captures clause risks, compliance gaps, precedent shifts, contract deviations, regulatory changes, and litigation exposure to enable continuous legal operations improvement.

When should I use Self Improving Legal?

Self Improving Legal fits situations like: an unfavorable clause is accepted; slips through review; A compliance deadline is missed; A new regulation impacts the organization.

How do I install Self Improving Legal in Claude Code?

Run `npx skills add aAAaqwq/AGI-Super-Team --skill self-improving-legal -a claude-code`. Or copy the skill folder (skills/self-improving-legal in aAAaqwq/AGI-Super-Team) into .claude/skills/self-improving-legal in your project. Claude Code loads it when a task matches its description.

How do I install Self Improving Legal in Codex?

Run `npx skills add aAAaqwq/AGI-Super-Team --skill self-improving-legal -a codex`. Or copy the skill folder (skills/self-improving-legal in aAAaqwq/AGI-Super-Team) into .agents/skills/self-improving-legal in your project. Codex loads it when a task matches its description.

Can I use Self Improving Legal in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aAAaqwq/AGI-Super-Team --skill self-improving-legal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/self-improving-legal, .gemini/skills/self-improving-legal, .github/skills/self-improving-legal and .opencode/skills/self-improving-legal in your project.

What does Self Improving Legal need to run?

Going by SKILL.md and its folder, Self Improving Legal needs a shell, JavaScript and TypeScript for the scripts in its folder and the command-line tools its instructions call (git). Our summary lists: Node.js; A Bash shell.

Does Self Improving Legal access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Self Improving Legal safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Self Improving Legal use?

Self Improving Legal is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Self Improving Legal use?

About 6.7k tokens (SKILL.md is roughly 27k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.2k tokens, read only when the agent opens those files.

What are the alternatives to Self Improving Legal?

Skills that share tags, products or a category with Self Improving Legal: Tw Legal RAG (aa0101181514/tw-legal-rag, 328 stars), Design Award Search (SeanJ1ang/design-judge-skills, 712 stars), China Lawyer Analyst (CSlawyer1985/china-lawyer-analyst, 196 stars) and Billing And Litigation Budget (THUYRan/Legal-Skills-Chinese, 874 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Self Improving Legal?

aAAaqwq (a GitHub user) maintains it in aAAaqwq/AGI-Super-Team, which has 105 GitHub stars. The repository holds 167 skills in this directory. The repository was last updated on October 8, 2026.

Source: aAAaqwq/AGI-Super-Team on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.