Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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:

  1. Target set — documents sampled to exhibit a specific artifact or error mode
  2. Sandbox comparison — extract the same target documents on main and on a fix branch; diff the outputs field by field against an expected-change spec
  3. 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.

  1. State code — e.g., US_TN. Never US_ME or US_CA.
  2. Extractor collection — e.g., case_note_employment_info. If unclear, list directories in recidiviz/documents/config/extractor_collections/ filtered by state.
  3. Fix branch name — the branch implementing the change.
  4. Experiment name — short slug used in sandbox prefixes and filenames (e.g., tn_employ_null_training).
  5. 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.
  6. Target set — use an existing sample-cni-documents Google Sheet (paste the URL), or generate one now (default: generate).
  7. Target sample size — how many documents. Default: 50.
  8. 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 than main.
  9. 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. 200 only when the entity set is large enough that you need to cap LLM cost — but be aware that setting --document-limit prevents the public parsed view from being deployed (only __raw, __validated, __unvalidated, and __pre_resolution datasets 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).
  10. 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_id values (deduplicated) → --root-entity-ids for 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_id values → 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить run-cni-experiment с