Analyze Supreme Court opinions for principle invocation and methodological consistency. Use when the user asks about SCOTUS cases, principle weights, judicial methodology, constitutional principles, or consistency analysis. Also use when the user asks to "code an opinion," "check a case," "analyze a SCOTUS term," or anything involving Berman's model, SAW aggregation, or principled positivism.
Automated principle extraction and consistency auditing for Supreme Court opinions, based on Mitchell Berman's Simple Additive Weighting model.
This skill reads Supreme Court opinions and identifies which legal principles each opinion invokes, how prominently each principle figures in the reasoning, and whether each principle supports or opposes the outcome. It can:
When the user asks about a specific case (e.g., "code the Dobbs opinion" or "analyze Bruen"):
scripts/scotus_code.py search "<case name>"scripts/scotus_code.py code --cluster <id>data/codings/When the user asks to code a term (e.g., "code OT 2022" or "analyze the 2023 term"):
scripts/scotus_code.py term <year> --output data/codings/ot<year>.csvWhen the user asks whether a specific case is consistent with the Court's methodology:
data/weights/ (or compute them if not cached)When the user asks about how methodology has shifted:
data/weights/When in doubt, go lower.
Code direction as the opinion frames it. For dissents, the "outcome" is the dissent's preferred result.
All scripts are in scripts/. They require python3, requests, and pandas.
# Search for a case
python3 scripts/scotus_code.py search "Dobbs Jackson"
# Code a single cluster
python3 scripts/scotus_code.py code --cluster 6481357
# Code a full term
python3 scripts/scotus_code.py term 2022 --output data/codings/ot2022.csv
# Compute term-level weights
python3 scripts/scotus_code.py weights --terms 2018,2019,2020,2021,2022
# Run consistency check on a case against baseline weights
python3 scripts/scotus_code.py check --cluster 6481357 --baseline data/weights/ot2018-2022.json
Coding results are saved as both CSV and JSON in data/codings/.
CSV columns: case_name, author, opinion_type, outcome, principle_id, principle_name, prominence, direction, evidence
JSON includes full structured output with principles_not_coded and metadata.
data/codings/ — raw coding sheets (CSV and JSON per term)data/weights/ — estimated principle weights per termdata/consistency/ — consistency reports and discrepancy decompositionsdata/corpus/ — cached opinion texts from Court ListenerRequires a free auth token (set as COURTLISTENER_TOKEN env var). Get one at courtlistener.com — sign up, go to profile, copy token. Rate limit: 5,000 requests/hour with token.
The coding engine uses whatever model OpenClaw is configured with. The system prompt
for principle extraction is embedded in scripts/scotus_code.py. The prompt follows
the coding protocol exactly — same taxonomy, same prominence scale, same direction rules,
same decision rules.
Based on Mitchell Berman's principled positivism: net legal force = sum(weight × activation) across all relevant principles. See: Kamper, "Computational Jurisprudence: Testing Berman's Principled Positivism Through Agent-Based Modeling" (2026).
Code and data: https://dgk-law-and-cognition-lab.github.io/BermanModeling/