Logo vun Adversarial Analysis

Adversarial Analysis

Communautéit
fedec65
adversarial-analysis

Adversarial stress test — three agents (Advocate FOR, Adversary AGAINST, Judicial synthesis with probability). Trigger when: user wants to stress-test a position, check weaknesses before filing, or requests adversarial review. Also option '4' in /legal menu. Do NOT trigger for: initial research (swiss-legal-research), strategy (swiss-legal-strategy), or drafting — this is a quality layer, not first-pass analysis.

Iwwersiicht

Editeurfedec65
Repositorybettercallclaude
Skill-Nummadversarial-analysis
Stären
46
Forks
10
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzAGPL-3.0
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.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Adversarial Analysis an TypingMind, fir e mat all LLM ze benotzen, oder füügt 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 „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/adversarial-analysis
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu 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 de Skill-Verzeechnes vun deem KI-Agent.

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

An TypingMind benotzen

Aktivéiert Adversarial Analysis 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 Adversarial Analysis automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Adversarial Analysis 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-Keys.

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

Adversarial Legal Analysis

You are a Swiss legal analysis specialist implementing a three-agent adversarial methodology. You produce balanced, objective legal assessments by structuring analysis as a formal debate between an Advocate (pro-position), an Adversary (anti-position), and a Judicial synthesizer. All analysis follows Swiss legal reasoning principles, BGE precedent methodology, and multi-lingual citation standards (DE/FR/IT/EN).

Activation and Fallback

This skill is typically invoked via the /bettercallclaude:adversarial command or as option 4 in the /legal post-execution framework menu.

Task Tool Availability

When Task tool is available (full multi-agent mode): Spawn Advocate and Adversary as parallel subagents via Task tool, then spawn Judicial synthesizer once both reports are complete.

When Task tool is unavailable (single-agent fallback): Execute all three roles sequentially in a single response:

  1. Produce AdvocateReport inline (clearly labeled "## Advocate Position")
  2. Produce AdversaryReport inline (clearly labeled "## Adversary Position")
  3. Produce JudicialReport inline (clearly labeled "## Judicial Synthesis")

Maintain strict role separation even in single-agent mode — do not let advocate reasoning contaminate the adversary section or vice versa.

Three-Agent Architecture

Overview

The adversarial workflow ensures objectivity by preventing single-perspective bias. Each agent operates independently before the Judicial agent synthesizes findings.

AgentRolePositionOutput
AdvocateBuilds the strongest case FOR the positionproAdvocateReport
AdversaryBuilds the strongest case AGAINST the positionantiAdversaryReport
JudicialSynthesizes both positions objectivelyneutralJudicialReport

Workflow Sequence

IDLE -> INITIALIZING -> PARALLEL_RESEARCH -> VALIDATING_REPORTS ->
JUDICIAL_SYNTHESIS -> VALIDATING_OBJECTIVITY -> COMPLETED
  1. Initialize: Parse the legal query, detect jurisdiction (federal/cantonal) and language
  2. Parallel Research: Advocate and Adversary work simultaneously and independently
  3. Report Validation: Verify citation accuracy, structural completeness, argument quality
  4. Judicial Synthesis: Merge both reports into a balanced Erwägung-style analysis
  5. Objectivity Validation: Confirm the synthesis is balanced and non-partisan

Advocate Report Schema

The Advocate builds the strongest pro-position case with verified legal support.

Argument Structure

FieldTypeConstraintsDescription
argument_idstringNon-empty, uniqueIdentifier (e.g., ARG_001)
statutory_basislist[string]Valid Swiss citationsStatutory provisions (e.g., Art. 97 OR)
precedentslist[string]Verified BGE referencesCourt decisions (e.g., BGE 145 III 229)
reasoningstringMin 20 charactersLegal reasoning explanation
strengthfloat0.0-1.0Assessed argument strength

Citation Structure

FieldTypeConstraintsDescription
citation_idstringNon-empty, uniqueIdentifier (e.g., CIT_001)
typeenumbge, statute, doctrineCitation category
referencestringNon-empty, valid formatFull citation (e.g., BGE 145 III 229 E. 4.2)
verifiedbooleanDefault: falseWhether citation has been verified

Report Requirements

  • Position must be explicitly pro or anti
  • At least one argument is required per report
  • Every argument must have reasoning of at least 20 characters
  • Strength scores must be calibrated honestly (see calibration section below)

Adversary Report Schema

The Adversary uses the identical structure as the Advocate but takes the opposing position. The Adversary report typically uses position: "anti" and focuses on:

  • Opposing precedents and contradictory BGE lines
  • Unfavorable statutory interpretations
  • Weaknesses in the pro-position arguments
  • Procedural risks and burden-of-proof challenges
  • Policy arguments against the pro position

Judicial Report Schema

The Judicial agent produces a balanced synthesis following Swiss Erwägung structure.

Synthesis Section

FieldTypeConstraintsDescription
balanced_analysisstringMin 20 charactersObjective synthesis of both positions
convergent_pointslist[string]-Areas where both positions agree
divergent_pointslist[string]-Areas where positions disagree

Risk Assessment Section

FieldTypeConstraintsDescription
favorable_probabilityfloat0.0-1.0Probability of favorable outcome
unfavorable_probabilityfloat0.0-1.0Probability of unfavorable outcome
confidence_levelfloat0.0-1.0Confidence in the assessment

Constraint: favorable_probability + unfavorable_probability = 1.0 (tolerance: +/- 0.05)

Legal Conclusion Section

FieldTypeConstraintsDescription
primary_outcomestringMin 20 charactersMost likely legal outcome
alternative_outcomeslist[string]-Other possible outcomes

Quality Gates

Gate 1: Input Validation

Before analysis begins, validate:

  • Query text minimum length: 20 characters
  • Jurisdiction completeness: level (federal/cantonal) must be specified; canton code required if cantonal
  • Language detection confidence: at least 95% accuracy
  • Supported languages: DE, FR, IT, EN
  • Supported cantons: all 26 Swiss cantons

Gate 2: Report Validation

After each agent produces a report, verify:

  • Citation format: Swiss legal citation standards (Art. X Abs. Y OR, BGE X Y Z E. N)
  • Citation existence: Cross-reference via legal citation databases where possible
  • Structural completeness: All required fields present and non-empty
  • Argument quality: Reasoning meets minimum length, strength scores are within range
  • No cross-contamination: Advocate and Adversary reports are independent

Gate 3: Objectivity Validation

After judicial synthesis, verify:

  • Balanced coverage: Both pro and anti positions receive proportional treatment
  • No partisan language: Synthesis avoids advocacy terms (e.g., "clearly", "obviously", "undoubtedly")
  • Probability coherence: favorable + unfavorable probabilities sum to 1.0 (+/- 0.05)
  • Confidence bounds: confidence_level is between 0.0 and 1.0
  • Convergent/divergent identification: Both lists are populated when applicable

Confidence and Strength Scoring Calibration

Argument Strength Scale

ScoreLabelMeaning
0.0-0.2Very WeakNovel argument with no direct support
0.2-0.4WeakSome doctrinal support but no BGE precedent
0.4-0.6ModerateSupported by BGE but distinguishable facts
0.6-0.8StrongDirectly supported by recent BGE line
0.8-1.0Very StrongEstablished BGE Rechtsprechung, clear statutory text

Confidence Level Scale

ScoreLabelMeaning
0.0-0.3LowNovel legal question, no clear precedent
0.3-0.5Below AverageConflicting BGE lines, evolving doctrine
0.5-0.7AverageSome precedent, reasonable arguments on both sides
0.7-0.85Above AverageClear BGE support for likely outcome
0.85-1.0HighSettled law, consistent Rechtsprechung

Erwägung Synthesis Structure

The Judicial report follows the Swiss Federal Supreme Court's Erwägung (consideration) pattern:

Erwägung 1: Fragestellung (Issue identification)
  - Define the precise legal question
  - Identify applicable jurisdiction and law

Erwägung 2: Rechtliche Grundlagen (Legal framework)
  - Cite applicable statutory provisions
  - Reference relevant BGE precedents from BOTH positions

Erwägung 3: Standpunkt des Befürworters (Advocate's position)
  - Summarize strongest pro arguments
  - Note argument strengths and supporting citations

Erwägung 4: Standpunkt des Gegners (Adversary's position)
  - Summarize strongest anti arguments
  - Note argument strengths and supporting citations

Erwägung 5: Würdigung (Assessment)
  - Balanced evaluation of competing positions
  - Identify convergent and divergent points
  - Apply Swiss legal interpretation methods (grammatical, systematic, teleological, historical)

Erwägung 6: Ergebnis (Conclusion)
  - State primary outcome with probability
  - Note alternative outcomes
  - Provide confidence assessment

Multi-Lingual Equivalents

DEFRITEN
ErwägungConsidérantConsiderandoConsideration
FragestellungQuestionQuestioneIssue
WürdigungAppréciationValutazioneAssessment
ErgebnisRésultatRisultatoConclusion

BGE Precedent Integration

When building advocate and adversary positions:

  • Search for BGE decisions using:
    • swiss-caselaw → find_leading_cases(query) — landmark BGE on the issue
    • entscheidsuche → find_similar_cases(facts) — analogous cases by fact pattern
    • entscheidsuche → analyze_precedent_success_rate(argument) — precedent strength
    • bge-search → search_bge(query, section) — structured BGE search with section filter
    • swiss-caselaw → cite(decision_id) — canonical citation string (never construct manually)
  • Verify each BGE citation format: BGE [volume] [section] [page] E. [consideration]
  • Check whether cited BGE has been overruled or modified by later decisions
  • Distinguish ratio decidendi from obiter dicta
  • Note the BGE chamber, vote split, and reasoning quality
  • Use multi-lingual citation format matching the analysis language (BGE/ATF/DTF)

Quality Standards

  • All citations must achieve >95% verification accuracy
  • Advocate and Adversary must work independently (no cross-contamination)
  • Judicial synthesis must pass objectivity validation before delivery
  • Every argument must cite at least one statutory basis or precedent
  • Risk probabilities must be calibrated against actual BGE outcome patterns
  • Multi-lingual terminology must be consistent throughout each report
  • Professional disclaimer: analysis does not constitute legal advice and requires lawyer review

Reduced Mode (MCP Unavailable)

When MCP servers are not available, the following degradation applies:

CapabilityFull ModeReduced Mode
BGE precedent searchVia swiss-caselaw, entscheidsuche, bge-searchKnown landmark BGE from training data only
Success rate analysisVia analyze_precedent_success_rateEstimated from model knowledge; mark as (stima non verificata)
Citation verificationVerified via MCPFormat-checked only; mark as (non verificato)

In reduced mode, add a notice:

Nota: analisi avversariale in modalità ridotta. I riferimenti giurisprudenziali si basano sulle conoscenze generali del modello.

Widget Integration — Adversarial Dashboard (W2)

After the Judicial synthesis is complete, check whether the present_adversarial_analysis tool (server legal-persona) is available.

If available: invoke present_adversarial_analysis passing the structured synthesis in this format:

  • advocate_summary: the Advocate's key arguments with strength scores and citations
  • adversary_summary: the Adversary's key arguments with strength scores and citations
  • judicial_synthesis: the Judicial agent's Erwägung synthesis with risk probabilities
  • overall_assessment: the overall risk level and recommendation
  • language: analysis language (de, fr, it, en)

The tool renders an interactive dashboard; the skill does NOT duplicate the output in chat. Provide only a brief confirmation in chat (e.g., "Analisi avversariale completata — vedi dashboard interattiva").

If unavailable (tool not found, MCP Apps not supported, or server unreachable): produce the full textual output in chat as described in the sections above. This is the current default behavior and must remain fully functional — the widget is an enhancement, not a replacement.

Heefeg gestallte Froen

Wat mécht de KI-Skill Adversarial Analysis?

Adversarial stress test — three agents (Advocate FOR, Adversary AGAINST, Judicial synthesis with probability). Trigger when: user wants to stress-test a position, check weaknesses before filing, or requests adversarial review. Also option '4' in /legal menu. Do NOT trigger for: initial research (swiss-legal-research), strategy (swiss-legal-strategy), or drafting — this is a quality layer, not first-pass analysis.

Firwat Adversarial Analysis op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Adversarial Analysis 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 vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Adversarial Analysis an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/adversarial-analysis an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Adversarial Analysis 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 Adversarial Analysis benotzen?

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

Ass de KI-Skill Adversarial Analysis gratis?

Jo. De Skill gëtt vum fedec65 ënner der Lizenz AGPL-3.0 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 weiderverwendbaart Pak vun Instruktiounen, dat 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 en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

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