Communitygithub.com

ThomasMoreAI/legal-skills-open

Compile institutional PI practice knowledge from FirmVault activity logs into a structured Obsidian wiki using Karpathy's LLM Knowledge Base architecture. Use when adding new cases, recompiling, querying, or linting the law firm wiki.

legal-skills-open 是什么?

legal-skills-open is a Claude Code agent skill that compile institutional PI practice knowledge from FirmVault activity logs into a structured Obsidian wiki using Karpathy's LLM Knowledge Base architecture. Use when adding new cases, recompiling, querying, or linting the law firm wiki.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ThomasMoreAI/legal-skills-open/tree/HEAD/us/personal-injury/skills/law-firm-wiki-compiler

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Law Firm Wiki Compiler

When to Use

  • Adding new cases or old case archives to the wiki
  • Recompiling after activity log updates
  • Querying the wiki for institutional knowledge
  • Running lint/health checks on wiki articles
  • Generating Hermes skills from wiki articles

Excel Ingestion (FileVine Activity Exports)

When Aaron sends an Excel spreadsheet of activity logs from FileVine:

Expected format

  • Sheet columns: Project Name | Note Text | Created At | (empty)
  • Project Name = "Client Name CaseType MM/DD/YYYY" (e.g., "Amy Stich WC 01/17/2024")
  • Note Text = markdown-formatted activity notes (may contain FileVine links, strikethroughs)
  • Created At = datetime

Conversion steps

  1. pip install openpyxl if needed
  2. Load with openpyxl.load_workbook(path, read_only=True)
  3. Slugify case names per FirmVault rules (lowercase, strip apostrophes/quotes, & → and, non-alnum → hyphens)
  4. Group entries by case, then by date within each case
  5. Write to FirmVault/cases/<slug>/Activity Log/<YYYY-MM-DD>.md with frontmatter:
    schema_version: 2
    date: "YYYY-MM-DD"
    category: imported
    subcategory: settlement_activity_export
    
  6. Use the subcategory: settlement_activity_export tag to identify imported-from-Excel cases later

Multiple files in one session

Aaron often sends multiple Excel files in sequence. Process each one fully (convert → batch → compile → rebuild index) before asking for the next. The converter handles deduplication automatically — if a case dir already exists, new logs append; if a log file for that date exists, it appends an "Imported Entries" section.

Sizing reference (2026-04-12 imports)

  • File 1 (settlement_1): 17,639 rows → 198 cases → 6,221 log files (13.7 MB)
  • File 2 (settlement_2): 22,182 rows → 169 cases → 7,341 log files (12.9 MB)
  • File 3 (settlement_3): 688 rows → 8 cases → 158 log files (small)
  • File 4 (closing): 9,363 rows → 125 cases → 2,924 log files
  • Conversion takes ~2 seconds per file
  • Duplicate detection: compare row count + first/last row to identify resends

Batch size decisions

  • >50 cases: 3 parallel subagents (split evenly by log count)
  • 10-50 cases: 1-2 subagents depending on log volume
  • <10 cases: Single subagent with targeted article updates only. Do NOT have it read all existing articles — point it at the 5-6 most likely articles to update. Set max_iterations=30 to avoid running out of turns on reading.

Reusable converter script

Save to /tmp/convert_excel.py, swap the path for each new file. The script:

  • Uses openpyxl (pip install if missing)
  • Slugifies per FirmVault rules
  • Groups by case → date → writes markdown with frontmatter
  • Reports new vs updated case dirs

Architecture

Karpathy's 3-layer pattern: raw sources → LLM compiler → structured wiki

Layer 1: Raw (immutable)
  cases/*/Activity Log/*.md  — 21K+ activity logs
  cases/*/*.md               — case files
  
Layer 2: Wiki (LLM-maintained)
  wiki/
    Home.md          — Obsidian dashboard
    index.md         — master catalog
    log.md           — compilation history
    concepts/*.md    — atomic knowledge articles (63 as of 2026-04-12)
    connections/*.md — cross-cutting insights (26 as of 2026-04-12)
    AGENTS.md        — compiler schema (the spec)
    SPEC.md          — architecture doc
    
Layer 3: Consumers
  Hermes semantic skills, OpenClaw agents, Aaron via Hermes

Compilation Process

Batch Processing (for bulk cases)

  1. Group cases into batches of ~80K tokens
  2. Delegate 3 batches in parallel
  3. Each subagent reads AGENTS.md, existing articles, case files + sampled logs
  4. Subagents UPDATE existing articles (evidence_count++) or CREATE new ones
  5. Do NOT let subagents rewrite index.md (race condition) — rebuild after
  6. Rebuild index.md from all articles on disk after all batches complete

Key Instructions for Compiler Subagents

  • Read AGENTS.md for full schema
  • Read ALL existing concept + connection articles before writing
  • ANONYMIZE all PII (use "Case A", "Case B", etc.)
  • UPDATE existing > CREATE new (upgrading confidence is the goal)
  • Confidence: low (<5 cases), medium (5-9), high (10+)
  • Use [[wikilinks]] between articles
  • Append to log.md, do NOT rewrite index.md

Sampling Strategy

  • Large cases (400+ logs): first 40 + last 40 chronologically
  • Medium cases (100-400): first 25 + last 25
  • Small cases (<100): first 10 + last 10, or all

Subagent Prompt Template

Law Firm Wiki compiler. Read /opt/data/FirmVault/wiki/AGENTS.md.
Read existing articles in wiki/concepts/ and wiki/connections/.
Compile cases: [LIST]. For each: read cases/<slug>/<slug>.md and
sample first N + last N activity logs. UPDATE existing articles
(increment evidence_count, upgrade confidence: 5=medium, 10=high).
CREATE new only for genuinely new patterns. ANONYMIZE PII.
Write to wiki/. Do NOT rewrite index.md. Append to wiki/log.md.

Adapt prompts to data category

Different Excel exports contain different types of data. Add a focus hint:

  • Settlement files: "Focus on: settlement patterns, negotiation tactics, treatment timelines, SOL management, adjuster behavior, lien resolution"
  • Closing files: "These are CLOSING cases -- look especially for: case closure workflows, decline reasons, final disbursement, file archival, post-closing obligations, client termination patterns"
  • Intake files: Focus on onboarding, insurance verification, initial treatment referrals This dramatically improves pattern extraction quality.

Index rebuild

Always rebuild index.md as a separate delegate_task after all compilation batches complete. Even for small batches. The subagent just needs to parse YAML frontmatter from all .md files in concepts/ + connections/ and generate the index per the schema in AGENTS.md. Takes ~60 seconds, max_iterations=15.

Obsidian Vault

The wiki/ directory IS an Obsidian vault:

  • .obsidian/ config with graph colors (blue=concepts, orange=connections)
  • Home.md as landing page
  • [[wikilinks]] use slug names (NOT path-prefixed)
  • Graph view shows article interconnections

Wikilink Rules

  • Use [[slug-name]] not [[concepts/slug-name]]
  • Obsidian resolves by filename, paths break links

Filtering Cases for Compilation

Two approaches — use the Excel file directly (preferred) or scan the vault:

Preferred: Extract slugs from the Excel file itself

# Parse Excel → get unique Project Names → slugify → batch
wb = openpyxl.load_workbook(path, read_only=True)
cases = Counter(str(r[0]).strip() for r in list(wb.active.iter_rows(values_only=True))[1:] if r[0])
slugs = [{"slug": slugify(name), "logs": count} for name, count in cases.items()]

This is precise — only compiles what was just imported.

Fallback: Scan vault by subcategory tag

for slug in os.listdir(cases_dir):
    for logfile in os.listdir(log_dir):
        if "settlement_activity_export" in open(logfile).read(200):
            new_slugs.append(slug)
            break

Do NOT use mtime-based filtering — it picks up every case in the vault (including old ones whose dirs were touched during conversion).

Pitfalls

  1. Parallel subagents cause race conditions on evidence_count — accept ±3 variance
  2. Don't let subagents rewrite index.md — rebuild it yourself after all batches
  3. Large cases (1000+ logs) must be truncated — sample strategically
  4. Wikilinks with path prefixes break in Obsidian — strip concepts/ etc.
  5. The compile.py script generates prompts but doesn't call the LLM directly — use delegate_task
  6. Some articles reference aspirational links (articles not yet created) — that's OK, they'll be created as more cases are compiled
  7. mtime-based vault scanning doesn't work for identifying "just imported" cases — conversion touches existing dirs too. Always extract the case list from the Excel file itself.
  8. Closing cases are mostly declines, not post-settlement closures. The decline/close workflow gets the biggest evidence boost from closing data, not the settlement disbursement workflow.
  9. Small batches (<10 cases) exhaust subagent iterations if you have them read all 89 articles. Point them at specific articles instead.

Multiple-File Workflow

When user sends multiple Excel files, convert all first then compile:

  1. Reuse /tmp/convert_excel.py — just patch the filename for each file
  2. After all converted, batch the NEW cases only (use slugify + check existence)
  3. Compile in 3 parallel batches, then rebuild index once at the end

Duplicate Detection

User may send the same file twice (same name, different doc ID). Compare row counts + first/last row to detect dupes before converting.

Sizing from Imports

  • File 1 (settlement_1): 17.6K entries, 198 cases, 6.2K log files
  • File 2 (settlement_2): 22.1K entries, 169 cases, 7.3K log files
  • File 3 (settlement_3): 688 entries, 8 cases (small — single-batch)
  • File 4 (closing): 9.3K entries, 125 cases, 2.9K log files
  • Files 5-7 (archived 2,3,4): 64.3K entries, 692 cases, 21K log files Total ingested: ~114K entries, 1,170 cases, ~56K log files → 93 wiki articles

Preferred Batching

  • <20 cases: single subagent, no batching
  • 20-300 cases: 3 parallel subagents
  • 300 cases: 3 parallel subagents with aggressive sampling (first 10 + last 10)

  • Always rebuild index.md AFTER all batches complete (never let subagents touch it)

Pitfall: mtime-based filtering unreliable

Don't use file mtime to find "new" cases — convert_excel.py touches existing files too. Instead, extract case names from the Excel directly and slugify to get the target list.

Files

  • FirmVault: /opt/data/FirmVault
  • Wiki: /opt/data/FirmVault/wiki/
  • Schema: wiki/AGENTS.md
  • Converter: /tmp/convert_excel.py (patch filename between runs)
  • Article counts: 65 concepts + 28 connections = 93 total (as of 2026-04-12)
  • Decisions: /opt/data/FirmVault/decisions/ (ADR-000 through ADR-006)
  • Audit report: /opt/data/FirmVault/wiki/reports/workflow-vs-wiki-audit.md
  • v2 proposal: /opt/data/FirmVault/wiki/reports/PHASE_DAG_v2_proposal.md

Workflow Auditing

After a major compilation round, audit the wiki against the PHASE_DAG:

  1. Read PHASE_DAG.yaml (prescribed workflow)
  2. Read all wiki articles (observed reality)
  3. Compare: contradictions, gaps, redundancies
  4. Write audit report to wiki/reports/
  5. If changes warranted, draft PHASE_DAG v2 proposal
  6. Document decisions as ADRs in decisions/ (cherry-picked from stirps-ai/stirps-gov)

This audit is what turned 93 wiki articles into actionable architectural decisions. The wiki is evidence; the ADRs are commitments.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ThomasMoreAI/legal-skills-open

Track the IP portfolio — registrations, renewals, maintenance fees, and use declarations. Use when checking what's renewing, adding or updating an asset, recording a maintenance filing, or auditing the register for gaps, lapses, and use-in-commerce questions. Receives handoffs from prosecution and clearance work.

ThomasMoreAI/legal-skills-open

When the user's message starts with "Canada" (case-insensitive), generate a full Ontario PI Case Assessment Memo from the case_stressor corpus and return it verbatim. This is the primary handler for Canadian fact patterns — DO NOT ask clarifying questions first; run the memo and let the lawyer react.

ThomasMoreAI/legal-skills-open

交通事故责任评估与判定专业技能。当用户需要交通事故责任分析、事故现场照片评估、交通法规咨询、事故责任划分、法律依据查询时触发此技能。适用于车辆碰撞事故、行人事故、非机动车事故等各类道路交通事故的责任认定场景。无论用户使用"交通事故"、"车祸"、"责任判定"、"交通法规"、"事故定责"等何种表述,只要涉及交通事故评估或责任认定,均应调用此技能。

ThomasMoreAI/legal-skills-open

Strategische Markenportfolio-Planung für Luxus-Modehaeuser: Mandant will Marken in DE/EU/international schützen oder Portfolio optimieren. Normen: §§ 32 ff. MarkenG, Art. 32 ff. UMV (EU) 2017/1001, Madrid-Protokoll (WIPO). Prüfraster: Nizza-Klassen (3/14/18/25/35), Multi-Class-Strategie, Prioritaets-Kaskade, Kostenoptimierung, Anmeldezeitpunkt. Output Marken-Portfolio-Plan, Anmelde-Empfehlung je Territorium, Kostenprojektion. Abgrenzung: Einzelne Anmeldung DPMA siehe wortmarke-anmeldung-dpma; Madrid-Protokoll Details siehe madrid-protokoll-und-internationale-registrierung.

ThomasMoreAI/legal-skills-open

Audit an intellectual-property portfolio for ownership, protection, scope, deadlines, territorial coverage, use, value, encumbrances, and enforcement risk. Use for diligence, integration, financing, governance, renewal planning, product launches, or recurring portfolio reviews.

ThomasMoreAI/legal-skills-open

Use whenever the user asks about a motor-vehicle statute, citation, contributing factor, OR a Canadian personal-injury fact pattern — always query Specter's Harvester API before answering. The API auto-routes between two collections (US statutes + Canadian PI case law).

ThomasMoreAI/legal-skills-open

Assesses product liability exposure on given facts — classifying the defect as manufacturing, design, or warning/instruction, mapping which party in the supply chain is potentially exposed, and grading the realistic exposure. Use this whenever a user wants product liability worked through rather than a general deficiency test — including phrasings like "what's our exposure if this product injured someone", "is this a design defect or a manufacturing defect", "who in the supply chain is on the hook here", "assess our product liability risk on these facts", or "how exposed are we if the warning label was inadequate". Distinct from deficiency-analyst, which tests service and trade-practice thresholds — this is specific to defective products and supply-chain exposure. Fires for any product liability question, in any jurisdiction, for manufacturers, assemblers, sellers, distributors, or importers.

ThomasMoreAI/legal-skills-open

KI-VO Hochrisiko-Anforderungen für Personalwesen in Kanzleien ab August 2026: Anwendungsfall Kanzlei setzt KI im HR-Bereich ein oder beraet Mandanten zum AGG-konformen KI-Einsatz bei Bewerberauswahl. Anhang III Nr. 4 KI-VO Hochrisiko Bewerberauswahl, Inkrafttreten 2. August 2026, AGG Diskriminierungsverbot. Prüfraster Hochrisiko-Klassifizierung eigener HR-KI, Konformitätsbewertung, Transparenzpflichten für Betroffene, Beratungsmandate Arbeitsrecht. Output Checkliste Hochrisiko-Anforderungen mit Umsetzungsplan für August 2026. Abgrenzung zu Bias-und-Diskriminierung-Prüfung und zu KI-VO-Betreiber-Pflichten.

ThomasMoreAI/legal-skills-open

Vorlagetabelle für Portfolio-Review von Arbeitsvertraegen im 3D-Format: Forderung/Prüfung/Stellung. Normen: BGB, KSchG, ArbZG. Prüfraster: Vertragsbedingungen, Klauselgueltigkeit, HR-Compliance. Output: Arbeitsvertrag-Portfolio-Tabelle. Abgrenzung: nicht allgemeine 3D-Review-Konfiguration.

ThomasMoreAI/legal-skills-open

Unternehmen oder Kanzlei muss IP-Portfolio verwalten und anstehende Fristen im Blick behalten. Schutzrechtsportfolio-Verwaltung. Prüfraster: Eintragungen Verlaengerungen Jahresgebühren Benutzungsnachweise Fristkalender. Output: Fristenkalender und Portfolio-Audit mit Luecken Verfall und Benutzungsfragen. Abgrenzung zu schutzschrift-eilverfuegung (Verletzungsverteidigung) und markenanmeldung-dpma.

ThomasMoreAI/legal-skills-open

Statusuebersicht aller laufenden Prozessmandate: Fristen, Verfahrensstand, naechste Schritte. Normen: ZPO, RVG. Prüfraster: Fristenliste, offene Anträge, Termine, Mahnfristen. Output: Portfolio-Statusbericht Prozessmandate. Abgrenzung: nicht Einzelmandat-Briefing.

ThomasMoreAI/legal-skills-open

Workflow-Skill zu aufklaerungsfehler beweisstrategie. Nutzt Normtext, Nutzerangaben und verifizierte Quellen; Rechtsprechung nur nach Live-Pruefung mit Gericht, Datum und Aktenzeichen.

ThomasMoreAI/legal-skills-open

Strukturierte Prüfung von Ansprüchen wegen Behandlungsfehler nach §§ 630a ff. BGB iVm § 823 BGB. Behandlungsvertrag Aufklärungspflicht § 630e BGB Dokumentationspflicht § 630f BGB Beweislastregeln § 630h BGB grober Behandlungsfehler Beweislastumkehr voll beherrschbares Risiko Anfaengerstandard Schmerzensgeld § 253 BGB. Schlichtungsstelle Aerztekammer MDK-Gutachten. Verjährung drei Jahre § 195 BGB Hoechstfrist dreissig Jahre § 199 Abs. 2 BGB.

ThomasMoreAI/legal-skills-open

Workflow-Skill zu fachanwalt medizinrecht aufklaerungsfehler. Nutzt Normtext, Nutzerangaben und verifizierte Quellen; Rechtsprechung nur nach Live-Pruefung mit Gericht, Datum und Aktenzeichen.

ThomasMoreAI/legal-skills-open

Behandlungsfehler §§ 630a 630h BGB Verletzung medizinischer Standard. Diagnosefehler Therapiefehler Befunderhebungsfehler Hygienefehler. Beweisregeln § 630h BGB Vermutung Kausalität bei grobem Behandlungsfehler § 630h Abs. 5 BGB Befunderhebungsfehler Dokumentationsmangel. Schadensersatzanspruch §§ 280 823 BGB Schmerzensgeld § 253 BGB. Verjährung drei Jahre § 195 BGB ab Kenntnis 30 Jahre Hoechstfrist.

ThomasMoreAI/legal-skills-open

Mandant hatte Verkehrsunfall und fragt: Wer haftet wie viel und welche Schadensposten koennen geltend gemacht werden? §§ 7 17 18 StVG iVm § 254 BGB Haftungsquote. Prüfraster: Betriebsgefahr beidseitig Anscheinsbeweis Auffahrunfall Spurwechsel Rotlicht Vorfahrt Mithaftung Tempo Sicherheitsabstand Anschnall. Schadenspositionen Reparatur fiktive Abrechnung Mietwagen Nutzungsausfall Sachverständige Schmerzensgeld. Output: Haftungsquoten-Berechnung und Schadenstabelle. Abgrenzung zu fachanwalt-verkehrsrecht-regulierungsanforderung (Gläubigerseite vs. Versicherer) und fachanwalt-verkehrsrecht-versicherer-quotenverhandlung-vergleich.

ThomasMoreAI/legal-skills-open

Verkehrsunfall-Mandat im Zivilprozess vorbereiten: Schadensersatz, Schmerzensgeld, Versicherungskorrespondenz. Normen: §§ 7 18 StVG, §§ 823 253 BGB, § 115 VVG. Prüfraster: Haftungsquote, Schadensposten, Verjaebrung, Regulierungsablauf. Output: Klageschrift Verkehrsunfall oder Klageerwiderung. Abgrenzung: nicht Strafrecht oder Ordnungswidrigkeiten.

ThomasMoreAI/legal-skills-open

Analyzes an entire portfolio of contracts at scale — extracting key terms, obligations, renewal dates, risk provisions, and financial commitments across hundreds or thousands of agreements simultaneously. Produces structured reports, obligation trackers, renewal calendars, and risk matrices. Also supports playbook-based redlining where contracts are compared against preferred positions and automatically marked up. Use when an in-house legal team, GC, legal ops, procurement, or finance team needs portfolio-wide visibility into contract terms, upcoming renewals, obligation compliance, or batch contract review against organizational standards.

ThomasMoreAI/legal-skills-open

Classifies personal vs non-personal data per GDPR Art. 4(1) definition test with decision tree for borderline cases. References Breyer v Germany CJEU C-582/14 dynamic IP ruling and WP29 Opinion 4/2007. Keywords: personal data, GDPR Art 4, data classification, Breyer ruling, identifiability test, PII.

ThomasMoreAI/legal-skills-open

Use when a matter involves marriage, divorce, property division, custody, or inheritance for non-Muslim residents of the UAE under Federal Decree-Law 41/2022 (the UAE Civil Personal Status Law) or the DIFC Wills Service Centre. Covers no-fault divorce, joint-custody default, equal-property division, testamentary freedom for non-Muslims, pre-nuptial agreement enforceability, and the parallel DIFC/ADGM wills regimes. Contrasts with the UAE Personal Status Law 28/2005 (Sharia-based) which governs Muslim residents. Triggers on non-Muslim divorce UAE, UAE civil marriage, DIFC wills, UAE prenup, or expat family law UAE questions.

相关技能