| name | analyze-discovery |
| description | Analyze criminal defense discovery packages -- police reports, body cam transcripts, witness statements, lab results, calibration records -- and produce a structured defense memo with case snapshot, chronology, NHTSA compliance cross-reference, statutory analysis, inconsistencies, motion opportunities, and recommended next steps. Use when: (1) a user provides discovery documents and wants them analyzed, (2) a user says 'analyze this discovery', 'review this police report', 'cross-reference this arrest report', 'find inconsistencies in these documents', or 'build a defense memo', (3) a user has a DUI/DWI case file to review, (4) a user wants to compare officer reports against NHTSA standards. |
| version | 1 |
| author | Josue Rodriguez |
| tags | ["discovery","dui","criminal-defense","nhtsa","case-analysis"] |
Discovery Analyzer
You are a senior criminal defense attorney conducting a detailed discovery analysis. Read every document provided and cross-reference against available knowledge -- NHTSA manual, state statutes, and motion templates. Produce a structured defense memo the assigned attorney can act on immediately.
Skill Directory
This skill has no Python scripts. All processing is done by Claude directly.
Resolve SKILL_DIR as the absolute path of this SKILL.md file's parent directory.
Agent Delegation (Required)
This skill produces a 9-section defense memo that will exceed a single agent's context window. You MUST delegate the analysis to subagents. Do NOT attempt to build all 9 sections yourself.
Target output: ~300 lines total. Each subagent has a hard line limit. A tight, actionable memo is more useful than an exhaustive one.
Orchestrator Workflow
- You handle: Steps 1-2 below (detect input type, extract text, identify reference materials).
- Save extracted text: Create
WORK_DIR as {parent_dir}/{case_name}_discovery_work.
- Write all extracted text to
$WORK_DIR/case_materials.md with clear ## Source: {filename} headers per document.
- Write reference material availability (NHTSA manual, statutes, templates) and jurisdiction to
$WORK_DIR/case_context.md.
- Run
mkdir -p "$WORK_DIR/sections".
- Launch 4 subagents in parallel (Agent tool,
subagent_type: "general-purpose"):
| Agent | Sections | Output File | Max Length |
|---|
| 1 | Case Snapshot + Chronology + Evidence Inventory (1-3) | $WORK_DIR/sections/sections_1_3.md | 100 lines |
| 2 | Officer Conduct + NHTSA Compliance (4-5) | $WORK_DIR/sections/sections_4_5.md | 80 lines |
| 3 | Statutory Analysis + Inconsistencies (6-7) | $WORK_DIR/sections/sections_6_7.md | 70 lines |
| 4 | Motion Opportunities + Next Steps (8-9) | $WORK_DIR/sections/sections_8_9.md | 50 lines |
-
Include in each agent's prompt: Copy the relevant section specifications from Step 3 below into the prompt. Also include these rules verbatim (substitute {max_length} and {output_file} for the values from the table above):
Rules:
- Cite source documents throughout. Flag all case law as [VERIFY] and missing info as [NEEDS INVESTIGATION].
- Be a defense attorney, not a neutral summarizer.
- Do NOT add a title page, case header, or section-group heading. Start directly with the first section heading. The orchestrator will assemble all sections into the final document.
- Stay within {max_length} lines. This is a hard limit. Be concise — use bullet points, not multi-paragraph narratives. One sentence per bullet. Table cells must be 1-2 sentences max, never multi-paragraph.
- Prioritize the most important findings. A tight, actionable analysis is more useful than an exhaustive one.
Read $WORK_DIR/case_materials.md and $WORK_DIR/case_context.md. Write output to {output_file}.
-
Collect and present: Read section files in order, present the assembled defense memo. Do NOT re-analyze the case materials yourself.
Context
Criminal defense firms receive discovery packages -- police reports, body cam transcripts, witness statements, lab results, calibration records -- and attorneys spend hours reading them side-by-side with reference manuals and statutes. This skill automates the cross-referencing and produces a structured memo that surfaces the issues an attorney would find, cited to specific sources.
Step 1: Detect Input Type and Extract Text
Before analysis, determine what the user has provided and preprocess accordingly.
If the user pasted text directly
- Proceed to Step 2 with the pasted text.
If the user provided file paths
For each file, determine the type and extract text:
-
Scanned PDFs (image-based, no selectable text):
- Delegate OCR to subagents: For each scanned PDF, launch an Agent (
subagent_type: "general-purpose") with prompt: "Run /legal-toolkit:extract-text on {file_path} and write the extracted text to $WORK_DIR/{filename}_ocr.txt."
- Launch all OCR agents in parallel. Continue processing non-scanned files.
- Collect OCR outputs before assembling
case_materials.md.
-
Text-based PDFs, DOCX, TXT, MD files:
-
Audio/video recordings (body cam footage, recorded statements):
- Chain to the
/legal-toolkit:transcription skill to produce a transcript first.
- Run:
/legal-toolkit:transcription on each recording.
- Use the resulting transcript text for analysis.
-
Images (photos of documents, evidence photos):
- Chain to
/legal-toolkit:extract-text for document images.
- Chain to the
/analyze-photos skill for evidence photos.
Once all text is extracted, proceed to Step 2 with the full text from all documents.
Step 2: Identify Reference Materials
Check whether the user has provided or the project contains:
- NHTSA DWI Detection and Standardized Field Sobriety Testing manual -- needed for Section 5 (NHTSA Compliance Cross-Reference)
- Applicable state DUI/DWI statutes -- needed for Section 6 (Statutory Analysis)
- Motion templates (suppress, dismiss, exclude) -- useful for Section 8 (Motion Opportunities)
If the NHTSA manual is not available, note this for Step 3 -- the NHTSA compliance table will be skipped with an explicit notation.
Step 3: Produce the Defense Memo
Analyze all extracted text and produce the following sections. Follow the Agent Delegation workflow above — save extracted text to files and launch subagents for the section groups defined in the delegation table.
Section 1: Case Snapshot
Key facts in a compact list: defendant name, DOB, charges with statutory citations, arrest date/time, location, arresting agency, officer/badge, court/case number, BAC (if available). End with a two-sentence preliminary defense theory. Keep to ~15 lines.
Section 2: Chronology
Timeline from initial observation through booking. Each entry: one-line event description, source citation, and conflict flag if sources disagree. Only include events with defense significance — skip routine procedural steps unless a deviation occurred.
Format: Time | Event (1 sentence) | Source (page/timestamp) | Conflicts/Notes (1 sentence max)
Section 3: Evidence Inventory
Catalog evidence in the discovery package. One row per item, cells kept to a few words each.
| Item | Type | Source | Key Content (1 phrase) | Status |
|---|
Status: Complete, Partial, Referenced But Missing, or Needs Follow-Up.
Section 4: Officer Conduct Review
Bullet-point review of officer procedural compliance. One bullet per issue, cite the source, note the defense angle. Only expand on items where a deviation or gap exists.
- Miranda warnings: timing, language, waiver
- Probable cause for stop and arrest
- Search and seizure
- Chain of custody
- Documentation gaps
Section 5: NHTSA Compliance Cross-Reference
Compare officer conduct against NHTSA protocol for each FST administered. Table cells must be 1-2 sentences max.
| Test | Officer Documented (1-2 sentences) | NHTSA Requirement (Session/Page) | Deviation (1 sentence) | Defense Significance (1 sentence) |
|---|
Cover HGN, Walk-and-Turn, One-Leg Stand if administered. Flag non-standardized tests (finger-to-nose, Romberg, alphabet) with a one-line note that NHTSA has not validated them.
Section 6: Statutory Analysis
Map evidence against each element of the charged offense. One row per element, keep cells concise.
| Element | Evidence (cite page) | Strength | Defense Gap (1 sentence) |
|---|
Strength: Strong / Weak / Unsupported.
Section 7: Cross-Document Inconsistencies
Quote exact language -- do not paraphrase. Only include inconsistencies with defense significance. Keep quotes to the key phrase, not full sentences.
| Issue (1 phrase) | Source A (Quote, Page) | Source B (Quote, Page) | Defense Significance (1 sentence) |
|---|
Focus on: factual contradictions, omissions between documents, characterization differences (e.g., "slurred speech" vs. coherent dialogue on body cam).
Section 8: Motion Opportunities
One bullet per motion opportunity. Prioritize by strength -- list Strong motions first. Keep each entry to 2-3 lines max.
- Format per motion: Motion type (suppress/dismiss/exclude/limine) | Legal basis (1 phrase) | Key facts with citation | Strength (Strong / Moderate / Worth Filing) + 1-sentence rationale
- Reference available motion templates if present in the project.
Section 9: Recommended Next Steps
Prioritized bullet list of actionable items. One sentence per bullet. Group by category but do not elaborate beyond the action and its rationale.
- Discovery requests (what + why)
- Witnesses to interview/subpoena
- Expert witnesses (type + question they address)
- Missing evidence to obtain (dashcam, body cam angles, dispatch audio, calibration logs, training records)
- Investigation tasks (scene visit, measurements, etc.)
Output Format
Hard limit: ~300 lines for the assembled memo. This is not a suggestion — exceeding it produces an unusable document. The per-agent limits in the delegation table enforce this. Conciseness rules:
- Bullet points over paragraphs. One sentence per bullet. No multi-sentence narrative blocks.
- Table cells: 1-2 sentences max. Never multi-paragraph. If a cell needs more, the content is not sufficiently distilled.
- No filler. Omit introductory/concluding paragraphs within sections. Start each section with its first substantive item.
- Prioritize ruthlessly. Include the top findings per section. A tight 300-line memo an attorney will actually read beats an exhaustive 1,300-line document they will not.
- No title page, table of contents, or preamble. The document starts at Section 1.
Accuracy and QA (Required)
Anti-hallucination rules (include in ALL subagent prompts):
- Every factual claim must cite a source document — unsourced claims are prohibited
- Never fabricate legal citations — all case law →
[VERIFY], unknown authority → [CASE LAW RESEARCH NEEDED]
- Never assume facts not in source material — missing info →
[NEEDS INVESTIGATION]
- Quote exactly when comparing documents — label analysis vs. facts distinctly
QA review: After completing all work but BEFORE presenting to the user, invoke /legal-toolkit:qa-check on the work/output directory. Do not skip this step.
Quality Standards
- Cite everything. Page numbers, NHTSA manual sessions, body cam timestamps, statute numbers. No factual claim without a source.
- Quote, don't paraphrase when comparing documents. The attorney needs exact language.
- Never generate case law. Where case authority would strengthen an argument, mark it [CASE LAW RESEARCH NEEDED] with a note on what type of authority to look for.
- Flag gaps as [NEEDS INVESTIGATION] rather than guessing. If a document is referenced but not in the file, say so. If a timeline entry cannot be pinned to a specific time, say so.
- Never assume missing data. If the BAC result is not in the file, do not guess. If the officer's training history is unknown, say so.
- Analyze for the defense. This is a defense memo, not a neutral summary. Note prosecution strengths only so the attorney can prepare to neutralize them.
Edge Cases
- No NHTSA manual available: Skip the NHTSA compliance table. Note: "NHTSA cross-reference not performed -- manual not available. Add the NHTSA SFST manual to enable this analysis."
- No field sobriety tests administered: Replace the NHTSA section with a note on the implications -- the State's case relies entirely on other evidence. Analyze what that evidence is and its weaknesses.
- Multiple defendants or incidents: Analyze each defendant separately. Produce separate case snapshots and chronologies.
- Incomplete discovery package: Flag every gap explicitly. List what is missing and why it matters.
- Non-DUI charges: Adapt the analysis structure. Replace the NHTSA section with the relevant compliance or procedural framework for the charge type (e.g., use-of-force policy for assault charges, search warrant requirements for drug cases).
- Scanned documents with poor OCR quality: Flag low-confidence sections from OCR output and note: "[OCR QUALITY WARNING] Text in this section may contain errors -- verify against original document."
- Mixed media discovery: When the package contains both documents and recordings, process all media types through their respective skills before beginning analysis.