Sort My Legal Inbox
When to use
- Explicit: "triage my legal inbox", "sweep inbound for contracts", "what legal email needs me", "run intake".
- Implicit: first skill the user runs when they see a "Needs you" card and ask "what's waiting on me?"
- Safe on-demand - daily or few times/week for solo founder. Default window: last 7 days if unspecified.
Steps
- Read shared context:
context/legal-context.md. If missing/empty, ask the user in plain language: "I need a few basics about your company first. Want to set those up now?" Then runset-up-my-legal-infoif yes. Stop until that's done. - Read config:
config/counterparty-stack.json. If your inbox isn't connected, ask the user in plain language: "I need to connect your inbox to look through it. Want to connect Gmail or Outlook now?" Stop until connected. - Discover inbox tool via Composio. Run
composio search inboxfor tool slug. Confirm slug matchescounterparty-stack.inboxCategory. - Pull inbound. Default window: last 7 days (or user N). Query inbox slug for likely-legal messages - contract attachments (.pdf, .docx), law-firm sender domains, subject keywords ("NDA", "MSA", "DPA", "DSR", "subpoena", "office action", "terms", "agreement"), threads replying to prior legal inbound.
- Classify each item. Apply rubric, pick one bucket:
- NDA - traffic-light: Green = mutual, ≤3-year term, reasonable scope, standard non-solicit (or none), no unusual residuals, no non-compete, US governing law. Yellow = exactly one deviation (one-way where we sole discloser, 3-5 year term, broad residuals, adjacent jurisdiction like Canada/UK). Red = two+ deviations, or any of: non-compete, IP assignment, unlimited liability, publicity / press-release obligations, term >5 years or perpetual, non-standard governing law. Default Red if text not confidently parsed.
- MSA / order form - umbrella or commercial-terms doc from customer/vendor.
- DPA - data-processing addendum or stand-alone data terms.
- DSR - data-subject request (GDPR Art. 15, CCPA).
- subpoena / legal process - subpoena, preservation demand, cease-and-desist, litigation hold.
- TM office action - USPTO office action or TM correspondence.
- contractor paper - inbound consulting / contractor / work-for-hire from counterparty.
- other - anything else legal-flavored (insurance-cert request, privacy inquiry, vendor security questionnaire).
- Route each item. Recommend one:
- self-handle via
draft-a-legal-document- only if item maps cleanly to existing template (e.g. Green NDA with known counterparty). - send to
review-a-contract(mode=full) - most MSA / DPA / order-form / Yellow NDAs go here. - flag
attorneyReviewRequired- Red NDAs, subpoenas, litigation-adjacent, anything ambiguous. - ignore - spam, newsletters, resolved threads.
- self-handle via
- Write summary to
intake-summaries/{YYYY-MM-DD}.mdatomically (*.tmp→ rename). Structure: counts at top ("7 items: 3 NDA, 1 MSA, 1 DSR, 2 other"), then one section per item withFrom,Subject,Received,Classification,One-line summary,Recommended route. - Append to
outputs.json- read existing array, add{ id, type: "intake-summary", title, summary, path, status: "draft", createdAt, updatedAt, attorneyReviewRequired }. SetattorneyReviewRequired: trueif any item flagged for attorney review. - Summarize to user. Plain language. One short paragraph: "I found {N} legal items. {X} NDAs (with the safe ones flagged), {Y} customer contracts, {Z} that need a real lawyer's eyes. Want me to draft replies for the safe ones, or fully review the customer contracts?" Never name files or paths.
Never invent
Every classification ties to observed message. If inbox tool errored or returned no data, mark UNKNOWN in summary - don't guess. If attachment unparseable, say so and ask user to paste.
Outputs
intake-summaries/{YYYY-MM-DD}.md- Appends to
outputs.jsonwith typeintake-summary.