run-cni-experiment
БесплатноБез исполняемых скриптовНе проверенRun a controlled CNI prompt/config experiment: identify documents exhibiting a target artifact or error mode, extract against main and a fix branch, diff the…
от Recidiviz★ 48 звёзд на GitHubОб этом скилле
Skill: Run CNI Experiment
Overview
This skill runs a controlled experiment to validate a CNI prompt or config change. It has three layers:
- Target set — documents sampled to exhibit a specific artifact or error mode
- Sandbox comparison — extract the same target documents on
mainand on a fix branch; diff the outputs field by field against an expected-change spec - Golden eval backstop — run the labeled eval on both branches; flag any accuracy regression
The sandbox comparison answers did the fix produce the expected change? The golden eval answers did anything else break?
Caveats:
- Never query US_ME or US_CA data.
- Document text contains PII. Keep all output files local; do not paste note text into Slack, GitHub, or Notion.
Phase 1: Gather inputs
Ask the user (in one message) for the following. State defaults; user can override any.
- State code — e.g.,
US_TN. NeverUS_MEorUS_CA. - Extractor collection — e.g.,
case_note_employment_info. If unclear, list directories inrecidiviz/documents/config/extractor_collections/filtered by state. - Fix branch name — the branch implementing the change.
- Experiment name — short slug used in sandbox prefixes and filenames
(e.g.,
tn_employ_null_training). - Expected change — describe the before-state and after-state as
field-specifically as possible. Examples:
- "Notes mentioning 'on-the-job training' programs currently return a
non-null
employer_name; after the fix they should return NULL." - "Notes with only past-tense employment language currently populate
employment_start_date; after the fix that field should be NULL." - "Notes with no housing mention currently return
is_housed = TRUE; after the fix they should return NULL." This becomes the success criterion for Phase 5.
- "Notes mentioning 'on-the-job training' programs currently return a
non-null
- Target set — use an existing
sample-cni-documentsGoogle Sheet (paste the URL), or generate one now (default: generate). - Target sample size — how many documents. Default: 50.
- Baseline source — use existing staging/prod extraction results as the
baseline (default: yes, use existing), or run a fresh sandbox extraction
on
main. Using existing results is faster and avoids the new-document noise problem. Run a fresh baseline only if the current staging data is known to be stale or on a different code version thanmain. - Document limit for extraction runs — default: omit for small target
sets (a few dozen people); the extraction completes quickly and omitting it
ensures the public parsed view is deployed, which Phase 5 queries. Set to
e.g.
200only when the entity set is large enough that you need to cap LLM cost — but be aware that setting--document-limitprevents the public parsed view from being deployed (only__raw,__validated,__unvalidated, and__pre_resolutiondatasets are created). If you do set it, see Phase 5a for the fallback query path. Also disables the entity-resolution pass. Applies to all sandbox extraction runs (Phase 3 fresh baseline if used, and Phase 4 branch extraction always). - Project — default
recidiviz-staging.
Phase 2: Assemble the candidate set
If the user provided an existing set of document_contents_ids (e.g. from a
prior sample-cni-documents sheet), skip to reading it. Otherwise, invoke
sample-cni-documents with all inputs
already known — pass them through without re-prompting the user:
- State code → from Phase 1 input #1
- Extractor collection → from Phase 1 input #2
- Sample size → 2–3× the target count from Phase 1 input #7
- What you're looking for / filter criteria → the expected-change description from Phase 1 input #5 (semantic criterion → sample-then-read mode)
- Project → from Phase 1 input #10
Important: sample-then-read selects documents whose text matches the target pattern. It does not verify that the baseline extractor actually produces the before-state for those documents — that confirmation happens in Phase 3.5. Treat the Phase 2 output as a candidate set, not the final target set.
From the candidate Google Sheet, extract:
person_external_idvalues (deduplicated) →--root-entity-idsfor the extraction runs. The baseline run fetches all documents for these people; Phase 3.5 then filters down to the confirmed before-state docs.document_contents_idvalues → the candidate list Phase 3.5 filters.
Get the --external-id-type by querying the metadata table. Always do
this fresh — do not assume the type from prior runs or from the state code
alone, as the registered types vary by state and can differ from what you'd
expect (e.g., US_CO uses US_CO_OFFENDERID, not US_CO_DOC).
SELECT DISTINCT person_external_id_type
FROM `{project}.{state_lower}_document_store_metadata.{collection_nam
Установить run-cni-experiment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл run-cni-experiment?
Run a controlled CNI prompt/config experiment: identify documents exhibiting a target artifact or error mode, extract against main and a fix branch, diff the outputs, run golden eval on both, and produce a structured report. Use when you have a hypothesis about a prompt or config change and want to verify it worked (sandbox) and didn't regress anything (golden eval).
Как установить скилл run-cni-experiment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл run-cni-experiment запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic