Logo: Redline Emailer

Redline Emailer

Communautéit
bstevescherer
redline-emailer

Translates contract redlines into client-ready or opposing-counsel emails. Accepts three input modes: (1) a .docx with tracked changes, (2) a redlined PDF with strikethrough/underline formatting, or (3) a verbal description of changes. Produces a copy-paste-ready email, tone-matched to the recipient: plain-English for own clients, professional legal cover for opposing counsel. Use when the attorney says "write the redline email", "summarize these changes for the client", "draft a cover email for the redline", "explain these edits to opposing counsel", or "turn this redline into an email". Do NOT use for drafting contracts or generating redlines — use the relevant drafter skill. Do NOT use for diffing two clean (non-redlined) document versions.

Iwwersiicht

Editeurbstevescherer
Repositoryheycounsel-community
Skill-Nummredline-emailer
Stären
43
Forks
6
Matgeliwwert Dateien
4
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    bstevescherer huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Redline Emailer an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/bstevescherer/heycounsel-community/tree/main/skills/redline-emailer
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bstevescherer/heycounsel-community.git /tmp/heycounsel-community
mkdir -p .claude/skills
cp -r /tmp/heycounsel-community/skills/redline-emailer .claude/skills/redline-emailer
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Redline Emailer an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Redline Emailer automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Redline Emailer net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Input Modes

ModeTriggerInput
A: .docx Tracked ChangesUser provides a .docx with Track ChangesParse Word XML for w:del/w:ins elements
B: Redlined PDFUser provides a .pdf with redline formattingParse PDF for strikethrough/underline/color-coded text
C: Verbal DescriptionUser describes changes, no fileWork from the attorney's description

Auto-detect the mode from what the user provides. See references/intake-questions.md Q1.


Instructions

Step 1: Load References

Read before doing anything:

  • references/intake-questions.md — short intake flow (4 questions, most auto-detectable)
  • references/email-templates.md — tone guides and structural templates for both recipient types
  • references/validation-rules.md — quality checks per recipient type

Step 2: Run Intake

Follow references/intake-questions.md. This should take 60 seconds or less.

What you must know before proceeding:

  1. Input mode (auto-detect from file type)
  2. Recipient: client or opposing counsel
  3. Contract identity: title, parties
  4. Special instructions (if any)

Do NOT re-ask questions the attorney already answered in their initial request. If the attorney says "write the redline email for opposing counsel" and drops a .docx, you have all four answers — go straight to Step 3.

Step 3: Extract Changes

This step varies by input mode.


Mode A: .docx with Tracked Changes

Extract changes from Word XML. The .docx format uses the same elements that redline_engine.py writes — we're reading them instead.

Namespace:

W = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'

Element patterns:

  • <w:del> → <w:r> → <w:delText> = deleted text
  • <w:ins> → <w:r> → <w:t> = inserted text

Extraction approach:

  1. Load the .docx with python-docx: doc = Document(filepath)
  2. Walk doc.element.body looking for {W}del and {W}ins elements
  3. Substitutions: When w:del and w:ins are siblings in the same w:p, they represent a substitution (old → new)
  4. Pure deletions: A w:del with no adjacent w:ins = text was removed
  5. Pure additions: A w:ins with no adjacent w:del = text was added
  6. Comments: Parse word/comments.xml from the .docx zip archive for w:comment elements — these provide reviewer context for each change. Match comments to changes via w:commentRangeStart / w:commentReference IDs.

Grouping: For each change, find the nearest preceding paragraph with a heading style (e.g., Heading 1, Heading 2) to determine which contract section it belongs to. If no heading styles are used, fall back to pattern matching: "Section X.X", "Article Y", numbered paragraphs.

Output: A structured change list:

[
  { section: "Section 4.2 — Limitation of Liability",
    type: "substitution",
    old: "twelve (12) months",
    new: "twenty-four (24) months",
    comment: "Per client instruction — doubled the liability cap" },
  ...
]

Mode B: Redlined PDF

Parse the PDF for redline formatting. Redlined PDFs come in two flavors — detect which one and apply the right strategy.

Format detection: Scan the first 2-3 pages using PyMuPDF (fitz):

python
import fitz
doc = fitz.open(filepath)
page = doc[0]
blocks = page.get_text("dict")["blocks"]

Check text spans for formatting flags:

  • Strikethrough flag present → Strikethrough + underline format
  • Red/colored text without strikethrough → Track Changes exported to PDF
  • Neither → Uncertain format (trigger fallback)

Strikethrough + underline format:

  • Spans with strikethrough flag = deleted text
  • Spans with underline flag (especially if also colored/red) = inserted text
  • The fitz span flags field: bit 0x100 = strikethrough (check via span["flags"] & 2**8)
  • Group by surrounding text context and section headings

Track Changes exported to PDF:

  • Look for visual patterns: red text, margin annotations, inline "[Deleted: ...]" text
  • Balloon-style comments in margins may appear as separate text blocks positioned outside the main content area (check x-coordinate relative to page margins)
  • This format is harder to parse reliably — extract what you can

Fallback (uncertain format or low-confidence extraction): Present the extracted text to the attorney:

"I extracted the following text from the PDF but I'm not fully confident in which parts are additions vs. deletions. Can you confirm or correct?"

Show the extracted text with your best guess at markup, and let the attorney correct before proceeding to email generation.

Grouping: Same heading/section detection as Mode A, applied to the PDF text flow.


Mode C: Verbal Description

No document processing. The attorney describes the changes. Structure their description into the same change list format during email generation.

If the description is unstructured, ask:

"Can you organize by section or topic? For example: 'In the payment terms, we changed X to Y. In the liability section, we added Z.'"

If the attorney prefers to stay informal, work with what they give you.


Step 4: Generate Email

Using the change list from Step 3 and the recipient type from Step 2:

  1. Select the appropriate template from references/email-templates.md (Template A for client, Template B for counsel)
  2. Map each change to the appropriate email section
  3. Apply the tone rules for the selected recipient type
  4. Check for tone calibration overrides (casual, contentious, sophisticated client, etc.)
  5. Fill in subject line, greeting, body sections, and sign-off
  6. Leave [Attorney Name] / [Firm Name] / [Client Name] as placeholders unless provided during intake

For client emails: Group changes by topic/impact, not section number. Each change gets a "what it means for you" explanation.

For counsel emails: List changes by section number with precise references. Keep each bullet to 1-2 sentences.

For large redlines (20+ changes): Prioritize commercially significant changes. Group minor/conforming changes under a single note: "Additional conforming changes have been made throughout."

Step 5: Validate and Deliver

Run every applicable check from references/validation-rules.md:

  • Universal checks 1-4 (both recipients)
  • Client checks 5-8 (Template A only)
  • Counsel checks 9-12 (Template B only)

Fix any failures silently. Do not show the validation output — just deliver a clean email.

Deliver the email as plain text in the conversation, formatted and ready to copy-paste. Include the subject line on its own line at the top.

After delivery, offer:

"Want me to adjust the tone, add/remove anything, or generate a version for [the other recipient type]?"


Performance Notes

  • The intake should feel instant. Do not ask questions you can answer from the document or from context.
  • If extraction (Mode A or B) takes more than a few seconds, give the attorney a brief status: "Reading the tracked changes..." / "Parsing the redlined PDF..."
  • The email should read like YOU wrote it, not like a template was filled in. Vary sentence structure. Avoid repetitive bullet patterns.
  • For Mode B (PDF), be honest about extraction confidence. A partially-correct extraction that the attorney can fix is better than a confidently-wrong one.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Redline Emailer?

Translates contract redlines into client-ready or opposing-counsel emails. Accepts three input modes: (1) a .docx with tracked changes, (2) a redlined PDF with strikethrough/underline formatting, or (3) a verbal description of changes. Produces a copy-paste-ready email, tone-matched to the recipient: plain-English for own clients, professional legal cover for opposing counsel. Use when the attorney says "write the redline email", "summarize these changes for the client", "draft a cover email for the redline", "explain these edits to opposing counsel", or "turn this redline into an email". D...

Firwat Redline Emailer op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Redline Emailer besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Redline Emailer an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/bstevescherer/heycounsel-community/tree/main/skills/redline-emailer an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Redline Emailer benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Redline Emailer benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Redline Emailer domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Redline Emailer gratis?

Jo. bstevescherer huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇