Skip to content

Add claude-legal-immigration-laws: reference corpora + verbatim FAM + 11-skill self-help layer#2

Open
codearranger wants to merge 5 commits into
mainfrom
claude/immigration-law-sources-9M8CL
Open

Add claude-legal-immigration-laws: reference corpora + verbatim FAM + 11-skill self-help layer#2
codearranger wants to merge 5 commits into
mainfrom
claude/immigration-law-sources-9M8CL

Conversation

@codearranger
Copy link
Copy Markdown
Owner

@codearranger codearranger commented May 29, 2026

claude-legal-immigration-laws — federal immigration-law plugin

Adds a shared, venue-independent immigration-law plugin (the federal counterpart to claude-legal-federal-laws) and, as of v0.3.0, a document-producing skills layer on top of it.

Reference corpora (rules verbatim, case law on-demand)

  • INA — 8 U.S.C. Chapter 12, one file per subchapter (~1.6 MB) + an INA↔8 U.S.C. crosswalk, via pull_ina.py.
  • Regulations — curated 8 CFR (DHS chapter I + EOIR/BIA chapter V) and State-Dept 22 CFR parts (~3.6 MB), via pull_immigration_cfr.py.
  • Foreign Affairs Manualverbatim 9 FAM 100/302/402/502/504 + 8 FAM 300 + 7 FAM 000/1400 (~3.6 MB), via pull_fam.py.
  • EOIR court rules — new court-rules/ corpus: binding rules are 8 CFR Part 1003/1240/1208 (already mirrored); the ICPM + BIA Practice Manual ship as canonical-URL pointer stubs, via pull_eoir_manuals.py.
  • Case law — federal circuits / BIA / AAO indexed for on-demand lookup (CourtListener), not snapshotted.

FAM mirroring fix

fam.state.gov serves an incomplete TLS chain (omits the Sectigo intermediate) and Python's ssl doesn't AIA-chase — the server's own misconfiguration, not a proxy or bot-gate. pull_fam.py reads the leaf's AIA "CA Issuers" URL, fetches the intermediate, adds it to the verify bundle (all content fetches then fully verified), and crawls the site's JSON TOC API. This replaced the earlier (incorrect) "unmirrorable egress-proxy 503" characterization; corpus moved from 6 pointer stubs to ~3.6 MB verbatim.

Skills layer (11, v0.3.0)

Matter-neutral, venue-independent, documents-not-advice; each opens with NOT LEGAL ADVICE and flags when a licensed attorney / EOIR-accredited representative is needed (+ notario-fraud warnings):

immigration-pro-se · eoir-immigration-courts · immigration-deadlines · immigration-fact-check · eoir-removal-defense · eoir-motions-to-reopen-reconsider · bia-appeals · uscis-benefit-requests · immigration-foia · circuit-petition-for-review · consular-visa-refusal

Wiring

  • Versions: immigration plugin.json0.3.0; marketplace metadata.version0.25.0.
  • Quarterly refresh-references.yml runs the immigration leg (INA / 8 CFR + 22 CFR / FAM / EOIR manuals) and opens a review PR.
  • CLAUDE.md skills index + corpus/versioning notes; README listing, corpus table, and repo tree.

Verification

  • lint-skills.py: 229 skills, 0 failed; every corpus relative link resolves; all 11 disclaimers present.
  • Pull scripts tested: pull_ina.py, pull_immigration_cfr.py (33 parts), pull_fam.py (verbatim, content byte-identical across runs), pull_eoir_manuals.py.

NOT LEGAL ADVICE. Generated content is a drafting aid; immigration consequences are severe and often irreversible — verify against current law and consult a licensed attorney or EOIR-accredited representative before filing.

🤖 Generated with Claude Code

claude and others added 5 commits May 29, 2026 03:14
New federal, venue-independent reference plugin for U.S. immigration law,
parallel to claude-legal-federal-laws. This first pass connects the sources
(no drafting skills yet).

Rules — snapshotted verbatim as Markdown:
- INA (8 U.S.C. Chapter 12) via scripts/pull_ina.py from uscode.house.gov
  USLM XML; one file per subchapter I-V (~1.6 MB) + an INA-section <->
  8 U.S.C.-section crosswalk in the corpus README.
- Immigration regulations via scripts/pull_immigration_cfr.py from the eCFR
  versioner API: curated 8 CFR (DHS chapter I + DOJ/EOIR chapter V incl. the
  immigration courts and BIA at 8 CFR 1003) and 22 CFR visa/passport/exchange
  parts; 33 parts (~4.4 MB).
- Foreign Affairs Manual via scripts/pull_fam.py as canonical-URL pointer
  stubs (fam.state.gov is bot-gated/503 to scripted clients), with a
  _file_is_stub guard that preserves any later-mirrored verbatim text.

Case law — wired on-demand, not snapshotted (too large/fast-moving):
references/legal-data-apis.md + online-sources.md index the federal circuit
courts (petitions for review under INA s 242 / 8 U.S.C. s 1252, via
CourtListener REST + the connected CourtListener MCP, with per-circuit court
ids), the BIA precedent decisions (I&N Dec., via the EOIR Virtual Law
Library), and the USCIS AAO decisions.

Also: register the plugin in marketplace.json (metadata 0.23.1 -> 0.24.0),
add an "immigration" leg to the quarterly refresh-references workflow, and
update CLAUDE.md + README.md (ten plugins total).

https://claude.ai/code/session_018MusqBvemNPhMLWy1s2jUr
…t-gating

Investigated whether the curl_cffi Chrome-TLS-impersonation technique the TN
and NY pullers use to defeat Cloudflare TLS-fingerprint gates could let the FAM
corpus go verbatim. It can't — the fam.state.gov 503 in this environment is a
different failure mode:

- Egress is a transparent, mandatory TLS-inspecting proxy (every TLS cert is
  re-signed by "sandbox-egress-production TLS Inspection CA"), so there is no
  client-side proxy to bypass.
- The proxy's UPSTREAM connection to fam.state.gov fails certificate
  verification ("unable to get local issuer certificate at depth 0") because
  fam.state.gov serves an incomplete chain (omits the intermediate; a browser
  AIA-repairs, the proxy doesn't), and returns the 503. ecfr.gov serves a
  complete chain through the same proxy and returns 200.
- curl_cffi (incl. verify=False) makes no difference: the proxy, not our
  client, is the one failing verification.

So this is an egress/cert-chain issue, not destination bot-gating. Corrected
the inaccurate "bot-gated (503 to scripted clients)" wording to the accurate
explanation across pull_fam.py (docstring, stub text, manifest note), the
regenerated FAM stub files, the corpus README, legal-data-apis.md, the
plugin.json + marketplace.json descriptions, CLAUDE.md, README.md, and the
refresh-references workflow comment. pull_fam.py keeps the urllib + stub path
(curl_cffi would not help this failure mode); verbatim FAM still requires
running the puller from an egress that can complete fam.state.gov's chain.

https://claude.ai/code/session_018MusqBvemNPhMLWy1s2jUr
… the JSON TOC API

The "fam.state.gov is unmirrorable" premise was wrong. The site serves only its
leaf certificate and omits the Sectigo intermediate that signed it; a browser
repairs this by AIA-fetching, but Python's ssl does not — hence the cert-verify
failure. This is the server's own misconfiguration, not an egress proxy or
bot-gate, and it is fixable from any networked machine.

pull_fam.py rewrite:
- build_ssl_context() opens an unverified handshake ONLY to read the leaf's AIA
  "CA Issuers" URL, downloads the intermediate, and adds it to a verifying
  context (certifi roots, falling back to the system store), ending with a
  verifying handshake so all content fetches are fully TLS-verified.
- Replaces the dead /fam/*.html targets with the live JSON TOC API
  (/api/Tree/GetTreeByVolumeId) + per-section /FAM/<vol>/<id>.html windows-1252
  pages, reduced to Markdown by an html.parser walker (mirrors pull_oregon_ors).
- Scopes to the immigration-relevant slices: 9 FAM 100/302/402/502/504,
  8 FAM 300, 7 FAM 000/1400. Stub fallback + _file_is_stub guard retained for
  offline runs.

Corpus: 6 pointer stubs -> ~3.6 MB verbatim FAM text.

Docs/versions: corrected the stale "egress/cert-chain 503" characterization in
the corpus README, top-level README, CLAUDE.md, legal-data-apis.md,
online-sources.md (dead URLs fixed), plugin.json and marketplace.json; CI FAM
step now runs the real puller (continue-on-error + the guard keep it safe);
bumped immigration plugin.json 0.1.0 -> 0.2.0, marketplace 0.24.0 -> 0.24.1,
FAM _manifest.json -> 0.2.0 (mode verbatim).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e refresh target list

Three README spots still described FAM as pointer stubs (the corpus table, the
repo tree, and the scripts list) and the workflow target selector omitted
immigration/oh/tn. Brings README in line with the verbatim FAM mirroring and the
actual workflow_dispatch options.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Turns claude-legal-immigration-laws from references-only into a full plugin
with a venue-independent, matter-neutral, document-producing skills layer
(the immigration analog of the federal FCRA consumer-credit skills).

Skills (11), each opening with NOT LEGAL ADVICE, producing documents not advice,
citing the in-plugin corpora by relative path, and flagging when a licensed
attorney / EOIR-accredited representative is needed (+ notario-fraud warnings):
- immigration-pro-se (forum map + documents-not-advice boundary; goes first)
- eoir-immigration-courts (the EOIR system + filing format + the court rules)
- immigration-deadlines, immigration-fact-check
- eoir-removal-defense, eoir-motions-to-reopen-reconsider, bia-appeals
- uscis-benefit-requests, immigration-foia
- circuit-petition-for-review, consular-visa-refusal

Court rules: new references/court-rules/ corpus + scripts/pull_eoir_manuals.py.
The binding immigration-court rules are 8 CFR Part 1003/1240/1208 (already
mirrored verbatim in immigration-regulations/); the EOIR practice manuals
(ICPM + BIA Practice Manual) are JS-rendered + Akamai-gated, so they ship as
canonical-URL pointer stubs with chapter enumeration + a cross-reference to the
binding regs, on the same _file_is_stub discipline as the NY/TN sources.

Wiring: plugin.json 0.2.0 -> 0.3.0 (+ skill keywords + description); marketplace
metadata 0.24.1 -> 0.25.0 + listing copy; CLAUDE.md skills index + court-rules +
versioning note; README; refresh-references.yml gains an EOIR-manuals step on
the immigration leg. Lint: 229 skills, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codearranger codearranger changed the title Add claude-legal-immigration-laws shared reference plugin Add claude-legal-immigration-laws: reference corpora + verbatim FAM + 11-skill self-help layer May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants