
2026 Legal Research Agent
- 171 installs
- 178 repo stars
- Updated July 14, 2026
- erichowens/some_claude_skills
Run agentic legal research on statutes, cases, and guidance to answer compliance questions before product, policy, or go-to-market decisions harden.
About
Agent-oriented skill for 2026-era legal research: querying regulations and precedent, summarizing obligations, and drafting sourced briefs so teams validate compliance assumptions before implementation or launch in regulated domains.
- Case law search
- Statute summarization
- Citation tracing
- Jurisdiction compare
- Compliance memos
2026 Legal Research Agent by the numbers
- 171 all-time installs (skills.sh)
- Ranked #3,105 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/erichowens/some_claude_skills --skill 2026-legal-research-agentAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 171 |
|---|---|
| repo stars | ★ 178 |
| Last updated | July 14, 2026 |
| Repository | erichowens/some_claude_skills ↗ |
What it does
Run agentic legal research on statutes, cases, and guidance to answer compliance questions before product, policy, or go-to-market decisions harden.
Files
2026 Legal Research Agent
---
When to Use This Skill
Use this skill when you need to:
- Find authoritative legal sources for a specific state's expungement laws
- Configure Firecrawl jobs to scrape court systems, legislatures, or legal aid sites
- Validate scraped data for accuracy and completeness
- Research 2026 law changes including Clean Slate acts and marijuana expungement
- Build URL patterns for systematic state-by-state data collection
- Identify gaps in existing scraped data coverage
Do NOT use this skill for:
- Interpreting what laws mean (use
national-expungement-expert) - Building user interfaces or components
- Providing legal advice to users
- General web scraping unrelated to legal data
---
Core Instructions
1. Authoritative Source Hierarchy
When researching expungement laws, prioritize sources in this order:
Tier 1 (Primary Authority):
├── State Legislature websites (statute text)
├── State Court Administrative Office
└── State Attorney General publications
Tier 2 (Official Secondary):
├── State Bar Association guides
├── Court self-help centers
└── Public law databases (public.law, justia.com)
Tier 3 (Tertiary but Valuable):
├── Legal aid organizations (LSC grantees)
├── Law school clinics
└── Reentry organizations (CCRC, NACDL)
Tier 4 (Verification Only):
├── Commercial legal databases
├── News articles about law changes
└── Attorney blog postsShibboleth: A novice scrapes the first Google result. An expert knows that courts.{state}.gov contains the self-help forms while legislature.{state}.gov contains the statute text—and both are needed.
2. URL Pattern Knowledge by State Type
States organize their legal resources differently. Know the patterns:
Unified Court Systems (courts own everything):
California: courts.ca.gov/selfhelp-expungement.htm
Oregon: courts.oregon.gov/programs/exp/Pages/default.aspx
Washington: courts.wa.gov/forms/?fa=forms.contribute&formID=101Split Systems (legislature + court separate):
Texas: txcourts.gov (forms) + texas.public.law (statutes)
New York: nycourts.gov (forms) + nysenate.gov/legislation/laws (statutes)
Florida: flcourts.gov (forms) + leg.state.fl.us/statutes (statutes)Public.law States (excellent statute hosting):
oregon.public.law, california.public.law, texas.public.law
michigan.public.law, washington.public.lawShibboleth: Knowing that apps.leg.wa.gov/RCW/ is Washington's statute database while leg.wa.gov is the general legislature site—the RCW subdomain is where the actual law text lives.
3. 2026 Legal Landscape Awareness
As of 2026, these major changes affect research:
Clean Slate States (automatic expungement passed):
- Pennsylvania (2018), Utah (2019), New Jersey (2019), Michigan (2020)
- California (2020), Connecticut (2021), Delaware (2021), Virginia (2021)
- Oklahoma (2022), Colorado (2022), New York (2023), Minnesota (2023)
- Maryland (2024), Illinois (2024), Oregon (2025)
Marijuana Expungement (specific statutes):
- Most states now have separate marijuana expungement provisions
- Search for "cannabis conviction" alongside "expungement"
- Check for retroactive application dates
2025-2026 Law Changes to Verify:
- Oregon HB 2316 (expanded eligibility)
- California AB 1076 (automatic relief expansion)
- Check CCRC's Restoration of Rights Project for current status
Shibboleth: Knowing that "automatic expungement" doesn't mean immediate—Pennsylvania's Clean Slate has a 10-year waiting period for arrests and varies by offense. Research must capture these nuances.
4. Firecrawl Configuration Expertise
When configuring scrape jobs:
Extraction Schema Design:
// For statute pages, extract:
{
statuteCitation: "string", // e.g., "ORS 137.225"
title: "string", // e.g., "Setting aside conviction"
fullText: "string", // Complete statute text
effectiveDate: "string", // When current version took effect
lastAmended: "string", // Most recent amendment date
subsections: "array", // Parsed subsections
}
// For court self-help pages, extract:
{
stateName: "string",
expungementPageUrl: "string",
formsLibraryUrl: "string",
selfHelpUrl: "string",
contactPhone: "string",
feeScheduleUrl: "string",
}
// For forms, extract:
{
formNumber: "string", // e.g., "MC-440"
formTitle: "string",
pdfUrl: "string",
applicableTo: "array", // ["misdemeanor", "arrest"]
lastUpdated: "string",
}Rate Limiting for Government Sites:
rateLimit: 2, // 2 requests/second max for .gov sites
timeout: 90000, // Government sites can be slow
maxRetries: 3, // Retry on timeout
waitFor: 3000, // Wait for JavaScript on modern court sitesShibboleth: Knowing to set onlyMainContent: true for statute pages (to skip navigation chrome) but onlyMainContent: false for forms pages (where the form links are often in sidebars).
5. Data Validation Checklist
After scraping, validate:
□ Statute citations match official format (e.g., "ORS" not "Or. Rev. Stat.")
□ Effective dates are parseable and reasonable (not future, not too old)
□ URLs are live and return 200 status
□ PDF form links actually download PDFs (not HTML error pages)
□ Phone numbers are in consistent format
□ Fee amounts are numeric and reasonable ($0-$500 typical range)
□ State code extracted correctly (watch for ambiguous URLs)Common Extraction Errors:
- "oregon.public.law" matching "la" (Louisiana) instead of "or" (Oregon)
- Statute text truncated at 10,000 characters (increase limit)
- Form "last updated" dates in inconsistent formats
- County-specific URLs mistaken for state-level
6. Gap Analysis Process
To identify missing data for a state:
# Check what we have
ls src/data/scraped/states/{state}/
# Expected files for complete coverage:
# - statutes.json (eligibility rules from statute text)
# - court-system.json (court URLs, contacts, forms links)
# - forms/ (actual PDF forms)
# - fees.json (filing fee amounts)
# - counties/ (county-specific court data)
# Cross-reference with state data file
grep -l "waitingPeriods\|eligibilityRules" src/data/states/{state}.tsPriority order for filling gaps: 1. Statutes (foundation for all rules) 2. Court forms (what users actually need to file) 3. Fee information (users need to budget) 4. County contacts (where to file) 5. Spanish resources (accessibility)
---
Anti-Patterns
Never Do These:
1. Scrape without rate limiting - Government sites will block you 2. Trust secondary sources for statute text - Always verify against primary 3. Assume URL patterns are consistent - Each state is different 4. Ignore effective dates - Laws change; scraped data needs timestamps 5. Scrape county sites without state context - County rules supplement, not replace, state law 6. Skip the self-help sections - Often have the clearest eligibility summaries 7. Treat all states the same - Clean Slate states have fundamentally different processes
Common Mistakes:
❌ Scraping Wikipedia for statute text
✅ Scraping the state legislature's official code
❌ Using findlaw.com as primary source
✅ Using findlaw.com to find the citation, then scraping the official source
❌ Assuming "expungement" is the only term
✅ Searching for: expungement, sealing, set-aside, dismissal, destruction, pardons
❌ Treating waiting periods as simple numbers
✅ Capturing offense-specific waiting periods (felonies vs misdemeanors vs arrests)---
Project-Specific Context
This skill is designed for the National Expungement Guide project:
Existing Infrastructure
- Firecrawl scripts:
scripts/firecrawl/ - Job definitions:
scripts/firecrawl/jobs.ts(P0-P4 priority jobs) - URL config:
scripts/firecrawl/config.ts(all 50 states) - Output path:
src/data/scraped/states/{state}/ - State data:
src/data/states/(TypeScript files per state)
Running Scrapes
# Set API key first
export FIRECRAWL_API_KEY=your_key
# Run P0 (state statutes + courts) - ~$0.20 cost
npx tsx scripts/firecrawl/run-p0.ts
# Dry run to preview
npx tsx scripts/firecrawl/run-p0.ts --dry-run
# Check reports
cat scripts/firecrawl/reports/p0-*.jsonData Flow
Firecrawl scrape → src/data/scraped/{state}/*.json
↓
Manual review + cleanup
↓
Integrated into src/data/states/{state}.ts
↓
Used by eligibility wizard + PDF generator---
References
See references/ folder for:
url-patterns-by-state.md- Complete URL patterns for all 50 statesclean-slate-timeline.md- When each Clean Slate law passed and took effectfirecrawl-schemas.md- All extraction schemas used
---
Example Workflow
User request: "Research California's 2026 expungement laws and scrape the latest data"
Agent workflow: 1. Check existing data: ls src/data/scraped/states/ca/ 2. Verify current statute version at california.public.law 3. Check for 2025-2026 law changes via CCRC or news search 4. Update scripts/firecrawl/config.ts if URLs changed 5. Run targeted scrape: add CA-specific URLs to P0 job 6. Validate extracted data against known statute citations 7. Document any gaps or changes found
Clean Slate Implementation Timeline
Tracking automatic expungement laws by state with implementation dates.
Active Clean Slate Laws (as of 2026)
2018
Pennsylvania - First in the nation
- Signed: June 28, 2018
- Effective: June 28, 2019
- Coverage:
- Non-conviction records (arrests)
- Summary offenses after 10 years arrest-free
- Misdemeanor convictions (2nd, 3rd degree) after 10 years
- Exclusions: Felonies, violent crimes, sex offenses
- Source: 18 Pa.C.S. § 9122.2
2019
Utah
- Signed: March 29, 2019
- Effective: May 1, 2020
- Coverage:
- Acquittals and dismissals (automatic)
- Arrests without charges
- Note: Does NOT cover convictions automatically (petition required)
- Source: Utah Code 77-40a
New Jersey
- Signed: December 18, 2019
- Effective: June 15, 2020
- Coverage:
- Most criminal convictions after 10 years
- Disorderly persons offenses
- Municipal ordinance violations
- Exclusions: Murder, sex crimes, robbery, other violent offenses
- Source: N.J.S.A. 2C:52-5.1 ("Clean Slate Law")
2020
Michigan
- Signed: October 12, 2020
- Effective: April 11, 2021
- Coverage:
- Arrests after 7 years
- Misdemeanor convictions after 7 years
- Up to 2 felony convictions after 10 years
- Exclusions: Assaultive crimes, crimes > 10 years max, traffic offenses
- Source: MCL 780.621g
California
- Signed: October 8, 2020 (AB 1076)
- Effective: January 1, 2021
- Coverage:
- Arrests not leading to conviction (after 3 years)
- Completion of sentence/probation (automatic relief)
- Exclusions: Registration offenses, cases with victims opposed
- Source: PC 1203.425
2021
Connecticut
- Signed: June 22, 2021 (PA 21-32)
- Effective: January 1, 2023
- Coverage:
- Most misdemeanors after 7 years
- Class D and E felonies after 10 years
- Exclusions: Class A-C felonies, sex offenses, family violence
- Note: One of the most comprehensive laws
- Source: Conn. Gen. Stat. § 54-142e
Delaware
- Signed: July 29, 2021
- Effective: July 29, 2021
- Coverage:
- Misdemeanor convictions after 7 years
- Some felonies after 10 years
- Exclusions: Violent felonies, sex offenses
- Source: 11 Del. C. § 4373
Virginia
- Signed: March 31, 2021 (SB 5034)
- Effective: July 1, 2021
- Coverage:
- Limited automatic sealing
- Certain misdemeanors after waiting period
- Exclusions: DUI, domestic violence, many felonies
- Note: Implementation phased, ongoing
- Source: Va. Code 19.2-392.12
2022
Oklahoma
- Signed: May 25, 2022
- Effective: November 1, 2022
- Coverage:
- Nonviolent misdemeanors after 5 years
- Nonviolent felonies after 5-15 years (depending on level)
- Exclusions: Violent crimes, sex offenses
- Source: 22 O.S. § 19c
Colorado
- Signed: May 31, 2022
- Effective: January 1, 2024
- Coverage:
- Certain misdemeanors automatic sealing
- Drug offenses expanded eligibility
- Exclusions: Violent crimes, sex offenses
- Source: CRS 24-72-710.5
2023
New York
- Signed: November 16, 2023
- Effective dates:
- Misdemeanors: November 16, 2024
- Felonies (Class D/E): November 16, 2027
- Coverage:
- Most misdemeanors after 3 years
- Class D and E felonies after 8 years
- Exclusions: Sex offenses, Class A-C felonies, violent felonies
- Note: Largest impact due to population
- Source: CPL 160.57
Minnesota
- Signed: May 19, 2023
- Effective: January 1, 2025
- Coverage:
- Petty misdemeanors, misdemeanors after 2 years
- Gross misdemeanors after 4 years
- Some felonies after 5-7 years
- Exclusions: Murder, criminal sexual conduct, DUI
- Source: Minn. Stat. 609A.015
2024
Maryland
- Signed: May 16, 2024
- Effective: October 1, 2024
- Coverage:
- Expanded automatic sealing
- Certain misdemeanors and felonies
- Details: Implementation regulations pending
- Source: Md. Code, Crim. Proc. § 10-301
Illinois
- Signed: August 9, 2024
- Effective: January 1, 2025
- Coverage:
- Extensive automatic sealing
- Most misdemeanors
- Many Class 3 and 4 felonies
- Exclusions: Sex offenses, violent crimes, DUI
- Source: 20 ILCS 2630/5.2
2025
Oregon
- Signed: July 1, 2025
- Effective: January 1, 2026
- Coverage:
- Arrests and dismissals (automatic after 3 years)
- Many misdemeanors (automatic after 3 years)
- Some felonies (automatic after 7-10 years)
- Exclusions: Person felonies, Class A felonies, sex offenses
- Source: ORS 137.225(12)
---
Pending/Proposed Clean Slate Legislation
Under Consideration (2026)
- Massachusetts: Multiple bills introduced
- Washington: SB 5180 (2023) discussion ongoing
- Nevada: AB 192 (2023) partial implementation
- Texas: Limited bills (nondisclosure expansion)
- Florida: Advocacy campaigns active
Failed/Stalled
- Ohio: Multiple bills failed to advance
- Arizona: SB 1294 (2020) did not pass
- Wisconsin: No automatic mechanism possible under current law
---
Implementation Patterns
What "Automatic" Actually Means
Truly Automatic:
- State agency reviews records systematically
- No petition or action required from individual
- Records updated on set schedule
- Examples: PA, NJ, CT, MI
Semi-Automatic:
- Triggered by completion of sentence/probation
- May require verification by probation officer
- Individual may need to confirm eligibility
- Examples: CA, OK
Automatic Notification:
- Individual notified of eligibility
- Still must petition or confirm
- Simplified petition process
- Examples: Some VA provisions
Timeline from Law to Implementation
Typical pattern: 1. Law signed (Day 0) 2. Regulations drafted (3-6 months) 3. IT systems built (6-18 months) 4. Testing period (3-6 months) 5. Gradual rollout (6-12 months) 6. Full implementation (18-36 months total)
Fastest: Utah (12 months from signing) Slowest: Virginia (36+ months, ongoing)
Common Exclusions Across States
Nearly universal exclusions:
- Sex offenses requiring registration
- Murder/manslaughter
- Domestic violence (varies)
- Offenses against children
Common exclusions:
- DUI (some states)
- Violent felonies generally
- Crimes with mandatory minimums
- Offenses with sentences > 10 years
Less common exclusions:
- Drug trafficking (many states include)
- Property crimes (usually included)
- First-degree felonies only (some states)
---
Verification URLs
For researching current law status:
| State | Primary Source |
|---|---|
| PA | https://www.legis.state.pa.us/cfdocs/legis/LI/consCheck.cfm?txtType=HTM&ttl=18&div=0&chpt=91 |
| NJ | https://www.njleg.state.nj.us/ |
| MI | http://www.legislature.mi.gov/ |
| CA | https://leginfo.legislature.ca.gov/ |
| CT | https://www.cga.ct.gov/ |
| DE | https://delcode.delaware.gov/ |
| VA | https://law.lis.virginia.gov/ |
| OK | https://www.oscn.net/ |
| CO | https://leg.colorado.gov/ |
| NY | https://www.nysenate.gov/legislation |
| MN | https://www.revisor.mn.gov/ |
| MD | https://mgaleg.maryland.gov/ |
| IL | https://www.ilga.gov/ |
| OR | https://www.oregonlegislature.gov/ |
| UT | https://le.utah.gov/ |
---
Research Notes
Key Advocacy Organizations
- Clean Slate Initiative: https://www.cleanslateinitiative.org/
- Collateral Consequences Resource Center: https://ccresourcecenter.org/
- ACLU Criminal Law Reform: state-specific pages
- Legal Aid organizations: state-by-state
Academic Sources
- Brennan Center for Justice (wage penalty studies)
- Vera Institute of Justice (racial disparity data)
- RAND Corporation (recidivism studies)
Media Coverage for Law Changes
- Search "[State] Clean Slate" + year for implementation updates
- State bar association news for attorney guidance
- Court administrative orders for implementation rules
URL Patterns by State
Quick reference for authoritative legal sources by state.
Pattern Legend
- Legislature: Official statute text
- Court Admin: Court system self-help and forms
- Public.law: Third-party but authoritative statute hosting
- Forms: Direct links to expungement forms
---
Pacific States
Oregon (OR)
Legislature: https://oregon.public.law/statutes/ors_137.225
Court Admin: https://www.courts.oregon.gov/programs/exp/Pages/default.aspx
Forms: https://www.courts.oregon.gov/forms/Pages/default.aspx
Key statute: ORS 137.225 (Set aside)California (CA)
Legislature: https://california.public.law/codes/ca_penal_code_section_1203.4
Court Admin: https://www.courts.ca.gov/selfhelp-expungement.htm
Forms: https://www.courts.ca.gov/forms.htm
Key statutes: PC 1203.4 (Dismissal), PC 1203.4a (Arrests)Washington (WA)
Legislature: https://apps.leg.wa.gov/RCW/default.aspx?cite=9.96.060
Court Admin: https://www.courts.wa.gov/forms/
Forms: https://www.courts.wa.gov/forms/?fa=forms.contribute&formID=101
Key statute: RCW 9.96.060 (Vacating convictions)Alaska (AK)
Legislature: http://www.legis.state.ak.us/basis/statutes.asp#12.62.180
Court Admin: https://courts.alaska.gov/shc/records/
Key statute: AS 12.62.180Hawaii (HI)
Legislature: https://www.capitol.hawaii.gov/hrscurrent/Vol14_Ch0701-0853/HRS0831/
Court Admin: https://www.courts.state.hi.us/self-help
Key statute: HRS 831-3.2---
Mountain States
Colorado (CO)
Legislature: https://leg.colorado.gov/sites/default/files/2023a_1167_signed.pdf
Court Admin: https://www.courts.state.co.us/Forms/Index.cfm
Key statute: CRS 24-72-702 (Sealing)Nevada (NV)
Legislature: https://www.leg.state.nv.us/NRS/NRS-179.html
Court Admin: https://nvcourts.gov/self-help
Key statute: NRS 179.245-179.301Utah (UT)
Legislature: https://le.utah.gov/xcode/Title77/Chapter40/77-40.html
Court Admin: https://www.utcourts.gov/howto/expunge/
Key statute: Utah Code 77-40-102
Clean Slate: Utah Code 77-40a (automatic)Arizona (AZ)
Legislature: https://www.azleg.gov/ars/13/00905.htm
Court Admin: https://www.azcourts.gov/selfservicecenter/
Key statute: ARS 13-905 (Set aside)
Note: Voter rights restoration: ARS 13-908New Mexico (NM)
Legislature: https://nmonesource.com/nmos/nmsa/en/item/4371/index.do
Court Admin: https://www.nmcourts.gov/self-help/
Key statute: NMSA 1978 § 29-3AIdaho (ID)
Legislature: https://legislature.idaho.gov/statutesrules/idstat/Title67/T67CH30/
Court Admin: https://isc.idaho.gov/forms
Key statute: Idaho Code 67-3004 (expungement), IC 19-2604 (withheld judgment)Montana (MT)
Legislature: https://leg.mt.gov/bills/mca/title_0460/chapter_0180/part_0020/sections_index.html
Court Admin: https://courts.mt.gov/forms
Key statute: MCA 46-18-1101 (Deferred sentences)Wyoming (WY)
Legislature: https://wyoleg.gov/statutes/compress/title07.pdf
Court Admin: https://www.courts.state.wy.us/
Key statute: Wyo. Stat. Ann. § 7-13-1501
Note: Limited expungement - primarily DNA records---
Southwest States
Texas (TX)
Legislature: https://texas.public.law/statutes/tex._code_of_crim._proc._art._55.01
Court Admin: https://www.txcourts.gov/rules-forms/
Key statutes:
- Art. 55.01 (Expunction) - arrests/dismissals only
- Gov't Code 411.081 (Nondisclosure) - some convictionsOklahoma (OK)
Legislature: https://www.oscn.net/applications/oscn/DeliverDocument.asp?CiteID=69619
Court Admin: https://www.oscn.net/
Key statute: 22 O.S. § 18 (Expungement)
Clean Slate: 22 O.S. § 19c (automatic)---
Midwest States
Illinois (IL)
Legislature: https://www.ilga.gov/legislation/ilcs/ilcs3.asp?ActID=1876
Court Admin: https://www.illinoiscourts.gov/forms/expungement-forms
Key statutes:
- 20 ILCS 2630/5.2 (Expungement)
- 730 ILCS 5/5-5-5 (Sealing)
Clean Slate: SB 2122 (2024)Michigan (MI)
Legislature: http://www.legislature.mi.gov/documents/mcl/pdf/mcl-780-621.pdf
Court Admin: https://www.courts.michigan.gov/administration/admin-services/forms/set-aside/
Key statute: MCL 780.621
Clean Slate: MCL 780.621g (automatic)Ohio (OH)
Legislature: https://codes.ohio.gov/ohio-revised-code/section-2953.32
Court Admin: https://www.supremecourt.ohio.gov/
Key statute: ORC 2953.32Indiana (IN)
Legislature: https://iga.in.gov/legislative/laws/2021/ic/titles/035#35-38-9
Court Admin: https://www.in.gov/courts/forms/
Key statute: IC 35-38-9Minnesota (MN)
Legislature: https://www.revisor.mn.gov/statutes/cite/609A
Court Admin: https://www.mncourts.gov/Help-Topics/Expungement.aspx
Key statute: Minn. Stat. Ch. 609A
Clean Slate: Minn. Stat. 609A.015 (2023)Wisconsin (WI)
Legislature: https://docs.legis.wisconsin.gov/statutes/statutes/973/015
Court Admin: https://www.wicourts.gov/services/public/selfhelp/expungement.htm
Key statute: Wis. Stat. 973.015
Note: Limited - only granted at sentencingIowa (IA)
Legislature: https://www.legis.iowa.gov/docs/code/901C.pdf
Court Admin: https://www.iowacourts.gov/for-the-public/representing-yourself/
Key statute: Iowa Code 901CMissouri (MO)
Legislature: https://revisor.mo.gov/main/OneSection.aspx?section=610.140
Court Admin: https://www.courts.mo.gov/page.jsp?id=35299
Key statute: RSMo 610.140Kansas (KS)
Legislature: http://www.kslegislature.org/li/b2021_22/statute/021_000_0000_chapter/021_061_0000_article/
Court Admin: https://www.kscourts.org/KSCourts/media/KsCourts/court%20forms/General/298.pdf
Key statute: K.S.A. 21-6614Nebraska (NE)
Legislature: https://nebraskalegislature.gov/laws/statutes.php?statute=29-3523
Court Admin: https://supremecourt.nebraska.gov/self-help
Key statute: Neb. Rev. Stat. 29-3523North Dakota (ND)
Legislature: https://www.legis.nd.gov/cencode/t12-1c10.pdf
Court Admin: https://www.ndcourts.gov/
Key statute: N.D.C.C. 12-60.1-01South Dakota (SD)
Legislature: https://sdlegislature.gov/Statutes/Codified_Laws/2068901
Court Admin: https://ujs.sd.gov/
Key statute: SDCL 23A-3---
Southeast States
Florida (FL)
Legislature: http://www.leg.state.fl.us/statutes/index.cfm?App_mode=Display_Statute&URL=0900-0999/0943/0943.html
Court Admin: https://www.flcourts.gov/Resources-Services/Court-Improvement/Family-Courts/Expungement
Key statute: F.S. 943.0585 (Expungement), F.S. 943.059 (Sealing)Georgia (GA)
Legislature: https://law.justia.com/codes/georgia/2020/title-35/chapter-3/article-7/
Court Admin: https://www.georgiacourts.gov/
Key statute: O.C.G.A. 35-3-37 (Restriction)North Carolina (NC)
Legislature: https://www.ncleg.gov/EnactedLegislation/Statutes/PDF/BySection/Chapter_15A/GS_15A-145.5.pdf
Court Admin: https://www.nccourts.gov/help-topics/criminal-record-expungement
Key statute: N.C.G.S. 15A-145.5Tennessee (TN)
Legislature: https://www.tn.gov/tbi/divisions/cjis-division/tennessee-expungement-information.html
Court Admin: https://www.tncourts.gov/
Key statute: T.C.A. 40-32-101
Note: No true expungement - diversion onlyVirginia (VA)
Legislature: https://law.lis.virginia.gov/vacode/title19.2/chapter9.1/
Court Admin: https://www.vacourts.gov/
Key statute: Va. Code 19.2-392.2
Clean Slate: SB 5034 (2021)Kentucky (KY)
Legislature: https://apps.legislature.ky.gov/law/statutes/chapter.aspx?id=37305
Court Admin: https://courts.ky.gov/courts/circuit/Pages/expungement.aspx
Key statute: KRS 431.073Alabama (AL)
Legislature: https://codes.findlaw.com/al/title-15-criminal-procedure/al-code-sect-15-27-1.html
Court Admin: https://judicial.alabama.gov/
Key statute: Ala. Code § 15-27-1
Note: Very limited eligibilityMississippi (MS)
Legislature: https://law.justia.com/codes/mississippi/2020/title-99/chapter-19/
Court Admin: https://courts.ms.gov/
Key statute: Miss. Code Ann. § 99-19-71Louisiana (LA)
Legislature: https://www.legis.la.gov/Legis/Law.aspx?d=78537
Court Admin: https://www.lasc.org/
Key statute: La. C.Cr.P. art. 971-995Arkansas (AR)
Legislature: https://codes.findlaw.com/ar/title-16-practice-procedure-and-courts/ar-code-sect-16-90-1401.html
Court Admin: https://www.arcourts.gov/
Key statute: Ark. Code Ann. § 16-90-1401South Carolina (SC)
Legislature: https://www.scstatehouse.gov/code/t17c022.php
Court Admin: https://www.sccourts.org/selfHelp/
Key statute: S.C. Code Ann. § 17-22-910
Note: Very limited - first offense onlyWest Virginia (WV)
Legislature: http://www.wvlegislature.gov/wvcode/ChapterEntire.cfm?chap=61&art=11
Court Admin: https://www.courtswv.gov/
Key statute: W. Va. Code § 61-11-25---
Northeast States
New York (NY)
Legislature: https://www.nysenate.gov/legislation/laws/CPL/160.50
Court Admin: https://www.nycourts.gov/courthelp/Criminal/sealingConvictions.shtml
Key statutes:
- CPL 160.50 (Sealing after dismissal)
- CPL 160.59 (Sealing after conviction)
Clean Slate: CPL 160.57 (2023)Pennsylvania (PA)
Legislature: https://www.legis.state.pa.us/cfdocs/legis/LI/consCheck.cfm?txtType=HTM&ttl=18&div=0&chpt=91
Court Admin: https://www.pacourts.us/learn/expungement
Key statute: 18 Pa.C.S. § 9122
Clean Slate: 18 Pa.C.S. § 9122.2New Jersey (NJ)
Legislature: https://lis.njleg.state.nj.us/nxt/gateway.dll?f=templates&fn=default.htm&vid=Publish:10.1048/Enu
Court Admin: https://www.njcourts.gov/selfhelp/expungement.html
Key statute: N.J.S.A. 2C:52-1
Clean Slate: N.J.S.A. 2C:52-5.1Massachusetts (MA)
Legislature: https://malegislature.gov/Laws/GeneralLaws/PartIV/TitleII/Chapter276/Section100A
Court Admin: https://www.mass.gov/sealing-criminal-records
Key statute: M.G.L. c. 276, § 100AConnecticut (CT)
Legislature: https://www.cga.ct.gov/current/pub/chap_961.htm#sec_54-142a
Court Admin: https://jud.ct.gov/crimrecords/
Key statute: Conn. Gen. Stat. § 54-142a
Clean Slate: PA 21-32Maryland (MD)
Legislature: https://mgaleg.maryland.gov/mgawebsite/Laws/StatuteText?article=gcp§ion=10-105
Court Admin: https://mdcourts.gov/legalhelp/expungement
Key statute: Md. Code, Crim. Proc. § 10-105Delaware (DE)
Legislature: https://delcode.delaware.gov/title11/c004/sc07/index.html
Court Admin: https://courts.delaware.gov/help/expungement.aspx
Key statute: 11 Del. C. § 4372
Clean Slate: 11 Del. C. § 4373Rhode Island (RI)
Legislature: http://webserver.rilin.state.ri.us/Statutes/TITLE12/12-1.3/INDEX.HTM
Court Admin: https://www.courts.ri.gov/Courts/districtcourt/PDF/Expungement_Instructions.pdf
Key statute: R.I. Gen. Laws § 12-1.3-1Vermont (VT)
Legislature: https://legislature.vermont.gov/statutes/section/13/230/07601
Court Admin: https://www.vermontjudiciary.org/
Key statute: 13 V.S.A. § 7601New Hampshire (NH)
Legislature: http://www.gencourt.state.nh.us/rsa/html/LIX/651/651-5.htm
Court Admin: https://www.courts.nh.gov/
Key statute: RSA 651:5Maine (ME)
Legislature: https://legislature.maine.gov/statutes/15/title15sec2003.html
Court Admin: https://www.courts.maine.gov/fees-forms/forms/
Key statute: 15 M.R.S. § 2003---
District of Columbia
DC
Legislature: https://code.dccouncil.gov/us/dc/council/code/titles/16/chapters/8/
Court Admin: https://www.dccourts.gov/services/criminal-matters/motion-to-seal
Key statute: D.C. Code § 16-803---
Cross-Reference Resources
National Compilations
CCRC Restoration Project: https://ccresourcecenter.org/state-restoration-profiles/
NACDL Second Chance: https://www.nacdl.org/Landing/SecondChances
Collateral Consequences Resource Center: https://ccresourcecenter.org/
Legal Services Corporation: https://www.lsc.gov/what-legal-aid/find-legal-aidState-Specific Legal Aid
LawHelp.org: https://www.lawhelp.org/find-help/
Legal Aid Finder: https://www.lsc.gov/what-legal-aid/find-legal-aid#!/usr/bin/env npx tsx
/**
* Validate Scraped Data
*
* Quick validation script to check scraped data quality.
* Run after Firecrawl scrapes to identify issues.
*
* Usage:
* npx tsx .claude/skills/2026-legal-research-agent/scripts/validate-scraped-data.ts
* npx tsx .claude/skills/2026-legal-research-agent/scripts/validate-scraped-data.ts --state OR
*/
import * as fs from "fs";
import * as path from "path";
const SCRAPED_DIR = "src/data/scraped/states";
interface ValidationResult {
state: string;
file: string;
issues: string[];
warnings: string[];
}
interface ScrapedData {
url?: string;
title?: string;
content?: string;
scrapedAt?: string;
[key: string]: unknown;
}
function validateStateData(stateCode: string): ValidationResult[] {
const results: ValidationResult[] = [];
const stateDir = path.join(SCRAPED_DIR, stateCode.toLowerCase());
if (!fs.existsSync(stateDir)) {
return [
{
state: stateCode,
file: stateDir,
issues: ["State directory does not exist"],
warnings: [],
},
];
}
const files = fs.readdirSync(stateDir).filter((f) => f.endsWith(".json"));
for (const file of files) {
const filePath = path.join(stateDir, file);
const result: ValidationResult = {
state: stateCode,
file: file,
issues: [],
warnings: [],
};
try {
const content = fs.readFileSync(filePath, "utf-8");
const data: ScrapedData = JSON.parse(content);
// Check for required fields
if (!data.url) {
result.issues.push("Missing 'url' field");
}
if (!data.scrapedAt) {
result.warnings.push("Missing 'scrapedAt' timestamp");
} else {
// Check if data is stale (>90 days old)
const scrapedDate = new Date(data.scrapedAt);
const daysSinceScraped =
(Date.now() - scrapedDate.getTime()) / (1000 * 60 * 60 * 24);
if (daysSinceScraped > 90) {
result.warnings.push(
`Data is ${Math.round(daysSinceScraped)} days old (>90 days)`
);
}
}
// Check content quality
if (data.content) {
if (data.content.length < 100) {
result.warnings.push(
`Content very short (${data.content.length} chars)`
);
}
if (data.content.length > 500000) {
result.warnings.push(
`Content very long (${data.content.length} chars) - may be unprocessed HTML`
);
}
if (data.content.includes("404") || data.content.includes("Not Found")) {
result.issues.push("Content appears to be error page");
}
}
// Validate URLs
if (data.url) {
try {
new URL(data.url);
} catch {
result.issues.push(`Invalid URL format: ${data.url}`);
}
}
// Check for state code mismatch
if (data.url) {
const urlLower = data.url.toLowerCase();
const stateInUrl = detectStateFromUrl(urlLower);
if (stateInUrl && stateInUrl !== stateCode.toUpperCase()) {
result.issues.push(
`URL suggests state ${stateInUrl}, but file is in ${stateCode.toUpperCase()} directory`
);
}
}
} catch (e) {
result.issues.push(`Failed to parse JSON: ${e}`);
}
if (result.issues.length > 0 || result.warnings.length > 0) {
results.push(result);
}
}
return results;
}
function detectStateFromUrl(url: string): string | null {
// Known URL patterns
const patterns: Record<string, string> = {
"oregon.public.law": "OR",
"california.public.law": "OR",
"courts.oregon.gov": "OR",
"courts.ca.gov": "CA",
"courts.wa.gov": "WA",
// Add more as needed
};
for (const [pattern, code] of Object.entries(patterns)) {
if (url.includes(pattern)) {
return code;
}
}
return null;
}
function getAllStateCodes(): string[] {
if (!fs.existsSync(SCRAPED_DIR)) {
return [];
}
return fs
.readdirSync(SCRAPED_DIR)
.filter((f) => {
const stat = fs.statSync(path.join(SCRAPED_DIR, f));
return stat.isDirectory() && f !== "unknown";
})
.map((f) => f.toUpperCase());
}
function printResults(results: ValidationResult[]) {
const hasIssues = results.some((r) => r.issues.length > 0);
const hasWarnings = results.some((r) => r.warnings.length > 0);
if (!hasIssues && !hasWarnings) {
console.log("✅ All scraped data passed validation");
return;
}
console.log("\n📋 Validation Results\n");
for (const result of results) {
if (result.issues.length > 0 || result.warnings.length > 0) {
console.log(`\n${result.state}/${result.file}:`);
for (const issue of result.issues) {
console.log(` ❌ ERROR: ${issue}`);
}
for (const warning of result.warnings) {
console.log(` ⚠️ WARN: ${warning}`);
}
}
}
console.log("\n---");
console.log(`Total files with issues: ${results.filter((r) => r.issues.length > 0).length}`);
console.log(`Total files with warnings: ${results.filter((r) => r.warnings.length > 0).length}`);
}
// Main execution
const args = process.argv.slice(2);
const stateArg = args.find((a) => a.startsWith("--state="))?.split("=")[1];
const singleState = args.includes("--state")
? args[args.indexOf("--state") + 1]
: stateArg;
let statesToCheck: string[];
if (singleState) {
statesToCheck = [singleState.toUpperCase()];
} else {
statesToCheck = getAllStateCodes();
}
if (statesToCheck.length === 0) {
console.log("No scraped data found in", SCRAPED_DIR);
console.log("Run Firecrawl scrapes first.");
process.exit(0);
}
console.log(`🔍 Validating scraped data for ${statesToCheck.length} states...`);
const allResults: ValidationResult[] = [];
for (const state of statesToCheck) {
const results = validateStateData(state);
allResults.push(...results);
}
printResults(allResults);