
Mediation Analysis
- 56 installs
- 451 repo stars
- Updated July 21, 2026
- borghei/claude-skills
mediation-analysis is a Claude Code skill that provides a dispute-analysis and mediation-preparation framework covering settlement calculation and interest mapping.
About
mediation-analysis is a skill that provides a framework for analyzing disputes and preparing mediation strategy. It runs from dispute assessment through settlement calculation, interest mapping, and mediation readiness, with bundled scripts to extract structured dispute data and compute BATNA, WATNA, and ZOPA. It is flagged experimental and does not constitute legal advice. A user runs it when preparing for mediation or developing negotiation strategy.
- Analyzes disputes and prepares mediation strategy across a 6-section framework
- Calculates BATNA, WATNA, ZOPA, and settlement scenarios via settlement_calculator.py
- Includes a mediation readiness checklist and interest-mapping guides
Mediation Analysis by the numbers
- 56 all-time installs (skills.sh)
- Ranked #1,583 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
mediation-analysis capabilities & compatibility
- Capabilities
- dispute analysis · settlement calculation · negotiation prep
- Use cases
- research
What mediation-analysis says it does
Dispute analysis and mediation preparation framework.
Calculates BATNA, WATNA, ZOPA, and settlement scenarios.
It does NOT constitute legal advice.
npx skills add https://github.com/borghei/claude-skills --skill mediation-analysisAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 56 |
|---|---|
| repo stars | ★ 451 |
| Last updated | July 21, 2026 |
| Repository | borghei/claude-skills ↗ |
What it does
Prepare for a mediation by analyzing a dispute and calculating settlement ranges.
Who is it for?
Preparing for mediation, analyzing disputes, calculating settlement ranges, and mapping party interests.
Skip if: Getting binding legal advice; the skill is marked experimental and is informational only.
When should I use this skill?
You are preparing for mediation, analyzing a dispute, calculating a settlement range, or developing negotiation strategy.
What you get
A structured dispute analysis with BATNA/WATNA/ZOPA, interest map, and mediation readiness checklist.
- Structured dispute analysis
- Settlement scenario calculations
- Mediation readiness checklist
By the numbers
- 6-section analysis framework
- 10-item mediation readiness checklist
- 2 bundled scripts: dispute_analyzer.py, settlement_calculator.py
Files
⚠️ EXPERIMENTAL — This skill is provided for educational and informational purposes only. It does NOT constitute legal advice. All responsibility for usage rests with the user. Consult qualified legal professionals before acting on any output.
Mediation Analysis
Production-ready framework for analyzing disputes and preparing mediation strategy. Covers the full cycle from dispute assessment through settlement calculation, interest mapping, and mediation readiness.
---
Table of Contents
- Operating Modes
- Tools
- Core Analysis Framework
- Underlying Interests Analysis
- Legal Analysis
- Settlement Strategy
- Reference Guides
- Workflows
- Troubleshooting
- Success Criteria
- Scope and Limitations
- Anti-Patterns
- Tool Reference
---
Operating Modes
Mode 1: Guided Information Gathering
Use when starting from scratch without structured materials.
Step 1 -- Dispute Overview:
- Who are the parties? (names, roles, relationship)
- What is the dispute about? (summary in neutral terms)
- When did the dispute arise? (timeline of key events)
- What is the current status? (pre-litigation, filed, discovery, trial date)
Step 2 -- Positions and Claims:
- What does each party want? (stated positions)
- What are the claimed amounts? (monetary and non-monetary)
- What evidence supports each side?
- What are the weaknesses in each side's case?
Step 3 -- Context and Constraints:
- Is there an ongoing relationship? (employment, commercial, family)
- Are there power imbalances? (resources, information, leverage)
- Are there time pressures? (deadlines, statute of limitations)
- What has been tried so far? (direct negotiation, prior mediation)
Mode 2: Direct Analysis
Use when dispute materials are already available (pleadings, correspondence, statements).
Provide the materials and specify which analysis sections are needed. The framework will extract the structured analysis from the raw materials.
---
Tools
Dispute Analyzer
Extracts structured dispute data from text descriptions.
# Analyze a dispute description
python scripts/dispute_analyzer.py --input dispute.txt
# Analyze with JSON output
python scripts/dispute_analyzer.py --input dispute.txt --json
# Analyze inline text
python scripts/dispute_analyzer.py --text "Party A claims breach of contract for failure to deliver..."
# Save structured analysis
python scripts/dispute_analyzer.py --input dispute.txt --output analysis.jsonSettlement Calculator
Calculates BATNA, WATNA, ZOPA, and settlement scenarios.
# Calculate from parameters file
python scripts/settlement_calculator.py --input params.json
# Calculate with JSON output
python scripts/settlement_calculator.py --input params.json --json
# Quick inline calculation
python scripts/settlement_calculator.py \
--claimed 500000 \
--litigation-cost-a 80000 \
--litigation-cost-b 120000 \
--probability 0.65 \
--time-to-trial 18
# Save settlement analysis
python scripts/settlement_calculator.py --input params.json --output settlement.json---
Core Analysis Framework
The analysis produces 6 sections. Each section builds on the previous.
Section 1: Case Summary
Write a neutral chronological summary covering:
| Element | Description |
|---|---|
| Parties | Names, roles, and relationship |
| Timeline | Key events in chronological order |
| Dispute trigger | The event that escalated to a dispute |
| Current status | Procedural posture (pre-suit, filed, discovery) |
| Prior resolution attempts | What has been tried |
Neutrality check: The summary should be acceptable to both parties. Avoid characterizing conduct as "wrong" or "unreasonable."
Section 2: Issues in Dispute
For each issue, document:
| Component | Description |
|---|---|
| Issue statement | Neutral framing of the disputed question |
| Party A position | What Party A asserts and why |
| Party B position | What Party B asserts and why |
| Key evidence | Evidence supporting each side |
| Strength assessment | Strong / Moderate / Weak for each side |
| Legal basis | Applicable law, contract terms, or principles |
Section 3: Underlying Interests Analysis
Move beyond positions to interests. See detailed section below.
Section 4: Legal Analysis
Per-issue assessment of legal merits. See detailed section below.
Section 5: Mediation Strategy and Settlement Directions
BATNA/WATNA, ZOPA, and settlement scenarios. See detailed section below.
Section 6: Mediation Readiness Checklist
| Item | Status | Notes |
|---|---|---|
| All parties agreed to mediate | ||
| Mediator selected and confirmed | ||
| Decision-makers attending or available | ||
| Key documents exchanged or available | ||
| Opening statement prepared | ||
| Settlement authority established | ||
| BATNA/WATNA analysis complete | ||
| Non-monetary interests identified | ||
| Creative options brainstormed | ||
| Authority limits clarified with client |
---
Underlying Interests Analysis
Interests are the needs, concerns, and motivations behind stated positions.
Interest Categories
| Category | Description | Examples |
|---|---|---|
| Legal | Rights, entitlements, obligations | Contract rights, statutory claims, precedent |
| Commercial | Business and financial concerns | Revenue, costs, market position, reputation |
| Relational | Relationship preservation | Ongoing business, employment, community ties |
| Emotional | Personal feelings and values | Fairness, respect, acknowledgment, vindication |
| Procedural | How the process unfolds | Speed, privacy, control, voice, transparency |
Interest Mapping
For each party, map interests by category and priority:
| Party | Interest | Category | Priority | Compatible? |
|---|---|---|---|---|
| A | Preserve business reputation | Commercial | High | Yes -- shared |
| A | Recover financial losses | Legal/Commercial | High | Negotiable |
| B | Avoid setting precedent | Legal | High | Negotiable |
| B | Maintain relationship with A | Relational | Medium | Yes -- shared |
Shared and Compatible Interests
Identify interests both parties share or that do not conflict:
- Shared: Both want confidentiality, speed, cost control
- Compatible: A wants acknowledgment, B wants no public admission -- private acknowledgment possible
- Conflicting: A wants maximum payment, B wants minimum payment -- negotiation zone needed
Barriers to Resolution
| Barrier | Description | Mitigation |
|---|---|---|
| Reactive devaluation | Offers seem less attractive because they come from the other side | Have mediator propose options |
| Anchoring | First number distorts all subsequent negotiation | Use objective criteria to anchor |
| Loss aversion | Parties feel losses more than equivalent gains | Frame in terms of gains vs current state |
| Principal-agent | Party's representative may have different interests | Ensure decision-makers participate |
| Information asymmetry | One party knows more than the other | Structured disclosure through mediator |
---
Legal Analysis
For each disputed issue, assess:
| Factor | Assessment |
|---|---|
| Applicable law | Statute, regulation, contract term, or common law |
| Strength of claim | Strong (>70%) / Moderate (40-70%) / Weak (<40%) |
| Key uncertainties | Factual disputes, legal ambiguities, evidentiary gaps |
| Likely trial outcome | Best case, worst case, most likely |
| Damages range | If claimant prevails, likely award range |
| Costs to trial | Attorney fees, expert fees, opportunity costs per party |
| Time to resolution | Months/years to trial and potential appeal |
---
Settlement Strategy
BATNA / WATNA Analysis
| Metric | Party A | Party B |
|---|---|---|
| Best Alternative (BATNA) | Win at trial, recover full claim + costs | Win at trial, pay nothing + recover costs |
| Worst Alternative (WATNA) | Lose at trial, recover nothing, pay own costs | Lose at trial, pay full claim + costs |
| Most Likely Alternative | Partial recovery minus litigation costs | Partial liability minus litigation costs |
| Litigation cost estimate | $X over Y months | $X over Y months |
| Net expected value | (Probability x Award) - Litigation costs | -(Probability x Award) - Litigation costs |
ZOPA Identification
The Zone of Possible Agreement exists when Party A's minimum acceptable settlement is less than Party B's maximum they would pay.
Party A minimum = Expected trial value - litigation costs - risk discount
Party B maximum = Expected trial liability + litigation costs + risk premium
ZOPA exists when: A minimum < B maximum
ZOPA range: [A minimum ... B maximum]Settlement Scenarios
| Scenario | Description | When Appropriate |
|---|---|---|
| Straightforward Compromise | Split the difference on monetary claims | Simple disputes with clear monetary value |
| Interest-Based Solution | Address underlying interests beyond money | Ongoing relationships, non-monetary concerns |
| Package Deal | Bundle monetary and non-monetary elements | Complex disputes with multiple issues and interests |
---
Reference Guides
| Guide | Path | Description |
|---|---|---|
| Mediation Process | references/mediation_process.md | 12 stages of mediation with roles and techniques |
| Negotiation Concepts | references/negotiation_concepts.md | BATNA, WATNA, ZOPA, interest-based negotiation, barriers |
---
Workflows
Workflow 1: Full Mediation Preparation
1. Gather dispute information (Mode 1 or Mode 2). 2. Run scripts/dispute_analyzer.py on available materials. 3. Complete the 6-section Core Analysis Framework. 4. Run scripts/settlement_calculator.py with dispute parameters. 5. Prepare opening statement and settlement proposals. 6. Complete Mediation Readiness Checklist. 7. Validation: All 6 sections complete, BATNA/ZOPA calculated, proposals prepared.
Workflow 2: Quick Settlement Range
1. Identify claimed amount, litigation costs, and success probability. 2. Run scripts/settlement_calculator.py with parameters. 3. Review ZOPA range and three scenarios. 4. Adjust parameters for sensitivity analysis. 5. Validation: Settlement range established with supporting rationale.
Workflow 3: Multi-Party Mediation
1. Map all parties and their relationships. 2. Run dispute analysis for each bilateral relationship. 3. Identify coalition possibilities and shared interests. 4. Calculate settlement ranges for each party pair. 5. Design package deals that address all parties' core interests. 6. Validation: Each party pair analyzed, coalitions mapped, package options developed.
---
Troubleshooting
| Problem | Likely Cause | Resolution |
|---|---|---|
| ZOPA appears negative | Parties' expectations unrealistic or litigation costs understated | Reality-test each party's BATNA; increase cost estimates |
| Cannot identify interests | Parties stuck on positions | Use "why" questions; explore consequences of winning/losing |
| Power imbalance distorting negotiation | Resource or information asymmetry | Recommend process adjustments; structured information sharing |
| Decision-maker absent | Representative lacks authority | Adjourn until decision-maker available; confirm authority in advance |
| Emotional barriers dominant | Unresolved relational issues | Address emotional interests first; consider apology or acknowledgment |
| Multi-party complexity | Too many bilateral dynamics | Break into sub-mediations; use single-text procedure |
---
Success Criteria
| Criterion | Target |
|---|---|
| Dispute issues identified | All contested issues listed with positions |
| Interests mapped | At least 3 interests per party, categorized |
| Legal strength assessed | Each issue rated with rationale |
| BATNA/WATNA calculated | Both parties' alternatives quantified |
| ZOPA identified | Settlement range established or confirmed negative |
| Settlement scenarios | Minimum 3 scenarios with rationale |
| Readiness checklist | All items addressed before mediation |
---
Scope & Limitations
In scope: Dispute analysis, interest mapping, settlement calculation, mediation preparation, negotiation strategy.
Out of scope: Acting as mediator, providing legal advice, predicting judicial outcomes with certainty, drafting settlement agreements, representing parties.
Disclaimer: This skill provides an analytical framework for mediation preparation. It does not constitute legal advice. Settlement calculations are estimates based on inputs provided and should be validated by qualified counsel.
---
Anti-Patterns
| Anti-Pattern | Why It Fails | Better Approach |
|---|---|---|
| Positional bargaining only | Focuses on what parties demand, ignoring why they want it; leaves value on the table | Map interests first, then generate options that satisfy underlying needs |
| Ignoring litigation costs in settlement math | Parties anchor on the claim amount without factoring in costs to pursue it; produces unrealistic expectations | Always include full litigation costs (fees, time, opportunity cost) in BATNA calculation |
| Assuming equal bargaining power | Power imbalances distort negotiation; weaker party may accept unfavorable terms under pressure | Identify imbalances early; recommend process protections (separate caucuses, information sharing, independent advice) |
| Skipping emotional interests | Emotional needs (respect, acknowledgment, fairness) often drive dispute more than money; ignoring them produces impasse | Include emotional and relational interests in the analysis alongside legal and commercial interests |
---
Tool Reference
| Tool | Input | Output | Use Case |
|---|---|---|---|
dispute_analyzer.py | Dispute description text | Structured analysis with parties, issues, interests, timeline | First-pass dispute structuring |
settlement_calculator.py | Dispute parameters (amounts, costs, probability) | BATNA/WATNA, ZOPA, 3 settlement scenarios | Quantitative settlement range analysis |
Mediation Process Reference
Complete reference for the mediation lifecycle, from pre-mediation assessment through settlement and follow-up. Covers 12 stages, roles, power imbalance strategies, and impasse-breaking techniques.
---
Table of Contents
- Mediation Stages Overview
- Phase 1: Pre-Mediation
- Phase 2: Opening
- Phase 3: Exploration
- Phase 4: Negotiation
- Phase 5: Settlement
- Roles and Responsibilities
- Power Imbalance Strategies
- Impasse-Breaking Techniques
- Mediation Agreement Checklist
---
Mediation Stages Overview
| # | Stage | Phase | Primary Activity |
|---|---|---|---|
| 1 | Case Assessment | Pre-Mediation | Evaluate suitability for mediation |
| 2 | Mediator Selection | Pre-Mediation | Choose and engage mediator |
| 3 | Ground Rules | Pre-Mediation | Agree process framework |
| 4 | Joint Session | Opening | Parties meet, mediator introduces process |
| 5 | Opening Statements | Opening | Each party presents their perspective |
| 6 | Agenda Setting | Opening | Identify and prioritize issues |
| 7 | Joint Discussion | Exploration | Facilitated dialogue on issues |
| 8 | Caucuses | Exploration | Private sessions with mediator |
| 9 | Reality Testing | Exploration | Evaluate positions against BATNA |
| 10 | Interest-Based Bargaining | Negotiation | Generate options from interests |
| 11 | Option Generation and Trade-offs | Negotiation | Develop and evaluate proposals |
| 12 | Agreement and Implementation | Settlement | Document terms and next steps |
---
Phase 1: Pre-Mediation
Stage 1: Case Assessment
Evaluate whether mediation is appropriate for this dispute.
| Factor | Favors Mediation | Disfavors Mediation |
|---|---|---|
| Relationship | Ongoing or valued relationship | No future contact needed |
| Complexity | Moderate complexity with room for creativity | Requires legal precedent or declaratory relief |
| Power balance | Roughly equal or addressable imbalance | Severe, unaddressable imbalance |
| Emotional state | Parties willing to engage | One party seeking only punishment/vindication |
| Time pressure | Both parties want resolution | One party benefits from delay |
| Confidentiality | Both prefer private resolution | Public interest requires transparency |
| Legal clarity | Mixed merits; uncertain outcome | Clear legal winner; no genuine dispute |
Stage 2: Mediator Selection
| Criterion | Considerations |
|---|---|
| Subject matter expertise | Does the dispute require domain knowledge? |
| Mediation style | Facilitative (interest-based) vs evaluative (merit-based) vs transformative (relationship-focused) |
| Neutrality | No conflicts of interest; perceived as fair by both parties |
| Availability | Can schedule promptly given any time pressures |
| Language/culture | Cross-border disputes may require multilingual or culturally aware mediator |
| Cost | Fee structure (hourly, daily, flat); cost sharing arrangement |
Stage 3: Ground Rules
Standard ground rules to establish before mediation begins:
| Rule | Purpose |
|---|---|
| Confidentiality | Statements in mediation cannot be used in later proceedings |
| Good faith participation | Parties commit to genuine engagement |
| Decision-maker presence | Someone with authority to settle must attend or be reachable |
| No recording | Proceedings are not recorded |
| Voluntary participation | Either party may withdraw at any time |
| Mediator's role | Mediator facilitates; does not decide or advise |
| Time framework | Expected duration and any hard stops |
| Communication rules | Respectful dialogue; no interrupting; mediator manages process |
---
Phase 2: Opening
Stage 4: Joint Session
The mediator: 1. Welcomes parties and makes introductions. 2. Explains the mediation process and ground rules. 3. Confirms authority to settle. 4. Explains confidentiality. 5. Answers procedural questions. 6. Invites opening statements.
Stage 5: Opening Statements
Each party presents their perspective to the mediator and the other party.
| Element | Guidance |
|---|---|
| Duration | 10-15 minutes per party (mediator sets limit) |
| Tone | Firm but respectful; focus on impact, not blame |
| Content | Key facts, how the dispute has affected the party, what resolution is sought |
| Audience | Primarily the other party (not the mediator) |
| Goal | Help the other side understand your perspective and interests |
For counsel preparing a client's opening:
- Focus on storytelling, not legal argument.
- Emphasize impact and interests, not just positions.
- Acknowledge the other side's legitimate concerns where possible.
- Signal willingness to negotiate, not entrenchment.
Stage 6: Agenda Setting
The mediator works with parties to create a shared agenda.
| Step | Activity |
|---|---|
| 1 | List all issues raised by both parties |
| 2 | Consolidate overlapping issues |
| 3 | Reframe positional statements as neutral issues |
| 4 | Agree on order (easy issues first builds momentum; hard issues first if time-pressured) |
| 5 | Confirm agenda with both parties |
---
Phase 3: Exploration
Stage 7: Joint Discussion
The mediator facilitates dialogue on each agenda item.
| Technique | Purpose | When to Use |
|---|---|---|
| Active listening | Ensure parties feel heard | Throughout |
| Reframing | Convert positions to interests | When parties state demands |
| Summarizing | Confirm understanding, identify common ground | After each issue discussion |
| Questioning | Explore underlying needs | When positions are rigid |
| Normalizing | Reduce emotional intensity | When emotions are high |
| Acknowledging | Validate feelings without agreeing | When parties feel dismissed |
Stage 8: Caucuses
Private meetings between the mediator and each party.
| Purpose | Technique |
|---|---|
| Explore confidential information | "What hasn't been said that's important?" |
| Reality test positions | "What happens if you go to trial?" |
| Explore settlement flexibility | "What could you live with?" |
| Coach on negotiation | "How might the other side hear that?" |
| Manage emotions | Allow venting in private |
| Test proposals | "If I could get X, would you accept Y?" |
Confidentiality in caucus: The mediator does not share caucus information with the other party unless given explicit permission.
Stage 9: Reality Testing
The mediator helps parties evaluate their positions against realistic alternatives.
| Question | Purpose |
|---|---|
| "What is your best alternative if mediation fails?" | Establish BATNA |
| "What is the worst that could happen at trial?" | Establish WATNA |
| "What will litigation cost you in money, time, and stress?" | Factor in total cost |
| "How certain are you of winning?" | Calibrate confidence |
| "What precedent supports your position?" | Test legal basis |
| "How does the other side see this issue?" | Build empathy |
| "What would a judge/jury find most persuasive?" | External perspective |
---
Phase 4: Negotiation
Stage 10: Interest-Based Bargaining
Move from positions to interests to options.
| Step | Activity | Example |
|---|---|---|
| 1. Identify interests | Ask "why" behind each position | "Why is the payment timeline important to you?" |
| 2. Find shared interests | Map overlapping needs | Both want confidentiality; both want to avoid future disputes |
| 3. Generate options | Brainstorm without commitment | "What if we structured payments differently?" |
| 4. Evaluate options | Apply objective criteria | Market rates, legal standards, industry practice |
| 5. Develop proposals | Combine options into packages | Payment + non-compete + reference letter |
Stage 11: Option Generation and Trade-offs
| Technique | Description | When to Use |
|---|---|---|
| Brainstorming | Generate ideas without evaluation | Early in negotiation |
| Logrolling | Trade issues of different value | Parties value issues differently |
| Expanding the pie | Add new value to the negotiation | Fixed-sum impasse |
| Contingent agreement | Terms depend on future events | Disagreement about future facts |
| Post-settlement settlement | Improve deal after initial agreement | Both see room for optimization |
| Single-text procedure | Mediator drafts; parties refine | Multi-party or complex disputes |
---
Phase 5: Settlement
Stage 12: Agreement and Implementation
| Step | Activity |
|---|---|
| 1 | Confirm all terms orally with both parties present |
| 2 | Draft settlement agreement (or heads of terms) |
| 3 | Review draft with each party and their counsel |
| 4 | Address any remaining concerns or ambiguities |
| 5 | Sign the agreement |
| 6 | Establish implementation timeline |
| 7 | Agree on dispute resolution for implementation issues |
| 8 | Schedule any follow-up (if phased implementation) |
---
Roles and Responsibilities
Mediator's Role
| Stage | Mediator's Primary Function |
|---|---|
| Pre-mediation | Assess suitability; design process |
| Opening | Set tone; establish trust and ground rules |
| Exploration | Facilitate communication; identify interests |
| Negotiation | Generate options; reality test; manage impasse |
| Settlement | Help draft agreement; ensure informed consent |
The mediator does NOT:
- Decide who is right or wrong
- Provide legal advice to either party
- Force a settlement
- Disclose caucus information without permission
- Act as advocate for either party
Counsel's Role in Mediation
| Stage | Counsel's Function |
|---|---|
| Pre-mediation | Prepare client; research BATNA; gather evidence |
| Opening | Support client's statement; provide legal framework |
| Exploration | Ensure client's interests are fully expressed |
| Negotiation | Advise on legal implications of proposals; protect rights |
| Settlement | Review agreement; ensure enforceable terms |
Party's Role
| Stage | Party's Function |
|---|---|
| Pre-mediation | Gather information; consider interests and priorities |
| Opening | Share perspective honestly and constructively |
| Exploration | Listen actively; engage with the other side's concerns |
| Negotiation | Evaluate options; make informed decisions |
| Settlement | Commit to terms they can fulfill |
---
Power Imbalance Strategies
When one party has significantly more power (resources, information, leverage):
| Strategy | How It Works | When to Use |
|---|---|---|
| Separate caucuses | Weaker party can speak freely; mediator ensures interests are represented | Information or confidence imbalance |
| Process education | Ensure weaker party understands options and rights | Knowledge imbalance |
| Support persons | Allow advisors, advocates, or support persons | Emotional or resource imbalance |
| Structured information sharing | Require relevant information exchange before negotiation | Information asymmetry |
| Reality testing both sides | Mediator tests stronger party's position too, not just weaker party's | Leverage imbalance |
| Adjournment | Allow weaker party time to obtain advice | Pressure tactics |
| Terminate mediation | If imbalance cannot be addressed, mediation may not be appropriate | Severe, unaddressable imbalance |
---
Impasse-Breaking Techniques
When negotiation stalls, these techniques can restart progress.
| # | Technique | How It Works | Best For |
|---|---|---|---|
| 1 | Conditional proposal | "If they do X, would you do Y?" (tested in caucus) | Bridging small gaps |
| 2 | Bracketing | Narrow the range: "Can we agree the answer is between X and Y?" | Monetary disputes |
| 3 | Mediator's proposal | Mediator suggests a number; both sides say yes/no confidentially | Final gap after extensive negotiation |
| 4 | Change the shape | Restructure deal (lump sum to installments, add non-monetary terms) | Fixed-sum impasse |
| 5 | Future focus | Shift from past wrongs to future relationship and needs | Relational disputes |
| 6 | Take a break | Adjourn for hours or days to reduce emotion and allow reflection | High-emotion impasse |
| 7 | Bring in expertise | Neutral expert provides opinion on a technical dispute | Factual disagreement |
| 8 | Partial agreement | Agree on what you can; set aside the rest | Multi-issue disputes |
| 9 | Role reversal | Ask each party to argue the other side's position | Empathy deficit |
| 10 | Cost of no agreement | Calculate total cost of continued litigation for both sides | Unrealistic expectations |
---
Mediation Agreement Checklist
Every settlement agreement should address:
| Element | Details |
|---|---|
| Parties | Full legal names of all parties to the agreement |
| Recitals | Brief neutral description of the dispute being resolved |
| Settlement terms | Specific, measurable, enforceable obligations |
| Payment terms | Amount, schedule, method, currency, interest on late payment |
| Non-monetary terms | Specific actions, timelines, and standards |
| Confidentiality | Scope of confidentiality; what can be disclosed and to whom |
| Non-disparagement | Mutual or unilateral; scope and duration |
| Mutual release | Full and final release of all claims arising from the dispute |
| Representations | Authority to enter agreement; no assignment of claims |
| Breach provisions | What happens if a party breaches the agreement |
| Dispute resolution | How disputes about the agreement itself will be resolved |
| Governing law | Which jurisdiction's law governs the agreement |
| Execution | Signatures, dates, counterparts, electronic signatures |
| Attachments | Any referenced documents, schedules, or exhibits |
Negotiation Concepts Reference
Core negotiation concepts for dispute resolution and mediation. Covers positions vs interests, BATNA, WATNA, ZOPA, interest-based negotiation, settlement patterns, barriers to settlement, and impasse-breaking techniques.
---
Table of Contents
- Positions vs Interests
- BATNA -- Best Alternative to Negotiated Agreement
- WATNA -- Worst Alternative to Negotiated Agreement
- ZOPA -- Zone of Possible Agreement
- Interest-Based Negotiation
- Settlement Patterns
- Barriers to Settlement
- Impasse-Breaking Techniques
---
Positions vs Interests
The most fundamental concept in negotiation theory.
| Concept | Definition | Example |
|---|---|---|
| Position | What a party demands | "I want $500,000" |
| Interest | Why the party wants it | "I need to cover medical costs and lost income" |
Why the Distinction Matters
| Approach | Outcome | Problem |
|---|---|---|
| Position-based | Win-lose or compromise | Leaves value on the table; damages relationships |
| Interest-based | Potential win-win | Requires more effort; may create value both sides share |
Examples of Positions vs Interests
| Position | Underlying Interest |
|---|---|
| "I want full payment of the invoice" | Cash flow; being treated fairly as a vendor |
| "I refuse to pay more than half" | Belief that goods were defective; budget constraints |
| "I demand an apology" | Need for acknowledgment and respect |
| "I want a 3-year non-compete" | Protecting trade secrets and client relationships |
| "I insist on keeping the corner office" | Status; recognition of seniority; proximity to team |
| "I won't accept less than $1 million" | Financial security; sense of being made whole |
Uncovering Interests
| Question | Purpose |
|---|---|
| "Why is that important to you?" | Moves from position to interest |
| "What would that give you?" | Explores underlying need |
| "If you got that, what would change?" | Tests whether position actually satisfies interest |
| "What are you most concerned about?" | Identifies primary interest |
| "What would happen if you didn't get that?" | Identifies fear/risk driving the position |
| "What would a good outcome look like for you beyond this specific demand?" | Opens creative thinking |
---
BATNA -- Best Alternative to Negotiated Agreement
Definition
BATNA is the best outcome a party can achieve if negotiation fails. It is the standard against which any proposed settlement should be measured.
Calculating BATNA for Legal Disputes
The litigation cost model:
BATNA = (Probability of winning) x (Expected award if winning) - (Total litigation costs)| Component | How to Estimate |
|---|---|
| Probability of winning | Based on legal analysis, precedent, evidence strength |
| Expected award | Based on damages calculation, comparable cases, statutory limits |
| Litigation costs | Attorney fees + expert fees + court costs + management time + opportunity cost |
| Time factor | Discount future amounts to present value |
| Non-monetary costs | Stress, distraction, reputation risk, publicity |
BATNA Assessment Table
| Factor | Party A (Claimant) | Party B (Respondent) |
|---|---|---|
| Probability of success | Estimate % based on legal merits | = 1 minus Party A's probability |
| Expected award range | Low estimate to high estimate | Same range (their exposure) |
| Litigation costs | Attorney fees + experts + time | Attorney fees + experts + time |
| Time to resolution | Months/years to trial + appeal | Same timeline |
| Non-monetary costs | Management distraction, stress | Reputation, business disruption |
| Net expected value | (Prob x Award) - Costs | -(Prob x Award) - Costs |
BATNA Strengthening
| Strategy | How It Helps |
|---|---|
| Strengthen your case | Better evidence improves probability; raises your BATNA |
| Reduce litigation costs | Efficient counsel selection; early expert retention |
| Develop alternatives | Other revenue sources; replacement relationships |
| Improve information | Better understanding of your case's strengths and weaknesses |
| Create competition | Multiple potential settlement partners |
Common BATNA Mistakes
| Mistake | Why It's Wrong |
|---|---|
| Ignoring litigation costs | Best case at trial minus costs is what matters, not gross award |
| Assuming best-case scenario | BATNA should use realistic, not optimistic, probabilities |
| Ignoring time value | A dollar today is worth more than a dollar in 3 years |
| Forgetting non-monetary costs | Stress, distraction, and reputation damage are real |
| Confusing BATNA with aspiration | BATNA is what happens without agreement, not what you hope for |
---
WATNA -- Worst Alternative to Negotiated Agreement
Definition
WATNA is the worst realistic outcome if negotiation fails. It provides a floor for assessing risk and motivating settlement.
WATNA Calculation
WATNA = (Probability of losing) x (Maximum adverse outcome) + (Total litigation costs)| Factor | Claimant's WATNA | Respondent's WATNA |
|---|---|---|
| Outcome | Lose case entirely; recover nothing | Lose case; pay maximum damages + costs |
| Costs incurred | Full litigation costs (own + potentially adverse costs) | Full litigation costs + adverse award |
| Time lost | Years of litigation with zero recovery | Years of liability uncertainty |
| Reputation | Failed claim may damage credibility | Public judgment may damage reputation |
| Precedent | Adverse precedent may harm future claims | Adverse precedent may invite more claims |
BATNA-WATNA Spectrum
WATNA ←————— Most Likely Outcome ——————→ BATNA
(worst case) (realistic middle) (best case)
Settlement should be measured against this full spectrum, not just BATNA.---
ZOPA -- Zone of Possible Agreement
Definition
The ZOPA is the range within which an agreement is possible -- where Party A's minimum acceptable outcome overlaps with Party B's maximum concession.
Identifying ZOPA
Party A's reservation point (minimum acceptable) = BATNA value
Party B's reservation point (maximum payable) = Avoiding WATNA value
ZOPA exists when: A's minimum < B's maximum
ZOPA = [A's minimum ... B's maximum]ZOPA Examples
| Scenario | A's Minimum | B's Maximum | ZOPA |
|---|---|---|---|
| Positive ZOPA | $150,000 | $250,000 | $150K-$250K (agreement possible) |
| Negative ZOPA | $300,000 | $200,000 | None (no overlap; settlement not possible at current expectations) |
| Narrow ZOPA | $190,000 | $210,000 | $190K-$210K (possible but difficult) |
| Wide ZOPA | $100,000 | $400,000 | $100K-$400K (easy to reach agreement; challenge is distribution) |
When ZOPA Is Negative
| Cause | Solution |
|---|---|
| Unrealistic expectations | Reality testing -- share objective criteria, case law, expert opinions |
| Information asymmetry | Structured information exchange |
| Emotional anchoring | Cooling-off period; focus on interests not positions |
| Misunderstanding of BATNA | Educate on true litigation costs and risks |
| Non-monetary factors unaddressed | Expand negotiation to include non-monetary terms |
ZOPA Expansion Strategies
| Strategy | How It Works |
|---|---|
| Add issues | More issues create more trading opportunities |
| Change currency | Non-monetary value (apology, reference, future business) |
| Change timing | Phased payments; deferred consideration |
| Add contingencies | Performance-based payments; earn-outs |
| Bundle elements | Package deals with offsetting concessions |
---
Interest-Based Negotiation
The Harvard Method (Fisher and Ury)
| Principle | Description |
|---|---|
| Separate people from problem | Address relationship issues separately from substantive issues |
| Focus on interests, not positions | Explore why parties want what they want |
| Invent options for mutual gain | Brainstorm solutions before deciding |
| Use objective criteria | Base decisions on fair standards, not power |
Interest-Based Negotiation Process
| Step | Activity | Tools |
|---|---|---|
| 1. Prepare | Identify own interests; research other side's interests | Interest mapping worksheet |
| 2. Explore | Share interests; ask questions; listen actively | Open-ended questions; active listening |
| 3. Generate options | Brainstorm without commitment; expand the pie | Brainstorming rules; no criticism during generation |
| 4. Evaluate | Apply objective criteria; assess feasibility | Market data; legal standards; precedent |
| 5. Agree | Select option(s) that satisfy core interests of both sides | BATNA comparison; commitment testing |
| 6. Implement | Document terms; establish accountability | Written agreement; milestone tracking |
Objective Criteria
When parties disagree on value, use external standards:
| Criterion Type | Examples |
|---|---|
| Market value | Comparable transactions; appraisals; industry benchmarks |
| Legal standard | Statutory provisions; case law; regulatory guidance |
| Expert opinion | Independent valuation; technical assessment |
| Precedent | Similar settlements; prior dealings between parties |
| Scientific standard | Technical specifications; safety standards |
| Professional standard | Industry best practice; professional codes |
| Cost-based | Actual costs incurred; replacement cost |
| Equal treatment | How similar situations have been handled |
---
Settlement Patterns
Pattern 1: Split the Difference
| Characteristic | Description |
|---|---|
| Method | Average of parties' last positions |
| Best for | Simple monetary disputes with narrow gap |
| Risk | Rewards extreme opening positions; ignores interests |
| Fairness perception | Often perceived as "fair" despite being arbitrary |
Pattern 2: Trade-offs (Logrolling)
| Characteristic | Description |
|---|---|
| Method | Parties trade concessions on issues they value differently |
| Best for | Multi-issue disputes where parties' priorities differ |
| Requires | Understanding each party's priority ranking |
| Example | A cares more about speed; B cares more about money. A gets quick payment; B pays less. |
Pattern 3: Creative Expansion
| Characteristic | Description |
|---|---|
| Method | Add new elements to create value |
| Best for | Disputes where pure monetary division is inadequate |
| Example | Add future business commitment, training, joint venture, or non-monetary terms |
| Risk | Complexity; enforcement challenges |
Pattern 4: Contingent Agreement
| Characteristic | Description |
|---|---|
| Method | Terms depend on future events or performance |
| Best for | Disagreement about future facts (e.g., will the business succeed?) |
| Example | Earn-out based on future revenue; royalty based on sales |
| Risk | Monitoring costs; potential for future disputes |
Pattern 5: Phased Agreement
| Characteristic | Description |
|---|---|
| Method | Implementation over time with milestones |
| Best for | Cash flow constraints; trust building; complex implementation |
| Example | Payment in 4 quarterly installments; performance milestones |
| Risk | Default risk; changed circumstances |
---
Barriers to Settlement
Cognitive and Psychological Barriers
| Barrier | Description | Effect on Negotiation | Mitigation |
|---|---|---|---|
| Reactive devaluation | Offers seem less attractive because they come from the other side | Parties reject proposals they would accept from a neutral source | Have mediator propose options; use objective criteria |
| Anchoring | First number mentioned distorts all subsequent negotiation | Opening offer creates a reference point that is hard to escape | Use objective criteria to anchor; make first offer strategically |
| Loss aversion | Losses feel ~2x as painful as equivalent gains | Parties resist concessions even when net outcome improves | Frame proposals as gains relative to current situation, not losses from aspiration |
| Endowment effect | People overvalue what they already have | Parties overvalue their current position or claimed rights | Use objective valuation; compare to BATNA, not current claim |
| Confirmation bias | Parties seek information supporting their position | Leads to overconfidence in own case | Reality testing; neutral case evaluation |
| Sunk cost fallacy | Parties feel they must "get something" for costs already incurred | Resistance to settlement that doesn't cover past costs | Focus on forward-looking value, not recouping past costs |
Structural Barriers
| Barrier | Description | Effect | Mitigation |
|---|---|---|---|
| Principal-agent problem | Party's representative has different interests than the party | Lawyers may prefer trial; executives may prefer settlement | Ensure decision-makers participate directly |
| Information asymmetry | One party knows more than the other | Uninformed party cannot evaluate proposals accurately | Structured disclosure; neutral expert assessment |
| Constituency pressure | Party must satisfy stakeholders (board, family, public) | Cannot accept reasonable offers due to external pressure | Confidential process; mediator assists with framing |
| Multiple parties | More parties means more interests to satisfy | Exponentially more complex; spoiler dynamics | Coalition building; single-text procedure |
| Precedent concerns | Settling may encourage similar claims | Party resists settlement to avoid "opening the floodgates" | Confidential settlement; distinguish the facts |
---
Impasse-Breaking Techniques
10 Techniques with Examples
| # | Technique | Description | Example |
|---|---|---|---|
| 1 | Conditional proposal | "If they do X, would you do Y?" Tested privately in caucus before presenting to both sides | "If they agreed to a non-disparagement clause, would you accept $50K less?" |
| 2 | Bracketing | Narrow the negotiation range by getting agreement on a bracket | "Can we agree the settlement is somewhere between $200K and $350K?" |
| 3 | Mediator's proposal | Mediator proposes a specific number; both sides say yes or no confidentially. Revealed only if both say yes. | Mediator proposes $275K. Both sides respond confidentially. |
| 4 | Change the shape | Restructure the deal to break the impasse | Convert lump sum to installments; add non-monetary terms; change timeline |
| 5 | Future focus | Redirect from past grievances to future needs and relationship | "Instead of debating what happened, what would the ideal future look like?" |
| 6 | Strategic adjournment | Take a break to allow emotions to cool and reflection to occur | "Let's reconvene in one week. Please consider [specific question]." |
| 7 | Neutral expert | Bring in a subject matter expert to provide an objective view on a contested fact | Joint retention of a valuation expert to assess fair market value |
| 8 | Partial agreement | Agree on resolved issues; isolate remaining disputes | "We've agreed on liability, confidentiality, and timeline. Only the amount remains." |
| 9 | Role reversal | Ask each party to argue the other side's case for 5 minutes | Forces empathy and often reveals that the other side's position has more merit than assumed |
| 10 | Cost of impasse | Calculate the total cost of continued litigation for both sides and present it | "If mediation fails, Party A faces $120K in costs and 18 months. Party B faces $150K and the same timeline." |
Choosing the Right Technique
| Situation | Best Techniques |
|---|---|
| Close to agreement on money | Bracketing, mediator's proposal |
| Emotional impasse | Strategic adjournment, future focus, role reversal |
| Factual disagreement | Neutral expert, reality testing |
| Structural complexity | Partial agreement, change the shape |
| Distrust between parties | Conditional proposals (via caucus), mediator's proposal |
| Unrealistic expectations | Cost of impasse, reality testing |
#!/usr/bin/env python3
"""
Dispute Analyzer
Analyzes dispute description text and extracts parties, claims, key issues,
timeline of events, and evidence references. Maps each party's positions
and interests. Identifies overlapping interests and potential ZOPA.
Usage:
python dispute_analyzer.py --input dispute.txt
python dispute_analyzer.py --text "Party A claims breach of contract..."
python dispute_analyzer.py --input dispute.txt --json
python dispute_analyzer.py --input dispute.txt --output analysis.json
"""
import argparse
import json
import re
import sys
from typing import Any, Dict, List, Optional, Tuple
# Entity/party extraction patterns
PARTY_INDICATORS = [
r"(?:plaintiff|claimant|petitioner|applicant|complainant)",
r"(?:defendant|respondent|opposing\s+party)",
r"(?:party\s+[a-z])",
r"(?:the\s+(?:company|employer|employee|tenant|landlord|buyer|seller|contractor|client|vendor|supplier|customer|insured|insurer|licensor|licensee))",
]
# Claim type patterns
CLAIM_PATTERNS: Dict[str, List[str]] = {
"breach_of_contract": [
r"\bbreach\s+of\s+contract\b", r"\bfailed\s+to\s+perform\b",
r"\bnon-?performance\b", r"\bcontractual\s+(?:breach|violation)\b",
],
"negligence": [
r"\bnegligen(?:ce|t)\b", r"\bduty\s+of\s+care\b",
r"\bfailed\s+to\s+exercise\b", r"\breasonable\s+care\b",
],
"employment": [
r"\bwrongful\s+(?:termination|dismissal)\b", r"\bdiscrimination\b",
r"\bharassment\b", r"\bunfair\s+(?:dismissal|treatment)\b",
r"\bemployment\s+(?:dispute|claim)\b",
],
"intellectual_property": [
r"\binfringement\b", r"\btrademark\b", r"\bcopyright\b",
r"\bpatent\b", r"\btrade\s+secret\b", r"\bmisappropriation\b",
],
"property": [
r"\bland(?:lord|lady)\b", r"\btenant\b", r"\blease\b",
r"\bproperty\s+(?:damage|dispute)\b", r"\beviction\b",
],
"debt_collection": [
r"\bowed\b", r"\bunpaid\b", r"\bdebt\b", r"\binvoice\b",
r"\bpayment\s+(?:due|owed|outstanding)\b",
],
"personal_injury": [
r"\bpersonal\s+injury\b", r"\bbodily\s+harm\b",
r"\bmedical\s+(?:expenses|bills)\b", r"\binjured\b",
],
"professional_liability": [
r"\bmalpractice\b", r"\bprofessional\s+(?:negligence|liability)\b",
r"\bfiduciary\b", r"\bstandard\s+of\s+care\b",
],
}
# Monetary amount patterns
MONEY_PATTERN = re.compile(
r"(?:(?:USD|EUR|GBP|CAD|AUD)\s*)?[\$\u20ac\u00a3]?\s*\d[\d,]*(?:\.\d{1,2})?\s*"
r"(?:million|billion|thousand|[MBKmk])?(?:\s*(?:USD|EUR|GBP|CAD|AUD))?",
re.IGNORECASE,
)
# Date patterns
DATE_PATTERN = re.compile(
r"\b(?:\d{1,2}[/-]\d{1,2}[/-]\d{2,4}|\d{4}[/-]\d{1,2}[/-]\d{1,2}|"
r"(?:January|February|March|April|May|June|July|August|September|October|November|December)"
r"\s+\d{1,2},?\s+\d{4}|\d{1,2}\s+"
r"(?:January|February|March|April|May|June|July|August|September|October|November|December)"
r"\s+\d{4})",
re.IGNORECASE,
)
# Evidence reference patterns
EVIDENCE_PATTERNS = [
(r"\b(?:exhibit|evidence)\s+[A-Z\d]+\b", "formal_exhibit"),
(r"\b(?:email|correspondence|letter)\s+(?:dated|from|of)\b", "correspondence"),
(r"\bcontract\s+(?:dated|signed|executed)\b", "contract"),
(r"\binvoice\s+(?:#|no\.?|number)\s*\w+", "invoice"),
(r"\bwitness(?:es)?\b", "witness"),
(r"\bexpert\s+(?:report|opinion|testimony)\b", "expert"),
(r"\bphoto(?:graph)?s?\b", "photograph"),
(r"\brecording\b", "recording"),
(r"\bbank\s+(?:statement|record)\b", "financial_record"),
(r"\bmedical\s+record\b", "medical_record"),
]
# Interest category patterns
INTEREST_PATTERNS: Dict[str, List[str]] = {
"legal": [
r"\bright\b", r"\bentitle\b", r"\bliabilit", r"\bobligat",
r"\bprecedent\b", r"\blaw\b", r"\blegal\b",
],
"commercial": [
r"\bbusiness\b", r"\brevenue\b", r"\bprofit\b", r"\bcost\b",
r"\bmarket\b", r"\breputation\b", r"\bfinancial\b",
],
"relational": [
r"\brelationship\b", r"\bpartnership\b", r"\bongoing\b",
r"\bfuture\s+(?:business|dealings)\b", r"\btrust\b",
],
"emotional": [
r"\bfairness\b", r"\brespect\b", r"\backnowledg", r"\bapolog",
r"\bfrustr", r"\banger\b", r"\bdisappoint\b", r"\bprincipl",
],
"procedural": [
r"\bspeed\b", r"\bquick\b", r"\bprivac(?:y|ate)\b",
r"\bconfidential\b", r"\bcontrol\b", r"\bvoice\b",
],
}
def extract_sentences(text: str) -> List[str]:
"""Split into sentences."""
abbrevs = ["Mr.", "Mrs.", "Ms.", "Dr.", "Jr.", "Sr.", "No.", "Art.", "Sec.", "v."]
protected = text
for abbr in abbrevs:
protected = protected.replace(abbr, abbr.replace(".", "<DOT>"))
sentences = re.split(r'(?<=[.!?])\s+', protected)
return [s.replace("<DOT>", ".").strip() for s in sentences if s.strip()]
def extract_parties(text: str) -> List[Dict[str, Any]]:
"""Extract party references from text."""
parties = []
seen_labels = set()
text_lower = text.lower()
# Named parties: "X v Y" or "X vs Y" or "X versus Y"
vs_match = re.search(r'([A-Z][\w\s&,.]+?)\s+(?:v\.?|vs\.?|versus)\s+([A-Z][\w\s&,.]+?)(?:\.|,|\s{2})', text)
if vs_match:
for i, group in enumerate([vs_match.group(1).strip(), vs_match.group(2).strip()], 1):
label = f"Party {i}"
parties.append({"name": group, "label": label, "role": "claimant" if i == 1 else "respondent"})
seen_labels.add(label)
# Role-based extraction
for pat in PARTY_INDICATORS:
for m in re.finditer(pat, text_lower):
matched = m.group().strip()
if matched not in seen_labels:
seen_labels.add(matched)
role = "claimant" if any(w in matched for w in ["plaintiff", "claimant", "petitioner", "applicant"]) else "respondent"
parties.append({"name": matched.title(), "label": matched.title(), "role": role})
if not parties:
parties = [
{"name": "Party A", "label": "Party A", "role": "claimant"},
{"name": "Party B", "label": "Party B", "role": "respondent"},
]
return parties
def extract_claims(text: str) -> List[Dict[str, Any]]:
"""Extract and classify claims from text."""
claims = []
text_lower = text.lower()
sentences = extract_sentences(text)
for claim_type, patterns in CLAIM_PATTERNS.items():
for pat in patterns:
for m in re.finditer(pat, text_lower):
# Find the sentence containing this match
for sent in sentences:
if m.group() in sent.lower():
claims.append({
"type": claim_type,
"matched_phrase": m.group(),
"context": sent.strip()[:200],
})
break
break # One match per pattern group is enough
# Deduplicate by type
seen_types = set()
unique = []
for c in claims:
if c["type"] not in seen_types:
seen_types.add(c["type"])
unique.append(c)
return unique
def extract_monetary_amounts(text: str) -> List[Dict[str, str]]:
"""Extract monetary amounts from text."""
amounts = []
sentences = extract_sentences(text)
for sent in sentences:
for m in MONEY_PATTERN.finditer(sent):
val = m.group().strip()
if val and any(c.isdigit() for c in val) and len(val) > 1:
amounts.append({
"amount": val,
"context": sent.strip()[:200],
})
return amounts
def extract_dates(text: str) -> List[Dict[str, str]]:
"""Extract dates and build timeline."""
dates = []
sentences = extract_sentences(text)
for sent in sentences:
for m in DATE_PATTERN.finditer(sent):
dates.append({
"date": m.group().strip(),
"context": sent.strip()[:200],
})
return dates
def extract_evidence(text: str) -> List[Dict[str, str]]:
"""Extract evidence references."""
evidence = []
sentences = extract_sentences(text)
for sent in sentences:
for pat, etype in EVIDENCE_PATTERNS:
for m in re.finditer(pat, sent, re.IGNORECASE):
evidence.append({
"type": etype,
"reference": m.group().strip(),
"context": sent.strip()[:200],
})
return evidence
def analyze_interests(text: str) -> Dict[str, List[str]]:
"""Identify interest categories present in the text."""
text_lower = text.lower()
found: Dict[str, List[str]] = {}
for category, patterns in INTEREST_PATTERNS.items():
matches = []
for pat in patterns:
for m in re.finditer(pat, text_lower):
matches.append(m.group())
if matches:
found[category] = list(set(matches))
return found
def assess_complexity(
parties: List, claims: List, amounts: List, dates: List, evidence: List, text: str
) -> Dict[str, Any]:
"""Assess dispute complexity."""
word_count = len(text.split())
factors = {
"party_count": len(parties),
"claim_count": len(claims),
"monetary_references": len(amounts),
"date_references": len(dates),
"evidence_references": len(evidence),
"text_length_words": word_count,
}
score = 0
score += min(len(parties), 4)
score += min(len(claims) * 2, 8)
score += min(len(amounts), 3)
score += min(len(evidence), 3)
score += 2 if word_count > 2000 else (1 if word_count > 500 else 0)
if score >= 12:
level = "high"
elif score >= 6:
level = "moderate"
else:
level = "low"
factors["complexity_score"] = score
factors["complexity_level"] = level
return factors
def format_human_report(analysis: Dict[str, Any]) -> str:
"""Format analysis as human-readable report."""
lines = []
lines.append("=" * 72)
lines.append("DISPUTE ANALYSIS REPORT")
lines.append("=" * 72)
lines.append(f"\nComplexity: {analysis['complexity']['complexity_level'].upper()} "
f"(score: {analysis['complexity']['complexity_score']})")
lines.append("\n--- PARTIES ---")
for p in analysis["parties"]:
lines.append(f" {p['name']} ({p['role']})")
lines.append(f"\n--- CLAIMS ({len(analysis['claims'])}) ---")
for c in analysis["claims"]:
lines.append(f" Type: {c['type'].replace('_', ' ').title()}")
lines.append(f" {c['context'][:150]}")
if analysis["monetary_amounts"]:
lines.append(f"\n--- MONETARY AMOUNTS ({len(analysis['monetary_amounts'])}) ---")
for a in analysis["monetary_amounts"]:
lines.append(f" {a['amount']}")
lines.append(f" {a['context'][:150]}")
if analysis["timeline"]:
lines.append(f"\n--- TIMELINE ({len(analysis['timeline'])}) ---")
for d in analysis["timeline"]:
lines.append(f" {d['date']}: {d['context'][:120]}")
if analysis["evidence"]:
lines.append(f"\n--- EVIDENCE REFERENCES ({len(analysis['evidence'])}) ---")
for e in analysis["evidence"]:
lines.append(f" [{e['type']}] {e['reference']}")
if analysis["interests"]:
lines.append("\n--- INTEREST CATEGORIES ---")
for cat, keywords in analysis["interests"].items():
lines.append(f" {cat.title()}: {', '.join(keywords)}")
lines.append("\n--- ZOPA INDICATORS ---")
if analysis["interests"].get("relational"):
lines.append(" + Relational interests present -- parties may value ongoing relationship")
if analysis["interests"].get("procedural"):
lines.append(" + Procedural interests present -- process matters to parties")
if analysis["interests"].get("emotional"):
lines.append(" + Emotional interests present -- consider non-monetary resolution elements")
shared = set()
for cat in analysis["interests"]:
if cat in ("relational", "procedural"):
shared.add(cat)
if shared:
lines.append(f" Potentially shared interests: {', '.join(shared)}")
lines.append("\n" + "=" * 72)
return "\n".join(lines)
def main() -> None:
parser = argparse.ArgumentParser(
description="Analyze dispute description and extract structured dispute data."
)
parser.add_argument("--input", "-i", type=str, help="Path to dispute description file")
parser.add_argument("--text", "-t", type=str, help="Inline dispute text")
parser.add_argument("--output", "-o", type=str, help="Path to save output (JSON)")
parser.add_argument("--json", action="store_true", help="Output in JSON format")
args = parser.parse_args()
if not args.input and not args.text:
parser.print_help()
sys.exit(1)
try:
if args.input:
with open(args.input, "r", encoding="utf-8") as f:
text = f.read()
else:
text = args.text
if not text or not text.strip():
print("Error: Empty input text.", file=sys.stderr)
sys.exit(1)
parties = extract_parties(text)
claims = extract_claims(text)
amounts = extract_monetary_amounts(text)
dates = extract_dates(text)
evidence = extract_evidence(text)
interests = analyze_interests(text)
complexity = assess_complexity(parties, claims, amounts, dates, evidence, text)
analysis = {
"parties": parties,
"claims": claims,
"monetary_amounts": amounts,
"timeline": dates,
"evidence": evidence,
"interests": interests,
"complexity": complexity,
}
if args.output:
with open(args.output, "w", encoding="utf-8") as f:
json.dump(analysis, f, indent=2, ensure_ascii=False)
print(f"Analysis saved to {args.output}")
elif args.json:
print(json.dumps(analysis, indent=2, ensure_ascii=False))
else:
print(format_human_report(analysis))
except FileNotFoundError:
print(f"Error: File not found: {args.input}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
Settlement Calculator
Takes dispute parameters and calculates BATNA/WATNA for each party, ZOPA range,
and three settlement scenarios (conservative, balanced, creative). Supports
both inline parameters and JSON input.
Usage:
python settlement_calculator.py --input params.json
python settlement_calculator.py --input params.json --json
python settlement_calculator.py --claimed 500000 --litigation-cost-a 80000 \
--litigation-cost-b 120000 --probability 0.65 --time-to-trial 18
python settlement_calculator.py --input params.json --output settlement.json
Input JSON schema:
{
"claimed_amount": 500000,
"litigation_cost_a": 80000,
"litigation_cost_b": 120000,
"success_probability": 0.65,
"time_to_trial_months": 18,
"discount_rate_annual": 0.05,
"partial_recovery_low": 0.3,
"partial_recovery_high": 0.8,
"non_monetary_factors": ["ongoing relationship", "confidentiality"],
"counterclaim_amount": 0,
"counterclaim_probability": 0.0,
"party_a_name": "Claimant",
"party_b_name": "Respondent"
}
"""
import argparse
import json
import math
import sys
from typing import Any, Dict, List, Optional, Tuple
DEFAULT_PARAMS = {
"claimed_amount": 0,
"litigation_cost_a": 0,
"litigation_cost_b": 0,
"success_probability": 0.5,
"time_to_trial_months": 12,
"discount_rate_annual": 0.05,
"partial_recovery_low": 0.3,
"partial_recovery_high": 0.8,
"non_monetary_factors": [],
"counterclaim_amount": 0,
"counterclaim_probability": 0.0,
"party_a_name": "Party A (Claimant)",
"party_b_name": "Party B (Respondent)",
}
def present_value(amount: float, months: int, annual_rate: float) -> float:
"""Calculate present value of a future amount."""
if annual_rate <= 0 or months <= 0:
return amount
years = months / 12.0
return amount / ((1 + annual_rate) ** years)
def calculate_batna_watna(params: Dict[str, Any]) -> Dict[str, Any]:
"""Calculate BATNA and WATNA for both parties."""
claimed = params["claimed_amount"]
cost_a = params["litigation_cost_a"]
cost_b = params["litigation_cost_b"]
prob = params["success_probability"]
months = params["time_to_trial_months"]
rate = params["discount_rate_annual"]
low_pct = params["partial_recovery_low"]
high_pct = params["partial_recovery_high"]
counterclaim = params.get("counterclaim_amount", 0)
counter_prob = params.get("counterclaim_probability", 0)
# Party A (Claimant) analysis
a_best_case = claimed - cost_a # Win full amount minus own costs
a_worst_case = -cost_a - (counterclaim * counter_prob) # Lose, pay costs, face counterclaim
a_expected_value = (prob * claimed * (low_pct + high_pct) / 2) - cost_a
a_expected_pv = present_value(a_expected_value, months, rate)
# Risk-adjusted expected value
a_risk_adjusted = (prob * claimed) - cost_a - (counter_prob * counterclaim)
# Party B (Respondent) analysis
b_best_case = -cost_b # Win case, only pay own costs
b_worst_case = -(claimed + cost_b) # Lose full amount plus costs
b_expected_value = -(prob * claimed * (low_pct + high_pct) / 2) - cost_b
b_expected_pv = present_value(abs(b_expected_value), months, rate) * -1
# Risk-adjusted for respondent
b_risk_adjusted = -(prob * claimed) - cost_b + (counter_prob * counterclaim)
return {
"party_a": {
"name": params["party_a_name"],
"best_case_trial": round(a_best_case, 2),
"worst_case_trial": round(a_worst_case, 2),
"expected_value": round(a_expected_value, 2),
"present_value": round(a_expected_pv, 2),
"risk_adjusted": round(a_risk_adjusted, 2),
"litigation_cost": cost_a,
},
"party_b": {
"name": params["party_b_name"],
"best_case_trial": round(b_best_case, 2),
"worst_case_trial": round(b_worst_case, 2),
"expected_value": round(b_expected_value, 2),
"present_value": round(b_expected_pv, 2),
"risk_adjusted": round(b_risk_adjusted, 2),
"litigation_cost": cost_b,
},
}
def calculate_zopa(params: Dict[str, Any], batna: Dict[str, Any]) -> Dict[str, Any]:
"""Calculate Zone of Possible Agreement."""
claimed = params["claimed_amount"]
prob = params["success_probability"]
cost_a = params["litigation_cost_a"]
cost_b = params["litigation_cost_b"]
# Party A's minimum acceptable: what they'd get at trial minus costs and risk
a_minimum = max(0, (prob * claimed) - cost_a)
# Party B's maximum acceptable: what they'd lose at trial plus costs avoided
b_maximum = (prob * claimed) + cost_b
zopa_exists = a_minimum < b_maximum
zopa_range = round(b_maximum - a_minimum, 2) if zopa_exists else 0
midpoint = round((a_minimum + b_maximum) / 2, 2) if zopa_exists else 0
return {
"exists": zopa_exists,
"party_a_minimum": round(a_minimum, 2),
"party_b_maximum": round(b_maximum, 2),
"range": zopa_range,
"midpoint": midpoint,
"as_percentage_of_claim": round(midpoint / claimed * 100, 1) if claimed > 0 else 0,
}
def generate_scenarios(
params: Dict[str, Any], batna: Dict[str, Any], zopa: Dict[str, Any]
) -> List[Dict[str, Any]]:
"""Generate three settlement scenarios."""
claimed = params["claimed_amount"]
non_monetary = params.get("non_monetary_factors", [])
scenarios = []
# Scenario 1: Straightforward Compromise (split-the-difference within ZOPA)
if zopa["exists"]:
compromise_amount = zopa["midpoint"]
else:
# If no ZOPA, use risk-adjusted midpoint
compromise_amount = round(claimed * params["success_probability"] * 0.75, 2)
scenarios.append({
"name": "Straightforward Compromise",
"settlement_amount": round(compromise_amount, 2),
"percentage_of_claim": round(compromise_amount / claimed * 100, 1) if claimed > 0 else 0,
"rationale": (
"Pure monetary split based on litigation risk analysis. "
"Amount reflects the expected value of litigation discounted by costs and uncertainty."
),
"terms": [
f"Lump sum payment of {compromise_amount:,.2f}",
"Full and final settlement",
"Mutual release of all claims",
"Each party bears own costs",
],
"suitable_when": "Simple monetary dispute with no ongoing relationship",
})
# Scenario 2: Interest-Based Solution
interest_amount = round(compromise_amount * 0.85, 2) # Slightly less cash
interest_terms = [
f"Monetary component: {interest_amount:,.2f}",
"Mutual release with non-disparagement clause",
"Confidentiality of settlement terms",
]
if "ongoing relationship" in [f.lower() for f in non_monetary]:
interest_terms.append("Framework for future business dealings")
if "confidentiality" in [f.lower() for f in non_monetary]:
interest_terms.append("Enhanced confidentiality provisions")
if non_monetary:
interest_terms.append(f"Non-monetary elements: {', '.join(non_monetary)}")
scenarios.append({
"name": "Interest-Based Solution",
"settlement_amount": interest_amount,
"percentage_of_claim": round(interest_amount / claimed * 100, 1) if claimed > 0 else 0,
"rationale": (
"Lower monetary amount offset by non-monetary value. "
"Addresses underlying interests beyond pure financial recovery."
),
"terms": interest_terms,
"suitable_when": "Parties have ongoing relationship or value non-monetary outcomes",
})
# Scenario 3: Package Deal (phased payment + non-monetary)
total_package = round(compromise_amount * 1.05, 2) # Slightly more total value
initial_payment = round(total_package * 0.5, 2)
deferred_payment = round(total_package * 0.5, 2)
package_terms = [
f"Initial payment: {initial_payment:,.2f} within 30 days",
f"Deferred payment: {deferred_payment:,.2f} over 6-12 months",
f"Total package value: {total_package:,.2f}",
"Mutual release upon completion of all payments",
"Performance guarantee / security for deferred payments",
]
if non_monetary:
package_terms.append(f"Non-monetary elements: {', '.join(non_monetary)}")
scenarios.append({
"name": "Package Deal",
"settlement_amount": total_package,
"percentage_of_claim": round(total_package / claimed * 100, 1) if claimed > 0 else 0,
"rationale": (
"Higher total value delivered through phased payments, reducing immediate "
"cash burden on paying party while providing certainty to receiving party. "
"Bundles monetary and non-monetary elements."
),
"terms": package_terms,
"suitable_when": "Paying party has cash flow constraints; multiple issues to trade off",
})
return scenarios
def build_sensitivity(params: Dict[str, Any]) -> List[Dict[str, Any]]:
"""Run sensitivity analysis across probability ranges."""
claimed = params["claimed_amount"]
cost_a = params["litigation_cost_a"]
cost_b = params["litigation_cost_b"]
results = []
for prob in [0.2, 0.35, 0.5, 0.65, 0.8]:
a_min = max(0, (prob * claimed) - cost_a)
b_max = (prob * claimed) + cost_b
mid = round((a_min + b_max) / 2, 2)
results.append({
"probability": prob,
"party_a_minimum": round(a_min, 2),
"party_b_maximum": round(b_max, 2),
"midpoint": mid,
"zopa_exists": a_min < b_max,
})
return results
def format_currency(amount: float) -> str:
"""Format number as currency string."""
if amount < 0:
return f"-{abs(amount):,.2f}"
return f"{amount:,.2f}"
def format_human_report(result: Dict[str, Any]) -> str:
"""Format results as human-readable report."""
lines = []
lines.append("=" * 72)
lines.append("SETTLEMENT ANALYSIS REPORT")
lines.append("=" * 72)
p = result["parameters"]
lines.append(f"\nClaimed amount: {format_currency(p['claimed_amount'])}")
lines.append(f"Success probability: {p['success_probability']:.0%}")
lines.append(f"Time to trial: {p['time_to_trial_months']} months")
lines.append(f"Litigation cost (A): {format_currency(p['litigation_cost_a'])}")
lines.append(f"Litigation cost (B): {format_currency(p['litigation_cost_b'])}")
b = result["batna_watna"]
lines.append(f"\n--- {b['party_a']['name'].upper()} ---")
lines.append(f" Best case at trial: {format_currency(b['party_a']['best_case_trial'])}")
lines.append(f" Worst case at trial: {format_currency(b['party_a']['worst_case_trial'])}")
lines.append(f" Expected value: {format_currency(b['party_a']['expected_value'])}")
lines.append(f" Risk-adjusted: {format_currency(b['party_a']['risk_adjusted'])}")
lines.append(f"\n--- {b['party_b']['name'].upper()} ---")
lines.append(f" Best case at trial: {format_currency(b['party_b']['best_case_trial'])}")
lines.append(f" Worst case at trial: {format_currency(b['party_b']['worst_case_trial'])}")
lines.append(f" Expected value: {format_currency(b['party_b']['expected_value'])}")
lines.append(f" Risk-adjusted: {format_currency(b['party_b']['risk_adjusted'])}")
z = result["zopa"]
lines.append(f"\n--- ZOPA ---")
lines.append(f" ZOPA exists: {'YES' if z['exists'] else 'NO'}")
if z["exists"]:
lines.append(f" A minimum: {format_currency(z['party_a_minimum'])}")
lines.append(f" B maximum: {format_currency(z['party_b_maximum'])}")
lines.append(f" Range: {format_currency(z['range'])}")
lines.append(f" Midpoint: {format_currency(z['midpoint'])} ({z['as_percentage_of_claim']}% of claim)")
lines.append("\n--- SETTLEMENT SCENARIOS ---")
for i, s in enumerate(result["scenarios"], 1):
lines.append(f"\n Scenario {i}: {s['name']}")
lines.append(f" Amount: {format_currency(s['settlement_amount'])} ({s['percentage_of_claim']}% of claim)")
lines.append(f" Rationale: {s['rationale'][:150]}")
lines.append(f" Suitable: {s['suitable_when']}")
lines.append(f" Terms:")
for t in s["terms"]:
lines.append(f" - {t}")
lines.append("\n--- SENSITIVITY ANALYSIS ---")
lines.append(f" {'Prob':>6s} {'A Min':>12s} {'B Max':>12s} {'Midpoint':>12s} ZOPA")
for sa in result["sensitivity"]:
lines.append(
f" {sa['probability']:>5.0%} {format_currency(sa['party_a_minimum']):>12s} "
f"{format_currency(sa['party_b_maximum']):>12s} "
f"{format_currency(sa['midpoint']):>12s} {'Yes' if sa['zopa_exists'] else 'No'}"
)
lines.append("\n" + "=" * 72)
return "\n".join(lines)
def main() -> None:
parser = argparse.ArgumentParser(
description="Calculate settlement ranges, BATNA/WATNA, ZOPA, and scenarios."
)
parser.add_argument("--input", "-i", type=str, help="Path to parameters JSON file")
parser.add_argument("--claimed", type=float, help="Claimed amount")
parser.add_argument("--litigation-cost-a", type=float, help="Party A litigation costs")
parser.add_argument("--litigation-cost-b", type=float, help="Party B litigation costs")
parser.add_argument("--probability", type=float, help="Success probability (0-1)")
parser.add_argument("--time-to-trial", type=int, help="Months to trial")
parser.add_argument("--output", "-o", type=str, help="Path to save output (JSON)")
parser.add_argument("--json", action="store_true", help="Output in JSON format")
args = parser.parse_args()
try:
params = dict(DEFAULT_PARAMS)
if args.input:
with open(args.input, "r", encoding="utf-8") as f:
file_params = json.load(f)
params.update(file_params)
elif args.claimed is not None:
params["claimed_amount"] = args.claimed
if args.litigation_cost_a is not None:
params["litigation_cost_a"] = args.litigation_cost_a
if args.litigation_cost_b is not None:
params["litigation_cost_b"] = args.litigation_cost_b
if args.probability is not None:
params["success_probability"] = args.probability
if args.time_to_trial is not None:
params["time_to_trial_months"] = args.time_to_trial
else:
parser.print_help()
sys.exit(1)
if params["claimed_amount"] <= 0:
print("Error: Claimed amount must be positive.", file=sys.stderr)
sys.exit(1)
if not (0 <= params["success_probability"] <= 1):
print("Error: Probability must be between 0 and 1.", file=sys.stderr)
sys.exit(1)
batna = calculate_batna_watna(params)
zopa = calculate_zopa(params, batna)
scenarios = generate_scenarios(params, batna, zopa)
sensitivity = build_sensitivity(params)
result = {
"parameters": params,
"batna_watna": batna,
"zopa": zopa,
"scenarios": scenarios,
"sensitivity": sensitivity,
}
if args.output:
with open(args.output, "w", encoding="utf-8") as f:
json.dump(result, f, indent=2, ensure_ascii=False)
print(f"Settlement analysis saved to {args.output}")
elif args.json:
print(json.dumps(result, indent=2, ensure_ascii=False))
else:
print(format_human_report(result))
except FileNotFoundError:
print(f"Error: File not found: {args.input}", file=sys.stderr)
sys.exit(1)
except json.JSONDecodeError as e:
print(f"Error: Invalid JSON in input file: {e}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
Related skills
FAQ
Does mediation-analysis give legal advice?
No. It is marked experimental, is for educational and informational purposes only, and does not constitute legal advice.
What does the settlement calculator compute?
It calculates BATNA, WATNA, ZOPA, and settlement scenarios from claimed amounts, litigation costs, probability, and time to trial.